@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.
- package/bpk-component-pagination/src/BpkPaginationList.module.scss +1 -1
- package/bpk-component-pagination/src/BpkPaginationNudger.js +17 -20
- package/bpk-component-pagination/src/BpkPaginationNudger.module.scss +4 -26
- package/bpk-component-pagination/src/BpkPaginationPage.module.scss +24 -5
- package/bpk-component-tooltip/src/BpkTooltip.module.scss +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
24
|
-
import
|
|
25
|
-
import
|
|
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 =
|
|
31
|
-
const AlignedArrowRightIcon =
|
|
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
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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:
|
|
28
|
-
color: $bpk-text-
|
|
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-
|
|
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
|
-
|
|
51
|
+
|
|
52
|
+
@include bpk-hover {
|
|
53
|
+
color: $bpk-text-primary-day;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:active {
|
|
57
|
+
color: $bpk-text-primary-day;
|
|
58
|
+
}
|
|
40
59
|
}
|