@shopgate/pwa-ui-shared 7.30.0-alpha.8 → 7.30.0-beta.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.
Files changed (189) hide show
  1. package/AccordionContainer/index.js +17 -11
  2. package/AccordionContainer/spec.js +12 -3
  3. package/ActionButton/index.js +51 -32
  4. package/ActionButton/spec.js +13 -5
  5. package/AddToCartButton/index.js +44 -33
  6. package/AddToCartButton/mock.js +20 -8
  7. package/AddToCartButton/spec.js +29 -14
  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 +27 -18
  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 +48 -52
  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/CameraOverlay/style.js +0 -1
  106. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +25 -21
  107. package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +7 -5
  108. package/ScannerOverlay/components/ScannerBar/index.js +17 -12
  109. package/ScannerOverlay/index.js +24 -15
  110. package/Sheet/components/Header/components/SearchBar/index.js +35 -28
  111. package/Sheet/components/Header/components/SearchBar/spec.js +2 -1
  112. package/Sheet/components/Header/index.js +47 -34
  113. package/Sheet/components/Header/spec.js +2 -1
  114. package/Sheet/index.js +80 -65
  115. package/Sheet/spec.js +27 -14
  116. package/TaxDisclaimer/index.js +13 -10
  117. package/TaxDisclaimer/spec.js +3 -2
  118. package/TextField/components/ErrorText/index.js +7 -5
  119. package/TextField/components/FormElement/index.js +4 -3
  120. package/TextField/components/Hint/index.js +7 -5
  121. package/TextField/components/Label/index.js +6 -4
  122. package/TextField/components/Underline/index.js +8 -6
  123. package/TextField/index.js +102 -85
  124. package/TextField/spec.js +37 -23
  125. package/ToggleIcon/index.js +23 -15
  126. package/ToggleIcon/spec.js +12 -8
  127. package/icons/AccountBoxIcon.js +5 -4
  128. package/icons/AddMoreIcon.js +5 -4
  129. package/icons/ArrowDropIcon.js +5 -4
  130. package/icons/ArrowIcon.js +5 -4
  131. package/icons/BarcodeScannerIcon.js +5 -4
  132. package/icons/BoxIcon.js +5 -4
  133. package/icons/BrowseIcon.js +5 -4
  134. package/icons/BurgerIcon.js +5 -4
  135. package/icons/CalendarIcon.js +5 -5
  136. package/icons/CartCouponIcon.js +5 -4
  137. package/icons/CartIcon.js +5 -4
  138. package/icons/CartPlusIcon.js +5 -4
  139. package/icons/CheckIcon.js +5 -4
  140. package/icons/CheckedIcon.js +5 -4
  141. package/icons/ChevronIcon.js +5 -4
  142. package/icons/CreditCardIcon.js +5 -4
  143. package/icons/CrossIcon.js +5 -4
  144. package/icons/DescriptionIcon.js +5 -4
  145. package/icons/FilterIcon.js +5 -4
  146. package/icons/FlashDisabledIcon.js +5 -4
  147. package/icons/FlashEnabledIcon.js +5 -4
  148. package/icons/GridIcon.js +5 -4
  149. package/icons/HeartIcon.js +5 -4
  150. package/icons/HeartOutlineIcon.js +5 -4
  151. package/icons/HeartPlusIcon.js +5 -4
  152. package/icons/HeartPlusOutlineIcon.js +5 -4
  153. package/icons/HomeIcon.js +5 -4
  154. package/icons/InfoIcon.js +5 -4
  155. package/icons/InfoOutlineIcon.js +5 -4
  156. package/icons/ListIcon.js +5 -4
  157. package/icons/LocalShippingIcon.js +5 -4
  158. package/icons/LocationIcon.js +5 -4
  159. package/icons/LocatorIcon.js +5 -4
  160. package/icons/LockIcon.js +5 -4
  161. package/icons/LogoutIcon.js +5 -4
  162. package/icons/MagnifierIcon.js +5 -4
  163. package/icons/MapMarkerIcon.js +5 -4
  164. package/icons/MoreIcon.js +5 -4
  165. package/icons/MoreVertIcon.js +5 -4
  166. package/icons/NotificationIcon.js +5 -4
  167. package/icons/PersonIcon.js +5 -4
  168. package/icons/PhoneIcon.js +5 -4
  169. package/icons/PlaceholderIcon.js +5 -4
  170. package/icons/RadioCheckedIcon.js +5 -4
  171. package/icons/RadioUncheckedIcon.js +5 -4
  172. package/icons/SecurityIcon.js +5 -4
  173. package/icons/ShippingMethodIcon.js +5 -4
  174. package/icons/ShoppingCartIcon.js +5 -4
  175. package/icons/SortIcon.js +5 -4
  176. package/icons/StarHalfIcon.js +5 -4
  177. package/icons/StarIcon.js +5 -4
  178. package/icons/StarOutlineIcon.js +5 -4
  179. package/icons/StopIcon.js +5 -4
  180. package/icons/TickIcon.js +5 -4
  181. package/icons/TimeIcon.js +5 -4
  182. package/icons/TrashIcon.js +5 -4
  183. package/icons/TrashOutlineIcon.js +5 -4
  184. package/icons/UncheckedIcon.js +5 -4
  185. package/icons/ViewListIcon.js +5 -4
  186. package/icons/VisibilityIcon.js +5 -4
  187. package/icons/VisibilityOffIcon.js +5 -4
  188. package/icons/WarningIcon.js +5 -4
  189. package/package.json +7 -8
