@shopgate/pwa-ui-shared 7.30.0-alpha.6 → 7.30.0-alpha.8

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 (266) hide show
  1. package/AccordionContainer/index.js +39 -5
  2. package/AccordionContainer/spec.js +25 -2
  3. package/ActionButton/index.js +63 -7
  4. package/ActionButton/spec.js +59 -2
  5. package/ActionButton/style.js +22 -1
  6. package/AddToCartButton/index.js +184 -27
  7. package/AddToCartButton/mock.js +18 -4
  8. package/AddToCartButton/spec.js +51 -2
  9. package/AddToCartButton/style.js +127 -11
  10. package/Availability/index.js +34 -2
  11. package/Availability/spec.js +41 -1
  12. package/Availability/style.js +19 -1
  13. package/Button/index.js +76 -5
  14. package/Button/spec.js +33 -1
  15. package/Button/style.js +130 -21
  16. package/ButtonLink/connector.js +11 -2
  17. package/ButtonLink/index.js +44 -6
  18. package/ButtonLink/spec.js +23 -1
  19. package/Card/index.js +19 -2
  20. package/Card/style.js +11 -1
  21. package/CardList/components/Item/index.js +26 -2
  22. package/CardList/components/Item/style.js +7 -1
  23. package/CardList/index.js +34 -3
  24. package/CartTotalLine/components/Amount/index.js +28 -2
  25. package/CartTotalLine/components/Amount/style.js +8 -1
  26. package/CartTotalLine/components/Hint/index.js +23 -2
  27. package/CartTotalLine/components/Hint/style.js +12 -1
  28. package/CartTotalLine/components/Label/index.js +36 -2
  29. package/CartTotalLine/components/Label/style.js +17 -1
  30. package/CartTotalLine/components/Spacer/index.js +16 -2
  31. package/CartTotalLine/index.js +39 -2
  32. package/CartTotalLine/style.js +31 -1
  33. package/Checkbox/index.js +31 -2
  34. package/Checkbox/style.js +18 -1
  35. package/Chip/index.js +61 -2
  36. package/Chip/spec.js +24 -1
  37. package/Chip/style.js +71 -3
  38. package/ContextMenu/ContextMenu.hooks.js +6 -2
  39. package/ContextMenu/ContextMenuProvider.context.js +9 -3
  40. package/ContextMenu/ContextMenuProvider.js +21 -2
  41. package/ContextMenu/components/Item/index.js +67 -5
  42. package/ContextMenu/components/Item/style.js +32 -3
  43. package/ContextMenu/components/Position/index.js +61 -10
  44. package/ContextMenu/components/Position/style.js +11 -1
  45. package/ContextMenu/index.js +124 -3
  46. package/ContextMenu/spec.js +101 -2
  47. package/ContextMenu/style.js +45 -1
  48. package/Dialog/components/BasicDialog/index.js +5 -1
  49. package/Dialog/components/HtmlContentDialog/index.js +22 -2
  50. package/Dialog/components/HtmlContentDialog/spec.js +59 -1
  51. package/Dialog/components/PipelineErrorDialog/index.js +114 -25
  52. package/Dialog/components/PipelineErrorDialog/spec.js +92 -12
  53. package/Dialog/components/TextMessageDialog/index.js +28 -2
  54. package/Dialog/components/TextMessageDialog/spec.js +59 -1
  55. package/Dialog/components/VariantSelectModal/connector.js +11 -2
  56. package/Dialog/components/VariantSelectModal/index.js +65 -6
  57. package/Dialog/components/VariantSelectModal/spec.js +51 -2
  58. package/Dialog/constants.js +6 -1
  59. package/Dialog/index.js +114 -7
  60. package/Dialog/spec.js +81 -3
  61. package/DiscountBadge/index.js +30 -2
  62. package/DiscountBadge/spec.js +19 -1
  63. package/DiscountBadge/style.js +34 -2
  64. package/FavoritesButton/connector.js +18 -3
  65. package/FavoritesButton/index.js +118 -15
  66. package/FavoritesButton/mock.js +50 -4
  67. package/FavoritesButton/spec.js +120 -2
  68. package/FavoritesButton/style.js +26 -1
  69. package/Form/Builder/builders/buildCountryList.js +40 -6
  70. package/Form/Builder/builders/buildFormDefaults.js +35 -6
  71. package/Form/Builder/builders/buildFormElements.js +68 -10
  72. package/Form/Builder/builders/buildProvinceList.js +19 -2
  73. package/Form/Builder/builders/buildValidationErrorList.js +7 -2
  74. package/Form/Builder/classes/ActionListener/constants.js +22 -2
  75. package/Form/Builder/classes/ActionListener/index.js +441 -93
  76. package/Form/Builder/classes/ActionListener/spec.js +321 -19
  77. package/Form/Builder/components/CheckboxElement.js +35 -3
  78. package/Form/Builder/components/CountryElement.js +40 -3
  79. package/Form/Builder/components/ProvinceElement.js +40 -3
  80. package/Form/Builder/components/RadioElement.js +41 -3
  81. package/Form/Builder/components/SelectElement.js +39 -3
  82. package/Form/Builder/components/TextElement.js +49 -4
  83. package/Form/Builder/elementTypes.js +11 -1
  84. package/Form/Builder/index.js +298 -52
  85. package/Form/Builder/iso-3166-2.js +4943 -1
  86. package/Form/Builder/spec.js +300 -16
  87. package/Form/Checkbox/index.js +66 -4
  88. package/Form/Checkbox/style.js +25 -2
  89. package/Form/InfoField/index.js +50 -2
  90. package/Form/InfoField/spec.js +9 -1
  91. package/Form/InfoField/style.js +11 -1
  92. package/Form/Password/index.js +51 -6
  93. package/Form/Password/spec.js +34 -1
  94. package/Form/Password/style.js +11 -1
  95. package/Form/RadioGroup/components/Item/index.js +59 -3
  96. package/Form/RadioGroup/components/Item/style.js +32 -2
  97. package/Form/RadioGroup/index.js +101 -9
  98. package/Form/RadioGroup/spec.js +83 -3
  99. package/Form/RadioGroup/style.js +18 -2
  100. package/Form/Select/index.js +158 -10
  101. package/Form/Select/spec.js +36 -5
  102. package/Form/Select/style.js +27 -1
  103. package/Form/SelectContextChoices/index.js +77 -3
  104. package/Form/SelectContextChoices/spec.js +33 -4
  105. package/Form/SelectContextChoices/style.js +23 -1
  106. package/Form/TextField/index.js +92 -8
  107. package/Form/TextField/spec.js +110 -1
  108. package/Form/TextField/style.js +66 -8
  109. package/Form/index.js +54 -13
  110. package/FormElement/components/ErrorText/index.js +31 -2
  111. package/FormElement/components/ErrorText/style.js +13 -1
  112. package/FormElement/components/Label/index.js +35 -2
  113. package/FormElement/components/Label/style.js +76 -8
  114. package/FormElement/components/Placeholder/index.js +26 -2
  115. package/FormElement/components/Placeholder/style.js +48 -6
  116. package/FormElement/components/Underline/index.js +18 -2
  117. package/FormElement/components/Underline/style.js +51 -4
  118. package/FormElement/index.js +91 -6
  119. package/FormElement/spec.js +67 -2
  120. package/FormElement/style.js +13 -2
  121. package/Glow/index.js +90 -7
  122. package/Glow/spec.js +9 -1
  123. package/Glow/style.js +18 -1
  124. package/IndicatorCircle/index.js +33 -3
  125. package/IndicatorCircle/spec.js +28 -1
  126. package/IndicatorCircle/style.js +57 -3
  127. package/LoadingIndicator/index.js +29 -2
  128. package/LoadingIndicator/style.js +20 -1
  129. package/Manufacturer/index.js +20 -2
  130. package/Manufacturer/style.js +5 -1
  131. package/MessageBar/index.js +36 -2
  132. package/MessageBar/spec.js +79 -1
  133. package/MessageBar/style.js +38 -1
  134. package/NoResults/components/Icon/index.js +130 -2
  135. package/NoResults/components/Icon/style.js +17 -1
  136. package/NoResults/index.js +46 -2
  137. package/NoResults/style.js +31 -1
  138. package/Placeholder/index.js +25 -3
  139. package/Placeholder/style.js +11 -1
  140. package/PlaceholderLabel/index.js +27 -2
  141. package/PlaceholderLabel/spec.js +19 -1
  142. package/PlaceholderLabel/style.js +12 -1
  143. package/PlaceholderParagraph/index.js +36 -2
  144. package/PlaceholderParagraph/spec.js +19 -1
  145. package/Price/index.js +88 -7
  146. package/Price/style.js +22 -1
  147. package/PriceInfo/index.js +20 -2
  148. package/PriceInfo/style.js +5 -1
  149. package/PriceStriked/index.js +83 -12
  150. package/PriceStriked/style.js +33 -3
  151. package/ProductProperties/index.js +32 -2
  152. package/ProgressBar/index.js +101 -13
  153. package/ProgressBar/spec.js +13 -1
  154. package/ProgressBar/style.js +83 -2
  155. package/RadioButton/index.js +18 -2
  156. package/RadioButton/spec.js +21 -1
  157. package/RadioButton/style.js +21 -1
  158. package/RatingNumber/index.js +29 -2
  159. package/RatingStars/constants.js +2 -1
  160. package/RatingStars/index.js +130 -12
  161. package/RatingStars/spec.js +90 -3
  162. package/RatingStars/style.js +51 -2
  163. package/Ripple/components/RippleAnimation/index.js +88 -6
  164. package/Ripple/index.js +218 -40
  165. package/Ripple/style.js +18 -1
  166. package/RippleButton/index.js +52 -5
  167. package/RippleButton/spec.js +45 -1
  168. package/ScannerOverlay/components/CameraOverlay/index.js +13 -2
  169. package/ScannerOverlay/components/CameraOverlay/style.js +41 -1
  170. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +34 -2
  171. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +28 -1
  172. package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +11 -2
  173. package/ScannerOverlay/components/ScannerBar/index.js +31 -2
  174. package/ScannerOverlay/components/ScannerBar/style.js +20 -1
  175. package/ScannerOverlay/index.js +47 -7
  176. package/Sheet/components/Header/components/SearchBar/index.js +46 -2
  177. package/Sheet/components/Header/components/SearchBar/spec.js +21 -3
  178. package/Sheet/components/Header/components/SearchBar/style.js +47 -1
  179. package/Sheet/components/Header/index.js +75 -7
  180. package/Sheet/components/Header/spec.js +14 -1
  181. package/Sheet/components/Header/style.js +50 -1
  182. package/Sheet/index.js +170 -17
  183. package/Sheet/spec.js +85 -5
  184. package/Sheet/style.js +143 -2
  185. package/TaxDisclaimer/index.js +34 -4
  186. package/TaxDisclaimer/spec.js +31 -3
  187. package/TaxDisclaimer/style.js +9 -1
  188. package/TextField/components/ErrorText/index.js +33 -2
  189. package/TextField/components/ErrorText/style.js +25 -3
  190. package/TextField/components/FormElement/index.js +19 -2
  191. package/TextField/components/FormElement/style.js +32 -4
  192. package/TextField/components/Hint/index.js +21 -2
  193. package/TextField/components/Hint/style.js +40 -5
  194. package/TextField/components/Label/index.js +32 -3
  195. package/TextField/components/Label/style.js +68 -8
  196. package/TextField/components/Underline/index.js +19 -2
  197. package/TextField/components/Underline/style.js +51 -4
  198. package/TextField/index.js +189 -27
  199. package/TextField/spec.js +128 -3
  200. package/TextField/style.js +34 -4
  201. package/ToggleIcon/index.js +58 -8
  202. package/ToggleIcon/spec.js +35 -1
  203. package/icons/AccountBoxIcon.js +11 -2
  204. package/icons/AddMoreIcon.js +11 -2
  205. package/icons/ArrowDropIcon.js +11 -2
  206. package/icons/ArrowIcon.js +21 -2
  207. package/icons/BarcodeScannerIcon.js +11 -2
  208. package/icons/BoxIcon.js +11 -2
  209. package/icons/BrowseIcon.js +11 -2
  210. package/icons/BurgerIcon.js +11 -2
  211. package/icons/CalendarIcon.js +15 -3
  212. package/icons/CartCouponIcon.js +72 -2
  213. package/icons/CartIcon.js +11 -2
  214. package/icons/CartPlusIcon.js +11 -2
  215. package/icons/CheckIcon.js +11 -2
  216. package/icons/CheckedIcon.js +11 -2
  217. package/icons/ChevronIcon.js +11 -2
  218. package/icons/CreditCardIcon.js +11 -2
  219. package/icons/CrossIcon.js +11 -2
  220. package/icons/DescriptionIcon.js +11 -2
  221. package/icons/FilterIcon.js +11 -2
  222. package/icons/FlashDisabledIcon.js +11 -2
  223. package/icons/FlashEnabledIcon.js +11 -2
  224. package/icons/GridIcon.js +11 -2
  225. package/icons/HeartIcon.js +11 -2
  226. package/icons/HeartOutlineIcon.js +11 -2
  227. package/icons/HeartPlusIcon.js +12 -2
  228. package/icons/HeartPlusOutlineIcon.js +12 -2
  229. package/icons/HomeIcon.js +11 -2
  230. package/icons/InfoIcon.js +11 -2
  231. package/icons/InfoOutlineIcon.js +11 -2
  232. package/icons/ListIcon.js +11 -2
  233. package/icons/LocalShippingIcon.js +11 -2
  234. package/icons/LocationIcon.js +13 -3
  235. package/icons/LocatorIcon.js +11 -2
  236. package/icons/LockIcon.js +11 -2
  237. package/icons/LogoutIcon.js +11 -2
  238. package/icons/MagnifierIcon.js +11 -2
  239. package/icons/MapMarkerIcon.js +24 -3
  240. package/icons/MoreIcon.js +11 -2
  241. package/icons/MoreVertIcon.js +11 -2
  242. package/icons/NotificationIcon.js +14 -3
  243. package/icons/PersonIcon.js +12 -2
  244. package/icons/PhoneIcon.js +13 -3
  245. package/icons/PlaceholderIcon.js +11 -2
  246. package/icons/RadioCheckedIcon.js +11 -2
  247. package/icons/RadioUncheckedIcon.js +11 -2
  248. package/icons/SecurityIcon.js +11 -2
  249. package/icons/ShippingMethodIcon.js +18 -3
  250. package/icons/ShoppingCartIcon.js +11 -2
  251. package/icons/SortIcon.js +11 -2
  252. package/icons/StarHalfIcon.js +18 -2
  253. package/icons/StarIcon.js +18 -2
  254. package/icons/StarOutlineIcon.js +11 -2
  255. package/icons/StopIcon.js +11 -2
  256. package/icons/TickIcon.js +11 -2
  257. package/icons/TimeIcon.js +14 -3
  258. package/icons/TrashIcon.js +11 -2
  259. package/icons/TrashOutlineIcon.js +12 -2
  260. package/icons/UncheckedIcon.js +11 -2
  261. package/icons/ViewListIcon.js +11 -2
  262. package/icons/VisibilityIcon.js +11 -2
  263. package/icons/VisibilityOffIcon.js +11 -2
  264. package/icons/WarningIcon.js +11 -2
  265. package/index.js +13 -1
  266. package/package.json +5 -5
