@skyscanner/backpack-web 33.5.0 → 33.6.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.
@@ -21,6 +21,8 @@ The dismissible chip component is just a selectable chip that's
21
21
  been hard coded to have disabled={false}, selected and a trailing
22
22
  accessory view of a close icon.
23
23
  */
24
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
25
+ import { chipColors } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
24
26
 
25
27
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
26
28
  import CloseCircleIconSm from "../../bpk-component-icon/sm/close-circle";
@@ -36,23 +38,18 @@ const BpkDismissibleChip = ({
36
38
  type = CHIP_TYPES.default,
37
39
  ...rest
38
40
  }) => {
39
- const iconClassNames = getClassName(`bpk-chip--${type}-dismissible__trailing-accessory-view`);
40
41
  const classNames = getClassName(`bpk-chip--${type}-dismissible`, className);
41
42
  return /*#__PURE__*/_jsx(BpkSelectableChip, {
42
43
  ...rest,
43
44
  leadingAccessoryView: leadingAccessoryView,
44
45
  disabled: false,
45
- trailingAccessoryView: /*#__PURE__*/_jsx(CloseCircleIconSm
46
- // TODO: className to be removed
47
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
48
- , {
49
- className: iconClassNames
46
+ dismissible: true,
47
+ trailingAccessoryView: /*#__PURE__*/_jsx(CloseCircleIconSm, {
48
+ fill: type === CHIP_TYPES.default || type === CHIP_TYPES.onImage ? chipColors.privateChipOnDarkOnDismissIconNight : chipColors.privateChipOnDarkOnDismissIconDay
50
49
  }),
51
50
  selected: true,
52
51
  type: type,
53
52
  role: "button" // Override role="checkbox" because this chip is not selectable.
54
- // TODO: className to be removed
55
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
56
53
  ,
57
54
  className: classNames
58
55
  });
@@ -27,6 +27,7 @@ const BpkSelectableChip = ({
27
27
  children,
28
28
  className,
29
29
  disabled = false,
30
+ dismissible = false,
30
31
  leadingAccessoryView = null,
31
32
  role = 'checkbox',
32
33
  selected = false,
@@ -34,7 +35,7 @@ const BpkSelectableChip = ({
34
35
  type = CHIP_TYPES.default,
35
36
  ...rest
36
37
  }) => {
37
- const classNames = getClassName('bpk-chip', `bpk-chip--${type}`, disabled && 'bpk-chip--disabled', disabled && `bpk-chip--${type}-disabled`, !children && 'bpk-chip--icon-only', !disabled && selected && `bpk-chip--${type}-selected`, className);
38
+ const classNames = getClassName('bpk-chip', `bpk-chip--${type}`, disabled && 'bpk-chip--disabled', disabled && `bpk-chip--${type}-disabled`, !children && 'bpk-chip--icon-only', !disabled && selected && `bpk-chip--${type}-selected`, dismissible && `bpk-chip--${type}-dismissible`, className);
38
39
  return /*#__PURE__*/_jsxs("button", {
39
40
  "aria-checked": role === 'button' || role === 'tab' ? undefined : selected,
40
41
  className: classNames,
@@ -23,10 +23,7 @@ import BpkInput, { withOpenEvents } from "../../bpk-component-input";
23
23
  import BpkModal from "../../bpk-component-modal";
24
24
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
25
25
  import BpkPopover from "../../bpk-component-popover";
26
- import { cssModules } from "../../bpk-react-utils";
27
- import STYLES from "./BpkDatepicker.module.css";
28
26
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
29
- const getClassName = cssModules(STYLES);
30
27
  const Input = withOpenEvents(BpkInput);
31
28
  const DefaultCalendar = withCalendarState(composeCalendar(BpkCalendarNav, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDate));
32
29
  class BpkDatepicker extends Component {
@@ -192,7 +189,6 @@ class BpkDatepicker extends Component {
192
189
  delete rest.onOpenChange;
193
190
  delete rest.isOpen;
194
191
  const input = inputComponent || /*#__PURE__*/_jsx("div", {
195
- className: getClassName('bpk-datepicker__input'),
196
192
  ref: this.inputRef,
197
193
  children: /*#__PURE__*/_jsx(Input, {
198
194
  id: id,
@@ -210,7 +206,6 @@ class BpkDatepicker extends Component {
210
206
  });
211
207
  const calendarProps = {
212
208
  id: `${id}-calendar`,
213
- className: getClassName('bpk-datepicker__calendar'),
214
209
  changeMonthLabel,
215
210
  dateModifiers,
216
211
  daysOfWeek,
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-floating-notification{position:absolute;right:0;bottom:2rem;left:0;display:flex;max-width:25rem;margin:auto;padding:1.5rem;transition:opacity 400ms ease-in-out,transform 400ms ease-in-out;border-radius:.75rem;background:#05203c;color:#fff;box-shadow:0px 12px 50px 0px rgba(37,32,31,.25),0px 4px 14px 0px rgba(37,32,31,.25)}@media(max-width: 32rem){.bpk-floating-notification{max-width:100%;padding:1rem}}.bpk-floating-notification--leave{transform:translateY(0);opacity:1}.bpk-floating-notification--leave-active{transform:translateY(2rem);opacity:0}.bpk-floating-notification--leave-done{opacity:0}.bpk-floating-notification--appear{transform:translateY(2rem);opacity:0}.bpk-floating-notification--appear-active{transform:translateY(0);opacity:1}.bpk-floating-notification__button{min-height:0;padding:0;color:#fff;margin-inline-start:auto;word-break:keep-all}.bpk-floating-notification__icon{margin-right:.5rem;margin-left:.25rem;flex-shrink:0;transform:translateY(0.25rem);text-align:bottom;fill:#fff}.bpk-floating-notification__text{margin-inline-end:.5rem}
18
+ .bpk-floating-notification{position:absolute;right:0;bottom:2rem;left:0;display:flex;z-index:2;max-width:25rem;margin:auto;padding:1.5rem;transition:opacity 400ms ease-in-out,transform 400ms ease-in-out;border-radius:.75rem;background:#05203c;color:#fff;box-shadow:0px 12px 50px 0px rgba(37,32,31,.25),0px 4px 14px 0px rgba(37,32,31,.25)}@media(max-width: 32rem){.bpk-floating-notification{max-width:100%;padding:1rem}}.bpk-floating-notification--leave{transform:translateY(0);opacity:1}.bpk-floating-notification--leave-active{transform:translateY(2rem);opacity:0}.bpk-floating-notification--leave-done{opacity:0}.bpk-floating-notification--appear{transform:translateY(2rem);opacity:0}.bpk-floating-notification--appear-active{transform:translateY(0);opacity:1}.bpk-floating-notification__button{min-height:0;padding:0;color:#fff;margin-inline-start:auto;word-break:keep-all}.bpk-floating-notification__icon{margin-right:.5rem;margin-left:.25rem;flex-shrink:0;transform:translateY(0.25rem);text-align:bottom;fill:#fff}.bpk-floating-notification__text{margin-inline-end:.5rem}
@@ -84,7 +84,8 @@ const BpkMap = props => {
84
84
  rotateControl: false,
85
85
  clickableIcons: false,
86
86
  // https://developers.google.com/maps/documentation/javascript/reference/map#MapTypeStyle
87
- styles: mapOptionStyles
87
+ styles: mapOptionStyles,
88
+ scaleControl: true
88
89
  },
89
90
  onDragEnd: () => {
90
91
  if (ref && ref.current && onRegionChange) {
@@ -84,14 +84,13 @@ const BpkPhoneInput = props => {
84
84
  ...wrapperProps,
85
85
  className: getClassName('bpk-phone-input', wrapperProps.className),
86
86
  children: [/*#__PURE__*/_jsxs("div", {
87
- children: [/*#__PURE__*/_jsx(BpkLabel, {
88
- htmlFor: dialingCodeProps.id,
89
- disabled: disabled
90
- // TODO: className to be removed
91
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
92
- ,
87
+ children: [/*#__PURE__*/_jsx("div", {
93
88
  className: getClassName('bpk-phone-input__label'),
94
- children: dialingCodeProps.label
89
+ children: /*#__PURE__*/_jsx(BpkLabel, {
90
+ htmlFor: dialingCodeProps.id,
91
+ disabled: disabled,
92
+ children: dialingCodeProps.label
93
+ })
95
94
  }), /*#__PURE__*/_jsx(BpkSelect, {
96
95
  ...commonProps,
97
96
  ...dialingCodeProps,
@@ -116,14 +115,13 @@ const BpkPhoneInput = props => {
116
115
  })]
117
116
  }), /*#__PURE__*/_jsxs("div", {
118
117
  className: getClassName('bpk-phone-input__phone-number'),
119
- children: [/*#__PURE__*/_jsx(BpkLabel, {
120
- htmlFor: id,
121
- disabled: disabled
122
- // TODO: className to be removed
123
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
124
- ,
118
+ children: [/*#__PURE__*/_jsx("div", {
125
119
  className: getClassName('bpk-phone-input__label'),
126
- children: label
120
+ children: /*#__PURE__*/_jsx(BpkLabel, {
121
+ htmlFor: id,
122
+ disabled: disabled,
123
+ children: label
124
+ })
127
125
  }), /*#__PURE__*/_jsx(BpkInput, {
128
126
  ...commonProps,
129
127
  ...rest,
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0062e3;fill:var(--bpk-spinner-primary-color, rgb(0, 98, 227))}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#161616}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top:0rem;vertical-align:top}
18
+ @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{display:block;width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0062e3;fill:var(--bpk-spinner-primary-color, rgb(0, 98, 227))}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#161616}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top:0rem;vertical-align:top}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "33.5.0",
3
+ "version": "33.6.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,18 +0,0 @@
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
- .bpk-datepicker__calendar{margin:0 auto}.bpk-datepicker__input{display:inline-block;width:100%}