package/Button/index.js CHANGED
@@ -1,79 +1,94 @@
1
- import _extends from "@babel/runtime/helpers/extends";
1
+ import _createClass from "@babel/runtime/helpers/createClass";
2
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
3
  import React, { Component } from 'react';
3
4
  import PropTypes from 'prop-types';
4
5
  import BaseButton from '@shopgate/pwa-common/components/Button';
5
6
  import styles from "./style";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
6
8
  /**
7
9
  * The basic button component. This components applies Material Design styles and acts as
8
10
  * base to more feature-rich button components such as ActionButton and RippleButton, but can
9
11
  * also be used as standalone component or any other kind of new button.
10
12
  */
11
- class Button extends Component {
12
- /**
13
- * Getter for style depending on prop type.
14
- * @returns {Object}
15
- */
16
- get style() {
17
- const {
18
- flat,
19
- disabled
20
- } = this.props;
21
- switch (this.props.type) {
22
- case 'plain':
23
- return styles.plain();
24
- case 'regular':
25
- return styles.regular(disabled);
26
- case 'simple':
27
- return styles.simple(disabled);
28
- default:
29
- case 'primary':
30
- return styles.primary(disabled, flat);
31
- case 'secondary':
32
- return styles.secondary(disabled, flat);
33
- }
34
- }
35
-
36
- /**
37
- * Getter for the calculated button props.
38
- * @returns {Object}
39
- */
40
- get buttonProps() {
41
- const {
42
- className,
43
- disabled,
44
- onClick,
45
- testId,
46
- type,
47
- wrapContent,
48
- flat,
49
- ...rest
50
- } = this.props;
51
- const buttonProps = {
52
- className,
53
- disabled,
54
- onClick,
55
- ...rest
56
- };
57
- return buttonProps;
13
+ let Button = /*#__PURE__*/function (_Component) {
14
+ function Button() {
15
+ return _Component.apply(this, arguments) || this;
58
16
  }
59
-
17
+ _inheritsLoose(Button, _Component);
18
+ var _proto = Button.prototype;
60
19
  /**
61
20
  * Renders the component.
62
21
  * @return {JSX}
63
22
  */
64
- render() {
23
+ _proto.render = function render() {
65
24
  const {
66
25
  style
67
26
  } = this;
68
- const content = this.props.wrapContent ? /*#__PURE__*/React.createElement("div", {
69
- className: style.content
70
- }, this.props.children) : this.props.children;
71
- return /*#__PURE__*/React.createElement(BaseButton, _extends({}, this.buttonProps, {
27
+ const content = this.props.wrapContent ? /*#__PURE__*/_jsx("div", {
28
+ className: style.content,
29
+ children: this.props.children
30
+ }) : this.props.children;
31
+ return /*#__PURE__*/_jsx(BaseButton, {
32
+ ...this.buttonProps,
72
33
  className: `ui-shared__button ${style.button} ${this.props.className}`,
73
- testId: this.props.testId
74
- }), content);
75
- }
76
- }
34
+ testId: this.props.testId,
35
+ children: content
36
+ });
37
+ };
38
+ return _createClass(Button, [{
39
+ key: "style",
40
+ get:
41
+ /**
42
+ * Getter for style depending on prop type.
43
+ * @returns {Object}
44
+ */
45
+ function () {
46
+ const {
47
+ flat,
48
+ disabled
49
+ } = this.props;
50
+ switch (this.props.type) {
51
+ case 'plain':
52
+ return styles.plain();
53
+ case 'regular':
54
+ return styles.regular(disabled);
55
+ case 'simple':
56
+ return styles.simple(disabled);
57
+ default:
58
+ case 'primary':
59
+ return styles.primary(disabled, flat);
60
+ case 'secondary':
61
+ return styles.secondary(disabled, flat);
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Getter for the calculated button props.
67
+ * @returns {Object}
68
+ */
69
+ }, {
70
+ key: "buttonProps",
71
+ get: function () {
72
+ const {
73
+ className,
74
+ disabled,
75
+ onClick,
76
+ testId,
77
+ type,
78
+ wrapContent,
79
+ flat,
80
+ ...rest
81
+ } = this.props;
82
+ const buttonProps = {
83
+ className,
84
+ disabled,
85
+ onClick,
86
+ ...rest
87
+ };
88
+ return buttonProps;
89
+ }
90
+ }]);
91
+ }(Component);
77
92
  Button.defaultProps = {
78
93
  ...BaseButton.defaultProps,
79
94
  className: '',
package/Button/spec.js CHANGED
@@ -3,30 +3,36 @@ import React from 'react';
3
3
  import { shallow } from 'enzyme';
4
4
  import Button from "./index";
5
5
  import styles from "./style";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  describe('<Button />', () => {
7
8
  it('should render as a regular button if type is omitted', () => {
8
- const wrapper = shallow(/*#__PURE__*/React.createElement(Button, null, "Press me"));
9
+ const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
10
+ children: "Press me"
11
+ }));
9
12
  expect(wrapper).toMatchSnapshot();
10
13
  expect(wrapper.render().text()).toEqual('Press me');
11
14
  });
12
15
  it('should render as a regular button if type is explicitly defined', () => {
13
- const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
14
- type: "regular"
15
- }, "Press me"));
16
+ const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
17
+ type: "regular",
18
+ children: "Press me"
19
+ }));
16
20
  expect(wrapper).toMatchSnapshot();
