@skyscanner/backpack-web 35.3.0 → 35.3.1

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.
@@ -14,7 +14,7 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export default ((props, propName, componentName) => {
17
+ */export default (props, propName, componentName) => {
18
18
  const {
19
19
  xScaleDataKey,
20
20
  yScaleDataKey
@@ -31,4 +31,4 @@
31
31
  }
32
32
  }
33
33
  return null;
34
- });
34
+ };
@@ -20,7 +20,7 @@ import { cssModules } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkDescriptionList.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
23
- export default (({
23
+ export default ({
24
24
  children,
25
25
  className,
26
26
  ...rest
@@ -29,4 +29,4 @@ export default (({
29
29
  .join(' '),
30
30
  ...rest,
31
31
  children: children
32
- }));
32
+ });
@@ -20,7 +20,7 @@ import { cssModules } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkDescriptionList.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
23
- export default (({
23
+ export default ({
24
24
  children,
25
25
  className,
26
26
  ...rest
@@ -29,4 +29,4 @@ export default (({
29
29
  .join(' '),
30
30
  ...rest,
31
31
  children: children
32
- }));
32
+ });
@@ -20,7 +20,7 @@ import { cssModules } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkDescriptionList.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
23
- export default (({
23
+ export default ({
24
24
  children,
25
25
  className,
26
26
  ...rest
@@ -29,4 +29,4 @@ export default (({
29
29
  .join(' '),
30
30
  ...rest,
31
31
  children: children
32
- }));
32
+ });
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- export default (({
3
+ export default ({
4
4
  styles = {},
5
5
  ...props
6
6
  }) => /*#__PURE__*/_jsx("svg", {
@@ -9,4 +9,4 @@ export default (({
9
9
  children: /*#__PURE__*/_jsx("path", {
10
10
  d: "M0 0v75h75C37.5 75 0 37.5 0 0z"
11
11
  })
12
- }));
12
+ });
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- export default (({
3
+ export default ({
4
4
  styles = {},
5
5
  ...props
6
6
  }) => /*#__PURE__*/_jsx("svg", {
@@ -9,4 +9,4 @@ export default (({
9
9
  children: /*#__PURE__*/_jsx("path", {
10
10
  d: "M7501.307 8.517l-68.043 39.341c-10.632 6.185-23.795 6.185-34.528 0l-68.144-39.34c-8.91-5.173-18.988-8.215-29.316-8.518H0v55h14832V0H7530.671a63.604 63.604 0 00-29.364 8.517z"
11
11
  })
12
- }));
12
+ });
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { wrapDisplayName } from "../../bpk-react-utils";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
- export default ((displayName, classNamesToAdd = []) => ComposedComponent => {
21
+ export default (displayName, classNamesToAdd = []) => ComposedComponent => {
22
22
  const ClassNameModifierHOC = props => {
23
23
  let classNames = [];
24
24
  const {
@@ -36,4 +36,4 @@ export default ((displayName, classNamesToAdd = []) => ComposedComponent => {
36
36
  };
37
37
  ClassNameModifierHOC.displayName = wrapDisplayName(ComposedComponent, displayName);
38
38
  return ClassNameModifierHOC;
39
- });
39
+ };
@@ -4,13 +4,15 @@ export declare const NAVIGATION_TAB_GROUP_TYPES: {
4
4
  SurfaceContrast: string;
5
5
  };
6
6
  export type NavigationTabGroupTypes = (typeof NAVIGATION_TAB_GROUP_TYPES)[keyof typeof NAVIGATION_TAB_GROUP_TYPES];
7
- type TabItem = {
7
+ type TabWrapItem = {
8
8
  id: string;
9
- text: string;
10
- icon?: FunctionComponent<any> | null;
11
9
  href?: string;
12
10
  [rest: string]: any;
13
11
  };
12
+ type TabItem = TabWrapItem & {
13
+ text: string;
14
+ icon?: FunctionComponent<any> | null;
15
+ };
14
16
  export type Props = {
15
17
  id: string;
16
18
  tabs: TabItem[];
@@ -76,9 +76,14 @@ const BpkNavigationTabGroup = ({
76
76
  "aria-label": ariaLabel,
77
77
  children: tabs.map((tab, index) => {
78
78
  const selected = index === selectedTab;
79
- const Icon = tab.icon;
79
+ const {
80
+ icon,
81
+ text,
82
+ ...tabWrapItem
83
+ } = tab;
84
+ const Icon = icon;
80
85
  return /*#__PURE__*/_jsx(TabWrap, {
81
- tab: tab,
86
+ tab: tabWrapItem,
82
87
  selected: selected,
83
88
  onClick: e => handleButtonClick(e, tab, index),
84
89
  type: type,
@@ -89,7 +94,7 @@ const BpkNavigationTabGroup = ({
89
94
  }), /*#__PURE__*/_jsx(BpkText, {
90
95
  tagName: "span",
91
96
  textStyle: TEXT_STYLES.label2,
92
- children: tab.text
97
+ children: text
93
98
  })]
94
99
  })
95
100
  }, `index-${index.toString()}`);
@@ -103,7 +103,7 @@ const BpkPopover = ({
103
103
  }
104
104
  }
105
105
  }) : getReferenceProps();
106
- const targetElement = /*#__PURE__*/isValidElement(target) ? ( /*#__PURE__*/cloneElement(target, {
106
+ const targetElement = /*#__PURE__*/isValidElement(target) ? (/*#__PURE__*/cloneElement(target, {
107
107
  ...referenceProps,
108
108
  // @ts-ignore - we're adding a popover ref to the target element so we can position the popover relative to it
109
109
  ref: refs.setReference
@@ -26,7 +26,7 @@ const renderSteps = numberOfSteps => {
26
26
  const steps = [];
27
27
  for (let i = 1; i <= numberOfSteps; i += 1) {
28
28
  const left = `${100 * (i / (numberOfSteps + 1))}%`;
29
- steps.push( /*#__PURE__*/_jsx("div", {
29
+ steps.push(/*#__PURE__*/_jsx("div", {
30
30
  className: getClassName('bpk-progress__step'),
31
31
  style: {
32
32
  left
@@ -180,7 +180,7 @@ class BpkSplitInput extends Component {
180
180
  } = this.props;
181
181
  const inputs = [];
182
182
  for (let index = 0; index < inputLength; index += 1) {
183
- inputs.push( /*#__PURE__*/_jsx(InputField, {
183
+ inputs.push(/*#__PURE__*/_jsx(InputField, {
184
184
  index: index,
185
185
  focus: focusedInput === index,
186
186
  id: `${id}-${index}`,
@@ -50,7 +50,7 @@ const BpkInteractiveStarRating = props => {
50
50
  }
51
51
  for (let starNumber = 1; starNumber <= maxRating; starNumber += 1) {
52
52
  const type = getTypeByRating(starNumber, currentRating);
53
- stars.push( /*#__PURE__*/_jsx(BpkInteractiveStar, {
53
+ stars.push(/*#__PURE__*/_jsx(BpkInteractiveStar, {
54
54
  onClick: event => onRatingSelect(starNumber, event),
55
55
  type: type,
56
56
  large: large,
@@ -53,7 +53,7 @@ const BpkStarRating = props => {
53
53
  }
54
54
  for (let starNumber = 1; starNumber <= maxRating; starNumber += 1) {
55
55
  const type = getTypeByRating(starNumber, rounding(currentRating));
56
- stars.push( /*#__PURE__*/_jsx(BpkStar, {
56
+ stars.push(/*#__PURE__*/_jsx(BpkStar, {
57
57
  type: type,
58
58
  large: large
59
59
  }, `star-${starNumber}`));
@@ -224,7 +224,7 @@ class Portal extends Component {
224
224
  return null;
225
225
  }
226
226
  const stopPropagationHandler = e => e.stopPropagation();
227
- return /*#__PURE__*/createPortal( /*#__PURE__*/_jsx("div", {
227
+ return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx("div", {
228
228
  onClick: stopPropagationHandler,
229
229
  onMouseDown: stopPropagationHandler,
230
230
  onMouseUp: stopPropagationHandler,
@@ -16,10 +16,10 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- export default ((styles = {}) => (...classNames) => classNames.reduce((className, currentClass) => {
19
+ export default (styles = {}) => (...classNames) => classNames.reduce((className, currentClass) => {
20
20
  if (currentClass && typeof currentClass === 'string') {
21
21
  const realName = styles[currentClass] || currentClass;
22
22
  return className ? `${className} ${realName}` : realName;
23
23
  }
24
24
  return className;
25
- }, ''));
25
+ }, '');
@@ -47,7 +47,7 @@ const withScrimmedPortal = WrappedComponent => {
47
47
  */
48
48
  if (isPortalReady) {
49
49
  const portalElement = getPortalElement(renderTarget);
50
- return /*#__PURE__*/createPortal( /*#__PURE__*/_jsx(Scrimmed, {
50
+ return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(Scrimmed, {
51
51
  ...rest,
52
52
  isPortalReady: isPortalReady
53
53
  }), portalElement);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "35.3.0",
3
+ "version": "35.3.1",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",