@skyscanner/backpack-web 4.1.0 → 6.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.
Files changed (94) hide show
  1. package/README.md +65 -64
  2. package/bpk-animate-height/package.json +2 -2
  3. package/bpk-component-accordion/package.json +6 -6
  4. package/bpk-component-aria-live/package.json +7 -7
  5. package/bpk-component-autosuggest/package.json +4 -4
  6. package/bpk-component-badge/package.json +4 -4
  7. package/bpk-component-banner-alert/package.json +8 -8
  8. package/bpk-component-barchart/package.json +7 -7
  9. package/bpk-component-blockquote/package.json +2 -2
  10. package/bpk-component-breadcrumb/package.json +5 -5
  11. package/bpk-component-breakpoint/package.json +2 -2
  12. package/bpk-component-button/package.json +2 -2
  13. package/bpk-component-calendar/package.json +8 -8
  14. package/bpk-component-card/package.json +4 -4
  15. package/bpk-component-checkbox/package.json +4 -4
  16. package/bpk-component-chip/package.json +5 -5
  17. package/bpk-component-close-button/package.json +4 -4
  18. package/bpk-component-code/package.json +2 -2
  19. package/bpk-component-content-container/package.json +2 -2
  20. package/bpk-component-datatable/package.json +3 -3
  21. package/bpk-component-datepicker/package.json +8 -8
  22. package/bpk-component-datepicker/src/BpkDatepicker.js +14 -12
  23. package/bpk-component-description-list/package.json +2 -2
  24. package/bpk-component-dialog/package.json +8 -8
  25. package/bpk-component-drawer/package.json +8 -8
  26. package/bpk-component-drawer/src/BpkDrawer.js +2 -10
  27. package/bpk-component-fieldset/package.json +12 -12
  28. package/bpk-component-flare/package.json +4 -4
  29. package/bpk-component-floating-notification/README.md +5 -0
  30. package/bpk-component-floating-notification/package.json +4 -4
  31. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +6 -1
  32. package/bpk-component-form-validation/package.json +9 -9
  33. package/bpk-component-graphic-promotion/package.json +4 -4
  34. package/bpk-component-grid/package.json +2 -2
  35. package/bpk-component-grid-toggle/package.json +3 -3
  36. package/bpk-component-horizontal-nav/package.json +5 -5
  37. package/bpk-component-icon/package.json +5 -5
  38. package/bpk-component-image/package.json +5 -5
  39. package/bpk-component-infinite-scroll/package.json +6 -6
  40. package/bpk-component-input/package.json +6 -6
  41. package/bpk-component-label/package.json +2 -2
  42. package/bpk-component-link/package.json +3 -3
  43. package/bpk-component-list/package.json +2 -2
  44. package/bpk-component-loading-button/package.json +6 -6
  45. package/bpk-component-map/package.json +6 -6
  46. package/bpk-component-mobile-scroll-container/package.json +2 -2
  47. package/bpk-component-modal/package.json +9 -9
  48. package/bpk-component-modal/src/BpkModal.js +4 -9
  49. package/bpk-component-navigation-bar/package.json +7 -7
  50. package/bpk-component-navigation-stack/README.md +1 -0
  51. package/bpk-component-navigation-stack/package.json +7 -6
  52. package/bpk-component-nudger/package.json +6 -6
  53. package/bpk-component-overlay/package.json +4 -4
  54. package/bpk-component-pagination/package.json +4 -4
  55. package/bpk-component-panel/package.json +2 -2
  56. package/bpk-component-phone-input/package.json +8 -8
  57. package/bpk-component-popover/package.json +8 -8
  58. package/bpk-component-popover/src/BpkPopoverPortal.js +25 -14
  59. package/bpk-component-price/README.md +4 -2
  60. package/bpk-component-price/index.js +3 -2
  61. package/bpk-component-price/package.json +3 -3
  62. package/bpk-component-price/src/BpkPrice.js +16 -12
  63. package/bpk-component-price/src/BpkPrice.module.scss +16 -10
  64. package/bpk-component-price/src/common-types.js +29 -0
  65. package/bpk-component-progress/package.json +4 -4
  66. package/bpk-component-radio/package.json +3 -3
  67. package/bpk-component-rating/package.json +3 -3
  68. package/bpk-component-rtl-toggle/package.json +3 -3
  69. package/bpk-component-scrollable-calendar/package.json +5 -5
  70. package/bpk-component-section-list/package.json +5 -5
  71. package/bpk-component-select/package.json +3 -3
  72. package/bpk-component-skip-link/package.json +2 -2
  73. package/bpk-component-slider/package.json +3 -3
  74. package/bpk-component-spinner/package.json +2 -2
  75. package/bpk-component-split-input/package.json +3 -3
  76. package/bpk-component-split-input/src/BpkInputField.js +1 -1
  77. package/bpk-component-split-input/src/BpkInputField.module.scss +3 -3
  78. package/bpk-component-split-input/src/BpkSplitInput.js +3 -1
  79. package/bpk-component-split-input/src/BpkSplitInput.module.scss +2 -2
  80. package/bpk-component-star-rating/package.json +5 -5
  81. package/bpk-component-switch/package.json +2 -2
  82. package/bpk-component-table/package.json +2 -2
  83. package/bpk-component-text/package.json +2 -2
  84. package/bpk-component-textarea/package.json +4 -4
  85. package/bpk-component-theme-toggle/package.json +4 -4
  86. package/bpk-component-ticket/README.md +0 -1
  87. package/bpk-component-ticket/package.json +4 -4
  88. package/bpk-component-ticket/src/BpkTicket.js +0 -40
  89. package/bpk-component-ticket/src/BpkTicket.module.scss +13 -165
  90. package/bpk-component-tooltip/package.json +3 -3
  91. package/bpk-react-utils/package.json +1 -1
  92. package/bpk-react-utils/src/Portal.js +1 -1
  93. package/bpk-scrim-utils/package.json +2 -2
  94. package/package.json +1 -1
