@skyscanner/backpack-web 17.0.2 → 17.1.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.
@@ -23,7 +23,7 @@ $bpk-spacing-v2: true;
23
23
  .bpk-pagination-page-list {
24
24
  display: flex;
25
25
  margin: 0;
26
- padding: 0;
26
+ padding: 0 bpk-spacing-md();
27
27
  align-items: baseline;
28
28
  list-style: none;
29
29
 
@@ -20,17 +20,16 @@ import PropTypes from 'prop-types';
20
20
  import React from 'react';
21
21
 
22
22
  import { cssModules } from '../../bpk-react-utils';
23
- import { withButtonAlignment, withRtlSupport } from '../../bpk-component-icon';
24
- import ArrowLeftIcon from '../../bpk-component-icon/lg/arrow-left';
25
- import ArrowRightIcon from '../../bpk-component-icon/lg/arrow-right';
23
+ import BpkButton from '../../bpk-component-button';
24
+ import { withRtlSupport } from '../../bpk-component-icon';
25
+ import ArrowLeftIcon from '../../bpk-component-icon/sm/arrow-left';
26
+ import ArrowRightIcon from '../../bpk-component-icon/sm/arrow-right';
26
27
 
27
28
  import STYLES from './BpkPaginationNudger.module.scss';
28
29
 
29
30
  const getClassName = cssModules(STYLES);
30
- const AlignedArrowLeftIcon = withButtonAlignment(withRtlSupport(ArrowLeftIcon));
31
- const AlignedArrowRightIcon = withButtonAlignment(
32
- withRtlSupport(ArrowRightIcon),
33
- );
31
+ const AlignedArrowLeftIcon = withRtlSupport(ArrowLeftIcon);
32
+ const AlignedArrowRightIcon = withRtlSupport(ArrowRightIcon);
34
33
 
35
34
  const nudgerIcon = (forward) =>
36
35
  forward ? (
@@ -47,19 +46,17 @@ const BpkPaginationNudger = (props) => {
47
46
  const { disabled, forward, label, onNudge } = props;
48
47
 
49
48
  return (
50
- <div className={getClassName('bpk-pagination-nudger')}>
51
- <button
52
- type="button"
53
- className={getClassName('bpk-pagination-nudger__button')}
54
- onClick={onNudge}
55
- disabled={disabled}
56
- >
57
- {nudgerIcon(forward)}
58
- <span className={getClassName('bpk-pagination-nudger__text--hidden')}>
59
- {label}
60
- </span>
61
- </button>
62
- </div>
49
+ <BpkButton
50
+ link
51
+ onClick={onNudge}
52
+ disabled={disabled}
53
+ className={getClassName('bpk-pagination-nudger')}
54
+ >
55
+ {nudgerIcon(forward)}
56
+ <span className={getClassName('bpk-pagination-nudger__text--hidden')}>
57
+ {label}
58
+ </span>
59
+ </BpkButton>
63
60
  );
64
61
  };
65
62
 
@@ -21,32 +21,10 @@
21
21
  $bpk-spacing-v2: true;
22
22
 
23
23
  .bpk-pagination-nudger {
24
- text-align: center;
25
- vertical-align: middle;
26
-
27
- &__button {
28
- height: $bpk-button-height;
29
- border: none;
30
- background: none;
31
- cursor: pointer;
32
- appearance: none;
33
-
34
- @include bpk-button--link;
35
-
36
- // Using stylelint-disable as we need to override padding provided by bpk-button--link otherwise it shifts the arrow buttons out of alignment.
37
- /* stylelint-disable-next-line order/properties-order, order/order */
38
- padding: 0;
39
-
40
- &:disabled {
41
- cursor: not-allowed;
42
- }
43
-
44
- .bpk-pagination-nudger__icon {
45
- fill: currentcolor;
46
-
47
- @include bpk-icon--rtl-support;
48
- }
49
- }
24
+ display: flex;
25
+ width: bpk-spacing-xl() + bpk-spacing-sm();
26
+ height: bpk-spacing-xl() + bpk-spacing-sm();
27
+ padding: $bpk-one-pixel-rem * 10;
50
28
 
51
29
  &__text {
52
30
  &--hidden {
@@ -23,18 +23,37 @@ $bpk-spacing-v2: true;
23
23
  .bpk-pagination-page {
24
24
  min-width: $bpk-button-height;
25
25
  height: $bpk-button-height;
26
- padding: 0;
27
- border-radius: 50%;
28
- color: $bpk-text-link-day;
26
+ padding: 0 $bpk-one-pixel-rem * 16;
27
+ border-radius: $bpk-border-radius-xs * 2;
28
+ color: $bpk-text-primary-day;
29
29
 
30
- @include bpk-border-lg(
30
+ @include bpk-border-sm(
31
31
  var(--bpk-pagination-selected-background-color, $bpk-line-day)
32
32
  );
33
33
  @include bpk-label-1;
34
+
35
+ @include bpk-hover {
36
+ background-color: transparent;
37
+
38
+ @include bpk-border-sm($bpk-core-primary-day);
39
+ }
40
+
41
+ &:active {
42
+ background-color: transparent;
43
+
44
+ @include bpk-border-sm($bpk-core-primary-day);
45
+ }
34
46
  }
35
47
 
36
48
  .bpk-pagination-page--selected {
37
49
  color: $bpk-text-primary-inverse-day;
38
50
  box-shadow: $bpk-button-selected-box-shadow;
39
- cursor: auto;
51
+
52
+ @include bpk-hover {
53
+ color: $bpk-text-primary-day;
54
+ }
55
+
56
+ &:active {
57
+ color: $bpk-text-primary-day;
58
+ }
40
59
  }
@@ -137,7 +137,7 @@ $dark-background-color: $bpk-surface-contrast-day;
137
137
  @include bpk-layer;
138
138
 
139
139
  &--padded {
140
- padding: bpk-spacing-sm() bpk-spacing-md();
140
+ padding: bpk-spacing-md() bpk-spacing-base();
141
141
  }
142
142
 
143
143
  &--dark {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "17.0.2",
3
+ "version": "17.1.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",