17
21
  expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.regular(false).button}`);
18
22
  });
19
23
  it('should render as a primary button', () => {
20
- const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
21
- type: "primary"
22
- }, "Press me"));
24
+ const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
25
+ type: "primary",
26
+ children: "Press me"
27
+ }));
23
28
  expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.primary(false, false).button}`);
24
29
  expect(wrapper).toMatchSnapshot();
25
30
  });
26
31
  it('should render as a secondary button', () => {
27
- const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
28
- type: "secondary"
29
- }, "Press me"));
32
+ const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
33
+ type: "secondary",
34
+ children: "Press me"
35
+ }));
30
36
  expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.secondary(false, false).button}`);
31
37
  expect(wrapper).toMatchSnapshot();
32
38
  });
@@ -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 ActionButton from "../ActionButton";
@@ -7,35 +7,43 @@ import connect from "./connector";
7
7
  /**
8
8
  * Simple wrapper around ActionButton so it's easy to render buttons which behave as links.
9
9
  */
10
- class ButtonLink extends Component {
11
- constructor(...args) {
12
- super(...args);
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ let ButtonLink = /*#__PURE__*/function (_Component) {
12
+ function ButtonLink(...args) {
13
+ var _this;
14
+ _this = _Component.call.apply(_Component, [this].concat(args)) || this;
13
15
  /**
14
16
  * Opens the given url on click.
15
17
  * @returns {undefined}
16
18
  */
17
- this.handleClick = () => {
18
- this.props.navigate(this.props.href);
19
+ _this.handleClick = () => {
20
+ _this.props.navigate(_this.props.href);
19
21
  };
22
+ return _this;
20
23
  }
24
+ _inheritsLoose(ButtonLink, _Component);
25
+ var _proto = ButtonLink.prototype;
21
26
  /**
22
27
  * Renders an ActionButton and handles link handling.
23
28
  * @returns {JSX.Element}
24
29
  */
25
- render() {
30
+ _proto.render = function render() {
26
31
  const {
27
32
  children,
28
33
  href,
29
34
  navigate,
30
35
  ...props
31
36
  } = this.props;
32
- return /*#__PURE__*/React.createElement(ActionButton, _extends({
37
+ return /*#__PURE__*/_jsx(ActionButton, {
33
38
  className: "ui-shared__button-link",
34
39
  onClick: this.handleClick,
35
- type: "secondary"
36
- }, props), children);
37
- }
38
- }
40
+ type: "secondary",
41
+ ...props,
42
+ children: children
43
+ });
44
+ };
45
+ return ButtonLink;
46
+ }(Component);
39
47
  ButtonLink.defaultProps = {
40
48
  disabled: false,
41
49
  className: '',
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
  import ActionButton from "../ActionButton";
4
4
  import { UnwrappedButtonLink as ButtonLink } from "./index";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  describe('<ButtonLink>', () => {
6
7
  describe('On click action', () => {
7
8
  beforeAll(() => {
@@ -10,10 +11,11 @@ describe('<ButtonLink>', () => {
10
11
  it('should create component and open page on click', () => {
11
12
  const mockedNavigate = jest.fn();
12
13
  const link = 'https://example.com';
13
- const component = shallow(/*#__PURE__*/React.createElement(ButtonLink, {
14
+ const component = shallow(/*#__PURE__*/_jsx(ButtonLink, {
14
15
  href: link,
15
- navigate: mockedNavigate
16
- }, "Text inside"));
16
+ navigate: mockedNavigate,
17
+ children: "Text inside"
18
+ }));
17
19
  expect(component).toMatchSnapshot();
18
20
  component.simulate('click');
19
21
  expect(mockedNavigate).toHaveBeenCalledTimes(1);
package/Card/index.js CHANGED
@@ -7,14 +7,16 @@ import styles from "./style";
7
7
  * @param {Object} props The component properties.
8
8
  * @returns {JSX}
9
9
  */
10
+ import { jsx as _jsx } from "react/jsx-runtime";
10
11
  const Card = ({
11
12
  className,
12
13
  children,
13
14
  id
14
- }) => /*#__PURE__*/React.createElement("div", {
15
+ }) => /*#__PURE__*/_jsx("div", {
15
16
  className: `ui-shared__card ${styles} ${className}`,
16
- id: id
17
- }, children);
17
+ id: id,
18
+ children: children
19
+ });
18
20
  Card.defaultProps = {
19
21
  className: '',
20
22
  id: null
@@ -8,6 +8,7 @@ import styles from "./style";
8
8
  * @param {Object} props The component props.
9
9
  * @return {JSX}
10
10
  */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const Item = ({
12
13
  children,
13
14
  className,
@@ -16,10 +17,11 @@ const Item = ({
16
17
  if (!Children.count(children)) {
17
18
  return null;
18
19
  }
19
- return /*#__PURE__*/React.createElement(ListItem, {
20
+ return /*#__PURE__*/_jsx(ListItem, {
20
21
  className: `${styles} ${className}`,
21
- isSelected: isSelected
22
- }, children);
22
+ isSelected: isSelected,
23
+ children: children
24
+ });
23
25
  };
24
26
  Item.defaultProps = {
25
27
  children: null,
package/CardList/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
1
2
  import React, { Component, Children, isValidElement } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import List from '@shopgate/pwa-common/components/List';
@@ -6,12 +7,18 @@ import Item from "./components/Item";
6
7
  /**
7
8
  * The CardList component.
8
9
  */
9
- class CardList extends Component {
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ let CardList = /*#__PURE__*/function (_Component) {
12
+ function CardList() {
13
+ return _Component.apply(this, arguments) || this;
14
+ }
15
+ _inheritsLoose(CardList, _Component);
16
+ var _proto = CardList.prototype;
10
17
  /**
11
18
  * Renders the component.
12
19
  * @return {JSX}
13
20
  */
14
- render() {
21
+ _proto.render = function render() {
15
22
  const {
16
23
  children,
17
24
  className
@@ -19,16 +26,18 @@ class CardList extends Component {
19
26
  if (!Children.count(children)) {
20
27
  return null;
21
28
  }
22
- return /*#__PURE__*/React.createElement(List, {
23
- className: `ui-shared__card-list ${className}`
24
- }, Children.map(children, child => {
25
- if (! /*#__PURE__*/isValidElement(child)) {
26
- return null;
27
- }
28
- return child;
29
- }));
30
- }
31
- }
29
+ return /*#__PURE__*/_jsx(List, {
30
+ className: `ui-shared__card-list ${className}`,
31
+ children: Children.map(children, child => {
32
+ if (! /*#__PURE__*/isValidElement(child)) {
33
+ return null;
34
+ }
35
+ return child;
36
+ })
37
+ });
38
+ };
39
+ return CardList;
40
+ }(Component);
32
41
  CardList.Item = Item;
33
42
  CardList.defaultProps = {
34
43
  children: null,
@@ -8,6 +8,7 @@ import styles from "./style";
8
8
  * @param {Object} props The component props.
9
9
  * @return {JSX}
10
10
  */
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const Amount = ({
12
13
  amount,
13
14
  currency
@@ -15,14 +16,15 @@ const Amount = ({
15
16
  if (amount === null) {
16
17
  return null;
17
18
  }
18
- return /*#__PURE__*/React.createElement("div", {
19
- className: styles.amount
20
- }, typeof amount === 'string' && /*#__PURE__*/React.createElement(I18n.Text, {
21
- string: amount
22
- }), typeof amount === 'number' && /*#__PURE__*/React.createElement(I18n.Price, {
23
- price: amount,
24
- currency: currency
25
- }));
19
+ return /*#__PURE__*/_jsxs("div", {
20
+ className: styles.amount,
21
+ children: [typeof amount === 'string' && /*#__PURE__*/_jsx(I18n.Text, {
22
+ string: amount
23
+ }), typeof amount === 'number' && /*#__PURE__*/_jsx(I18n.Price, {
24
+ price: amount,
25
+ currency: currency
26
+ })]
27
+ });
26
28
  };
27
29
  Amount.defaultProps = {
28
30
  amount: null,
@@ -8,17 +8,19 @@ import styles from "./style";
8
8
  * @param {Object} props The component props.
9
9
  * @return {JSX|null}
10
10
  */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const Hint = ({
12
13
  hint
13
14
  }) => {
14
15
  if (hint === null) {
15
16
  return null;
16
17
  }
17
- return /*#__PURE__*/React.createElement("div", {
18
- className: styles.hint
19
- }, /*#__PURE__*/React.createElement(I18n.Text, {
20
- string: hint
21
- }));
18
+ return /*#__PURE__*/_jsx("div", {
19
+ className: styles.hint,
20
+ children: /*#__PURE__*/_jsx(I18n.Text, {
21
+ string: hint
22
+ })
23
+ });
22
24
  };
23
25
  Hint.defaultProps = {
24
26
  hint: null
@@ -9,6 +9,7 @@ import styles from "./style";
9
9
  * @param {Object} props The component props.
10
10
  * @return {JSX|null}
11
11
  */
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  function Label({
13
14
  label,
14
15
  showSeparator,
@@ -16,19 +17,20 @@ function Label({
16
17
  suffix
17
18
  }) {
18
19
  if (!label) {
19
- return /*#__PURE__*/React.createElement("div", {
20
+ return /*#__PURE__*/_jsx("div", {
20
21
  className: styles.label
21
22
  });
22
23
  }
23
- return /*#__PURE__*/React.createElement("div", {
24
- className: styles.label
25
- }, /*#__PURE__*/React.createElement(I18n.Text, {
26
- string: label,
27
- params: labelParams,
28
- className: classNames({
29
- [styles.labelWithSuffix]: !!suffix
30
- })
31
- }), suffix, `${showSeparator ? ':' : ''}`);
24
+ return /*#__PURE__*/_jsxs("div", {
25
+ className: styles.label,
26
+ children: [/*#__PURE__*/_jsx(I18n.Text, {
27
+ string: label,
28
+ params: labelParams,
29
+ className: classNames({
30
+ [styles.labelWithSuffix]: !!suffix
31
+ })
32
+ }), suffix, `${showSeparator ? ':' : ''}`]
33
+ });
32
34
  }
33
35
  Label.defaultProps = {
34
36
  label: null,
@@ -5,12 +5,14 @@ import PropTypes from 'prop-types';
5
5
  * @param {props} The component props
6
6
  * @returns {JSX}
7
7
  */
8
+ import { jsx as _jsx } from "react/jsx-runtime";
8
9
  const Spacer = ({
9
10
  children,
10
11
  className
11
- }) => /*#__PURE__*/React.createElement("div", {
12
- className: className
13
- }, children);
12
+ }) => /*#__PURE__*/_jsx("div", {
13
+ className: className,
14
+ children: children
15
+ });
14
16
  Spacer.defaultProps = {
15
17
  children: null,
16
18
  className: null
@@ -10,6 +10,7 @@ import styles from "./style";
10
10
  /**
11
11
  * @returns {JSX}
12
12
  */
13
+ import { jsx as _jsx } from "react/jsx-runtime";
13
14
  const CartTotalLine = ({
14
15
  children,
15
16
  type,
@@ -19,13 +20,14 @@ const CartTotalLine = ({
19
20
  if (!children) {
20
21
  return null;
21
22
  }
22
- return /*#__PURE__*/React.createElement("div", {
23
+ return /*#__PURE__*/_jsx("div", {
23
24
  className: classNames(className, `ui-shared__cart-total-line ui-shared__cart-${type}-line`, styles.line, {
24
25
  [styles.disabled]: isDisabled,
25
26
  [styles[type] || styles.base]: true
26
27
  }),
27
- "data-test-id": `${type}CartTotal`
28
- }, children);
28
+ "data-test-id": `${type}CartTotal`,
29
+ children: children
30
+ });
29
31
  };
30
32
  CartTotalLine.defaultProps = {
31
33
  children: null,
package/Checkbox/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import classNames from 'classnames';
@@ -15,20 +14,22 @@ import styles from "./style";
15
14
  * @param {string} props.unCheckedClassName Class for unchecked icon.
16
15
  * @returns {JSX.Element}
17
16
  */
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  const Checkbox = ({
19
19
  checkedClassName,
20
20
  unCheckedClassName,
21
21
  className,
22
22
  ...props
23
- }) => /*#__PURE__*/React.createElement(BaseCheckbox, _extends({}, props, {
23
+ }) => /*#__PURE__*/_jsx(BaseCheckbox, {
24
+ ...props,
24
25
  className: `ui-shared__checkbox ${className}`,
25
- checkedIcon: /*#__PURE__*/React.createElement(CheckedIcon, {
26
+ checkedIcon: /*#__PURE__*/_jsx(CheckedIcon, {
26
27
  className: classNames(styles.icon, checkedClassName, 'checkedIcon')
27
28
  }),
28
- uncheckedIcon: /*#__PURE__*/React.createElement(UncheckedIcon, {
29
+ uncheckedIcon: /*#__PURE__*/_jsx(UncheckedIcon, {
29
30
  className: classNames(styles.icon, unCheckedClassName, 'uncheckedIcon')
30
31
  })
31
- }));
32
+ });
32
33
  Checkbox.defaultProps = {
33
34
  checkedClassName: styles.checkedIcon,
34
35
  className: '',
package/Chip/index.js CHANGED
@@ -10,6 +10,7 @@ import styles from "./style";
10
10
  * @param {Object} props The component props.
11
11
  * @returns {JSX}
12
12
  */
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  function Chip(props) {
14
15
  const {
15
16
  removable,
@@ -28,30 +29,35 @@ function Chip(props) {
28
29
  useEffect(() => {
29
30
  ref.current.removeAttribute('style');
30
31
  });
31
- return /*#__PURE__*/React.createElement("div", {
32
+ return /*#__PURE__*/_jsxs("div", {
32
33
  ref: ref,
33
34
  className: `ui-shared__chip ${styles.chip(removable, invert)}`,
34
- "data-test-id": id
35
- }, removable && /*#__PURE__*/React.createElement(Button, {
36
- className: styles.removeButton,
37
- onClick: handleRemove,
38
- testId: "removeFilter",
39
- "aria-label": removeLabel
40
- }, /*#__PURE__*/React.createElement(ResponsiveContainer, {
41
- breakpoint: "<=xs",
42
- appAlways: true
43
- }, /*#__PURE__*/React.createElement(CrossIcon, {
44
- size: 16
45
- })), /*#__PURE__*/React.createElement(ResponsiveContainer, {
46
- breakpoint: ">xs",
47
- webOnly: true
48
- }, /*#__PURE__*/React.createElement(CrossIcon, {
49
- size: 18
50
- }))), /*#__PURE__*/React.createElement(Button, {
51
- className: styles.name,
52
- onClick: onClick,
53
- "aria-label": editLabel
54
- }, children));
35
+ "data-test-id": id,
36
+ children: [removable && /*#__PURE__*/_jsxs(Button, {
37
+ className: styles.removeButton,
38
+ onClick: handleRemove,
39
+ testId: "removeFilter",
40
+ "aria-label": removeLabel,
41
+ children: [/*#__PURE__*/_jsx(ResponsiveContainer, {
42
+ breakpoint: "<=xs",
43
+ appAlways: true,
44
+ children: /*#__PURE__*/_jsx(CrossIcon, {
45
+ size: 16
46
+ })
47
+ }), /*#__PURE__*/_jsx(ResponsiveContainer, {
48
+ breakpoint: ">xs",
49
+ webOnly: true,
50
+ children: /*#__PURE__*/_jsx(CrossIcon, {
51
+ size: 18
52
+ })
53
+ })]
54
+ }), /*#__PURE__*/_jsx(Button, {
55
+ className: styles.name,
56
+ onClick: onClick,
57
+ "aria-label": editLabel,
58
+ children: children
59
+ })]
60
+ });
55
61
  }
56
62
  Chip.defaultProps = {
57
63
  invert: false,
package/Chip/spec.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
  import Chip from '.';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  describe('<Chip />', () => {
5
6
  it('should render a tag', () => {
6
- const wrapper = mount(/*#__PURE__*/React.createElement(Chip, {
7
- id: "some-id"
8
- }, "text"));
7
+ const wrapper = mount(/*#__PURE__*/_jsx(Chip, {
8
+ id: "some-id",
9
+ children: "text"
10
+ }));
9
11
  expect(wrapper).toMatchSnapshot();
10
12
  expect(wrapper.find('button').length).toEqual(2);
11
13
  expect(wrapper.find('button').at(1).text()).toEqual('text');
@@ -13,10 +15,11 @@ describe('<Chip />', () => {
13
15
  });
14
16
  describe('<Chip />', () => {
15
17
  it('should render a without removable icon', () => {
16
- const wrapper = mount(/*#__PURE__*/React.createElement(Chip, {
18
+ const wrapper = mount(/*#__PURE__*/_jsx(Chip, {
17
19
  id: "some-id",
18
- removable: false
19
- }, "text"));
20
+ removable: false,
21
+ children: "text"
22
+ }));
20
23
  expect(wrapper).toMatchSnapshot();
21
24
  expect(wrapper.find('button').length).toEqual(1);
22
25
  expect(wrapper.find('button').at(0).text()).toEqual('text');