@shopgate/pwa-ui-material 7.30.0-alpha.10 → 7.30.0-alpha.12

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.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classnames from 'classnames';
4
4
  import { useSpring, animated } from 'react-spring';
5
- import useMeasure from 'react-use/lib/useMeasure';
5
+ import { useMeasure } from 'react-use';
6
6
  import * as styles from "./style";
7
7
 
8
8
  /**
@@ -10,6 +10,7 @@ import * as styles from "./style";
10
10
  * @param {Object} props The component props.
11
11
  * @returns {JSX}
12
12
  */
13
+ import { jsx as _jsx } from "react/jsx-runtime";
13
14
  function AccordionContent(props) {
14
15
  const {
15
16
  children,
@@ -36,16 +37,19 @@ function AccordionContent(props) {
36
37
  },
37
38
  height: open ? contentHeight : 0
38
39
  });
39
- return /*#__PURE__*/React.createElement(animated.div, {
40
+ return /*#__PURE__*/_jsx(animated.div, {
40
41
  className: classnames('ui-material__accordion-content', styles.content),
41
42
  style: expand,
42
43
  id: id,
43
- "aria-hidden": !open
44
- }, /*#__PURE__*/React.createElement("div", {
45
- ref: ref
46
- }, /*#__PURE__*/React.createElement("div", {
47
- className: classnames(styles.contentInner, className)
48
- }, children)));
44
+ "aria-hidden": !open,
45
+ children: /*#__PURE__*/_jsx("div", {
46
+ ref: ref,
47
+ children: /*#__PURE__*/_jsx("div", {
48
+ className: classnames(styles.contentInner, className),
49
+ children: children
50
+ })
51
+ })
52
+ });
49
53
  }
