@shopgate/pwa-ui-shared 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.
Files changed (188) hide show
  1. package/AccordionContainer/index.js +17 -11
  2. package/AccordionContainer/spec.js +12 -3
  3. package/ActionButton/index.js +47 -33
  4. package/ActionButton/spec.js +5 -1
  5. package/AddToCartButton/index.js +44 -33
  6. package/AddToCartButton/mock.js +20 -8
  7. package/AddToCartButton/spec.js +4 -3
  8. package/Availability/index.js +5 -3
  9. package/Availability/spec.js +6 -5
  10. package/Button/index.js +73 -58
  11. package/Button/spec.js +16 -10
  12. package/ButtonLink/index.js +20 -12
  13. package/ButtonLink/spec.js +5 -3
  14. package/Card/index.js +5 -3
  15. package/CardList/components/Item/index.js +5 -3
  16. package/CardList/index.js +21 -12
  17. package/CartTotalLine/components/Amount/index.js +10 -8
  18. package/CartTotalLine/components/Hint/index.js +7 -5
  19. package/CartTotalLine/components/Label/index.js +12 -10
  20. package/CartTotalLine/components/Spacer/index.js +5 -3
  21. package/CartTotalLine/index.js +5 -3
  22. package/Checkbox/index.js +6 -5
  23. package/Chip/index.js +28 -22
  24. package/Chip/spec.js +9 -6
  25. package/ContextMenu/ContextMenuProvider.js +5 -3
  26. package/ContextMenu/components/Item/index.js +14 -11
  27. package/ContextMenu/components/Position/index.js +20 -12
  28. package/ContextMenu/index.js +54 -44
  29. package/ContextMenu/spec.js +31 -20
  30. package/Dialog/components/HtmlContentDialog/index.js +9 -7
  31. package/Dialog/components/HtmlContentDialog/spec.js +9 -6
  32. package/Dialog/components/PipelineErrorDialog/index.js +106 -47
  33. package/Dialog/components/PipelineErrorDialog/spec.js +5 -4
  34. package/Dialog/components/TextMessageDialog/index.js +9 -7
  35. package/Dialog/components/TextMessageDialog/spec.js +9 -6
  36. package/Dialog/components/VariantSelectModal/index.js +7 -5
  37. package/Dialog/components/VariantSelectModal/spec.js +6 -3
  38. package/Dialog/index.js +12 -8
  39. package/Dialog/spec.js +7 -6
  40. package/DiscountBadge/index.js +10 -8
  41. package/DiscountBadge/spec.js +3 -2
  42. package/FavoritesButton/index.js +40 -31
  43. package/FavoritesButton/spec.js +7 -3
  44. package/Form/Builder/classes/ActionListener/index.js +400 -401
  45. package/Form/Builder/components/CheckboxElement.js +13 -5
  46. package/Form/Builder/components/CountryElement.js +13 -5
  47. package/Form/Builder/components/ProvinceElement.js +13 -5
  48. package/Form/Builder/components/RadioElement.js +19 -11
  49. package/Form/Builder/components/SelectElement.js +26 -16
  50. package/Form/Builder/components/TextElement.js +13 -5
  51. package/Form/Builder/index.js +70 -60
  52. package/Form/Builder/spec.js +10 -9
  53. package/Form/Checkbox/index.js +31 -21
  54. package/Form/InfoField/index.js +19 -12
  55. package/Form/InfoField/spec.js +4 -1
  56. package/Form/Password/index.js +22 -15
  57. package/Form/Password/spec.js +10 -5
  58. package/Form/RadioGroup/components/Item/index.js +34 -25
  59. package/Form/RadioGroup/index.js +37 -28
  60. package/Form/RadioGroup/spec.js +45 -31
  61. package/Form/Select/index.js +52 -43
  62. package/Form/Select/spec.js +5 -2
  63. package/Form/SelectContextChoices/index.js +26 -22
  64. package/Form/SelectContextChoices/spec.js +4 -1
  65. package/Form/TextField/index.js +40 -27
  66. package/Form/TextField/spec.js +34 -21
  67. package/Form/index.js +23 -15
  68. package/FormElement/components/ErrorText/index.js +7 -5
  69. package/FormElement/components/Label/index.js +6 -4
  70. package/FormElement/components/Placeholder/index.js +7 -5
  71. package/FormElement/components/Underline/index.js +8 -6
  72. package/FormElement/index.js +62 -46
  73. package/FormElement/spec.js +10 -9
  74. package/Glow/index.js +30 -22
  75. package/Glow/spec.js +6 -1
  76. package/IndicatorCircle/index.js +10 -8
  77. package/IndicatorCircle/spec.js +3 -2
  78. package/LoadingIndicator/index.js +8 -6
  79. package/Manufacturer/index.js +9 -7
  80. package/MessageBar/index.js +20 -17
  81. package/MessageBar/spec.js +6 -5
  82. package/NoResults/components/Icon/index.js +134 -110
  83. package/NoResults/index.js +27 -21
  84. package/Placeholder/index.js +13 -5
  85. package/PlaceholderLabel/index.js +2 -1
  86. package/PlaceholderLabel/spec.js +13 -6
  87. package/PlaceholderParagraph/index.js +13 -12
  88. package/PlaceholderParagraph/spec.js +13 -6
  89. package/Price/index.js +46 -28
  90. package/PriceInfo/index.js +2 -1
  91. package/PriceStriked/index.js +41 -29
  92. package/ProductProperties/index.js +13 -10
  93. package/ProgressBar/index.js +28 -19
  94. package/ProgressBar/spec.js +2 -1
  95. package/RadioButton/index.js +6 -5
  96. package/RadioButton/spec.js +3 -2
  97. package/RatingNumber/index.js +2 -1
  98. package/RatingStars/index.js +50 -34
  99. package/RatingStars/spec.js +7 -6
  100. package/Ripple/components/RippleAnimation/index.js +12 -10
  101. package/Ripple/index.js +72 -62
  102. package/RippleButton/index.js +44 -27
  103. package/RippleButton/spec.js +20 -13
  104. package/ScannerOverlay/components/CameraOverlay/index.js +8 -5
  105. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +25 -21
  106. package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +7 -5
  107. package/ScannerOverlay/components/ScannerBar/index.js +17 -12
  108. package/ScannerOverlay/index.js +24 -15
  109. package/Sheet/components/Header/components/SearchBar/index.js +35 -28
  110. package/Sheet/components/Header/components/SearchBar/spec.js +2 -1
  111. package/Sheet/components/Header/index.js +47 -34
  112. package/Sheet/components/Header/spec.js +2 -1
  113. package/Sheet/index.js +80 -65
  114. package/Sheet/spec.js +27 -14
  115. package/TaxDisclaimer/index.js +13 -10
  116. package/TaxDisclaimer/spec.js +3 -2
  117. package/TextField/components/ErrorText/index.js +7 -5
  118. package/TextField/components/FormElement/index.js +4 -3
  119. package/TextField/components/Hint/index.js +7 -5
  120. package/TextField/components/Label/index.js +6 -4
  121. package/TextField/components/Underline/index.js +8 -6
  122. package/TextField/index.js +102 -85
  123. package/TextField/spec.js +37 -23
  124. package/ToggleIcon/index.js +23 -15
  125. package/ToggleIcon/spec.js +12 -8
  126. package/icons/AccountBoxIcon.js +5 -4
  127. package/icons/AddMoreIcon.js +5 -4
  128. package/icons/ArrowDropIcon.js +5 -4
  129. package/icons/ArrowIcon.js +5 -4
  130. package/icons/BarcodeScannerIcon.js +5 -4
  131. package/icons/BoxIcon.js +5 -4
  132. package/icons/BrowseIcon.js +5 -4
  133. package/icons/BurgerIcon.js +5 -4
  134. package/icons/CalendarIcon.js +5 -5
  135. package/icons/CartCouponIcon.js +5 -4
  136. package/icons/CartIcon.js +5 -4
  137. package/icons/CartPlusIcon.js +5 -4
  138. package/icons/CheckIcon.js +5 -4
  139. package/icons/CheckedIcon.js +5 -4
  140. package/icons/ChevronIcon.js +5 -4
  141. package/icons/CreditCardIcon.js +5 -4
  142. package/icons/CrossIcon.js +5 -4
  143. package/icons/DescriptionIcon.js +5 -4
  144. package/icons/FilterIcon.js +5 -4
  145. package/icons/FlashDisabledIcon.js +5 -4
  146. package/icons/FlashEnabledIcon.js +5 -4
  147. package/icons/GridIcon.js +5 -4
  148. package/icons/HeartIcon.js +5 -4
  149. package/icons/HeartOutlineIcon.js +5 -4
  150. package/icons/HeartPlusIcon.js +5 -4
  151. package/icons/HeartPlusOutlineIcon.js +5 -4
  152. package/icons/HomeIcon.js +5 -4
  153. package/icons/InfoIcon.js +5 -4
  154. package/icons/InfoOutlineIcon.js +5 -4
  155. package/icons/ListIcon.js +5 -4
  156. package/icons/LocalShippingIcon.js +5 -4
  157. package/icons/LocationIcon.js +5 -4
  158. package/icons/LocatorIcon.js +5 -4
  159. package/icons/LockIcon.js +5 -4
  160. package/icons/LogoutIcon.js +5 -4
  161. package/icons/MagnifierIcon.js +5 -4
  162. package/icons/MapMarkerIcon.js +5 -4
  163. package/icons/MoreIcon.js +5 -4
  164. package/icons/MoreVertIcon.js +5 -4
  165. package/icons/NotificationIcon.js +5 -4
  166. package/icons/PersonIcon.js +5 -4
  167. package/icons/PhoneIcon.js +5 -4
  168. package/icons/PlaceholderIcon.js +5 -4
  169. package/icons/RadioCheckedIcon.js +5 -4
  170. package/icons/RadioUncheckedIcon.js +5 -4
  171. package/icons/SecurityIcon.js +5 -4
  172. package/icons/ShippingMethodIcon.js +5 -4
  173. package/icons/ShoppingCartIcon.js +5 -4
  174. package/icons/SortIcon.js +5 -4
  175. package/icons/StarHalfIcon.js +5 -4
  176. package/icons/StarIcon.js +5 -4
  177. package/icons/StarOutlineIcon.js +5 -4
  178. package/icons/StopIcon.js +5 -4
  179. package/icons/TickIcon.js +5 -4
  180. package/icons/TimeIcon.js +5 -4
  181. package/icons/TrashIcon.js +5 -4
  182. package/icons/TrashOutlineIcon.js +5 -4
  183. package/icons/UncheckedIcon.js +5 -4
  184. package/icons/ViewListIcon.js +5 -4
  185. package/icons/VisibilityIcon.js +5 -4
  186. package/icons/VisibilityOffIcon.js +5 -4
  187. package/icons/WarningIcon.js +5 -4
  188. package/package.json +7 -8
