@skyscanner/backpack-web 9.2.0 → 11.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/bpk-animate-height/package.json +3 -3
- package/bpk-component-accordion/package.json +7 -7
- package/bpk-component-aria-live/README.md +2 -2
- package/bpk-component-aria-live/index.js +0 -1
- package/bpk-component-aria-live/package.json +8 -9
- package/bpk-component-aria-live/src/BpkAriaLive.js +21 -20
- package/bpk-component-autosuggest/package.json +4 -4
- package/bpk-component-badge/package.json +5 -5
- package/bpk-component-banner-alert/package.json +9 -9
- package/bpk-component-barchart/package.json +8 -8
- package/bpk-component-blockquote/package.json +2 -2
- package/bpk-component-breadcrumb/package.json +5 -5
- package/bpk-component-breakpoint/package.json +3 -3
- package/bpk-component-button/package.json +3 -3
- package/bpk-component-calendar/DOCS.md +1 -7
- package/bpk-component-calendar/README.md +0 -10
- package/bpk-component-calendar/index.js +0 -2
- package/bpk-component-calendar/package.json +9 -9
- package/bpk-component-calendar/src/BpkCalendarDate.js +0 -15
- package/bpk-component-calendar/src/BpkCalendarDate.module.scss +17 -50
- package/bpk-component-calendar/src/BpkCalendarGrid.module.scss +5 -5
- package/bpk-component-calendar/src/_variables.scss +1 -3
- package/bpk-component-card/package.json +4 -4
- package/bpk-component-checkbox/package.json +5 -5
- package/bpk-component-chip/package.json +5 -5
- package/bpk-component-close-button/package.json +4 -4
- package/bpk-component-code/package.json +2 -2
- package/bpk-component-content-cards/README.md +43 -0
- package/bpk-component-content-cards/index.js +21 -0
- package/bpk-component-content-cards/package.json +23 -0
- package/bpk-component-content-cards/src/BpkContentCard.js +83 -0
- package/bpk-component-content-cards/src/BpkContentCard.module.scss +87 -0
- package/bpk-component-content-cards/src/BpkContentCards.js +72 -0
- package/bpk-component-content-cards/src/BpkContentCards.module.css +18 -0
- package/bpk-component-content-cards/src/BpkContentCards.module.scss +51 -0
- package/bpk-component-content-container/package.json +2 -2
- package/bpk-component-datatable/README.md +78 -21
- package/bpk-component-datatable/package.json +5 -6
- package/bpk-component-datatable/src/BpkDataTable.js +176 -143
- package/bpk-component-datatable/src/BpkDataTable.module.scss +10 -14
- package/bpk-component-datatable/src/BpkDataTableColumn.js +37 -40
- package/bpk-component-datatable/src/BpkDataTableHeader.js +143 -0
- package/bpk-component-datatable/src/{BpkDataTableColumn.module.scss → BpkDataTableHeader.module.scss} +12 -11
- package/bpk-component-datatable/src/common-types.js +33 -11
- package/bpk-component-datatable/src/sort-types.js +6 -0
- package/bpk-component-datatable/src/utils.js +66 -9
- package/bpk-component-datepicker/package.json +9 -9
- package/bpk-component-description-list/package.json +2 -2
- package/bpk-component-dialog/package.json +8 -8
- package/bpk-component-drawer/package.json +9 -9
- package/bpk-component-fieldset/package.json +12 -12
- package/bpk-component-flare/package.json +4 -4
- package/bpk-component-floating-notification/README.md +0 -8
- package/bpk-component-floating-notification/index.js +0 -2
- package/bpk-component-floating-notification/package.json +5 -5
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +7 -26
- package/bpk-component-floating-notification/src/BpkFloatingNotification.module.scss +4 -17
- package/bpk-component-form-validation/package.json +10 -10
- package/bpk-component-graphic-promotion/{index.ts → index.js} +0 -0
- package/bpk-component-graphic-promotion/package.json +7 -6
- package/bpk-component-graphic-promotion/src/{BpkGraphicPromo.tsx → BpkGraphicPromo.js} +26 -16
- package/bpk-component-grid/package.json +2 -2
- package/bpk-component-grid-toggle/package.json +3 -3
- package/bpk-component-horizontal-nav/package.json +6 -6
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.scss +2 -2
- package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.module.scss +13 -13
- package/bpk-component-icon/package.json +7 -7
- package/bpk-component-image/package.json +6 -6
- package/bpk-component-infinite-scroll/package.json +6 -6
- package/bpk-component-input/package.json +6 -6
- package/bpk-component-label/package.json +2 -2
- package/bpk-component-link/package.json +4 -4
- package/bpk-component-list/README.md +8 -5
- package/bpk-component-list/package.json +2 -2
- package/bpk-component-list/src/BpkList.js +18 -2
- package/bpk-component-loading-button/package.json +6 -6
- package/bpk-component-map/package.json +6 -6
- package/bpk-component-mobile-scroll-container/package.json +3 -3
- package/bpk-component-modal/package.json +9 -9
- package/bpk-component-navigation-bar/package.json +8 -8
- package/bpk-component-navigation-bar/src/BpkNavigationBar.module.scss +2 -3
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.module.scss +4 -4
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.module.scss +3 -3
- package/bpk-component-nudger/package.json +7 -7
- package/bpk-component-overlay/package.json +4 -4
- package/bpk-component-pagination/package.json +4 -4
- package/bpk-component-panel/package.json +2 -2
- package/bpk-component-phone-input/package.json +9 -9
- package/bpk-component-popover/package.json +8 -8
- package/bpk-component-price/package.json +3 -3
- package/bpk-component-progress/package.json +5 -5
- package/bpk-component-radio/package.json +4 -4
- package/bpk-component-rating/package.json +4 -4
- package/bpk-component-rtl-toggle/package.json +2 -2
- package/bpk-component-scrollable-calendar/package.json +6 -6
- package/bpk-component-section-list/package.json +6 -6
- package/bpk-component-select/package.json +3 -3
- package/bpk-component-skip-link/package.json +2 -2
- package/bpk-component-slider/package.json +4 -4
- package/bpk-component-spinner/package.json +3 -3
- package/bpk-component-split-input/package.json +3 -3
- package/bpk-component-star-rating/package.json +5 -5
- package/bpk-component-switch/package.json +2 -2
- package/bpk-component-table/package.json +2 -2
- package/bpk-component-text/package.json +2 -2
- package/bpk-component-textarea/package.json +4 -4
- package/bpk-component-theme-toggle/package.json +5 -5
- package/bpk-component-ticket/package.json +4 -4
- package/bpk-component-tooltip/package.json +4 -4
- package/bpk-scrim-utils/package.json +2 -2
- package/bpk-theming/package.json +2 -2
- package/package.json +4 -4
- package/bpk-component-datatable/src/bpkHeaderRenderer.js +0 -110
- package/bpk-component-datatable/src/sorter.js +0 -166
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo-test.tsx +0 -134
- package/bpk-component-graphic-promotion/src/accessibility-test.tsx +0 -147
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2022 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
|
-
import React from 'react';
|
|
19
|
-
import { render } from '@testing-library/react';
|
|
20
|
-
import { axe } from 'jest-axe';
|
|
21
|
-
|
|
22
|
-
import BpkGraphicPromo, { TEXT_ALIGN } from './BpkGraphicPromo';
|
|
23
|
-
|
|
24
|
-
const sponsor = {
|
|
25
|
-
label: 'Sponsored',
|
|
26
|
-
logo: 'path/to/logo.png',
|
|
27
|
-
altText: 'Airline Name',
|
|
28
|
-
};
|
|
29
|
-
const buttonText = 'Learn more';
|
|
30
|
-
const onClick = () => {
|
|
31
|
-
window.location.href = 'https://www.skyscanner.net';
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const tagline = 'Tagline';
|
|
35
|
-
const headline = 'Ride your wave';
|
|
36
|
-
const subheading =
|
|
37
|
-
'Portugal and 6 more countries have just been added to the UK travel green list';
|
|
38
|
-
|
|
39
|
-
describe('BpkGraphicPromo accessibility tests', () => {
|
|
40
|
-
// TODO: Temporarily disabling tests due to a newer version of jest-axe which causes tests to fail when using nested interactive elements
|
|
41
|
-
|
|
42
|
-
it('should not have programmatically-detectable accessibility issues', async () => {
|
|
43
|
-
const { container } = render(
|
|
44
|
-
<BpkGraphicPromo
|
|
45
|
-
buttonText={buttonText}
|
|
46
|
-
className="test"
|
|
47
|
-
headline={headline}
|
|
48
|
-
invertVertically={false}
|
|
49
|
-
onClick={onClick}
|
|
50
|
-
sponsor={sponsor}
|
|
51
|
-
subheading={subheading}
|
|
52
|
-
tagline={tagline}
|
|
53
|
-
textAlign={TEXT_ALIGN.start}
|
|
54
|
-
/>,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const results = await axe(container);
|
|
58
|
-
expect(results).toHaveNoViolations();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should not have programmatically-detectable accessibility issues in centre aligned', async () => {
|
|
62
|
-
const { container } = render(
|
|
63
|
-
<BpkGraphicPromo
|
|
64
|
-
buttonText={buttonText}
|
|
65
|
-
headline={headline}
|
|
66
|
-
invertVertically={false}
|
|
67
|
-
onClick={onClick}
|
|
68
|
-
sponsor={sponsor}
|
|
69
|
-
subheading={subheading}
|
|
70
|
-
tagline={tagline}
|
|
71
|
-
textAlign={TEXT_ALIGN.center}
|
|
72
|
-
/>,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
const results = await axe(container);
|
|
76
|
-
expect(results).toHaveNoViolations();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should not have programmatically-detectable accessibility issues in right aligned', async () => {
|
|
80
|
-
const { container } = render(
|
|
81
|
-
<BpkGraphicPromo
|
|
82
|
-
buttonText={buttonText}
|
|
83
|
-
headline={headline}
|
|
84
|
-
invertVertically={false}
|
|
85
|
-
onClick={onClick}
|
|
86
|
-
sponsor={sponsor}
|
|
87
|
-
subheading={subheading}
|
|
88
|
-
tagline={tagline}
|
|
89
|
-
textAlign={TEXT_ALIGN.end}
|
|
90
|
-
/>,
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
const results = await axe(container);
|
|
94
|
-
expect(results).toHaveNoViolations();
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should not have programmatically-detectable accessibility issues in inverted portrait', async () => {
|
|
98
|
-
const { container } = render(
|
|
99
|
-
<BpkGraphicPromo
|
|
100
|
-
buttonText={buttonText}
|
|
101
|
-
headline={headline}
|
|
102
|
-
invertVertically
|
|
103
|
-
onClick={onClick}
|
|
104
|
-
sponsor={sponsor}
|
|
105
|
-
subheading={subheading}
|
|
106
|
-
tagline={tagline}
|
|
107
|
-
textAlign={TEXT_ALIGN.start}
|
|
108
|
-
/>,
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const results = await axe(container);
|
|
112
|
-
expect(results).toHaveNoViolations();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should not have programmatically-detectable accessibility issues when optional text is missing', async () => {
|
|
116
|
-
const { container } = render(
|
|
117
|
-
<BpkGraphicPromo
|
|
118
|
-
buttonText={buttonText}
|
|
119
|
-
headline={headline}
|
|
120
|
-
invertVertically={false}
|
|
121
|
-
onClick={onClick}
|
|
122
|
-
sponsor={sponsor}
|
|
123
|
-
textAlign={TEXT_ALIGN.start}
|
|
124
|
-
/>,
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
const results = await axe(container);
|
|
128
|
-
expect(results).toHaveNoViolations();
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('should not have programmatically-detectable accessibility issues in non-sponsored', async () => {
|
|
132
|
-
const { container } = render(
|
|
133
|
-
<BpkGraphicPromo
|
|
134
|
-
buttonText={buttonText}
|
|
135
|
-
headline={headline}
|
|
136
|
-
invertVertically={false}
|
|
137
|
-
onClick={onClick}
|
|
138
|
-
subheading={subheading}
|
|
139
|
-
tagline={tagline}
|
|
140
|
-
textAlign={TEXT_ALIGN.start}
|
|
141
|
-
/>,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
const results = await axe(container);
|
|
145
|
-
expect(results).toHaveNoViolations();
|
|
146
|
-
});
|
|
147
|
-
});
|