50
54
  AccordionContent.defaultProps = {
51
55
  open: false,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import AccordionContent from "./index";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  jest.mock('react-spring', () => ({
5
6
  ...jest.requireActual('react-spring'),
6
7
  useSpring: jest.fn().mockReturnValue({
@@ -9,22 +10,26 @@ jest.mock('react-spring', () => ({
9
10
  }));
10
11
  describe('<AccordionContent />', () => {
11
12
  it('should render as closed', () => {
12
- const wrapper = mount(/*#__PURE__*/React.createElement(AccordionContent, {
13
- id: "some-id"
14
- }, /*#__PURE__*/React.createElement("div", {
15
- id: "test"
16
- }, "Some Child")));
13
+ const wrapper = mount(/*#__PURE__*/_jsx(AccordionContent, {
14
+ id: "some-id",
15
+ children: /*#__PURE__*/_jsx("div", {
16
+ id: "test",
17
+ children: "Some Child"
18
+ })
19
+ }));
17
20
  expect(wrapper.find('#test').text()).toEqual('Some Child');
18
21
  expect(wrapper.find('div').get(0).props['aria-hidden']).toEqual(true);
19
22
  expect(wrapper).toMatchSnapshot();
20
23
  });
21
24
  it('should render as open', () => {
22
- const wrapper = mount(/*#__PURE__*/React.createElement(AccordionContent, {
25
+ const wrapper = mount(/*#__PURE__*/_jsx(AccordionContent, {
23
26
  open: true,
24
- id: "some-id"
25
- }, /*#__PURE__*/React.createElement("div", {
26
- id: "test"
27
- }, "Some Child")));
27
+ id: "some-id",
28
+ children: /*#__PURE__*/_jsx("div", {
29
+ id: "test",
30
+ children: "Some Child"
31
+ })
32
+ }));
28
33
  expect(wrapper.find('#test').text()).toEqual('Some Child');
29
34
  expect(wrapper.find('div').get(0).props['aria-hidden']).toEqual(false);
30
35
  expect(wrapper).toMatchSnapshot();
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import "core-js/modules/es.string.replace.js";
3
2
  import * as React from 'react';
4
3
  import PropTypes from 'prop-types';
@@ -28,6 +27,8 @@ import * as styles from "./style";
28
27
  * for the accordion header
29
28
  * @returns {JSX.Element}
30
29
  */
30
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
31
+ import { createElement as _createElement } from "react";
31
32
  function Accordion(props) {
32
33
  const {
33
34
  renderLabel,
@@ -47,48 +48,57 @@ function Accordion(props) {
47
48
  return null;
48
49
  }
49
50
  const controlsId = testId ? `${testId}-content`.replace(/[^\w\s]/gi, '-').replace(' ', '-') : 'accordion-content';
50
- return /*#__PURE__*/React.createElement("div", {
51
- className: "ui-material__accordion-container"
52
- }, /*#__PURE__*/React.createElement(AccordionContainer, {
53
- open: startOpened
54
- }, ({
55
- handleOpen,
56
- handleClose,
57
- open
58
- }) => {
59
- const clickHandlers = {
60
- onClick: open ? handleClose : handleOpen,
61
- onKeyDown: open ? handleClose : handleOpen,
62
- role
63
- };
64
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
65
- className: classnames('ui-material__accordion-title', className, styles.toggle),
66
- "data-test-id": testId
67
- }, /*#__PURE__*/React.createElement("div", _extends({}, openWithChevron ? {} : clickHandlers, {
68
- key: "accordion-toggle",
69
- "aria-expanded": open,
70
- "aria-controls": controlsId,
71
- "aria-label": handleLabel,
72
- className: classnames(styles.labelContainer, {
73
- [styles.toggleLeftAligned]: chevronPosition === 'left'
74
- })
75
- }), renderLabel({
76
- open
77
- }), /*#__PURE__*/React.createElement("div", _extends({
78
- className: classnames(styles.chevronContainer, chevronClassName, {
79
- [styles.clickable]: openWithChevron
80
- })
81
- }, openWithChevron ? clickHandlers : {}, {
82
- "aria-label": i18n.text(open ? 'favorites.close_list' : 'favorites.open_list')
83
- }), /*#__PURE__*/React.createElement(ChevronIcon, {
84
- className: open ? styles.chevronOpen : styles.chevronClosed
85
- }))), renderAdditionalHeaderContent && /*#__PURE__*/React.createElement("div", null, renderAdditionalHeaderContent())), /*#__PURE__*/React.createElement(AccordionContent, {
86
- open: open,
87
- id: controlsId,
88
- key: controlsId,
89
- className: contentClassName
90
- }, children));
91
- }));
51
+ return /*#__PURE__*/_jsx("div", {
52
+ className: "ui-material__accordion-container",
53
+ children: /*#__PURE__*/_jsx(AccordionContainer, {
54
+ open: startOpened,
55
+ children: ({
56
+ handleOpen,
57
+ handleClose,
58
+ open
59
+ }) => {
60
+ const clickHandlers = {
61
+ onClick: open ? handleClose : handleOpen,
62
+ onKeyDown: open ? handleClose : handleOpen,
63
+ role
64
+ };
65
+ return /*#__PURE__*/_jsxs(_Fragment, {
66
+ children: [/*#__PURE__*/_jsxs("div", {
67
+ className: classnames('ui-material__accordion-title', className, styles.toggle),
68
+ "data-test-id": testId,
69
+ children: [/*#__PURE__*/_createElement("div", {
70
+ ...(openWithChevron ? {} : clickHandlers),
71
+ key: "accordion-toggle",
72
+ "aria-expanded": open,
73
+ "aria-controls": controlsId,
74
+ "aria-label": handleLabel,
75
+ className: classnames(styles.labelContainer, {
76
+ [styles.toggleLeftAligned]: chevronPosition === 'left'
77
+ })
78
+ }, renderLabel({
79
+ open
80
+ }), /*#__PURE__*/_jsx("div", {
81
+ className: classnames(styles.chevronContainer, chevronClassName, {
82
+ [styles.clickable]: openWithChevron
83
+ }),
84
+ ...(openWithChevron ? clickHandlers : {}),
85
+ "aria-label": i18n.text(open ? 'favorites.close_list' : 'favorites.open_list'),
86
+ children: /*#__PURE__*/_jsx(ChevronIcon, {
87
+ className: open ? styles.chevronOpen : styles.chevronClosed
88
+ })
89
+ })), renderAdditionalHeaderContent && /*#__PURE__*/_jsx("div", {
90
+ children: renderAdditionalHeaderContent()
91
+ })]
92
+ }), /*#__PURE__*/_jsx(AccordionContent, {
93
+ open: open,
94
+ id: controlsId,
95
+ className: contentClassName,
96
+ children: children
97
+ }, controlsId)]
98
+ });
99
+ }
100
+ })
101
+ });
92
102
  }
93
103
  Accordion.defaultProps = {
94
104
  children: null,
package/Accordion/spec.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import Accordion from "./index";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  jest.unmock('@shopgate/pwa-ui-shared');
5
6
  jest.mock('@shopgate/engage/components');
6
7
  jest.mock('react-spring', () => ({
@@ -14,22 +15,23 @@ describe('<Accordion />', () => {
14
15
  jest.clearAllMocks();
15
16
  });
16
17
  it('should render with renderLabel prop and children', () => {
17
- const wrapper = mount(/*#__PURE__*/React.createElement(Accordion, {
18
- renderLabel: () => /*#__PURE__*/React.createElement("div", null),
19
- testId: "Some Thing"
20
- }, "Some content."));
18
+ const wrapper = mount(/*#__PURE__*/_jsx(Accordion, {
19
+ renderLabel: () => /*#__PURE__*/_jsx("div", {}),
20
+ testId: "Some Thing",
21
+ children: "Some content."
22
+ }));
21
23
  expect(wrapper).toMatchSnapshot();
22
24
  expect(wrapper.find('AccordionContent').exists()).toBe(true);
23
25
  });
24
26
  it('should not render without a renderLabel prop', () => {
25
- const wrapper = mount(/*#__PURE__*/React.createElement(Accordion, {
27
+ const wrapper = mount(/*#__PURE__*/_jsx(Accordion, {
26
28
  testId: "Some Thing"
27
29
  }));
28
30
  expect(wrapper).toMatchSnapshot();
29
31
  expect(wrapper.instance()).toEqual(null);
30
32
  });
31
33
  it('should not render without children', () => {
32
- const wrapper = mount(/*#__PURE__*/React.createElement(Accordion, {
34
+ const wrapper = mount(/*#__PURE__*/_jsx(Accordion, {
33
35
  renderLabel: () => {},
34
36
  testId: "Some Thing"
35
37
  }));
@@ -7,18 +7,20 @@ import { APP_BAR_BELOW, APP_BAR_BELOW_BEFORE, APP_BAR_BELOW_AFTER } from '@shopg
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
11
  function Below({
11
12
  elements
12
13
  }) {
13
- return /*#__PURE__*/React.createElement(Fragment, {
14
- key: "below"
15
- }, /*#__PURE__*/React.createElement(Portal, {
16
- name: APP_BAR_BELOW_BEFORE
17
- }), /*#__PURE__*/React.createElement(Portal, {
18
- name: APP_BAR_BELOW
19
- }, elements), /*#__PURE__*/React.createElement(Portal, {
20
- name: APP_BAR_BELOW_AFTER
21
- }));
14
+ return /*#__PURE__*/_jsxs(Fragment, {
15
+ children: [/*#__PURE__*/_jsx(Portal, {
16
+ name: APP_BAR_BELOW_BEFORE
17
+ }), /*#__PURE__*/_jsx(Portal, {
18
+ name: APP_BAR_BELOW,
19
+ children: elements
20
+ }), /*#__PURE__*/_jsx(Portal, {
21
+ name: APP_BAR_BELOW_AFTER
22
+ })]
23
+ }, "below");
22
24
  }
23
25
  Below.defaultProps = {
24
26
  elements: null
@@ -7,18 +7,20 @@ import { APP_BAR_CENTER, APP_BAR_CENTER_BEFORE, APP_BAR_CENTER_AFTER } from '@sh
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
11
  function Center({
11
12
  elements
12
13
  }) {
13
- return /*#__PURE__*/React.createElement(Fragment, {
14
- key: "center"
15
- }, /*#__PURE__*/React.createElement(Portal, {
16
- name: APP_BAR_CENTER_BEFORE
17
- }), /*#__PURE__*/React.createElement(Portal, {
18
- name: APP_BAR_CENTER
19
- }, elements), /*#__PURE__*/React.createElement(Portal, {
20
- name: APP_BAR_CENTER_AFTER
21
- }));
14
+ return /*#__PURE__*/_jsxs(Fragment, {
15
+ children: [/*#__PURE__*/_jsx(Portal, {
16
+ name: APP_BAR_CENTER_BEFORE
17
+ }), /*#__PURE__*/_jsx(Portal, {
18
+ name: APP_BAR_CENTER,
19
+ children: elements
20
+ }), /*#__PURE__*/_jsx(Portal, {
21
+ name: APP_BAR_CENTER_AFTER
22
+ })]
23
+ }, "center");
22
24
  }
23
25
  Center.defaultProps = {
24
26
  elements: null
@@ -1,3 +1,4 @@
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
2
  import React, { PureComponent } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import styles from "./style";
@@ -5,11 +6,17 @@ import styles from "./style";
5
6
  /**
6
7
  * The AppBarField component.
7
8
  */
8
- class AppBarField extends PureComponent {
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ let AppBarField = /*#__PURE__*/function (_PureComponent) {
11
+ function AppBarField() {
12
+ return _PureComponent.apply(this, arguments) || this;
13
+ }
14
+ _inheritsLoose(AppBarField, _PureComponent);
15
+ var _proto = AppBarField.prototype;
9
16
  /**
10
17
  * @returns {JSX}
11
18
  */
12
- render() {
19
+ _proto.render = function render() {
13
20
  const {
14
21
  fieldRef,
15
22
  onChange,
@@ -18,18 +25,20 @@ class AppBarField extends PureComponent {
18
25
  const {
19
26
  __
20
27
  } = this.context.i18n();
21
- return /*#__PURE__*/React.createElement("form", {
28
+ return /*#__PURE__*/_jsx("form", {
22
29
  className: styles.form,
23
- onSubmit: onSubmit
24
- }, /*#__PURE__*/React.createElement("input", {
25
- className: styles.field,
26
- onChange: onChange,
27
- placeholder: __('search.placeholder'),
28
- ref: fieldRef,
29
- "data-test-id": "searchInput"
30
- }));
31
- }
32
- }
30
+ onSubmit: onSubmit,
31
+ children: /*#__PURE__*/_jsx("input", {
32
+ className: styles.field,
33
+ onChange: onChange,
34
+ placeholder: __('search.placeholder'),
35
+ ref: fieldRef,
36
+ "data-test-id": "searchInput"
37
+ })
38
+ });
39
+ };
40
+ return AppBarField;
41
+ }(PureComponent);
33
42
  AppBarField.defaultProps = {
34
43
  fieldRef: null,
35
44
  onChange: null,
@@ -1,3 +1,4 @@
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
2
  import React, { PureComponent } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import styles from "./style";
@@ -5,11 +6,17 @@ import styles from "./style";
5
6
  /**
6
7
  * The AppBarIcon component.
7
8
  */
8
- class AppBarIcon extends PureComponent {
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ let AppBarIcon = /*#__PURE__*/function (_PureComponent) {
11
+ function AppBarIcon() {
12
+ return _PureComponent.apply(this, arguments) || this;
13
+ }
14
+ _inheritsLoose(AppBarIcon, _PureComponent);
15
+ var _proto = AppBarIcon.prototype;
9
16
  /**
10
17
  * @returns {JSX}
11
18
  */
12
- render() {
19
+ _proto.render = function render() {
13
20
  const {
14
21
  background,
15
22
  badge: Badge,
@@ -20,7 +27,7 @@ class AppBarIcon extends PureComponent {
20
27
  'aria-hidden': ariaHidden,
21
28
  'aria-label': ariaLabel
22
29
  } = this.props;
23
- return /*#__PURE__*/React.createElement("button", {
30
+ return /*#__PURE__*/_jsxs("button", {
24
31
  className: styles,
25
32
  onClick: onClick,
26
33
  style: {
@@ -30,10 +37,12 @@ class AppBarIcon extends PureComponent {
30
37
  "data-test-id": testId,
31
38
  "aria-hidden": ariaHidden,
32
39
  "aria-label": ariaLabel,
33
- type: "button"
34
- }, /*#__PURE__*/React.createElement(Icon, null), Badge && /*#__PURE__*/React.createElement(Badge, null));
35
- }
36
- }
40
+ type: "button",
41
+ children: [/*#__PURE__*/_jsx(Icon, {}), Badge && /*#__PURE__*/_jsx(Badge, {})]
42
+ });
43
+ };
44
+ return AppBarIcon;
45
+ }(PureComponent);
37
46
  AppBarIcon.defaultProps = {
38
47
  'aria-hidden': null,
39
48
  'aria-label': null,
@@ -7,18 +7,20 @@ import { APP_BAR_LEFT, APP_BAR_LEFT_BEFORE, APP_BAR_LEFT_AFTER } from '@shopgate
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
11
  function Left({
11
12
  elements
12
13
  }) {
13
- return /*#__PURE__*/React.createElement(Fragment, {
14
- key: "left"
15
- }, /*#__PURE__*/React.createElement(Portal, {
16
- name: APP_BAR_LEFT_BEFORE
17
- }), /*#__PURE__*/React.createElement(Portal, {
18
- name: APP_BAR_LEFT
19
- }, elements), /*#__PURE__*/React.createElement(Portal, {
20
- name: APP_BAR_LEFT_AFTER
21
- }));
14
+ return /*#__PURE__*/_jsxs(Fragment, {
15
+ children: [/*#__PURE__*/_jsx(Portal, {
16
+ name: APP_BAR_LEFT_BEFORE
17
+ }), /*#__PURE__*/_jsx(Portal, {
18
+ name: APP_BAR_LEFT,
19
+ children: elements
20
+ }), /*#__PURE__*/_jsx(Portal, {
21
+ name: APP_BAR_LEFT_AFTER
22
+ })]
23
+ }, "left");
22
24
  }
23
25
  Left.defaultProps = {
24
26
  elements: null
@@ -7,18 +7,20 @@ import { APP_BAR_RIGHT, APP_BAR_RIGHT_BEFORE, APP_BAR_RIGHT_AFTER } from '@shopg
7
7
  * @param {Object} props The component props.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
11
  function Right({
11
12
  elements
12
13
  }) {
13
- return /*#__PURE__*/React.createElement(Fragment, {
14
- key: "right"
15
- }, /*#__PURE__*/React.createElement(Portal, {
16
- name: APP_BAR_RIGHT_BEFORE
17
- }), /*#__PURE__*/React.createElement(Portal, {
18
- name: APP_BAR_RIGHT
19
- }, elements), /*#__PURE__*/React.createElement(Portal, {
20
- name: APP_BAR_RIGHT_AFTER
21
- }));
14
+ return /*#__PURE__*/_jsxs(Fragment, {
15
+ children: [/*#__PURE__*/_jsx(Portal, {
16
+ name: APP_BAR_RIGHT_BEFORE
17
+ }), /*#__PURE__*/_jsx(Portal, {
18
+ name: APP_BAR_RIGHT,
19
+ children: elements
20
+ }), /*#__PURE__*/_jsx(Portal, {
21
+ name: APP_BAR_RIGHT_AFTER
22
+ })]
23
+ }, "right");
22
24
  }
23
25
  Right.defaultProps = {
24
26
  elements: null
@@ -1,3 +1,4 @@
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
2
  import React, { PureComponent } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import classNames from 'classnames';
@@ -6,33 +7,41 @@ import styles from "./style";
6
7
  /**
7
8
  * The AppBarTitle component.
8
9
  */
9
- class AppBarTitle extends PureComponent {
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ let AppBarTitle = /*#__PURE__*/function (_PureComponent) {
12
+ function AppBarTitle() {
13
+ return _PureComponent.apply(this, arguments) || this;
14
+ }
15
+ _inheritsLoose(AppBarTitle, _PureComponent);
16
+ var _proto = AppBarTitle.prototype;
10
17
  /**
11
18
  * @returns {JSX.Element}
12
19
  */
13
- render() {
20
+ _proto.render = function render() {
14
21
  const {
15
22
  onClick,
16
23
  title
17
24
  } = this.props;
18
25
  if (!title) return null;
19
- return /*#__PURE__*/React.createElement("div", {
26
+ return /*#__PURE__*/_jsx("div", {
20
27
  className: classNames(styles, 'theme__app-bar__title'),
21
28
  role: "heading",
22
29
  "aria-labelledby": "titleLabel",
23
30
  "aria-level": "1",
24
31
  "data-test-id": `title: ${title}`,
25
- tabIndex: -1
26
- }, /*#__PURE__*/React.createElement("span", {
27
- role: "presentation",
28
- onClick: onClick,
29
- id: "titleLabel",
30
- dangerouslySetInnerHTML: {
31
- __html: title
32
- }
33
- }));
34
- }
35
- }
32
+ tabIndex: -1,
33
+ children: /*#__PURE__*/_jsx("span", {
34
+ role: "presentation",
35
+ onClick: onClick,
36
+ id: "titleLabel",
37
+ dangerouslySetInnerHTML: {
38
+ __html: title
39
+ }
40
+ })
41
+ });
42
+ };
43
+ return AppBarTitle;
44
+ }(PureComponent);
36
45
  AppBarTitle.defaultProps = {
37
46
  onClick: null
38
47
  };
package/AppBar/index.js CHANGED
@@ -18,6 +18,7 @@ import styles from "./style";
18
18
  * Updates the --app-bar-height custom property
19
19
  * @param {Object} ref The app bar ref.
20
20
  */
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
22
  const updateAppBarHeight = ref => {
22
23
  if (!ref.current) {
23
24
  return;
@@ -57,25 +58,28 @@ const AppBar = ({
57
58
  observer.disconnect();
58
59
  };
59
60
  }, [contentRef, observer]);
60
- return /*#__PURE__*/React.createElement("header", {
61
+ return /*#__PURE__*/_jsxs("header", {
61
62
  ref: contentRef,
62
63
  className: `${styles.outer} ui-material__app-bar`,
63
64
  "data-test-id": "Navigator",
64
65
  role: "banner",
65
- style: style
66
- }, /*#__PURE__*/React.createElement(SurroundPortals, {
67
- portalName: APP_BAR_CONTENT
68
- }, /*#__PURE__*/React.createElement("div", {
69
- className: styles.inner
70
- }, /*#__PURE__*/React.createElement(Left, {
71
- elements: left
72
- }), /*#__PURE__*/React.createElement(Center, {
73
- elements: center
74
- }), /*#__PURE__*/React.createElement(Right, {
75
- elements: right
76
- }))), /*#__PURE__*/React.createElement(Below, {
77
- elements: below
78
- }));
66
+ style: style,
67
+ children: [/*#__PURE__*/_jsx(SurroundPortals, {
68
+ portalName: APP_BAR_CONTENT,
69
+ children: /*#__PURE__*/_jsxs("div", {
70
+ className: styles.inner,
71
+ children: [/*#__PURE__*/_jsx(Left, {
72
+ elements: left
73
+ }), /*#__PURE__*/_jsx(Center, {
74
+ elements: center
75
+ }), /*#__PURE__*/_jsx(Right, {
76
+ elements: right
77
+ })]
78
+ })
79
+ }), /*#__PURE__*/_jsx(Below, {
80
+ elements: below
81
+ })]
82
+ });
79
83
  };
80
84
  AppBar.defaultProps = {
81
85
  backgroundColor: themeColors.light,
@@ -8,22 +8,23 @@ import styles from "../../style";
8
8
  * @param {Object} props The component props.
9
9
  * @returns {JSX}
10
10
  */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const Buttons = ({
12
13
  actions
13
14
  }) => actions.map(({
14
15
  label,
15
16
  action,
16
17
  disabled = false
17
- }) => /*#__PURE__*/React.createElement(Button, {
18
- key: label,
18
+ }) => /*#__PURE__*/_jsx(Button, {
19
19
  className: styles.button,
20
20
  flat: true,
21
21
  type: "primary",
22
22
  onClick: action,
23
- disabled: disabled
24
- }, /*#__PURE__*/React.createElement(I18n.Text, {
25
- string: label
26
- })));
23
+ disabled: disabled,
24
+ children: /*#__PURE__*/_jsx(I18n.Text, {
25
+ string: label
26
+ })
27
+ }, label));
27
28
  Buttons.defaultProps = {
28
29
  actions: []
29
30
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
  import Button from '@shopgate/pwa-ui-shared/Button';
4
4
  import Buttons from "./index";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const actions = [{
6
7
  label: 'action0',
7
8
  action: jest.fn()
@@ -14,12 +15,12 @@ const actions = [{
14
15
  }];
15
16
  describe('<Buttons />', () => {
16
17
  it('should not render if no actions are passed', () => {
17
- const wrapper = shallow(/*#__PURE__*/React.createElement(Buttons, null));
18
+ const wrapper = shallow(/*#__PURE__*/_jsx(Buttons, {}));
18
19
  expect(wrapper).toMatchSnapshot();
19
20
  expect(wrapper.instance()).toEqual(null);
20
21
  });
21
22
  it('should render buttons', () => {
22
- const wrapper = shallow(/*#__PURE__*/React.createElement(Buttons, {
23
+ const wrapper = shallow(/*#__PURE__*/_jsx(Buttons, {
23
24
  actions: actions
24
25
  }));
25
26
  expect(wrapper).toMatchSnapshot();