@@ -12,17 +12,19 @@ import styles from "./style";
12
12
  * @param {boolean} hasLeftElement Whether a left element is present
13
13
  * @return {JSX.Element}
14
14
  */
15
+ import { jsx as _jsx } from "react/jsx-runtime";
15
16
  const Placeholder = ({
16
17
  placeholder,
17
18
  visible,
18
19
  'aria-hidden': ariaHidden,
19
20
  hasLeftElement
20
- }) => /*#__PURE__*/React.createElement("div", {
21
+ }) => /*#__PURE__*/_jsx("div", {
21
22
  className: classNames(styles.placeholderStyles(visible, hasLeftElement), 'placeholder'),
22
- "aria-hidden": ariaHidden
23
- }, /*#__PURE__*/React.createElement(I18n.Text, {
24
- string: placeholder
25
- }));
23
+ "aria-hidden": ariaHidden,
24
+ children: /*#__PURE__*/_jsx(I18n.Text, {
25
+ string: placeholder
26
+ })
27
+ });
26
28
  Placeholder.defaultProps = {
27
29
  'aria-hidden': null,
28
30
  hasLeftElement: false,
@@ -8,12 +8,14 @@ import styles from "./style";
8
8
  * @param {Object} props The component props.
9
9
  * @return {JSX}
10
10
  */
11
- const Underline = props => /*#__PURE__*/React.createElement("div", {
12
- className: classNames(styles.underlineWrapper, 'underline')
13
- }, /*#__PURE__*/React.createElement("div", {
14
- className: styles.underline,
15
- style: styles.underlineStyle(props.isFocused, props.hasErrorMessage)
16
- }));
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ const Underline = props => /*#__PURE__*/_jsx("div", {
13
+ className: classNames(styles.underlineWrapper, 'underline'),
14
+ children: /*#__PURE__*/_jsx("div", {
15
+ className: styles.underline,
16
+ style: styles.underlineStyle(props.isFocused, props.hasErrorMessage)
17
+ })
18
+ });
17
19
  Underline.defaultProps = {
18
20
  isFocused: false,
19
21
  hasErrorMessage: false
@@ -1,3 +1,5 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
2
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
3
  import React, { Component } from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import classNames from 'classnames';
@@ -10,32 +12,17 @@ import style from "./style";
10
12
  /**
11
13
  * A component that provides a styled form element in material design.
12
14
  */
13
- class FormElement extends Component {
14
- /**
15
- * @returns {boolean} Whether the label is currently floating.
16
- */
17
- get isLabelFloating() {
18
- return !this.props.labelStatic && (this.props.isFocused || this.props.hasValue);
19
- }
20
-
21
- /**
22
- * @returns {boolean} Whether the hint text is currently visible.
23
- */
24
- get isPlaceholderVisible() {
25
- return !this.props.isFocused && !this.props.hasValue;
26
- }
27
-
28
- /**
29
- * @returns {boolean} Whether the hint text is currently visible.
30
- */
31
- get hasErrorMessage() {
32
- return !!this.props.errorText;
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ let FormElement = /*#__PURE__*/function (_Component) {
17
+ function FormElement() {
18
+ return _Component.apply(this, arguments) || this;
33
19
  }
34
-
20
+ _inheritsLoose(FormElement, _Component);
21
+ var _proto = FormElement.prototype;
35
22
  /**
36
23
  * @return {JSX.Element}
37
24
  */
38
- render() {
25
+ _proto.render = function render() {
39
26
  const {
40
27
  isFocused,
41
28
  errorText,
@@ -50,32 +37,61 @@ class FormElement extends Component {
50
37
  labelStatic,
51
38
  showErrorText
52
39
  } = this.props;
53
- return /*#__PURE__*/React.createElement("div", {
40
+ return /*#__PURE__*/_jsxs("div", {
54
41
  className: classNames(style.formElement, className, 'formElement', 'ui-shared__form-element', {
55
42
  disabled
56
- })
57
- }, hasPlaceholder && (placeholder || label) && /*#__PURE__*/React.createElement(Placeholder, {
58
- visible: this.isPlaceholderVisible,
59
- placeholder: placeholder || label,
60
- hasLeftElement: hasLeftElement,
61
- "aria-hidden": true
62
- }), label && /*#__PURE__*/React.createElement(Label, {
63
- htmlFor: htmlFor,
64
- label: label,
65
- labelStatic: labelStatic,
66
- isFocused: isFocused,
67
- isFloating: this.isLabelFloating,
68
- hasErrorMessage: this.hasErrorMessage
69
- }), this.props.children, this.props.hasUnderline && /*#__PURE__*/React.createElement(Underline, {
70
- isFocused: isFocused,
71
- hasErrorMessage: this.hasErrorMessage
72
- }), errorText && showErrorText && /*#__PURE__*/React.createElement(ErrorText, {
73
- errorText: errorText,
74
- translate: translateErrorText,
75
- elementName: htmlFor
76
- }));
77
- }
78
- }
43
+ }),
44
+ children: [hasPlaceholder && (placeholder || label) && /*#__PURE__*/_jsx(Placeholder, {
45
+ visible: this.isPlaceholderVisible,
46
+ placeholder: placeholder || label,
47
+ hasLeftElement: hasLeftElement,
48
+ "aria-hidden": true
49
+ }), label && /*#__PURE__*/_jsx(Label, {
50
+ htmlFor: htmlFor,
51
+ label: label,
52
+ labelStatic: labelStatic,
53
+ isFocused: isFocused,
54
+ isFloating: this.isLabelFloating,
55
+ hasErrorMessage: this.hasErrorMessage
56
+ }), this.props.children, this.props.hasUnderline && /*#__PURE__*/_jsx(Underline, {
57
+ isFocused: isFocused,
58
+ hasErrorMessage: this.hasErrorMessage
59
+ }), errorText && showErrorText && /*#__PURE__*/_jsx(ErrorText, {
60
+ errorText: errorText,
61
+ translate: translateErrorText,
62
+ elementName: htmlFor
63
+ })]
64
+ });
65
+ };
66
+ return _createClass(FormElement, [{
67
+ key: "isLabelFloating",
68
+ get:
69
+ /**
70
+ * @returns {boolean} Whether the label is currently floating.
71
+ */
72
+ function () {
73
+ return !this.props.labelStatic && (this.props.isFocused || this.props.hasValue);
74
+ }
75
+
76
+ /**
77
+ * @returns {boolean} Whether the hint text is currently visible.
78
+ */
79
+ }, {
80
+ key: "isPlaceholderVisible",
81
+ get: function () {
82
+ return !this.props.isFocused && !this.props.hasValue;
83
+ }
84
+
85
+ /**
86
+ * @returns {boolean} Whether the hint text is currently visible.
87
+ */
88
+ }, {
89
+ key: "hasErrorMessage",
90
+ get: function () {
91
+ return !!this.props.errorText;
92
+ }
93
+ }]);
94
+ }(Component);
79
95
  FormElement.defaultProps = {
80
96
  children: null,
81
97
  className: '',
@@ -1,7 +1,7 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React from 'react';
3
2
  import { mount } from 'enzyme';
4
3
  import FormElement from "./index";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const inputProps = {
6
6
  htmlFor: 'test-input'
7
7
  };
@@ -13,9 +13,7 @@ describe('<FormElement />', () => {
13
13
  },
14
14
  'should render a form element with 1 child': {
15
15
  props: {
16
- children: [/*#__PURE__*/React.createElement("input", {
17
- key: "test-key"
18
- })]
16
+ children: [/*#__PURE__*/_jsx("input", {}, "test-key")]
19
17
  }
20
18
  },
21
19
  'should render a focused form element': {
@@ -48,7 +46,10 @@ describe('<FormElement />', () => {
48
46
  Object.keys(tests).forEach(test => {
49
47
  it(test, () => {
50
48
  const testFixtures = tests[test];
51
- const wrapper = mount(/*#__PURE__*/React.createElement(FormElement, _extends({}, inputProps, testFixtures.props)));
49
+ const wrapper = mount(/*#__PURE__*/_jsx(FormElement, {
50
+ ...inputProps,
51
+ ...testFixtures.props
52
+ }));
52
53
  expect(wrapper).toMatchSnapshot();
53
54
  if (testFixtures.find) {
54
55
  expect(wrapper.find(testFixtures.find).find('Translate').props().string).toEqual(testFixtures.equal);
@@ -56,11 +57,11 @@ describe('<FormElement />', () => {
56
57
  });
57
58
  });
58
59
  it('Should hide placeholder with hasValue', () => {
59
- const wrapper = mount(/*#__PURE__*/React.createElement(FormElement, _extends({
60
- label: "testlabel"
61
- }, inputProps, {
60
+ const wrapper = mount(/*#__PURE__*/_jsx(FormElement, {
61
+ label: "testlabel",
62
+ ...inputProps,
62
63
  hasValue: true
63
- })));
64
+ }));
64
65
  expect(wrapper).toMatchSnapshot();
65
66
  expect(wrapper.find('Placeholder').props().visible).toEqual(false);
66
67
  });
package/Glow/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import _extends from "@babel/runtime/helpers/extends";
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
2
  import React, { Component } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -9,43 +9,48 @@ import styles from "./style";
9
9
  /**
10
10
  * Renders a glowing component that is visible when the user interacts with the element.
11
11
  */
12
- class Glow extends Component {
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ let Glow = /*#__PURE__*/function (_Component) {
13
14
  /**
14
15
  * The component constructor.
15
16
  * @param {Object} props The component props.
16
17
  */
17
- constructor(props) {
18
- super(props);
19
- this.handleTouchTap = () => {
20
- if (this.props.disabled) {
18
+ function Glow(props) {
19
+ var _this;
20
+ _this = _Component.call(this, props) || this;
21
+ _this.handleTouchTap = () => {
22
+ if (_this.props.disabled) {
21
23
  return;
22
24
  }
23
- this.setState({
25
+ _this.setState({
24
26
  hover: true
25
27
  });
26
- this.timeout = setTimeout(() => {
27
- this.setState({
28
+ _this.timeout = setTimeout(() => {
29
+ _this.setState({
28
30
  hover: false
29
31
  });
30
32
  }, 250);
31
33
  };
32
- this.timeout = null;
33
- this.state = {
34
+ _this.timeout = null;
35
+ _this.state = {
34
36
  hover: false
35
37
  };
38
+ return _this;
36
39
  }
37
40
 
38
41
  /**
39
42
  * Clears any previously set timeout.
40
43
  */
41
- componentWillUnmount() {
44
+ _inheritsLoose(Glow, _Component);
45
+ var _proto = Glow.prototype;
46
+ _proto.componentWillUnmount = function componentWillUnmount() {
42
47
  clearTimeout(this.timeout);
43
- }
48
+ };
44
49
  /**
45
50
  * Renders the component.
46
51
  * @returns {JSX.Element}
47
52
  */
48
- render() {
53
+ _proto.render = function render() {
49
54
  const {
50
55
  children,
51
56
  styles: propStyles,
@@ -69,19 +74,22 @@ class Glow extends Component {
69
74
 
70
75
  /* eslint-disable jsx-a11y/no-static-element-interactions,
71
76
  jsx-a11y/click-events-have-key-events */
72
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
77
+ return /*#__PURE__*/_jsxs("div", {
78
+ ...rest,
73
79
  className: classNames(styles.container, className, 'ui-shared__glow'),
74
80
  onClick: this.handleTouchTap,
75
81
  style: propStyles.container,
76
- ref: forwardedRef
77
- }), /*#__PURE__*/React.createElement("div", {
78
- className: styles.glow,
79
- style: innerInlineStyles
80
- }), children);
82
+ ref: forwardedRef,
83
+ children: [/*#__PURE__*/_jsx("div", {
84
+ className: styles.glow,
85
+ style: innerInlineStyles
86
+ }), children]
87
+ });
81
88
  /* eslint-enable jsx-a11y/no-static-element-interactions,
82
89
  jsx-a11y/click-events-have-key-events */
83
- }
84
- }
90
+ };
91
+ return Glow;
92
+ }(Component);
85
93
  Glow.defaultProps = {
86
94
  color: themeConfig.colors.shade8,
87
95
  className: null,
package/Glow/spec.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import Glow from "./index";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  describe('<Glow />', () => {
5
6
  it('should render with a smile', () => {
6
- const wrapper = mount(/*#__PURE__*/React.createElement(Glow, null, /*#__PURE__*/React.createElement("p", null, "Glowing!")));
7
+ const wrapper = mount(/*#__PURE__*/_jsx(Glow, {
8
+ children: /*#__PURE__*/_jsx("p", {
9
+ children: "Glowing!"
10
+ })
11
+ }));
7
12
  expect(wrapper).toMatchSnapshot();
8
13
  });
9
14
  });
@@ -12,24 +12,26 @@ import styles from "./style";
12
12
  * @param {boolean} props.paused Animation should be paused.
13
13
  * @returns {JSX}
14
14
  */
15
+ import { jsx as _jsx } from "react/jsx-runtime";
15
16
  const IndicatorCircle = ({
16
17
  size,
17
18
  color,
18
19
  strokeWidth,
19
20
  paused
20
- }) => /*#__PURE__*/React.createElement("svg", {
21
+ }) => /*#__PURE__*/_jsx("svg", {
21
22
  className: `${styles.spinner(paused)} ui-shared__indicator-circle`,
22
23
  viewBox: "25 25 50 50",
23
24
  width: size,
24
25
  height: size,
25
26
  xmlns: "http://www.w3.org/2000/svg",
26
- "data-test-id": "loadingIndicator"
27
- }, /*#__PURE__*/React.createElement("circle", {
28
- className: styles.circle(color, strokeWidth, paused),
29
- cx: "50",
30
- cy: "50",
31
- r: "20"
32
- }));
27
+ "data-test-id": "loadingIndicator",
28
+ children: /*#__PURE__*/_jsx("circle", {
29
+ className: styles.circle(color, strokeWidth, paused),
30
+ cx: "50",
31
+ cy: "50",
32
+ r: "20"
33
+ })
34
+ });
33
35
  IndicatorCircle.defaultProps = {
34
36
  color: `var(--color-secondary, ${themeConfig.colors.accent})`,
35
37
  paused: false,
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  import { shallow, mount } from 'enzyme';
3
3
  import IndicatorCircle from "./index";
4
4
  import styles from "./style";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  describe('<IndicatorCircle />', () => {
6
7
  it('should apply the given size', () => {
7
- const wrapper = shallow(/*#__PURE__*/React.createElement(IndicatorCircle, {
8
+ const wrapper = shallow(/*#__PURE__*/_jsx(IndicatorCircle, {
8
9
  size: 32
9
10
  }));
10
11
  expect(wrapper).toMatchSnapshot();
@@ -13,7 +14,7 @@ describe('<IndicatorCircle />', () => {
13
14
  expect(svg.props().height).toBe(32);
14
15
  });
15
16
  it('should apply the given color', () => {
16
- const wrapper = mount(/*#__PURE__*/React.createElement(IndicatorCircle, {
17
+ const wrapper = mount(/*#__PURE__*/_jsx(IndicatorCircle, {
17
18
  size: 32,
18
19
  color: "#fff",
19
20
  strokeWidth: 4
@@ -4,6 +4,7 @@ import classNames from 'classnames';
4
4
  import { themeConfig } from '@shopgate/engage';
5
5
  import IndicatorCircle from "../IndicatorCircle";
6
6
  import { container, imgContainer } from "./style";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
7
8
  const {
8
9
  loadingIndicator: {
9
10
  imgSrc: loadingImageSrc
@@ -16,15 +17,16 @@ const {
16
17
  */
17
18
  const LoadingIndicator = ({
18
19
  className
19
- }) => /*#__PURE__*/React.createElement("div", {
20
+ }) => /*#__PURE__*/_jsx("div", {
20
21
  className: classNames(className, {
21
22
  [container]: !loadingImageSrc,
22
23
  [imgContainer]: !!loadingImageSrc
23
- }, 'loading-indicator', 'ui-shared__loading-indicator')
24
- }, loadingImageSrc ? /*#__PURE__*/React.createElement("img", {
25
- src: loadingImageSrc,
26
- alt: ""
27
- }) : /*#__PURE__*/React.createElement(IndicatorCircle, null));
24
+ }, 'loading-indicator', 'ui-shared__loading-indicator'),
25
+ children: loadingImageSrc ? /*#__PURE__*/_jsx("img", {
26
+ src: loadingImageSrc,
27
+ alt: ""
28
+ }) : /*#__PURE__*/_jsx(IndicatorCircle, {})
29
+ });
28
30
  LoadingIndicator.defaultProps = {
29
31
  className: null
30
32
  };
@@ -9,16 +9,18 @@ import styles from "./style";
9
9
  * @param {string} [props.className] CSS classes.
10
10
  * @return {JSX}
11
11
  */
12
+ import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const Manufacturer = ({
13
14
  className,
14
15
  text
15
- }) => /*#__PURE__*/React.createElement("div", {
16
- className: `${styles} ${className} ui-shared__manufacturer`
17
- }, /*#__PURE__*/React.createElement("span", {
18
- dangerouslySetInnerHTML: {
19
- __html: text
20
- }
21
- }));
16
+ }) => /*#__PURE__*/_jsx("div", {
17
+ className: `${styles} ${className} ui-shared__manufacturer`,
18
+ children: /*#__PURE__*/_jsx("span", {
19
+ dangerouslySetInnerHTML: {
20
+ __html: text
21
+ }
22
+ })
23
+ });
22
24
  Manufacturer.defaultProps = {
23
25
  className: ''
24
26
  };
@@ -12,27 +12,30 @@ import styles from "./style";
12
12
  * @returns {JSX}
13
13
  * @deprecated Please import from `@shopgate/engage/components` instead.
14
14
  */
15
+ import { jsx as _jsx } from "react/jsx-runtime";
15
16
  const MessageBar = /*#__PURE__*/memo(({
16
17
  messages,
17
18
  classNames
18
- }) => /*#__PURE__*/React.createElement("div", {
19
+ }) => /*#__PURE__*/_jsx("div", {
19
20
  className: classnames(styles.container, classNames.container, 'ui-shared__message-bar'),
20
- role: messages.length > 0 ? 'alert' : null
21
- }, messages.map(item => {
22
- const {
23
- type = 'info',
24
- message,
25
- messageParams = null,
26
- translated
27
- } = item;
28
- const messageOutput = !translated ? i18n.text(message, messageParams) : message;
29
- return /*#__PURE__*/React.createElement("div", {
30
- key: `${type}-${message}`,
31
- className: classnames(classNames.message, styles[type])
32
- }, /*#__PURE__*/React.createElement("span", {
33
- "aria-hidden": true
34
- }, messageOutput));
35
- })));
21
+ role: messages.length > 0 ? 'alert' : null,
22
+ children: messages.map(item => {
23
+ const {
24
+ type = 'info',
25
+ message,
26
+ messageParams = null,
27
+ translated
28
+ } = item;
29
+ const messageOutput = !translated ? i18n.text(message, messageParams) : message;
30
+ return /*#__PURE__*/_jsx("div", {
31
+ className: classnames(classNames.message, styles[type]),
32
+ children: /*#__PURE__*/_jsx("span", {
33
+ "aria-hidden": true,
34
+ children: messageOutput
35
+ })
36
+ }, `${type}-${message}`);
37
+ })
38
+ }));
36
39
  MessageBar.defaultProps = {
37
40
  classNames: {
38
41
  container: null,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import MessageBar from "./index";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  const MESSAGE1 = 'This is some information';
5
6
  const MESSAGE2 = 'This is an error that happened here.';
6
7
  const MESSAGE3 = 'This is just a warning. Nothing to freak out about.';
@@ -11,13 +12,13 @@ const MESSAGE7 = 'Message with messageParams';
11
12
  describe('<MessageBar />', () => {
12
13
  describe('General rendering', () => {
13
14
  it('should be empty if no messages have been set', () => {
14
- const wrapper = mount(/*#__PURE__*/React.createElement(MessageBar, {
15
+ const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
15
16
  messages: []
16
17
  }));
17
18
  expect(wrapper).toMatchSnapshot();
18
19
  });
19
20
  it('should render a message as info if type is missing', () => {
20
- const wrapper = mount(/*#__PURE__*/React.createElement(MessageBar, {
21
+ const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
21
22
  messages: [{
22
23
  message: 'something'
23
24
  }]
@@ -27,7 +28,7 @@ describe('<MessageBar />', () => {
27
28
  });
28
29
  describe('Multiple messages rendering', () => {
29
30
  it('should render messages without frontend translation', () => {
30
- const wrapper = mount(/*#__PURE__*/React.createElement(MessageBar, {
31
+ const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
31
32
  messages: [{
32
33
  type: 'info',
33
34
  message: MESSAGE1
@@ -48,7 +49,7 @@ describe('<MessageBar />', () => {
48
49
  expect(wrapper).toMatchSnapshot();
49
50
  });
50
51
  it('should translate and render all given messages', () => {
51
- const wrapper = mount(/*#__PURE__*/React.createElement(MessageBar, {
52
+ const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
52
53
  messages: [{
53
54
  message: MESSAGE6,
54
55
  translated: false
@@ -64,7 +65,7 @@ describe('<MessageBar />', () => {
64
65
  expect(wrapper).toMatchSnapshot();
65
66
  });
66
67
  it('should render with custom classNames', () => {
67
- const wrapper = mount(/*#__PURE__*/React.createElement(MessageBar, {
68
+ const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
68
69
  messages: [{
69
70
  message: MESSAGE1
70
71
  }],