@skyscanner/backpack-web 14.0.0 → 15.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 +67 -64
- package/bpk-animate-height/README.md +2 -4
- package/bpk-component-accordion/README.md +6 -8
- package/bpk-component-aria-live/README.md +2 -4
- package/bpk-component-autosuggest/README.md +5 -7
- package/bpk-component-badge/README.md +2 -4
- package/bpk-component-banner-alert/README.md +4 -6
- package/bpk-component-barchart/README.md +2 -4
- package/bpk-component-blockquote/README.md +2 -4
- package/bpk-component-breadcrumb/README.md +2 -4
- package/bpk-component-breakpoint/README.md +2 -4
- package/bpk-component-button/README.md +4 -6
- package/bpk-component-calendar/README.md +3 -5
- package/bpk-component-card/README.md +2 -4
- package/bpk-component-checkbox/README.md +2 -4
- package/bpk-component-checkbox/src/BpkCheckbox.js +1 -0
- package/bpk-component-checkbox/src/BpkCheckbox.module.scss +4 -0
- package/bpk-component-chip/README.md +48 -23
- package/bpk-component-chip/index.js +5 -1
- package/bpk-component-chip/src/BpkDismissibleChip.js +16 -5
- package/bpk-component-chip/src/BpkDropdownChip.js +53 -0
- package/bpk-component-chip/src/BpkSelectableChip.js +1 -0
- package/bpk-component-chip/src/commonTypes.js +4 -4
- package/bpk-component-chip/src/themeAttributes.js +8 -12
- package/bpk-component-close-button/README.md +2 -4
- package/bpk-component-code/README.md +3 -5
- package/bpk-component-content-cards/README.md +1 -3
- package/bpk-component-content-container/README.md +2 -4
- package/bpk-component-datatable/README.md +3 -5
- package/bpk-component-datepicker/README.md +4 -6
- package/bpk-component-description-list/README.md +2 -4
- package/bpk-component-dialog/README.md +3 -5
- package/bpk-component-drawer/README.md +3 -5
- package/bpk-component-fieldset/README.md +3 -5
- package/bpk-component-fieldset/src/BpkFieldset.module.scss +1 -1
- package/bpk-component-flare/README.md +2 -4
- package/bpk-component-floating-notification/README.md +2 -4
- package/bpk-component-form-validation/README.md +2 -4
- package/bpk-component-graphic-promotion/README.md +2 -4
- package/bpk-component-grid/README.md +2 -4
- package/bpk-component-grid-toggle/README.md +2 -4
- package/bpk-component-grid-toggle/src/BpkGridToggle.module.scss +1 -1
- package/bpk-component-horizontal-nav/README.md +2 -4
- package/bpk-component-icon/README.md +9 -11
- package/bpk-component-icon/lg/baggage-cabin-add.js +8 -0
- package/bpk-component-icon/lg/baggage-cabin-not-included.js +8 -0
- package/bpk-component-icon/lg/baggage-cabin.js +8 -0
- package/bpk-component-icon/lg/baggage-checked-add.js +8 -0
- package/bpk-component-icon/lg/baggage-checked-not-included.js +8 -0
- package/bpk-component-icon/lg/baggage-checked.js +8 -0
- package/bpk-component-icon/lg/baggage-generic.js +8 -0
- package/bpk-component-icon/sm/baggage-cabin-add.js +8 -0
- package/bpk-component-icon/sm/baggage-cabin-not-included.js +8 -0
- package/bpk-component-icon/sm/baggage-cabin.js +8 -0
- package/bpk-component-icon/sm/baggage-checked-add.js +8 -0
- package/bpk-component-icon/sm/baggage-checked-not-included.js +8 -0
- package/bpk-component-icon/sm/baggage-checked.js +8 -0
- package/bpk-component-icon/sm/baggage-generic.js +8 -0
- package/bpk-component-image/README.md +5 -7
- package/bpk-component-infinite-scroll/README.md +5 -7
- package/bpk-component-input/README.md +4 -6
- package/bpk-component-label/README.md +2 -4
- package/bpk-component-label/src/BpkLabel.js +9 -14
- package/bpk-component-label/src/BpkLabel.module.scss +4 -0
- package/bpk-component-link/README.md +2 -4
- package/bpk-component-list/README.md +2 -4
- package/bpk-component-loading-button/README.md +4 -6
- package/bpk-component-map/README.md +7 -9
- package/bpk-component-mobile-scroll-container/README.md +3 -5
- package/bpk-component-modal/README.md +4 -6
- package/bpk-component-navigation-bar/README.md +7 -9
- package/bpk-component-nudger/README.md +5 -7
- package/bpk-component-nudger/src/BpkNudger.module.scss +2 -1
- package/bpk-component-overlay/README.md +3 -5
- package/bpk-component-page-indicator/README.md +42 -0
- package/bpk-component-page-indicator/index.js +28 -0
- package/bpk-component-page-indicator/src/BpkPageIndicator.js +147 -0
- package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +18 -0
- package/bpk-component-page-indicator/src/BpkPageIndicator.module.scss +91 -0
- package/bpk-component-page-indicator/src/NavButton.js +85 -0
- package/bpk-component-pagination/README.md +2 -4
- package/bpk-component-pagination/src/BpkPaginationNudger.module.scss +1 -22
- package/bpk-component-pagination/src/BpkPaginationPage.js +2 -1
- package/bpk-component-pagination/src/BpkPaginationPage.module.scss +5 -57
- package/bpk-component-panel/README.md +2 -4
- package/bpk-component-phone-input/README.md +3 -5
- package/bpk-component-popover/README.md +4 -6
- package/bpk-component-price/README.md +2 -4
- package/bpk-component-progress/README.md +2 -4
- package/bpk-component-radio/README.md +2 -4
- package/bpk-component-radio/src/BpkRadio.js +9 -10
- package/bpk-component-radio/src/BpkRadio.module.scss +4 -0
- package/bpk-component-rating/README.md +2 -4
- package/bpk-component-rtl-toggle/README.md +2 -4
- package/bpk-component-scrollable-calendar/README.md +3 -5
- package/bpk-component-section-list/README.md +2 -4
- package/bpk-component-select/README.md +2 -4
- package/bpk-component-skip-link/README.md +2 -4
- package/bpk-component-slider/README.md +2 -4
- package/bpk-component-spinner/README.md +2 -4
- package/bpk-component-split-input/README.md +2 -4
- package/bpk-component-star-rating/README.md +2 -4
- package/bpk-component-switch/README.md +2 -4
- package/bpk-component-table/README.md +2 -4
- package/bpk-component-text/README.md +5 -7
- package/bpk-component-textarea/README.md +2 -4
- package/bpk-component-theme-toggle/README.md +4 -6
- package/bpk-component-theme-toggle/src/theming.js +10 -14
- package/bpk-component-ticket/README.md +2 -4
- package/bpk-component-tooltip/README.md +3 -5
- package/bpk-react-utils/README.md +11 -13
- package/bpk-scrim-utils/README.md +2 -4
- package/bpk-theming/README.md +3 -5
- package/package.json +4 -4
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-chip --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import BpkSelectableChip, { BpkDismissibleChip, CHIP_TYPES } from 'bpk-component-chip';
|
|
16
|
-
import BeachIconSm from 'bpk-component-icon/sm/beach';
|
|
13
|
+
import BpkSelectableChip, { BpkDismissibleChip, BpkDropdownChip, CHIP_TYPES } from '@skyscanner/backpack-web/bpk-component-chip';
|
|
14
|
+
import BeachIconSm from '@skyscanner/backpack-web/bpk-component-icon/sm/beach';
|
|
17
15
|
|
|
18
16
|
export default () => (
|
|
19
17
|
|
|
@@ -37,6 +35,25 @@ export default () => (
|
|
|
37
35
|
Toggle me
|
|
38
36
|
</BpkSelectableChip>
|
|
39
37
|
|
|
38
|
+
// Standard dropdown chip.
|
|
39
|
+
<BpkDropdownChip
|
|
40
|
+
accessibilityLabel="Press to toggle chip"
|
|
41
|
+
selected={false}
|
|
42
|
+
onClick={() => { /* Use state to set 'selected={true}' */ }}
|
|
43
|
+
>
|
|
44
|
+
Toggle me
|
|
45
|
+
</BpkDropdownChip>
|
|
46
|
+
|
|
47
|
+
// Dropdown chip with an icon.
|
|
48
|
+
<BpkDropdownChip
|
|
49
|
+
accessibilityLabel="Press to toggle chip"
|
|
50
|
+
selected={false}
|
|
51
|
+
onClick={() => { /* Use state to set 'selected={true}' */ }}
|
|
52
|
+
leadingAccessoryView={<BeachIconSm />}
|
|
53
|
+
>
|
|
54
|
+
Toggle me
|
|
55
|
+
</BpkDropdownChip>
|
|
56
|
+
|
|
40
57
|
// Standard dismissible chip.
|
|
41
58
|
<BpkDismissibleChip
|
|
42
59
|
accessibilityLabel="Press to dismiss chip"
|
|
@@ -71,7 +88,20 @@ export default () => (
|
|
|
71
88
|
| leadingAccessoryView | node | false | null |
|
|
72
89
|
| selected | bool | false | false |
|
|
73
90
|
| trailingAccessoryView | node | false | null |
|
|
74
|
-
| type | oneOf(`CHIP_TYPES.
|
|
91
|
+
| type | oneOf(`CHIP_TYPES.onDark`, `CHIP_TYPES.default`, `CHIP_TYPES.onImage`) |
|
|
92
|
+
|
|
93
|
+
### BpkDropdownChip
|
|
94
|
+
|
|
95
|
+
| Property | PropType | Required | Default Value |
|
|
96
|
+
| --------------------- | --------------------------------------------------------------------- | -------- | ------------- |
|
|
97
|
+
| accessibilityLabel | string | true | - |
|
|
98
|
+
| children | node | true | - |
|
|
99
|
+
| onClick | func | true | - |
|
|
100
|
+
| className | string | false | null |
|
|
101
|
+
| disabled | bool | false | false |
|
|
102
|
+
| leadingAccessoryView | node | false | null |
|
|
103
|
+
| selected | bool | false | false |
|
|
104
|
+
| type | oneOf(`CHIP_TYPES.onDark`, `CHIP_TYPES.default`, `CHIP_TYPES.onImage`) |
|
|
75
105
|
|
|
76
106
|
### BpkDismissibleChip
|
|
77
107
|
|
|
@@ -83,29 +113,24 @@ Dismissible chips are selectable chips that have been preconfigured to have a 'c
|
|
|
83
113
|
| children | node | true | - |
|
|
84
114
|
| onClick | func | true | - |
|
|
85
115
|
| className | string | false | null |
|
|
86
|
-
| disabled | bool | false | false |
|
|
87
116
|
| leadingAccessoryView | node | false | null |
|
|
88
|
-
| type | oneOf(`CHIP_TYPES.
|
|
117
|
+
| type | oneOf(`CHIP_TYPES.onDark`, `CHIP_TYPES.default`, `CHIP_TYPES.onImage`) |
|
|
89
118
|
|
|
90
119
|
## Theme Props
|
|
91
120
|
|
|
92
|
-
###
|
|
121
|
+
### Default
|
|
93
122
|
|
|
94
|
-
- `
|
|
95
|
-
- `
|
|
96
|
-
- `chipPrimarySelectedActiveBackgroundColor`
|
|
97
|
-
- `chipPrimarySelectedTextColor`
|
|
123
|
+
- `chipDefaultSelectedBackgroundColor`
|
|
124
|
+
- `chipDefaultSelectedTextColor`
|
|
98
125
|
|
|
99
|
-
###
|
|
126
|
+
### On Dark
|
|
100
127
|
|
|
101
|
-
- `
|
|
102
|
-
- `
|
|
103
|
-
- `chipLightSelectedActiveBackgroundColor`
|
|
104
|
-
- `chipLightSelectedTextColor`
|
|
128
|
+
- `chipOnDarkSelectedBackgroundColor`
|
|
129
|
+
- `chipOnDarkSelectedTextColor`
|
|
105
130
|
|
|
106
|
-
###
|
|
131
|
+
### On Image
|
|
107
132
|
|
|
108
|
-
- `
|
|
109
|
-
- `
|
|
110
|
-
- `
|
|
111
|
-
- `
|
|
133
|
+
- `chipOnImageSelectedBackgroundColor`
|
|
134
|
+
- `chipOnImageSelectedHoverBackgroundColor`
|
|
135
|
+
- `chipOnImageSelectedActiveBackgroundColor`
|
|
136
|
+
- `chipOnImageSelectedTextColor`
|
|
@@ -24,11 +24,15 @@ import BpkSelectableChip, {
|
|
|
24
24
|
import BpkDismissibleChip, {
|
|
25
25
|
type Props as DismissibleProps,
|
|
26
26
|
} from './src/BpkDismissibleChip';
|
|
27
|
+
import BpkDropdownChip, {
|
|
28
|
+
type Props as DropdownProps,
|
|
29
|
+
} from './src/BpkDropdownChip';
|
|
27
30
|
import { CHIP_TYPES } from './src/commonTypes';
|
|
28
31
|
import themeAttributes from './src/themeAttributes';
|
|
29
32
|
|
|
30
33
|
export type BpkSelectableChipProps = SelectableProps;
|
|
31
34
|
export type BpkDismissibleChipProps = DismissibleProps;
|
|
35
|
+
export type BpkDropdownChipProps = DropdownProps;
|
|
32
36
|
|
|
33
37
|
export default BpkSelectableChip;
|
|
34
|
-
export { BpkDismissibleChip, CHIP_TYPES, themeAttributes };
|
|
38
|
+
export { BpkDismissibleChip, BpkDropdownChip, CHIP_TYPES, themeAttributes };
|
|
@@ -20,12 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
/*
|
|
22
22
|
The dismissible chip component is just a selectable chip that's
|
|
23
|
-
been hard coded to have
|
|
24
|
-
of a close icon.
|
|
23
|
+
been hard coded to have disabled={false}, selected and a trailing
|
|
24
|
+
accessory view of a close icon.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
import React from 'react';
|
|
28
28
|
|
|
29
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
29
30
|
import CloseCircleIconSm from '../../bpk-component-icon/sm/close-circle';
|
|
30
31
|
|
|
31
32
|
import BpkSelectableChip from './BpkSelectableChip';
|
|
@@ -34,18 +35,28 @@ import {
|
|
|
34
35
|
COMMON_DEFAULT_PROPS,
|
|
35
36
|
type CommonProps,
|
|
36
37
|
} from './commonTypes';
|
|
38
|
+
import STYLES from './BpkSelectableChip.module.scss';
|
|
37
39
|
|
|
38
40
|
export type Props = CommonProps;
|
|
39
41
|
|
|
42
|
+
const getClassName = cssModules(STYLES);
|
|
43
|
+
|
|
40
44
|
const BpkDismissibleChip = (props: Props) => {
|
|
41
|
-
const { ...rest } = props;
|
|
45
|
+
const { className, type, ...rest } = props;
|
|
46
|
+
const iconClassNames = getClassName(
|
|
47
|
+
`bpk-chip--${type}-dismissible__trailing-accessory-view`,
|
|
48
|
+
);
|
|
49
|
+
const classNames = getClassName(`bpk-chip--${type}-dismissible`, className);
|
|
42
50
|
|
|
43
51
|
return (
|
|
44
52
|
<BpkSelectableChip
|
|
45
53
|
{...rest}
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
disabled={false}
|
|
55
|
+
trailingAccessoryView={<CloseCircleIconSm className={iconClassNames} />}
|
|
56
|
+
selected
|
|
57
|
+
type={type}
|
|
48
58
|
role="button" // Override role="checkbox" because this chip is not selectable.
|
|
59
|
+
className={classNames}
|
|
49
60
|
/>
|
|
50
61
|
);
|
|
51
62
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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
|
+
|
|
19
|
+
/* @flow strict */
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
The dropdown chip component is just a selectable chip component
|
|
23
|
+
with a trailing accessory view of a chevron down icon.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import React from 'react';
|
|
27
|
+
|
|
28
|
+
import ChevronDownIconSm from '../../bpk-component-icon/sm/chevron-down';
|
|
29
|
+
|
|
30
|
+
import BpkSelectableChip from './BpkSelectableChip';
|
|
31
|
+
import {
|
|
32
|
+
COMMON_PROP_TYPES,
|
|
33
|
+
COMMON_DEFAULT_PROPS,
|
|
34
|
+
type CommonProps,
|
|
35
|
+
} from './commonTypes';
|
|
36
|
+
|
|
37
|
+
export type Props = CommonProps;
|
|
38
|
+
|
|
39
|
+
const BpkDropdownChip = (props: Props) => {
|
|
40
|
+
const { ...rest } = props;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<BpkSelectableChip
|
|
44
|
+
{...rest}
|
|
45
|
+
trailingAccessoryView={<ChevronDownIconSm />}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
BpkDropdownChip.propTypes = COMMON_PROP_TYPES;
|
|
51
|
+
BpkDropdownChip.defaultProps = COMMON_DEFAULT_PROPS;
|
|
52
|
+
|
|
53
|
+
export default BpkDropdownChip;
|
|
@@ -22,9 +22,9 @@ import PropTypes from 'prop-types';
|
|
|
22
22
|
import { type Node } from 'react';
|
|
23
23
|
|
|
24
24
|
export const CHIP_TYPES = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
onDark: 'on-dark',
|
|
26
|
+
default: 'default',
|
|
27
|
+
onImage: 'on-image',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export type CommonProps = {
|
|
@@ -56,5 +56,5 @@ export const COMMON_DEFAULT_PROPS = {
|
|
|
56
56
|
leadingAccessoryView: null,
|
|
57
57
|
selected: false,
|
|
58
58
|
trailingAccessoryView: null,
|
|
59
|
-
type: CHIP_TYPES.
|
|
59
|
+
type: CHIP_TYPES.default,
|
|
60
60
|
};
|
|
@@ -19,16 +19,12 @@
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
21
|
export default [
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'chipSuccessSelectedBackgroundColor',
|
|
31
|
-
'chipSuccessSelectedHoverBackgroundColor',
|
|
32
|
-
'chipSuccessSelectedActiveBackgroundColor',
|
|
33
|
-
'chipSuccessSelectedTextColor',
|
|
22
|
+
'chipDefaultSelectedBackgroundColor',
|
|
23
|
+
'chipDefaultSelectedTextColor',
|
|
24
|
+
'chipOnDarkSelectedBackgroundColor',
|
|
25
|
+
'chipOnDarkSelectedTextColor',
|
|
26
|
+
'chipOnImageSelectedBackgroundColor',
|
|
27
|
+
'chipOnImageSelectedHoverBackgroundColor',
|
|
28
|
+
'chipOnImageSelectedActiveBackgroundColor',
|
|
29
|
+
'chipOnImageSelectedTextColor',
|
|
34
30
|
];
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-close-button --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import BpkCloseButton from 'bpk-component-close-button';
|
|
13
|
+
import BpkCloseButton from '@skyscanner/backpack-web/bpk-component-close-button';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkCloseButton label="Close" onClick={() => console.log('click')} />
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-code --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import { BpkCode, BpkCodeBlock } from 'bpk-component-code';
|
|
16
|
-
import BpkText from 'bpk-component-text';
|
|
13
|
+
import { BpkCode, BpkCodeBlock } from '@skyscanner/backpack-web/bpk-component-code';
|
|
14
|
+
import BpkText from '@skyscanner/backpack-web/bpk-component-text';
|
|
17
15
|
|
|
18
16
|
const codeBlock = `import React from 'react';
|
|
19
17
|
import ReactDOM from 'react-dom';
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-content-container --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import BpkContentContainer from 'bpk-component-content-container';
|
|
13
|
+
import BpkContentContainer from '@skyscanner/backpack-web/bpk-component-content-container';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkContentContainer>
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-datatable --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import { BpkDataTable, BpkDataTableColumn } from 'bpk-component-datatable';
|
|
13
|
+
import { BpkDataTable, BpkDataTableColumn } from '@skyscanner/backpack-web/bpk-component-datatable';
|
|
16
14
|
|
|
17
15
|
const rows = [
|
|
18
16
|
{ name: 'Jose', description: 'Software Engineer' },
|
|
@@ -42,7 +40,7 @@ By default `BpkDataTable` sorts the column using the value of `dataKey`. For use
|
|
|
42
40
|
|
|
43
41
|
```js
|
|
44
42
|
import React from 'react';
|
|
45
|
-
import { BpkDataTable, BpkDataTableColumn } from 'bpk-component-datatable';
|
|
43
|
+
import { BpkDataTable, BpkDataTableColumn } from '@skyscanner/backpack-web/bpk-component-datatable';
|
|
46
44
|
|
|
47
45
|
const complexRows = [
|
|
48
46
|
{
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-datepicker --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React, { Component } from 'react';
|
|
15
|
-
import BpkDatepicker, { CALENDAR_SELECTION_TYPE } from 'bpk-component-datepicker';
|
|
13
|
+
import BpkDatepicker, { CALENDAR_SELECTION_TYPE } from '@skyscanner/backpack-web/bpk-component-datepicker';
|
|
16
14
|
import format from 'date-fns/format';
|
|
17
15
|
|
|
18
16
|
const formatDate = date => format(date, 'dd/MM/yyyy');
|
|
@@ -74,7 +72,7 @@ By default `BpkCalendar` is used but the calendar component is fully configurabl
|
|
|
74
72
|
|
|
75
73
|
```js
|
|
76
74
|
import React, { Component } from 'react';
|
|
77
|
-
import BpkDatepicker from 'bpk-component-datepicker';
|
|
75
|
+
import BpkDatepicker from '@skyscanner/backpack-web/bpk-component-datepicker';
|
|
78
76
|
import {
|
|
79
77
|
BpkCalendarNav,
|
|
80
78
|
BpkCalendarGridHeader,
|
|
@@ -82,7 +80,7 @@ import {
|
|
|
82
80
|
BpkCalendarDate,
|
|
83
81
|
withCalendarState,
|
|
84
82
|
composeCalendar,
|
|
85
|
-
} from 'bpk-component-calendar';
|
|
83
|
+
} from '@skyscanner/backpack-web/bpk-component-calendar';
|
|
86
84
|
import { colorSagano } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
87
85
|
|
|
88
86
|
const ColoredCalendarDate = props =>
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-description-list --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import { BpkDescriptionList, BpkDescriptionTerm, BpkDescriptionDetails } from 'bpk-component-description-list';
|
|
13
|
+
import { BpkDescriptionList, BpkDescriptionTerm, BpkDescriptionDetails } from '@skyscanner/backpack-web/bpk-component-description-list';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkDescriptionList>
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-dialog --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React, { Component } from 'react';
|
|
15
|
-
import BpkDialog from 'bpk-component-dialog';
|
|
16
|
-
import BpkButton from 'bpk-component-button';
|
|
13
|
+
import BpkDialog from '@skyscanner/backpack-web/bpk-component-dialog';
|
|
14
|
+
import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
|
|
17
15
|
|
|
18
16
|
class App extends Component {
|
|
19
17
|
constructor() {
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-drawer --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React, { Component } from 'react';
|
|
15
|
-
import BpkDrawer from 'bpk-component-drawer';
|
|
16
|
-
import BpkButton from 'bpk-component-button';
|
|
13
|
+
import BpkDrawer from '@skyscanner/backpack-web/bpk-component-drawer';
|
|
14
|
+
import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
|
|
17
15
|
|
|
18
16
|
class App extends Component {
|
|
19
17
|
constructor() {
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-fieldset --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React, { Component } from 'react';
|
|
15
|
-
import BpkFieldset from 'bpk-component-fieldset';
|
|
16
|
-
import BpkInput, { INPUT_TYPES } from 'bpk-component-input';
|
|
13
|
+
import BpkFieldset from '@skyscanner/backpack-web/bpk-component-fieldset';
|
|
14
|
+
import BpkInput, { INPUT_TYPES } from '@skyscanner/backpack-web/bpk-component-input';
|
|
17
15
|
|
|
18
16
|
class FieldsetContainer extends Component {
|
|
19
17
|
constructor(props) {
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-flare --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
@@ -16,7 +14,7 @@ Note that the default background color is white. You will need to apply a custom
|
|
|
16
14
|
|
|
17
15
|
```js
|
|
18
16
|
import React from 'react';
|
|
19
|
-
import { BpkContentBubble } from 'bpk-component-flare';
|
|
17
|
+
import { BpkContentBubble } from '@skyscanner/backpack-web/bpk-component-flare';
|
|
20
18
|
|
|
21
19
|
export default MyComponent = () => (
|
|
22
20
|
<div>
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npm install bpk-component-floating-notification --save-dev
|
|
7
|
-
```
|
|
5
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
8
6
|
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
11
9
|
```js
|
|
12
10
|
import React from 'react';
|
|
13
|
-
import BpkFloatingNotification from 'bpk-component-floating-notification';
|
|
11
|
+
import BpkFloatingNotification from '@skyscanner/backpack-web/bpk-component-floating-notification';
|
|
14
12
|
import BpkIconHeart from '../../packages/bpk-component-icon/sm/heart';
|
|
15
13
|
|
|
16
14
|
export default () => (
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-form-validation --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import BpkFormValidation from 'bpk-component-form-validation';
|
|
13
|
+
import BpkFormValidation from '@skyscanner/backpack-web/bpk-component-form-validation';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkFormValidation id="my-form-validation" expanded>
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npm install bpk-component-graphic-promotion --save-dev
|
|
7
|
-
```
|
|
5
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
8
6
|
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
11
9
|
```tsx
|
|
12
10
|
import React from 'react';
|
|
13
|
-
import BpkGraphicPromo from 'bpk-component-graphic-promotion';
|
|
11
|
+
import BpkGraphicPromo from '@skyscanner/backpack-web/bpk-component-graphic-promotion';
|
|
14
12
|
|
|
15
13
|
export default () => (
|
|
16
14
|
<BpkGraphicPromo
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-grid --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import { BpkGridContainer, BpkGridRow, BpkGridColumn } from 'bpk-component-grid';
|
|
13
|
+
import { BpkGridContainer, BpkGridRow, BpkGridColumn } from '@skyscanner/backpack-web/bpk-component-grid';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkGridContainer>
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-grid-toggle --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React from 'react';
|
|
15
|
-
import BpkGridToggle from 'bpk-component-grid-toggle';
|
|
13
|
+
import BpkGridToggle from '@skyscanner/backpack-web/bpk-component-grid-toggle';
|
|
16
14
|
|
|
17
15
|
export default () => (
|
|
18
16
|
<BpkGridToggle />
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install bpk-component-horizontal-nav --save-dev
|
|
9
|
-
```
|
|
7
|
+
Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a complete installation guide.
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
import React, { Component } from 'react';
|
|
15
|
-
import BpkHorizontalNav, { BpkHorizontalNavItem } from 'bpk-component-horizontal-nav';
|
|
13
|
+
import BpkHorizontalNav, { BpkHorizontalNavItem } from '@skyscanner/backpack-web/bpk-component-horizontal-nav';
|
|
16
14
|
|
|
17
15
|
export default class App extends Component {
|
|
18
16
|
constructor() {
|