@@ -33,7 +33,6 @@ type Props = {
33
33
  stubProps: { [string]: any },
34
34
  padded: boolean,
35
35
  vertical: boolean,
36
- withNotches: boolean,
37
36
  className: ?string,
38
37
  stubClassName: ?string,
39
38
  href: ?string,
@@ -49,7 +48,6 @@ const BpkTicket = (props: Props) => {
49
48
  stubClassName,
50
49
  stubProps,
51
50
  vertical,
52
- withNotches,
53
51
  ...rest
54
52
  } = props;
55
53
 
@@ -57,7 +55,6 @@ const BpkTicket = (props: Props) => {
57
55
  'bpk-ticket',
58
56
  className,
59
57
  vertical && 'bpk-ticket--vertical',
60
- withNotches && 'bpk-ticket--with-notches',
61
58
  );
62
59
 
63
60
  const mainClassNames = getClassName(
@@ -66,7 +63,6 @@ const BpkTicket = (props: Props) => {
66
63
  padded && 'bpk-ticket__main--padded',
67
64
  vertical && 'bpk-ticket__main--vertical',
68
65
  !vertical && 'bpk-ticket__main--horizontal',
69
- withNotches && 'bpk-ticket__paper--with-notches',
70
66
  );
71
67
 
72
68
  const mainInnerClassNames = getClassName(
@@ -82,7 +78,6 @@ const BpkTicket = (props: Props) => {
82
78
  padded && 'bpk-ticket__stub--padded',
83
79
  vertical && 'bpk-ticket__stub--vertical',
84
80
  !vertical && 'bpk-ticket__stub--horizontal',
85
- withNotches && 'bpk-ticket__paper--with-notches',
86
81
  );
87
82
 
88
83
  const stubInnerClassNames = getClassName(
@@ -91,30 +86,6 @@ const BpkTicket = (props: Props) => {
91
86
  !vertical && 'bpk-ticket__stub-inner--horizontal',
92
87
  );
93
88
 
94
- const punchlineClassNames = getClassName(
95
- 'bpk-ticket__punchline',
96
- vertical &&
97
- (withNotches
98
- ? 'bpk-ticket__punchline--horizontal-with-notches'
99
- : 'bpk-ticket__punchline--horizontal'),
100
- !vertical &&
101
- (withNotches
102
- ? 'bpk-ticket__punchline--vertical-with-notches'
103
- : 'bpk-ticket__punchline--vertical'),
104
- );
105
-
106
- const startNotchClassNames = getClassName(
107
- 'bpk-ticket__notch',
108
- vertical && 'bpk-ticket__notch--left',
109
- !vertical && 'bpk-ticket__notch--top',
110
- );
111
-
112
- const endNotchClassNames = getClassName(
113
- 'bpk-ticket__notch',
114
- vertical && 'bpk-ticket__notch--right',
115
- !vertical && 'bpk-ticket__notch--bottom',
116
- );
117
-
118
89
  const mainContent = padded ? (
119
90
  children
120
91
  ) : (
@@ -131,15 +102,6 @@ const BpkTicket = (props: Props) => {
131
102
  <div key="main" className={mainClassNames}>
132
103
  {mainContent}
133
104
  </div>,
134
- <div
135
- key="punchline"
136
- className={punchlineClassNames}
137
- role="presentation"
138
- aria-hidden="true"
139
- >
140
- {withNotches && <div className={startNotchClassNames} />}
141
- {withNotches && <div className={endNotchClassNames} />}
142
- </div>,
143
105
  // $FlowFixMe[cannot-spread-indexer] - inexact rest. See 'decisions/flowfixme.md'.
144
106
  <div key="stub" className={stubClassNames} {...stubProps}>
145
107
  {stubContent}
@@ -172,7 +134,6 @@ BpkTicket.propTypes = {
172
134
  vertical: PropTypes.bool,
173
135
  stubClassName: PropTypes.string,
174
136
  stubProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
175
- withNotches: PropTypes.bool,
176
137
  };
177
138
 
178
139
  BpkTicket.defaultProps = {
@@ -182,7 +143,6 @@ BpkTicket.defaultProps = {
182
143
  vertical: false,
183
144
  stubClassName: null,
184
145
  stubProps: {},
185
- withNotches: true,
186
146
  };
187
147
 
188
148
  export default BpkTicket;
@@ -41,7 +41,6 @@ $bpk-spacing-v2: true;
41
41
  }
42
42
 
43
43
  .bpk-ticket {
44
- $notch-size: bpk-spacing-md();
45
44
  $ticket-padding: bpk-spacing-base();
46
45
 
47
46
  position: relative;
@@ -49,12 +48,14 @@ $bpk-spacing-v2: true;
49
48
  display: flex;
50
49
  flex-direction: row;
51
50
  align-items: stretch;
51
+ flex: none;
52
52
  color: $bpk-card-color;
53
53
  text-decoration: none;
54
+ box-shadow: 0 5px 12px rgba($bpk-button-outline-background-color, 0.08),
55
+ 0 3px 12px rgba($bpk-button-outline-background-color, 0.08);
54
56
  cursor: pointer;
55
57
 
56
- @include bpk-box-shadow-sm;
57
- @include bpk-border-radius-sm;
58
+ @include bpk-border-radius-md;
58
59
  @include hidden-box-shadow-after;
59
60
 
60
61
  @include bpk-hover {
@@ -71,35 +72,22 @@ $bpk-spacing-v2: true;
71
72
  flex-direction: column;
72
73
  }
73
74
 
74
- &--with-notches {
75
- box-shadow: none;
76
-
77
- &::after {
78
- content: none;
79
- }
80
- }
81
-
82
75
  &__paper {
83
76
  position: relative;
84
77
  background-color: $bpk-card-background-color;
85
-
86
- &--with-notches {
87
- @include bpk-box-shadow-sm;
88
- @include hidden-box-shadow-after;
89
- }
90
78
  }
91
79
 
92
80
  @mixin main-styles {
93
81
  &--horizontal {
94
- border-radius: $bpk-border-radius-sm 0 0 $bpk-border-radius-sm;
82
+ border-radius: $bpk-border-radius-md 0 0 $bpk-border-radius-md;
95
83
 
96
84
  @include bpk-rtl {
97
- border-radius: 0 $bpk-border-radius-sm $bpk-border-radius-sm 0;
85
+ border-radius: 0 $bpk-border-radius-md $bpk-border-radius-md 0;
98
86
  }
99
87
  }
100
88
 
101
89
  &--vertical {
102
- border-radius: $bpk-border-radius-sm $bpk-border-radius-sm 0 0;
90
+ border-radius: $bpk-border-radius-md $bpk-border-radius-md 0 0;
103
91
  }
104
92
  }
105
93
 
@@ -123,15 +111,18 @@ $bpk-spacing-v2: true;
123
111
  @mixin stub-styles {
124
112
  &--horizontal {
125
113
  min-width: 30%;
126
- border-radius: 0 $bpk-border-radius-sm $bpk-border-radius-sm 0;
114
+ border-radius: 0 $bpk-border-radius-md $bpk-border-radius-md 0;
115
+ box-shadow: inset $bpk-one-pixel-rem 0 0 $bpk-color-sky-gray-tint-05;
127
116
 
128
117
  @include bpk-rtl {
129
- border-radius: $bpk-border-radius-sm 0 0 $bpk-border-radius-sm;
118
+ border-radius: $bpk-border-radius-md 0 0 $bpk-border-radius-md;
119
+ box-shadow: inset (-$bpk-one-pixel-rem) 0 0 $bpk-color-sky-gray-tint-05;
130
120
  }
131
121
  }
132
122
 
133
123
  &--vertical {
134
- border-radius: 0 0 $bpk-border-radius-sm $bpk-border-radius-sm;
124
+ border-radius: 0 0 $bpk-border-radius-md $bpk-border-radius-md;
125
+ box-shadow: inset 0 $bpk-one-pixel-rem 0 $bpk-color-sky-gray-tint-05;
135
126
  }
136
127
  }
137
128
 
@@ -151,147 +142,4 @@ $bpk-spacing-v2: true;
151
142
 
152
143
  @include stub-styles;
153
144
  }
154
-
155
- &__punchline {
156
- position: relative;
157
- z-index: 1;
158
- flex: 0 0 auto;
159
- background-color: $bpk-card-background-color;
160
-
161
- &--horizontal {
162
- height: $bpk-one-pixel-rem * 2;
163
- background-image: linear-gradient(
164
- $bpk-color-sky-gray-tint-06,
165
- $bpk-color-sky-gray-tint-06
166
- );
167
- background-repeat: repeat-x;
168
- background-position: 0 50%;
169
- background-size: 8 * $bpk-one-pixel-rem 2 * $bpk-one-pixel-rem;
170
- }
171
-
172
- &--horizontal-with-notches {
173
- height: $notch-size * 2;
174
- margin: auto $notch-size;
175
- padding: 0 $notch-size;
176
- background-image: linear-gradient(
177
- $bpk-color-sky-gray-tint-06,
178
- $bpk-color-sky-gray-tint-06
179
- );
180
- background-repeat: repeat-x;
181
- background-position: 0 50%;
182
- background-size: 8 * $bpk-one-pixel-rem 2 * $bpk-one-pixel-rem;
183
- }
184
-
185
- &--vertical {
186
- width: $bpk-one-pixel-rem * 2;
187
- background-image: linear-gradient(
188
- $bpk-color-sky-gray-tint-06,
189
- $bpk-color-sky-gray-tint-06
190
- );
191
- background-repeat: repeat-y;
192
- background-position: 50% 0;
193
- background-size: 2 * $bpk-one-pixel-rem 8 * $bpk-one-pixel-rem;
194
- }
195
-
196
- &--vertical-with-notches {
197
- width: $notch-size * 2;
198
- margin: $notch-size auto;
199
- padding: $notch-size 0;
200
- background-image: linear-gradient(
201
- $bpk-color-sky-gray-tint-06,
202
- $bpk-color-sky-gray-tint-06
203
- );
204
- background-repeat: repeat-y;
205
- background-position: 50% 0;
206
- background-size: 2 * $bpk-one-pixel-rem 8 * $bpk-one-pixel-rem;
207
- }
208
-
209
- &--fallback {
210
- display: table-cell;
211
- width: 2 * $bpk-one-pixel-rem;
212
- background-image: linear-gradient(
213
- $bpk-color-sky-gray-tint-06,
214
- $bpk-color-sky-gray-tint-06
215
- );
216
- background-repeat: repeat-y;
217
- background-position: 50% 0;
218
- background-size: 2 * $bpk-one-pixel-rem 8 * $bpk-one-pixel-rem;
219
- }
220
- }
221
-
222
- &__notch {
223
- position: absolute;
224
- width: $notch-size * 2;
225
- height: $notch-size;
226
- overflow: hidden;
227
-
228
- &::after {
229
- position: relative;
230
- content: '';
231
- display: block;
232
- width: $notch-size * 4;
233
- height: $notch-size * 4;
234
- transform: translate3d(
235
- 0,
236
- 0,
237
- 0
238
- ); // BPK-1011 fix rendering bug in safari 11
239
-
240
- border: $notch-size solid $bpk-color-white;
241
- border-radius: $notch-size * 2;
242
- box-shadow: $bpk-box-shadow-sm inset;
243
- }
244
-
245
- &--top {
246
- top: -$notch-size;
247
-
248
- &::after {
249
- right: -50%;
250
- bottom: 200%;
251
- left: -50%;
252
- }
253
- }
254
-
255
- &--right {
256
- right: -$notch-size;
257
- width: $notch-size;
258
- height: $notch-size * 2;
259
-
260
- &::after {
261
- right: 100%;
262
- bottom: 50%;
263
-
264
- @include bpk-rtl {
265
- right: auto;
266
- left: 200%;
267
- }
268
- }
269
- }
270
-
271
- &--bottom {
272
- bottom: -$notch-size;
273
-
274
- &::after {
275
- right: -50%;
276
- bottom: 100%;
277
- left: -50%;
278
- }
279
- }
280
-
281
- &--left {
282
- left: -$notch-size;
283
- width: $notch-size;
284
- height: $notch-size * 2;
285
-
286
- &::after {
287
- right: 200%;
288
- bottom: 50%;
289
-
290
- @include bpk-rtl {
291
- right: auto;
292
- left: 100%;
293
- }
294
- }
295
- }
296
- }
297
145
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpk-component-tooltip",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "Backpack tooltip component.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@popperjs/core": "^2.11.5",
18
18
  "bpk-mixins": "^31.1.1",
19
- "bpk-react-utils": "^5.0.0",
19
+ "bpk-react-utils": "^6.0.0",
20
20
  "prop-types": "^15.7.2"
21
21
  },
22
22
  "peerDependencies": {
@@ -24,6 +24,6 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@skyscanner/bpk-foundations-web": "^8.0.0",
27
- "bpk-component-text": "^7.0.5"
27
+ "bpk-component-text": "^7.0.6"
28
28
  }
29
29
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpk-react-utils",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "Utilities for Backpack's React components.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -155,7 +155,7 @@ class Portal extends Component {
155
155
  getTargetElement() {
156
156
  return typeof this.props.target === 'function'
157
157
  ? this.props.target()
158
- : this.props.target;
158
+ : this.props.target?.ref.current;
159
159
  }
160
160
 
161
161
  getRenderTarget() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpk-scrim-utils",
3
- "version": "5.1.10",
3
+ "version": "5.1.11",
4
4
  "description": "Higher order component that adds an overlay behind components and manages scroll states.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "a11y-focus-scope": "^1.1.3",
18
18
  "a11y-focus-store": "^1.0.0",
19
19
  "bpk-mixins": "^31.1.1",
20
- "bpk-react-utils": "^5.0.0"
20
+ "bpk-react-utils": "^6.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "^16.3.0 || ^17.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "4.1.0",
3
+ "version": "6.0.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",