package/TextField/spec.js CHANGED
@@ -1,5 +1,130 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{mount}from'enzyme';import TextField from"./index";var inputProps={name:'test-input'};describe('<TextField />',function(){it('should render a simple text field',function(){var wrapper=mount(React.createElement(TextField,inputProps));expect(wrapper).toMatchSnapshot();expect(wrapper.find('input').length).toBe(1);});it('should render the text field as password',function(){var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{password:true})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('input[type="password"]').length).toBe(1);});it('should render the text field with a default value',function(){var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{value:"FooBar"})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('input[value="FooBar"]').length).toBe(1);});it('should trigger the onChange callback',function(){var onChangeMock=jest.fn();var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{onChange:onChangeMock})));wrapper.find('input').simulate('change',{target:{value:'a'}});expect(onChangeMock).toHaveBeenCalledTimes(2);expect(wrapper.find('input').props().value).toEqual('a');});it('should receive the correct value while typing',function(){var wrapper=mount(React.createElement(TextField,inputProps));var input=wrapper.find('input');input.simulate('change',{target:{value:'foobar'}});expect(wrapper).toMatchSnapshot();expect(input.instance().value).toBe('foobar');});it('should sanitize the input',function(){var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{onSanitize:function onSanitize(value){return value.toUpperCase();}})));var input=wrapper.find('input');input.simulate('change',{target:{value:'foobar'}});expect(wrapper).toMatchSnapshot();expect(input.instance().value).toBe('FOOBAR');});it('should trigger the validation callback',function(){var onValidateMock=jest.fn();var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{onValidate:onValidateMock})));expect(wrapper).toMatchSnapshot();expect(onValidateMock).toHaveBeenCalled();});it('should focus the input',function(){var onFocusMock=jest.fn();var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{onFocusChange:onFocusMock})));var input=wrapper.find('input');expect(wrapper).toMatchSnapshot();expect(wrapper.instance().isFocused).toBe(false);input.simulate('focus');expect(wrapper.instance().isFocused).toBe(true);input.simulate('blur');expect(wrapper.instance().isFocused).toBe(false);});it('should show the error message',function(){var errorText='This is an error here';var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{errorText:errorText})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('Translate').at(2).props().string).toEqual(errorText);});it('should show the label',function(){var label='This is the label';var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{label:label})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('Label').find('Translate').props().string).toEqual(label);});it('should show the hint text',function(){var hintText='This is the hint text';var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{hintText:hintText})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('Hint').find('Translate').at(0).props().string).toEqual(hintText);});it('should replace the error text with custom validation error',function(){/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { mount } from 'enzyme';
4
+ import TextField from "./index";
5
+ const inputProps = {
6
+ name: 'test-input'
7
+ };
8
+ describe('<TextField />', () => {
9
+ it('should render a simple text field', () => {
10
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, inputProps));
11
+ expect(wrapper).toMatchSnapshot();
12
+ expect(wrapper.find('input').length).toBe(1);
13
+ });
14
+ it('should render the text field as password', () => {
15
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
16
+ password: true
17
+ })));
18
+ expect(wrapper).toMatchSnapshot();
19
+ expect(wrapper.find('input[type="password"]').length).toBe(1);
20
+ });
21
+ it('should render the text field with a default value', () => {
22
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
23
+ value: "FooBar"
24
+ })));
25
+ expect(wrapper).toMatchSnapshot();
26
+ expect(wrapper.find('input[value="FooBar"]').length).toBe(1);
27
+ });
28
+ it('should trigger the onChange callback', () => {
29
+ const onChangeMock = jest.fn();
30
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
31
+ onChange: onChangeMock
32
+ })));
33
+ wrapper.find('input').simulate('change', {
34
+ target: {
35
+ value: 'a'
36
+ }
37
+ });
38
+ expect(onChangeMock).toHaveBeenCalledTimes(2);
39
+ expect(wrapper.find('input').props().value).toEqual('a');
40
+ });
41
+ it('should receive the correct value while typing', () => {
42
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, inputProps));
43
+ const input = wrapper.find('input');
44
+ input.simulate('change', {
45
+ target: {
46
+ value: 'foobar'
47
+ }
48
+ });
49
+ expect(wrapper).toMatchSnapshot();
50
+ expect(input.instance().value).toBe('foobar');
51
+ });
52
+ it('should sanitize the input', () => {
53
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
54
+ onSanitize: value => value.toUpperCase()
55
+ })));
56
+ const input = wrapper.find('input');
57
+ input.simulate('change', {
58
+ target: {
59
+ value: 'foobar'
60
+ }
61
+ });
62
+ expect(wrapper).toMatchSnapshot();
63
+ expect(input.instance().value).toBe('FOOBAR');
64
+ });
65
+ it('should trigger the validation callback', () => {
66
+ const onValidateMock = jest.fn();
67
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
68
+ onValidate: onValidateMock
69
+ })));
70
+ expect(wrapper).toMatchSnapshot();
71
+ expect(onValidateMock).toHaveBeenCalled();
72
+ });
73
+ it('should focus the input', () => {
74
+ const onFocusMock = jest.fn();
75
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
76
+ onFocusChange: onFocusMock
77
+ })));
78
+ const input = wrapper.find('input');
79
+ expect(wrapper).toMatchSnapshot();
80
+ expect(wrapper.instance().isFocused).toBe(false);
81
+ input.simulate('focus');
82
+ expect(wrapper.instance().isFocused).toBe(true);
83
+ input.simulate('blur');
84
+ expect(wrapper.instance().isFocused).toBe(false);
85
+ });
86
+ it('should show the error message', () => {
87
+ const errorText = 'This is an error here';
88
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
89
+ errorText: errorText
90
+ })));
91
+ expect(wrapper).toMatchSnapshot();
92
+ expect(wrapper.find('Translate').at(2).props().string).toEqual(errorText);
93
+ });
94
+ it('should show the label', () => {
95
+ const label = 'This is the label';
96
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
97
+ label: label
98
+ })));
99
+ expect(wrapper).toMatchSnapshot();
100
+ expect(wrapper.find('Label').find('Translate').props().string).toEqual(label);
101
+ });
102
+ it('should show the hint text', () => {
103
+ const hintText = 'This is the hint text';
104
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
105
+ hintText: hintText
106
+ })));
107
+ expect(wrapper).toMatchSnapshot();
108
+ expect(wrapper.find('Hint').find('Translate').at(0).props().string).toEqual(hintText);
109
+ });
110
+ it('should replace the error text with custom validation error', () => {
111
+ /**
2
112
  * A custom validation method that always returns an error.
3
113
  * @return {string} The error message.
4
- */var onValidate=function onValidate(){return'Custom validation error';};var wrapper=mount(React.createElement(TextField,_extends({},inputProps,{onValidate:onValidate})));wrapper.find('input').simulate('blur');expect(wrapper).toMatchSnapshot();// Expect at least one element containing the validation error text.
5
- expect(wrapper.findWhere(function(node){try{return node.text()===onValidate();}catch(e){return false;}}).length).toBeGreaterThan(0);});});
114
+ */
115
+ const onValidate = () => 'Custom validation error';
116
+ const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
117
+ onValidate: onValidate
118
+ })));
119
+ wrapper.find('input').simulate('blur');
120
+ expect(wrapper).toMatchSnapshot();
121
+ // Expect at least one element containing the validation error text.
122
+ expect(wrapper.findWhere(node => {
123
+ try {
124
+ return node.text() === onValidate();
125
+ } catch (e) {
126
+ return false;
127
+ }
128
+ }).length).toBeGreaterThan(0);
129
+ });
130
+ });
@@ -1,5 +1,35 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';// Selects a date input that is not focused.
2
- var bluredDateSelector='input[type="date"]:in-range:not(:focus)';/**
1
+ import { css } from 'glamor';
2
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+
4
+ // Selects a date input that is not focused.
5
+ const bluredDateSelector = 'input[type="date"]:in-range:not(:focus)';
6
+
7
+ /**
3
8
  * The styles for the container element.
4
- */var container={input:css(_defineProperty({position:'relative',paddingBottom:themeConfig.variables.gap.big,width:'100%',// Fixes layout issue with webkit. Height is 0 in some webkit browsers.
5
- '& input[type="date"]':{minHeight:'1.3rem',appearance:'none',paddingLeft:0,marginLeft:0}},"& ".concat(bluredDateSelector,"::-webkit-datetime-edit-year-field, ")+"".concat(bluredDateSelector,"::-webkit-datetime-edit-month-field, ")+"".concat(bluredDateSelector,"::-webkit-datetime-edit-day-field, ")+"".concat(bluredDateSelector,"::-webkit-datetime-edit-text"),{padding:0,color:'transparent'})).toString(),multiLine:css({position:'relative',width:'100%'}).toString()};export default{container:container};
9
+ */
10
+ const container = {
11
+ input: css({
12
+ position: 'relative',
13
+ paddingBottom: themeConfig.variables.gap.big,
14
+ width: '100%',
15
+ // Fixes layout issue with webkit. Height is 0 in some webkit browsers.
16
+ '& input[type="date"]': {
17
+ minHeight: '1.3rem',
18
+ appearance: 'none',
19
+ paddingLeft: 0,
20
+ marginLeft: 0
21
+ },
22
+ // Removes placeholder texts on chrome when input is not focused.
23
+ [`& ${bluredDateSelector}::-webkit-datetime-edit-year-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-month-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-day-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-text`]: {
24
+ padding: 0,
25
+ color: 'transparent'
26
+ }
27
+ }).toString(),
28
+ multiLine: css({
29
+ position: 'relative',
30
+ width: '100%'
31
+ }).toString()
32
+ };
33
+ export default {
34
+ container
35
+ };
@@ -1,14 +1,64 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';/**
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ /**
2
5
  * No operational default handler
3
- */var noop=function noop(){};/**
6
+ */
7
+ const noop = () => {};
8
+
9
+ /**
4
10
  * An toggle icon with toggle handlers.
5
- */var ToggleIcon=/*#__PURE__*/function(_Component){/**
11
+ */
12
+ class ToggleIcon extends Component {
13
+ /**
6
14
  * @param {Object} props The component properties.
7
- */function ToggleIcon(props){var _this2;_classCallCheck(this,ToggleIcon);_this2=_callSuper(this,ToggleIcon,[props]);/**
8
- * Toggle icon
9
- */_defineProperty(_this2,"handleToggle",function(){_this2.setState(function(_ref){var on=_ref.on;return{on:!on};},function(){return _this2.props.toggleHandler(_this2.state.on);});});_this2.state={on:props.on};return _this2;}/**
15
+ */
16
+ constructor(props) {
17
+ super(props);
18
+ /**
19
+ * Toggle icon
20
+ */
21
+ this.handleToggle = () => {
22
+ this.setState(({
23
+ on
24
+ }) => ({
25
+ on: !on
26
+ }), () => this.props.toggleHandler(this.state.on));
27
+ };
28
+ this.state = {
29
+ on: props.on
30
+ };
31
+ }
32
+
33
+ /**
10
34
  * Reset state to received props
11
35
  * @param {Object} nextProps next props
12
- */_inherits(ToggleIcon,_Component);return _createClass(ToggleIcon,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){this.setState({on:nextProps.on});}},{key:"render",value:/**
36
+ */
37
+ UNSAFE_componentWillReceiveProps(nextProps) {
38
+ this.setState({
39
+ on: nextProps.on
40
+ });
41
+ }
42
+ /**
13
43
  * @return {*}
14
- */function render(){var _this$props=this.props,onIcon=_this$props.onIcon,offIcon=_this$props.offIcon;var on=this.state.on;return React.createElement("div",{className:"ui-shared__toggle-icon",onClick:this.handleToggle,"aria-hidden":true},on&&onIcon,!on&&offIcon);}}]);}(Component);_defineProperty(ToggleIcon,"defaultProps",{on:true,toggleHandler:noop});export default ToggleIcon;
44
+ */
45
+ render() {
46
+ const {
47
+ onIcon,
48
+ offIcon
49
+ } = this.props;
50
+ const {
51
+ on
52
+ } = this.state;
53
+ return /*#__PURE__*/React.createElement("div", {
54
+ className: "ui-shared__toggle-icon",
55
+ onClick: this.handleToggle,
56
+ "aria-hidden": true
57
+ }, on && onIcon, !on && offIcon);
58
+ }
59
+ }
60
+ ToggleIcon.defaultProps = {
61
+ on: true,
62
+ toggleHandler: noop
63
+ };
64
+ export default ToggleIcon;
@@ -1 +1,35 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{mount}from'enzyme';import ToggleIcon from"./index";import VisibilityIcon from"../icons/VisibilityIcon";import VisibilityOffIcon from"../icons/VisibilityOffIcon";var inputProps={onIcon:React.createElement(VisibilityIcon,null),offIcon:React.createElement(VisibilityOffIcon,null)};describe('<ToggleIcon>',function(){it('should render a toggle icon',function(){var wrapper=mount(React.createElement(ToggleIcon,inputProps));expect(wrapper).toMatchSnapshot();expect(wrapper.find('VisibilityIcon').length).toBe(1);expect(wrapper.find('VisibilityOffIcon').length).toBe(0);});it('should render a toggle icon with false as default',function(){var wrapper=mount(React.createElement(ToggleIcon,_extends({},inputProps,{on:false})));expect(wrapper).toMatchSnapshot();expect(wrapper.find('VisibilityIcon').length).toBe(0);expect(wrapper.find('VisibilityOffIcon').length).toBe(1);});it('should trigger the toggleHandler callback',function(){var mockToggleHandler=jest.fn();var wrapper=mount(React.createElement(ToggleIcon,_extends({},inputProps,{toggleHandler:mockToggleHandler})));wrapper.find('div').simulate('click');expect(wrapper).toMatchSnapshot();expect(mockToggleHandler.mock.calls.length).toBe(1);});});
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { mount } from 'enzyme';
4
+ import ToggleIcon from "./index";
5
+ import VisibilityIcon from "../icons/VisibilityIcon";
6
+ import VisibilityOffIcon from "../icons/VisibilityOffIcon";
7
+ const inputProps = {
8
+ onIcon: /*#__PURE__*/React.createElement(VisibilityIcon, null),
9
+ offIcon: /*#__PURE__*/React.createElement(VisibilityOffIcon, null)
10
+ };
11
+ describe('<ToggleIcon>', () => {
12
+ it('should render a toggle icon', () => {
13
+ const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, inputProps));
14
+ expect(wrapper).toMatchSnapshot();
15
+ expect(wrapper.find('VisibilityIcon').length).toBe(1);
16
+ expect(wrapper.find('VisibilityOffIcon').length).toBe(0);
17
+ });
18
+ it('should render a toggle icon with false as default', () => {
19
+ const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, _extends({}, inputProps, {
20
+ on: false
21
+ })));
22
+ expect(wrapper).toMatchSnapshot();
23
+ expect(wrapper.find('VisibilityIcon').length).toBe(0);
24
+ expect(wrapper.find('VisibilityOffIcon').length).toBe(1);
25
+ });
26
+ it('should trigger the toggleHandler callback', () => {
27
+ const mockToggleHandler = jest.fn();
28
+ const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, _extends({}, inputProps, {
29
+ toggleHandler: mockToggleHandler
30
+ })));
31
+ wrapper.find('div').simulate('click');
32
+ expect(wrapper).toMatchSnapshot();
33
+ expect(mockToggleHandler.mock.calls.length).toBe(1);
34
+ });
35
+ });
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The description icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var AccountBox=function AccountBox(props){return React.createElement(Icon,_extends({content:themeConfig.icons.accountBox},props));};export default AccountBox;
10
+ */
11
+ const AccountBox = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.accountBox
13
+ }, props));
14
+ export default AccountBox;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The add more icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var AddMore=function AddMore(props){return React.createElement(Icon,_extends({content:themeConfig.icons.addMore},props));};export default AddMore;
10
+ */
11
+ const AddMore = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.addMore
13
+ }, props));
14
+ export default AddMore;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The arrow-drop icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var ArrowDrop=function ArrowDrop(props){return React.createElement(Icon,_extends({content:themeConfig.icons.arrowDrop},props));};export default ArrowDrop;
10
+ */
11
+ const ArrowDrop = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.arrowDrop
13
+ }, props));
14
+ export default ArrowDrop;
@@ -1,6 +1,25 @@
1
- var _excluded=["shadow"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import React from'react';import PropTypes from'prop-types';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Icon from '@shopgate/pwa-common/components/Icon';
5
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
6
+
7
+ /**
2
8
  * The arrow icon component.
3
9
  * @param {Object} props The icon component properties.
4
10
  * @param {boolean} props.shadow Whether to show a shadow under the arrow.
5
11
  * @returns {JSX}
6
- */var ArrowIcon=function ArrowIcon(_ref){var shadow=_ref.shadow,props=_objectWithoutProperties(_ref,_excluded);var content=shadow?themeConfig.icons.arrowShadowed:themeConfig.icons.arrow;return React.createElement(Icon,_extends({content:content},props));};ArrowIcon.defaultProps={shadow:false};export default ArrowIcon;
12
+ */
13
+ const ArrowIcon = ({
14
+ shadow,
15
+ ...props
16
+ }) => {
17
+ const content = shadow ? themeConfig.icons.arrowShadowed : themeConfig.icons.arrow;
18
+ return /*#__PURE__*/React.createElement(Icon, _extends({
19
+ content: content
20
+ }, props));
21
+ };
22
+ ArrowIcon.defaultProps = {
23
+ shadow: false
24
+ };
25
+ export default ArrowIcon;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The barcode icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var BarcodeScanner=function BarcodeScanner(props){return React.createElement(Icon,_extends({content:themeConfig.icons.barcodeScanner},props));};export default BarcodeScanner;
10
+ */
11
+ const BarcodeScanner = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.barcodeScanner
13
+ }, props));
14
+ export default BarcodeScanner;
package/icons/BoxIcon.js CHANGED
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The box icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var Box=function Box(props){return React.createElement(Icon,_extends({content:themeConfig.icons.box},props));};export default Box;
10
+ */
11
+ const Box = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.box
13
+ }, props));
14
+ export default Box;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The home icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var Browse=function Browse(props){return React.createElement(Icon,_extends({content:themeConfig.icons.browse},props));};export default Browse;
10
+ */
11
+ const Browse = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.browse
13
+ }, props));
14
+ export default Browse;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The burger icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var Burger=function Burger(props){return React.createElement(Icon,_extends({content:themeConfig.icons.burger},props));};export default Burger;
10
+ */
11
+ const Burger = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.burger
13
+ }, props));
14
+ export default Burger;
@@ -1,6 +1,18 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';// SVG Content
2
- var content='<path d="M21.706 6.146c1.116 0 2.02-.898 2.02-2.016V2.02c0-1.119-.903-2.02-2.02-2.02s-2.019.9-2.019 2.02v2.111a2.014 2.014 0 002.019 2.015z"/><path d="M28.882 3.494h-4.066v1.027a3.078 3.078 0 01-3.075 3.076 3.076 3.076 0 01-3.074-3.076V3.494h-8.205v1.027c0 1.695-1.379 3.076-3.076 3.076s-3.075-1.38-3.075-3.076V3.494L.208 3.443v25.678h26.656l2.049-.006-.031-25.621zm-2.02 23.582H2.26V10.672h24.604v16.404h-.002z"/><path d="M7.354 6.146A2.016 2.016 0 009.375 4.13V2.02C9.375.9 8.47 0 7.354 0S5.336.9 5.336 2.02v2.111c0 1.117.901 2.015 2.018 2.015zM10.468 12.873h3.231v2.852h-3.231zM15.692 12.873h3.234v2.852h-3.234zM20.537 12.873h3.231v2.852h-3.231zM10.468 17.609h3.231v2.85h-3.231zM15.692 17.609h3.234v2.85h-3.234zM20.537 17.609h3.231v2.85h-3.231zM10.468 22.439h3.231v2.85h-3.231zM5.336 17.609h3.229v2.85H5.336zM5.336 22.439h3.229v2.85H5.336zM15.692 22.439h3.234v2.85h-3.234zM20.537 22.439h3.231v2.85h-3.231z"/>';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+
5
+ // SVG Content
6
+ const content = '<path d="M21.706 6.146c1.116 0 2.02-.898 2.02-2.016V2.02c0-1.119-.903-2.02-2.02-2.02s-2.019.9-2.019 2.02v2.111a2.014 2.014 0 002.019 2.015z"/><path d="M28.882 3.494h-4.066v1.027a3.078 3.078 0 01-3.075 3.076 3.076 3.076 0 01-3.074-3.076V3.494h-8.205v1.027c0 1.695-1.379 3.076-3.076 3.076s-3.075-1.38-3.075-3.076V3.494L.208 3.443v25.678h26.656l2.049-.006-.031-25.621zm-2.02 23.582H2.26V10.672h24.604v16.404h-.002z"/><path d="M7.354 6.146A2.016 2.016 0 009.375 4.13V2.02C9.375.9 8.47 0 7.354 0S5.336.9 5.336 2.02v2.111c0 1.117.901 2.015 2.018 2.015zM10.468 12.873h3.231v2.852h-3.231zM15.692 12.873h3.234v2.852h-3.234zM20.537 12.873h3.231v2.852h-3.231zM10.468 17.609h3.231v2.85h-3.231zM15.692 17.609h3.234v2.85h-3.234zM20.537 17.609h3.231v2.85h-3.231zM10.468 22.439h3.231v2.85h-3.231zM5.336 17.609h3.229v2.85H5.336zM5.336 22.439h3.229v2.85H5.336zM15.692 22.439h3.234v2.85h-3.234zM20.537 22.439h3.231v2.85h-3.231z"/>';
7
+
8
+ /**
3
9
  * The calendar icon component.
4
10
  * @param {Object} props The component properties.
5
11
  * @returns {JSX}
6
- */var Calendar=function Calendar(props){return React.createElement(Icon,_extends({content:content},props,{viewBox:"0 0 29.121 29.121"}));};export default Calendar;
12
+ */
13
+ const Calendar = props => /*#__PURE__*/React.createElement(Icon, _extends({
14
+ content: content
15
+ }, props, {
16
+ viewBox: "0 0 29.121 29.121"
17
+ }));
18
+ export default Calendar;
@@ -1,5 +1,75 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';var content="\n <defs>\n <style>\n .cls-1, .cls-3 {\n fill: #81c6e5;\n }\n\n .cls-1 {\n opacity: 0.19;\n }\n\n .cls-2 {\n fill: none;\n fill-rule: evenodd;\n }\n\n .cls-4 {\n clip-path: url(#clip-path);\n }\n\n .cls-5, .cls-6 {\n opacity: 0.09;\n }\n\n .cls-5 {\n fill: url(#linear-gradient);\n }\n\n .cls-6 {\n fill: url(#linear-gradient-2);\n }\n\n .cls-7 {\n fill: #fff;\n }\n </style>\n <clipPath id=\"clip-path\">\n <path class=\"cls-1\" d=\"M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z\" transform=\"translate(0 0)\"/>\n </clipPath>\n <linearGradient id=\"linear-gradient\" x1=\"0.273\" y1=\"0.267\" x2=\"0.705\" y2=\"0.641\" gradientUnits=\"objectBoundingBox\">\n <stop offset=\"0\"/>\n <stop offset=\"1\" stop-opacity=\"0.251\"/>\n </linearGradient>\n <linearGradient id=\"linear-gradient-2\" x1=\"0.5\" y1=\"0\" x2=\"0.5\" y2=\"1\" xlink:href=\"#linear-gradient\"/>\n </defs>\n <g transform=\"translate(283 -149)\">\n <path class=\"cls-2\" d=\"M39.474-83.7a22.758,22.758,0,0,0-32.346-.1,23.309,23.309,0,0,0-.1,32.455A22.484,22.484,0,0,0,23.1-44.5a22.282,22.282,0,0,0,16.123-6.644l.1-.1A23.26,23.26,0,0,0,39.474-83.7Z\" transform=\"translate(3265.005 8065.5)\"/>\n <path class=\"cls-3\" d=\"M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z\" transform=\"translate(3265 7975)\"/>\n <g class=\"cls-4\" transform=\"translate(3265 7975)\">\n <path class=\"cls-5\" d=\"M3173.978,8072.545l-20.807,21.038,17.736,17.381,20.526-22.043Z\" transform=\"translate(-3140.448 -8060)\"/>\n </g>\n <path class=\"cls-6\" d=\"M3160.986,8075.234l-6.975,6.144,6.15,6.08,6.542-6.665Z\" transform=\"translate(124.137 -86.315)\"/>\n <path class=\"cls-2\" d=\"M5.454-46.5a4.99,4.99,0,0,1,4.954,5.009,4.99,4.99,0,0,1-4.954,5.009A4.99,4.99,0,0,1,.5-41.491,4.99,4.99,0,0,1,5.454-46.5Z\" transform=\"translate(3275.621 8032.744)\"/>\n <path class=\"cls-2\" d=\"M32.454-10.482A4.99,4.99,0,0,1,27.5-15.491,4.99,4.99,0,0,1,32.454-20.5a4.99,4.99,0,0,1,4.954,5.009A4.99,4.99,0,0,1,32.454-10.482Z\" transform=\"translate(3262.269 8020.033)\"/>\n <g transform=\"translate(3276.244 7986.244)\">\n <path class=\"cls-7\" d=\"M5.008,0a5.073,5.073,0,0,1,5.008,5.12,5.073,5.073,0,0,1-5.008,5.12A5.073,5.073,0,0,1,0,5.12,5.073,5.073,0,0,1,5.008,0Z\" transform=\"translate(0 0)\"/>\n <path class=\"cls-7\" d=\"M2.553,23.044a1.533,1.533,0,0,1-1.067.467,1.448,1.448,0,0,1-1.067-.467,1.559,1.559,0,0,1,0-2.127L20.485.428a1.481,1.481,0,0,1,2.083,0,1.614,1.614,0,0,1,.051,2.127Z\" transform=\"translate(0.511 0)\"/>\n <path class=\"cls-7\" d=\"M4.854,9.927A4.918,4.918,0,0,1,0,4.963,4.918,4.918,0,0,1,4.854,0,4.918,4.918,0,0,1,9.709,4.963,4.918,4.918,0,0,1,4.854,9.927Z\" transform=\"translate(13.802 13.584)\"/>\n </g>\n </g>\n";/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ const content = `
5
+ <defs>
6
+ <style>
7
+ .cls-1, .cls-3 {
8
+ fill: #81c6e5;
9
+ }
10
+
11
+ .cls-1 {
12
+ opacity: 0.19;
13
+ }
14
+
15
+ .cls-2 {
16
+ fill: none;
17
+ fill-rule: evenodd;
18
+ }
19
+
20
+ .cls-4 {
21
+ clip-path: url(#clip-path);
22
+ }
23
+
24
+ .cls-5, .cls-6 {
25
+ opacity: 0.09;
26
+ }
27
+
28
+ .cls-5 {
29
+ fill: url(#linear-gradient);
30
+ }
31
+
32
+ .cls-6 {
33
+ fill: url(#linear-gradient-2);
34
+ }
35
+
36
+ .cls-7 {
37
+ fill: #fff;
38
+ }
39
+ </style>
40
+ <clipPath id="clip-path">
41
+ <path class="cls-1" d="M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z" transform="translate(0 0)"/>
42
+ </clipPath>
43
+ <linearGradient id="linear-gradient" x1="0.273" y1="0.267" x2="0.705" y2="0.641" gradientUnits="objectBoundingBox">
44
+ <stop offset="0"/>
45
+ <stop offset="1" stop-opacity="0.251"/>
46
+ </linearGradient>
47
+ <linearGradient id="linear-gradient-2" x1="0.5" y1="0" x2="0.5" y2="1" xlink:href="#linear-gradient"/>
48
+ </defs>
49
+ <g transform="translate(283 -149)">
50
+ <path class="cls-2" d="M39.474-83.7a22.758,22.758,0,0,0-32.346-.1,23.309,23.309,0,0,0-.1,32.455A22.484,22.484,0,0,0,23.1-44.5a22.282,22.282,0,0,0,16.123-6.644l.1-.1A23.26,23.26,0,0,0,39.474-83.7Z" transform="translate(3265.005 8065.5)"/>
51
+ <path class="cls-3" d="M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z" transform="translate(3265 7975)"/>
52
+ <g class="cls-4" transform="translate(3265 7975)">
53
+ <path class="cls-5" d="M3173.978,8072.545l-20.807,21.038,17.736,17.381,20.526-22.043Z" transform="translate(-3140.448 -8060)"/>
54
+ </g>
55
+ <path class="cls-6" d="M3160.986,8075.234l-6.975,6.144,6.15,6.08,6.542-6.665Z" transform="translate(124.137 -86.315)"/>
56
+ <path class="cls-2" d="M5.454-46.5a4.99,4.99,0,0,1,4.954,5.009,4.99,4.99,0,0,1-4.954,5.009A4.99,4.99,0,0,1,.5-41.491,4.99,4.99,0,0,1,5.454-46.5Z" transform="translate(3275.621 8032.744)"/>
57
+ <path class="cls-2" d="M32.454-10.482A4.99,4.99,0,0,1,27.5-15.491,4.99,4.99,0,0,1,32.454-20.5a4.99,4.99,0,0,1,4.954,5.009A4.99,4.99,0,0,1,32.454-10.482Z" transform="translate(3262.269 8020.033)"/>
58
+ <g transform="translate(3276.244 7986.244)">
59
+ <path class="cls-7" d="M5.008,0a5.073,5.073,0,0,1,5.008,5.12,5.073,5.073,0,0,1-5.008,5.12A5.073,5.073,0,0,1,0,5.12,5.073,5.073,0,0,1,5.008,0Z" transform="translate(0 0)"/>
60
+ <path class="cls-7" d="M2.553,23.044a1.533,1.533,0,0,1-1.067.467,1.448,1.448,0,0,1-1.067-.467,1.559,1.559,0,0,1,0-2.127L20.485.428a1.481,1.481,0,0,1,2.083,0,1.614,1.614,0,0,1,.051,2.127Z" transform="translate(0.511 0)"/>
61
+ <path class="cls-7" d="M4.854,9.927A4.918,4.918,0,0,1,0,4.963,4.918,4.918,0,0,1,4.854,0,4.918,4.918,0,0,1,9.709,4.963,4.918,4.918,0,0,1,4.854,9.927Z" transform="translate(13.802 13.584)"/>
62
+ </g>
63
+ </g>
64
+ `;
65
+
66
+ /**
2
67
  * Cart discount default icon
3
68
  * @param {Object} props .
4
69
  * @returns {JSX}
5
- */var CartCouponIcon=function CartCouponIcon(props){return React.createElement(Icon,_extends({content:content,viewBox:"3548 7826 45.999 46"},props));};export default CartCouponIcon;
70
+ */
71
+ const CartCouponIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
72
+ content: content,
73
+ viewBox: "3548 7826 45.999 46"
74
+ }, props));
75
+ export default CartCouponIcon;
package/icons/CartIcon.js CHANGED
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The cart icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var CartIcon=function CartIcon(props){return React.createElement(Icon,_extends({content:themeConfig.icons.cart},props));};export default CartIcon;
10
+ */
11
+ const CartIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.cart
13
+ }, props));
14
+ export default CartIcon;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The cart plus icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var CartPlus=function CartPlus(props){return React.createElement(Icon,_extends({content:themeConfig.icons.cartPlus},props));};export default CartPlus;
10
+ */
11
+ const CartPlus = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.cartPlus
13
+ }, props));
14
+ export default CartPlus;
@@ -1,5 +1,14 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import Icon from'@shopgate/pwa-common/components/Icon';import{themeConfig}from'@shopgate/pwa-common/helpers/config';/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Icon from '@shopgate/pwa-common/components/Icon';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+
6
+ /**
2
7
  * The check icon component.
3
8
  * @param {Object} props The icon component properties.
4
9
  * @returns {JSX}
5
- */var Check=function Check(props){return React.createElement(Icon,_extends({content:themeConfig.icons.check},props));};export default Check;
10
+ */
11
+ const Check = props => /*#__PURE__*/React.createElement(Icon, _extends({
12
+ content: themeConfig.icons.check
13
+ }, props));
14
+ export default Check;