@shopgate/pwa-ui-shared 7.30.3 → 7.31.0-alpha.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 (326) hide show
  1. package/ActionButton/index.js +66 -67
  2. package/AddToCartButton/index.js +217 -185
  3. package/Availability/index.js +24 -6
  4. package/Button/index.js +105 -82
  5. package/Button/spec.js +3 -4
  6. package/Card/index.js +26 -7
  7. package/CardList/components/Item/index.js +15 -3
  8. package/CartTotalLine/components/Amount/index.js +13 -4
  9. package/CartTotalLine/components/Hint/index.js +13 -4
  10. package/CartTotalLine/components/Label/index.js +23 -10
  11. package/CartTotalLine/index.js +41 -7
  12. package/Checkbox/index.js +41 -17
  13. package/Chip/index.js +82 -7
  14. package/ContextMenu/components/Item/index.js +38 -20
  15. package/ContextMenu/components/Position/index.js +38 -56
  16. package/ContextMenu/index.js +64 -28
  17. package/Dialog/components/BasicDialog/index.js +1 -0
  18. package/Dialog/components/HtmlContentDialog/spec.js +39 -0
  19. package/Dialog/components/PipelineErrorDialog/index.js +108 -157
  20. package/Dialog/components/PipelineErrorDialog/spec.js +12 -18
  21. package/Dialog/components/TextMessageDialog/index.js +1 -1
  22. package/Dialog/components/VariantSelectModal/index.js +1 -1
  23. package/Dialog/index.js +1 -1
  24. package/DiscountBadge/index.js +48 -15
  25. package/FavoritesButton/index.js +95 -100
  26. package/FavoritesButton/spec.js +5 -2
  27. package/Form/Builder/classes/ActionListener/index.js +1 -0
  28. package/Form/Checkbox/index.js +64 -56
  29. package/Form/InfoField/index.js +18 -6
  30. package/Form/Password/index.js +39 -52
  31. package/Form/RadioGroup/components/Item/index.js +72 -56
  32. package/Form/RadioGroup/index.js +79 -90
  33. package/Form/Select/index.js +108 -130
  34. package/Form/SelectContextChoices/index.js +30 -8
  35. package/Form/TextField/index.js +106 -82
  36. package/Form/TextField/spec.js +4 -3
  37. package/FormElement/components/ErrorText/index.js +32 -14
  38. package/FormElement/components/Label/index.js +56 -6
  39. package/FormElement/components/Placeholder/index.js +44 -11
  40. package/FormElement/components/Underline/index.js +63 -12
  41. package/FormElement/index.js +62 -85
  42. package/Glow/index.js +73 -83
  43. package/IndicatorCircle/index.js +73 -17
  44. package/IndicatorCircle/spec.js +2 -5
  45. package/LoadingIndicator/index.js +34 -12
  46. package/Manufacturer/index.js +21 -10
  47. package/MessageBar/index.js +12 -38
  48. package/NoResults/components/Icon/index.js +30 -14
  49. package/NoResults/index.js +35 -7
  50. package/Placeholder/index.js +34 -23
  51. package/PlaceholderLabel/index.js +17 -3
  52. package/Price/index.js +34 -21
  53. package/PriceInfo/index.js +23 -9
  54. package/PriceStriked/index.js +67 -77
  55. package/ProgressBar/index.js +112 -77
  56. package/RadioButton/index.js +29 -11
  57. package/RatingStars/index.js +122 -137
  58. package/Ripple/components/RippleAnimation/index.js +13 -3
  59. package/Ripple/index.js +158 -212
  60. package/RippleButton/index.js +63 -60
  61. package/RippleButton/spec.js +15 -9
  62. package/ScannerOverlay/components/CameraOverlay/index.js +54 -10
  63. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +53 -27
  64. package/ScannerOverlay/components/ScannerBar/index.js +50 -26
  65. package/Sheet/components/Header/components/SearchBar/index.js +54 -10
  66. package/Sheet/components/Header/index.js +96 -76
  67. package/Sheet/index.js +295 -157
  68. package/Sheet/spec.js +8 -6
  69. package/TaxDisclaimer/index.js +17 -4
  70. package/TaxDisclaimer/spec.js +16 -5
  71. package/TextField/components/ErrorText/index.js +35 -14
  72. package/TextField/components/FormElement/index.js +29 -4
  73. package/TextField/components/Hint/index.js +39 -10
  74. package/TextField/components/Label/index.js +43 -6
  75. package/TextField/components/Underline/index.js +64 -13
  76. package/TextField/index.js +157 -171
  77. package/TextField/spec.js +5 -3
  78. package/icons/AccountBoxIcon.d.ts +7 -0
  79. package/icons/AccountBoxIcon.d.ts.map +1 -0
  80. package/icons/AccountBoxIcon.js +1 -4
  81. package/icons/AddMoreIcon.d.ts +7 -0
  82. package/icons/AddMoreIcon.d.ts.map +1 -0
  83. package/icons/AddMoreIcon.js +0 -3
  84. package/icons/ArrowDropIcon.d.ts +7 -0
  85. package/icons/ArrowDropIcon.d.ts.map +1 -0
  86. package/icons/ArrowDropIcon.js +0 -3
  87. package/icons/ArrowIcon.d.ts +10 -0
  88. package/icons/ArrowIcon.d.ts.map +1 -0
  89. package/icons/ArrowIcon.js +2 -11
  90. package/icons/BarcodeScannerIcon.d.ts +7 -0
  91. package/icons/BarcodeScannerIcon.d.ts.map +1 -0
  92. package/icons/BarcodeScannerIcon.js +0 -3
  93. package/icons/BoxIcon.d.ts +7 -0
  94. package/icons/BoxIcon.d.ts.map +1 -0
  95. package/icons/BoxIcon.js +0 -3
  96. package/icons/BrowseIcon.d.ts +7 -0
  97. package/icons/BrowseIcon.d.ts.map +1 -0
  98. package/icons/BrowseIcon.js +1 -3
  99. package/icons/BurgerIcon.d.ts +7 -0
  100. package/icons/BurgerIcon.d.ts.map +1 -0
  101. package/icons/BurgerIcon.js +0 -3
  102. package/icons/CalendarIcon.d.ts +7 -0
  103. package/icons/CalendarIcon.d.ts.map +1 -0
  104. package/icons/CalendarIcon.js +0 -2
  105. package/icons/CartCouponIcon.d.ts +7 -0
  106. package/icons/CartCouponIcon.d.ts.map +1 -0
  107. package/icons/CartCouponIcon.js +0 -2
  108. package/icons/CartIcon.d.ts +7 -0
  109. package/icons/CartIcon.d.ts.map +1 -0
  110. package/icons/CartIcon.js +0 -2
  111. package/icons/CartPlusIcon.d.ts +7 -0
  112. package/icons/CartPlusIcon.d.ts.map +1 -0
  113. package/icons/CartPlusIcon.js +0 -2
  114. package/icons/CheckIcon.d.ts +7 -0
  115. package/icons/CheckIcon.d.ts.map +1 -0
  116. package/icons/CheckIcon.js +0 -2
  117. package/icons/CheckedIcon.d.ts +7 -0
  118. package/icons/CheckedIcon.d.ts.map +1 -0
  119. package/icons/CheckedIcon.js +0 -3
  120. package/icons/ChevronIcon.d.ts +7 -0
  121. package/icons/ChevronIcon.d.ts.map +1 -0
  122. package/icons/ChevronIcon.js +0 -2
  123. package/icons/CreditCardIcon.d.ts +7 -0
  124. package/icons/CreditCardIcon.d.ts.map +1 -0
  125. package/icons/CreditCardIcon.js +0 -2
  126. package/icons/CrossIcon.d.ts +7 -0
  127. package/icons/CrossIcon.d.ts.map +1 -0
  128. package/icons/CrossIcon.js +0 -2
  129. package/icons/DescriptionIcon.d.ts +7 -0
  130. package/icons/DescriptionIcon.d.ts.map +1 -0
  131. package/icons/DescriptionIcon.js +0 -2
  132. package/icons/FilterIcon.d.ts +7 -0
  133. package/icons/FilterIcon.d.ts.map +1 -0
  134. package/icons/FilterIcon.js +0 -2
  135. package/icons/FlashDisabledIcon.d.ts +7 -0
  136. package/icons/FlashDisabledIcon.d.ts.map +1 -0
  137. package/icons/FlashDisabledIcon.js +0 -2
  138. package/icons/FlashEnabledIcon.d.ts +7 -0
  139. package/icons/FlashEnabledIcon.d.ts.map +1 -0
  140. package/icons/FlashEnabledIcon.js +0 -2
  141. package/icons/GridIcon.d.ts +7 -0
  142. package/icons/GridIcon.d.ts.map +1 -0
  143. package/icons/GridIcon.js +1 -3
  144. package/icons/HeartIcon.d.ts +7 -0
  145. package/icons/HeartIcon.d.ts.map +1 -0
  146. package/icons/HeartIcon.js +0 -2
  147. package/icons/HeartOutlineIcon.d.ts +7 -0
  148. package/icons/HeartOutlineIcon.d.ts.map +1 -0
  149. package/icons/HeartOutlineIcon.js +1 -3
  150. package/icons/HeartPlusIcon.d.ts +7 -0
  151. package/icons/HeartPlusIcon.d.ts.map +1 -0
  152. package/icons/HeartPlusIcon.js +1 -3
  153. package/icons/HeartPlusOutlineIcon.d.ts +7 -0
  154. package/icons/HeartPlusOutlineIcon.d.ts.map +1 -0
  155. package/icons/HeartPlusOutlineIcon.js +1 -3
  156. package/icons/HomeIcon.d.ts +7 -0
  157. package/icons/HomeIcon.d.ts.map +1 -0
  158. package/icons/HomeIcon.js +0 -2
  159. package/icons/InfoIcon.d.ts +7 -0
  160. package/icons/InfoIcon.d.ts.map +1 -0
  161. package/icons/InfoIcon.js +0 -2
  162. package/icons/InfoOutlineIcon.d.ts +7 -0
  163. package/icons/InfoOutlineIcon.d.ts.map +1 -0
  164. package/icons/InfoOutlineIcon.js +0 -2
  165. package/icons/ListIcon.d.ts +7 -0
  166. package/icons/ListIcon.d.ts.map +1 -0
  167. package/icons/ListIcon.js +0 -2
  168. package/icons/LocalShippingIcon.d.ts +7 -0
  169. package/icons/LocalShippingIcon.d.ts.map +1 -0
  170. package/icons/LocalShippingIcon.js +0 -2
  171. package/icons/LocationIcon.d.ts +7 -0
  172. package/icons/LocationIcon.d.ts.map +1 -0
  173. package/icons/LocationIcon.js +1 -4
  174. package/icons/LocatorIcon.d.ts +7 -0
  175. package/icons/LocatorIcon.d.ts.map +1 -0
  176. package/icons/LocatorIcon.js +1 -3
  177. package/icons/LockIcon.d.ts +9 -0
  178. package/icons/LockIcon.d.ts.map +1 -0
  179. package/icons/LockIcon.js +1 -2
  180. package/icons/LogoutIcon.d.ts +7 -0
  181. package/icons/LogoutIcon.d.ts.map +1 -0
  182. package/icons/LogoutIcon.js +0 -2
  183. package/icons/MagnifierIcon.d.ts +7 -0
  184. package/icons/MagnifierIcon.d.ts.map +1 -0
  185. package/icons/MagnifierIcon.js +0 -2
  186. package/icons/MapMarkerIcon.d.ts +7 -0
  187. package/icons/MapMarkerIcon.d.ts.map +1 -0
  188. package/icons/MapMarkerIcon.js +1 -3
  189. package/icons/MoreIcon.d.ts +7 -0
  190. package/icons/MoreIcon.d.ts.map +1 -0
  191. package/icons/MoreIcon.js +1 -3
  192. package/icons/MoreVertIcon.d.ts +7 -0
  193. package/icons/MoreVertIcon.d.ts.map +1 -0
  194. package/icons/MoreVertIcon.js +1 -3
  195. package/icons/NotificationIcon.d.ts +7 -0
  196. package/icons/NotificationIcon.d.ts.map +1 -0
  197. package/icons/NotificationIcon.js +1 -3
  198. package/icons/PersonIcon.d.ts +9 -0
  199. package/icons/PersonIcon.d.ts.map +1 -0
  200. package/icons/PersonIcon.js +0 -3
  201. package/icons/PhoneIcon.d.ts +7 -0
  202. package/icons/PhoneIcon.d.ts.map +1 -0
  203. package/icons/PhoneIcon.js +1 -4
  204. package/icons/PlaceholderIcon.d.ts +7 -0
  205. package/icons/PlaceholderIcon.d.ts.map +1 -0
  206. package/icons/PlaceholderIcon.js +0 -2
  207. package/icons/RadioCheckedIcon.d.ts +10 -0
  208. package/icons/RadioCheckedIcon.d.ts.map +1 -0
  209. package/icons/RadioCheckedIcon.js +0 -2
  210. package/icons/RadioUncheckedIcon.d.ts +10 -0
  211. package/icons/RadioUncheckedIcon.d.ts.map +1 -0
  212. package/icons/RadioUncheckedIcon.js +0 -2
  213. package/icons/SecurityIcon.d.ts +7 -0
  214. package/icons/SecurityIcon.d.ts.map +1 -0
  215. package/icons/SecurityIcon.js +0 -2
  216. package/icons/ShippingMethodIcon.d.ts +7 -0
  217. package/icons/ShippingMethodIcon.d.ts.map +1 -0
  218. package/icons/ShippingMethodIcon.js +0 -2
  219. package/icons/ShoppingCartIcon.d.ts +7 -0
  220. package/icons/ShoppingCartIcon.d.ts.map +1 -0
  221. package/icons/ShoppingCartIcon.js +0 -2
  222. package/icons/SortIcon.d.ts +7 -0
  223. package/icons/SortIcon.d.ts.map +1 -0
  224. package/icons/SortIcon.js +0 -2
  225. package/icons/StarHalfIcon.d.ts +7 -0
  226. package/icons/StarHalfIcon.d.ts.map +1 -0
  227. package/icons/StarHalfIcon.js +0 -9
  228. package/icons/StarIcon.d.ts +7 -0
  229. package/icons/StarIcon.d.ts.map +1 -0
  230. package/icons/StarIcon.js +0 -9
  231. package/icons/StarOutlineIcon.d.ts +7 -0
  232. package/icons/StarOutlineIcon.d.ts.map +1 -0
  233. package/icons/StarOutlineIcon.js +0 -2
  234. package/icons/StopIcon.d.ts +7 -0
  235. package/icons/StopIcon.d.ts.map +1 -0
  236. package/icons/StopIcon.js +0 -2
  237. package/icons/TickIcon.d.ts +7 -0
  238. package/icons/TickIcon.d.ts.map +1 -0
  239. package/icons/TickIcon.js +0 -2
  240. package/icons/TimeIcon.d.ts +7 -0
  241. package/icons/TimeIcon.d.ts.map +1 -0
  242. package/icons/TimeIcon.js +0 -2
  243. package/icons/TrashIcon.d.ts +7 -0
  244. package/icons/TrashIcon.d.ts.map +1 -0
  245. package/icons/TrashIcon.js +0 -3
  246. package/icons/TrashOutlineIcon.d.ts +8 -0
  247. package/icons/TrashOutlineIcon.d.ts.map +1 -0
  248. package/icons/TrashOutlineIcon.js +0 -2
  249. package/icons/UncheckedIcon.d.ts +7 -0
  250. package/icons/UncheckedIcon.d.ts.map +1 -0
  251. package/icons/UncheckedIcon.js +0 -2
  252. package/icons/ViewListIcon.d.ts +7 -0
  253. package/icons/ViewListIcon.d.ts.map +1 -0
  254. package/icons/ViewListIcon.js +0 -2
  255. package/icons/VisibilityIcon.d.ts +8 -0
  256. package/icons/VisibilityIcon.d.ts.map +1 -0
  257. package/icons/VisibilityIcon.js +2 -4
  258. package/icons/VisibilityOffIcon.d.ts +8 -0
  259. package/icons/VisibilityOffIcon.d.ts.map +1 -0
  260. package/icons/VisibilityOffIcon.js +2 -4
  261. package/icons/WarningIcon.d.ts +7 -0
  262. package/icons/WarningIcon.d.ts.map +1 -0
  263. package/icons/WarningIcon.js +1 -3
  264. package/package.json +5 -5
  265. package/tsconfig.build.json +16 -0
  266. package/tsconfig.json +3 -0
  267. package/ActionButton/style.js +0 -22
  268. package/AddToCartButton/style.js +0 -148
  269. package/Availability/style.js +0 -19
  270. package/Button/style.js +0 -155
  271. package/Card/style.js +0 -11
  272. package/CardList/components/Item/style.js +0 -7
  273. package/CartTotalLine/components/Amount/style.js +0 -8
  274. package/CartTotalLine/components/Hint/style.js +0 -12
  275. package/CartTotalLine/components/Label/style.js +0 -17
  276. package/CartTotalLine/style.js +0 -31
  277. package/Checkbox/style.js +0 -18
  278. package/Chip/style.js +0 -78
  279. package/ContextMenu/components/Item/style.js +0 -34
  280. package/ContextMenu/components/Position/style.js +0 -11
  281. package/ContextMenu/style.js +0 -45
  282. package/DiscountBadge/style.js +0 -36
  283. package/FavoritesButton/style.js +0 -26
  284. package/Form/Checkbox/style.js +0 -25
  285. package/Form/InfoField/style.js +0 -11
  286. package/Form/Password/style.js +0 -11
  287. package/Form/RadioGroup/components/Item/style.js +0 -32
  288. package/Form/RadioGroup/style.js +0 -20
  289. package/Form/Select/style.js +0 -27
  290. package/Form/SelectContextChoices/style.js +0 -23
  291. package/Form/TextField/style.js +0 -70
  292. package/FormElement/components/ErrorText/style.js +0 -13
  293. package/FormElement/components/Label/style.js +0 -89
  294. package/FormElement/components/Placeholder/style.js +0 -56
  295. package/FormElement/components/Underline/style.js +0 -60
  296. package/FormElement/style.js +0 -14
  297. package/Glow/style.js +0 -18
  298. package/IndicatorCircle/style.js +0 -65
  299. package/LoadingIndicator/style.js +0 -20
  300. package/Manufacturer/style.js +0 -5
  301. package/MessageBar/spec.js +0 -80
  302. package/MessageBar/style.js +0 -38
  303. package/NoResults/components/Icon/style.js +0 -17
  304. package/NoResults/style.js +0 -31
  305. package/Placeholder/style.js +0 -11
  306. package/PlaceholderLabel/style.js +0 -12
  307. package/Price/style.js +0 -22
  308. package/PriceInfo/style.js +0 -5
  309. package/PriceStriked/style.js +0 -36
  310. package/ProgressBar/style.js +0 -85
  311. package/RadioButton/style.js +0 -21
  312. package/RatingStars/style.js +0 -53
  313. package/Ripple/style.js +0 -18
  314. package/ScannerOverlay/components/CameraOverlay/style.js +0 -40
  315. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +0 -28
  316. package/ScannerOverlay/components/ScannerBar/style.js +0 -20
  317. package/Sheet/components/Header/components/SearchBar/style.js +0 -47
  318. package/Sheet/components/Header/style.js +0 -50
  319. package/Sheet/style.js +0 -143
  320. package/TaxDisclaimer/style.js +0 -9
  321. package/TextField/components/ErrorText/style.js +0 -27
  322. package/TextField/components/FormElement/style.js +0 -34
  323. package/TextField/components/Hint/style.js +0 -46
  324. package/TextField/components/Label/style.js +0 -80
  325. package/TextField/components/Underline/style.js +0 -60
  326. package/TextField/style.js +0 -35
@@ -1,15 +1,31 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import CryptoJs from 'crypto-js';
4
- import styles from "./style";
4
+ import { themeColors } from '@shopgate/pwa-common/helpers/config';
5
+ import { makeStyles } from '@shopgate/engage/styles';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const useStyles = makeStyles()({
8
+ magnifier: {
9
+ fill: 'currentColor'
10
+ },
11
+ background: {
12
+ fill: themeColors.light
13
+ },
14
+ circle: {
15
+ fill: 'currentColor',
16
+ opacity: 0.065
17
+ }
18
+ });
5
19
 
6
20
  /**
7
21
  * The no search results icon component.
8
22
  * @param {Object} props Props of the component
9
23
  * @returns {JSX}
10
24
  */
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
25
  const NoResultIcon = props => {
26
+ const {
27
+ classes
28
+ } = useStyles();
13
29
  const filterId = useMemo(() => {
14
30
  const prefix = 'no-search-results-shadow';
15
31
  const hash = CryptoJs.MD5(`${prefix}-${Date.now() + Math.random()}`).toString();
@@ -46,7 +62,7 @@ const NoResultIcon = props => {
46
62
  children: [/*#__PURE__*/_jsx("g", {
47
63
  transform: "translate(0 46)",
48
64
  children: /*#__PURE__*/_jsx("circle", {
49
- className: styles.background,
65
+ className: classes.background,
50
66
  cx: "104",
51
67
  cy: "104",
52
68
  r: "104",
@@ -55,7 +71,7 @@ const NoResultIcon = props => {
55
71
  }), /*#__PURE__*/_jsx("g", {
56
72
  transform: "translate(-4 42)",
57
73
  children: /*#__PURE__*/_jsx("circle", {
58
- className: styles.background,
74
+ className: classes.background,
59
75
  cx: "108",
60
76
  cy: "108",
61
77
  r: "108",
@@ -63,19 +79,19 @@ const NoResultIcon = props => {
63
79
  })
64
80
  }), /*#__PURE__*/_jsxs("g", {
65
81
  children: [/*#__PURE__*/_jsx("circle", {
66
- className: styles.circle,
82
+ className: classes.circle,
67
83
  cx: "104",
68
84
  cy: "104",
69
85
  r: "104",
70
86
  transform: "translate(76 162)"
71
87
  }), /*#__PURE__*/_jsx("circle", {
72
- className: styles.circle,
88
+ className: classes.circle,
73
89
  cx: "92",
74
90
  cy: "92",
75
91
  r: "92",
76
92
  transform: "translate(88 174)"
77
93
  }), /*#__PURE__*/_jsx("circle", {
78
- className: styles.circle,
94
+ className: classes.circle,
79
95
  cx: "80",
80
96
  cy: "80",
81
97
  r: "80",
@@ -88,7 +104,7 @@ const NoResultIcon = props => {
88
104
  children: /*#__PURE__*/_jsx("g", {
89
105
  transform: "matrix(1, 0, 0, 1, 2686.4, -7054.12)",
90
106
  children: /*#__PURE__*/_jsx("path", {
91
- className: styles.background,
107
+ className: classes.background,
92
108
  d: "M90.216,116.652a24.732,24.732,0,0,1-20.61-10.992,13.394,13.394,0,0,1-7.263-1.374,20,20,0,0,1-7.655,1.767,20.473,20.473,0,0,1-18.255-10.6,20.009,20.009,0,0,1-6.478.981A23.584,23.584,0,0,1,6.4,73.076c0-10.6,6.085-19.236,15.507-22.181V50.11A13.07,13.07,0,0,1,34.862,37.155a13.905,13.905,0,0,1,2.748.2A18.6,18.6,0,0,1,52.724,29.7,19.248,19.248,0,0,1,65.876,35,14.4,14.4,0,0,1,75.1,31.659a13.191,13.191,0,0,1,6.281,1.963,24.851,24.851,0,0,1,40.239,1.767,21.962,21.962,0,0,1,20.61,5.3c.393-.2.589-.393.981-.589a16.9,16.9,0,0,1,7.459-1.963,15.491,15.491,0,0,1,15.311,13.937A22.951,22.951,0,0,1,181.49,64.439c2.944,6.478,2.355,13.544-1.57,20.218a21.266,21.266,0,0,1-18.059,10.011h-.2c-4.122,0-7.459-.785-10.207-2.552a13.109,13.109,0,0,1-7.263.393,24.871,24.871,0,0,1-15.311,15.114,24.1,24.1,0,0,1-18.451-.981A25.762,25.762,0,0,1,90.216,116.652Z",
93
109
  transform: "translate(-2686.4 7054.12)"
94
110
  })
@@ -99,7 +115,7 @@ const NoResultIcon = props => {
99
115
  children: [/*#__PURE__*/_jsx("g", {
100
116
  transform: "matrix(1, 0, 0, 1, 2770, -6819)",
101
117
  children: /*#__PURE__*/_jsx("rect", {
102
- className: styles.magnifier,
118
+ className: classes.magnifier,
103
119
  width: "13.003",
104
120
  height: "3.855",
105
121
  transform: "matrix(0.53, 0.85, -0.85, 0.53, -2613.92, 7029.38)"
@@ -107,7 +123,7 @@ const NoResultIcon = props => {
107
123
  }), /*#__PURE__*/_jsx("g", {
108
124
  transform: "matrix(1, 0, 0, 1, 2770, -6819)",
109
125
  children: /*#__PURE__*/_jsx("rect", {
110
- className: styles.magnifier,
126
+ className: classes.magnifier,
111
127
  width: "3.855",
112
128
  height: "13.003",
113
129
  transform: "translate(-2566.07 7029.56) rotate(37.01)"
@@ -115,13 +131,13 @@ const NoResultIcon = props => {
115
131
  }), /*#__PURE__*/_jsx("g", {
116
132
  transform: "matrix(1, 0, 0, 1, 2770, -6819)",
117
133
  children: /*#__PURE__*/_jsx("rect", {
118
- className: styles.magnifier,
134
+ className: classes.magnifier,
119
135
  width: "3.856",
120
136
  height: "13.002",
121
137
  transform: "translate(-2592.67 7023)"
122
138
  })
123
139
  }), /*#__PURE__*/_jsx("circle", {
124
- className: styles.background,
140
+ className: classes.background,
125
141
  cx: "34",
126
142
  cy: "34",
127
143
  r: "34",
@@ -135,12 +151,12 @@ const NoResultIcon = props => {
135
151
  children: [/*#__PURE__*/_jsx("g", {
136
152
  transform: "matrix(1, 0, 0, 1, 2623.3, -7041.94)",
137
153
  children: /*#__PURE__*/_jsx("path", {
138
- className: styles.magnifier,
154
+ className: classes.magnifier,
139
155
  d: "M83.335,33.853a34.228,34.228,0,1,0-1.494,49.8l4.482,4.482L84.63,89.829a1.926,1.926,0,0,0,0,2.789l17.032,16.932a1.926,1.926,0,0,0,2.789,0l5.677-5.677a1.926,1.926,0,0,0,0-2.789L93.1,84.152a1.926,1.926,0,0,0-2.789,0l-1.1,1.1-4.482-4.482A34.352,34.352,0,0,0,83.335,33.853Zm22.51,68.625-2.789,2.789L88.912,91.124,91.7,88.335ZM37.718,79.47a30.214,30.214,0,1,1,42.729,0A30.3,30.3,0,0,1,37.718,79.47Z",
140
156
  transform: "translate(-2648.22 7018.1)"
141
157
  })
142
158
  }), /*#__PURE__*/_jsx("path", {
143
- className: styles.magnifier,
159
+ className: classes.magnifier,
144
160
  d: "M111.291,55.583a1.972,1.972,0,1,0,2.789-2.789,28.585,28.585,0,0,0-40.338-.1,1.972,1.972,0,0,0,2.789,2.789A24.557,24.557,0,0,1,111.291,55.583Z",
145
161
  transform: "translate(-59.748 -38.701)"
146
162
  })]
@@ -1,11 +1,10 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import classNames from 'classnames';
4
- import I18n from '@shopgate/pwa-common/components/I18n';
3
+ import { I18n } from '@shopgate/engage/components';
5
4
  import { themeConfig } from '@shopgate/pwa-common/helpers/config';
6
5
  import { svgToDataUrl } from '@shopgate/engage/core';
6
+ import { makeStyles } from '@shopgate/engage/styles';
7
7
  import Icon from "./components/Icon";
8
- import styles from "./style";
9
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const {
11
10
  svgImages = {}
@@ -13,6 +12,31 @@ const {
13
12
  const {
14
13
  noResultsImage = ''
15
14
  } = svgImages || {};
15
+ const useStyles = makeStyles()(theme => ({
16
+ wrapper: {
17
+ alignItems: 'center',
18
+ display: 'flex',
19
+ flexDirection: 'column',
20
+ height: '100%',
21
+ width: '100%',
22
+ justifyContent: 'center',
23
+ textAlign: 'center',
24
+ background: 'var(--page-background-color)'
25
+ },
26
+ icon: {
27
+ width: 216,
28
+ color: 'var(--color-primary)'
29
+ },
30
+ headline: {
31
+ fontSize: '1.25rem',
32
+ fontWeight: 500,
33
+ marginTop: 30
34
+ },
35
+ text: {
36
+ marginTop: theme.spacing(2),
37
+ padding: theme.spacing(0, 2)
38
+ }
39
+ }));
16
40
 
17
41
  /**
18
42
  * The NoResults component.
@@ -20,12 +44,16 @@ const {
20
44
  * @returns {JSX.Element}
21
45
  */
22
46
  const NoResults = props => {
47
+ const {
48
+ classes,
49
+ cx
50
+ } = useStyles();
23
51
  const imageSRC = useMemo(() => svgToDataUrl(noResultsImage), []);
24
52
  return /*#__PURE__*/_jsxs("div", {
25
- className: classNames(styles.wrapper, props.className, ' ui-shared__no-results'),
53
+ className: cx(classes.wrapper, props.className, ' ui-shared__no-results'),
26
54
  "data-test-id": "noResults",
27
55
  children: [/*#__PURE__*/_jsx("div", {
28
- className: classNames(styles.icon, 'no-results__image'),
56
+ className: cx(classes.icon, 'no-results__image'),
29
57
  children: noResultsImage ? /*#__PURE__*/_jsx("img", {
30
58
  src: imageSRC,
31
59
  alt: ""
@@ -34,13 +62,13 @@ const NoResults = props => {
34
62
  role: "alert",
35
63
  "aria-atomic": "true",
36
64
  children: [/*#__PURE__*/_jsx("div", {
37
- className: styles.headline,
65
+ className: classes.headline,
38
66
  children: /*#__PURE__*/_jsx(I18n.Text, {
39
67
  string: props.headlineText,
40
68
  params: props
41
69
  })
42
70
  }), /*#__PURE__*/_jsx("div", {
43
- className: styles.text,
71
+ className: classes.text,
44
72
  children: /*#__PURE__*/_jsx(I18n.Text, {
45
73
  string: props.bodyText,
46
74
  params: props
@@ -1,35 +1,46 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { PureComponent } from 'react';
1
+ import React, { memo } from 'react';
3
2
  import PropTypes from 'prop-types';
4
- import styles from "./style";
3
+ import { makeStyles } from '@shopgate/engage/styles';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const useStyles = makeStyles()(() => ({
6
+ root: {
7
+ background: 'var(--color-background-accent)',
8
+ position: 'relative'
9
+ }
10
+ }));
5
11
 
6
12
  /**
7
13
  * The placeholder component.
14
+ * @param {Object} props Props (also spread to style).
15
+ * @returns {JSX.Element}
8
16
  */
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- let Placeholder = /*#__PURE__*/function (_PureComponent) {
11
- function Placeholder() {
12
- return _PureComponent.apply(this, arguments) || this;
13
- }
14
- _inheritsLoose(Placeholder, _PureComponent);
15
- var _proto = Placeholder.prototype;
16
- /**
17
- * @returns {JSX}
18
- */
19
- _proto.render = function render() {
20
- return /*#__PURE__*/_jsx("div", {
21
- className: `${styles} ui-shared__placeholder`,
22
- style: this.props
23
- });
17
+ const Placeholder = ({
18
+ height,
19
+ left,
20
+ top,
21
+ width,
22
+ ...rest
23
+ }) => {
24
+ const {
25
+ classes,
26
+ cx
27
+ } = useStyles();
28
+ const style = {
29
+ height,
30
+ left,
31
+ top,
32
+ width,
33
+ ...rest
24
34
  };
25
- return Placeholder;
26
- }(PureComponent);
27
- /* eslint-disable react/no-unused-prop-types */
28
- /* eslint-enable react/no-unused-prop-types */
35
+ return /*#__PURE__*/_jsx("div", {
36
+ className: cx(classes.root, 'ui-shared__placeholder'),
37
+ style: style
38
+ });
39
+ };
29
40
  Placeholder.defaultProps = {
30
41
  height: 0,
31
42
  left: 0,
32
43
  top: 0,
33
44
  width: 0
34
45
  };
35
- export default Placeholder;
46
+ export default /*#__PURE__*/memo(Placeholder);
@@ -1,23 +1,37 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styles from "./style";
3
+ import { makeStyles } from '@shopgate/engage/styles';
4
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const useStyles = makeStyles()(() => ({
7
+ label: {
8
+ background: themeConfig.colors.dark,
9
+ opacity: 0.1,
10
+ width: '100%',
11
+ height: 16,
12
+ marginBottom: 12
13
+ }
14
+ }));
4
15
 
5
16
  /**
6
17
  * Placeholder for one line texts.
7
18
  * @param {Object} props The component props.
8
19
  * @return {JSX}
9
20
  */
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
21
  const PlaceholderLabel = ({
12
22
  children,
13
23
  className,
14
24
  ready,
15
25
  style
16
26
  }) => {
27
+ const {
28
+ classes,
29
+ cx
30
+ } = useStyles();
17
31
  if (!ready) {
18
32
  return /*#__PURE__*/_jsx("div", {
19
33
  style: style,
20
- className: `${styles.label} ${className} ui-shared__placeholder-label`
34
+ className: cx(classes.label, className, 'ui-shared__placeholder-label')
21
35
  });
22
36
  }
23
37
  return children;
package/Price/index.js CHANGED
@@ -1,11 +1,29 @@
1
1
  import "core-js/modules/es.string.replace.js";
2
2
  import React, { useMemo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import classNames from 'classnames';
5
4
  import { I18n } from '@shopgate/engage/components';
5
+ import { i18n } from '@shopgate/engage/core/helpers';
6
+ import { makeStyles } from '@shopgate/engage/styles';
6
7
  import showTaxDisclaimer from '@shopgate/pwa-common-commerce/market/helpers/showTaxDisclaimer';
7
8
  import { useWidgetSettings } from '@shopgate/engage/core/hooks/useWidgetSettings';
8
- import styles from "./style";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const useStyles = makeStyles()({
11
+ container: {
12
+ display: 'flex',
13
+ position: 'relative',
14
+ whiteSpace: 'nowrap'
15
+ },
16
+ disclaimer: {
17
+ color: 'initial',
18
+ fontSize: 14,
19
+ position: 'absolute',
20
+ right: -10,
21
+ top: 0
22
+ },
23
+ discounted: {
24
+ color: 'var(--color-primary)'
25
+ }
26
+ });
9
27
 
10
28
  /**
11
29
  * The Price component
@@ -15,11 +33,13 @@ import styles from "./style";
15
33
  * @param {number} props.unitPrice The price of the product
16
34
  * @param {number} props.unitPriceMin The minimum price of possible child products
17
35
  * @param {boolean} props.discounted Tells if the pice is discounted
18
- * @param {Object} context The component context.
19
36
  * @return {JSX.Element}
20
37
  */
21
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
- const Price = (props, context) => {
38
+ const Price = props => {
39
+ const {
40
+ classes,
41
+ cx
42
+ } = useStyles();
23
43
  // Added with PWA 6 - CCP-2372
24
44
  const {
25
45
  show,
@@ -28,13 +48,9 @@ const Price = (props, context) => {
28
48
 
29
49
  // use widget setting if set to true/false, otherwise use market logic
30
50
  const showDisclaimer = typeof show === 'boolean' ? show : showTaxDisclaimer;
31
- const containerClasses = classNames(styles.container, props.className, {
32
- [styles.discounted]: props.discounted
51
+ const containerClasses = cx(classes.container, props.className, {
52
+ [classes.discounted]: props.discounted
33
53
  }, 'price', props.discounted ? 'ui-shared__price-discounted' : 'ui-shared__price');
34
- const {
35
- __,
36
- _p
37
- } = context.i18n();
38
54
  let ariaPrice;
39
55
  const showFromPrice = useMemo(() => {
40
56
  // unitPriceMin is falsy so we don't have a price range
@@ -43,11 +59,11 @@ const Price = (props, context) => {
43
59
  return props.unitPriceMin !== props.unitPriceMax;
44
60
  }, [props.unitPriceMax, props.unitPriceMin]);
45
61
  if (showFromPrice) {
46
- ariaPrice = __('price.from', {
47
- price: _p(props.unitPriceMin, props.currency, props.fractions)
62
+ ariaPrice = i18n.text('price.from', {
63
+ price: i18n.price(props.unitPriceMin, props.currency, props.fractions)
48
64
  });
49
65
  } else {
50
- ariaPrice = _p(props.unitPrice, props.currency, props.fractions);
66
+ ariaPrice = i18n.price(props.unitPrice, props.currency, props.fractions);
51
67
  }
52
68
  ariaPrice = ariaPrice.replace('-', '\u2212');
53
69
 
@@ -86,19 +102,19 @@ const Price = (props, context) => {
86
102
  className: containerClasses,
87
103
  "data-test-id": `minPrice: ${props.unitPriceMin} price: ${props.unitPrice} currency: ${props.currency}`,
88
104
  children: [/*#__PURE__*/_jsx("span", {
89
- "aria-label": __('price.label', {
105
+ "aria-label": i18n.text('price.label', {
90
106
  price: ariaPrice
91
107
  }),
92
108
  children: priceContent
93
109
  }), props.taxDisclaimer && showDisclaimer ? /*#__PURE__*/_jsxs("div", {
94
- className: styles.disclaimer,
110
+ className: classes.disclaimer,
95
111
  children: [/*#__PURE__*/_jsx("span", {
96
112
  "aria-hidden": true,
97
113
  children: hint || '*'
98
114
  }), /*#__PURE__*/_jsx("span", {
99
115
  className: "sr-only",
100
- "aria-label": hint || __('product.tax_disclaimer_aria'),
101
- children: __('product.tax_disclaimer_aria')
116
+ "aria-label": hint || i18n.text('product.tax_disclaimer_aria'),
117
+ children: i18n.text('product.tax_disclaimer_aria')
102
118
  })]
103
119
  }) : null]
104
120
  });
@@ -112,7 +128,4 @@ Price.defaultProps = {
112
128
  taxDisclaimer: false,
113
129
  allowFree: false
114
130
  };
115
- Price.contextTypes = {
116
- i18n: PropTypes.func
117
- };
118
131
  export default Price;
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import styles from "./style";
3
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
4
+ import { makeStyles } from '@shopgate/engage/styles';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const useStyles = makeStyles()({
7
+ root: {
8
+ color: themeConfig.colors.shade3
9
+ }
10
+ });
4
11
 
5
12
  /**
6
13
  * The price info component
@@ -9,17 +16,24 @@ import styles from "./style";
9
16
  * @param {string} [props.className] CSS classes
10
17
  * @return {JSX}
11
18
  */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
19
  const PriceInfo = ({
14
20
  className,
15
21
  text
16
- }) => /*#__PURE__*/_jsx("div", {
17
- className: `${styles} ${className} ui-shared__price-info`,
18
- dangerouslySetInnerHTML: {
19
- __html: text
20
- },
21
- "data-test-id": `priceInfo: ${text}`
22
- });
22
+ }) => {
23
+ const {
24
+ classes,
25
+ cx
26
+ } = useStyles();
27
+ return /*#__PURE__*/_jsx("div", {
28
+ className: cx(classes.root, className, 'ui-shared__price-info')
29
+ // eslint-disable-next-line react/no-danger
30
+ ,
31
+ dangerouslySetInnerHTML: {
32
+ __html: text
33
+ },
34
+ "data-test-id": `priceInfo: ${text}`
35
+ });
36
+ };
23
37
  PriceInfo.defaultProps = {
24
38
  className: ''
25
39
  };
@@ -1,8 +1,9 @@
1
- import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
- import React, { Component } from 'react';
1
+ import React, { useLayoutEffect, useRef, useState } from 'react';
3
2
  import PropTypes from 'prop-types';
4
- import I18n from '@shopgate/pwa-common/components/I18n';
5
- import styles from "./style";
3
+ import { I18n } from '@shopgate/engage/components';
4
+ import { i18n } from '@shopgate/engage/core/helpers';
5
+ import { makeStyles } from '@shopgate/engage/styles';
6
+ import { themeColors } from '@shopgate/pwa-common/helpers/config';
6
7
 
7
8
  /**
8
9
  * Calculates the angle for the strike-through line
@@ -20,10 +21,33 @@ const calcAngle = element => {
20
21
  const width = cloned.offsetWidth;
21
22
  const height = cloned.offsetHeight;
22
23
  document.body.removeChild(cloned);
23
-
24
- // Calculate the correct angle for the strike-through line
25
24
  return Math.round(90 - Math.atan(width / height) * (180 / Math.PI));
26
25
  };
26
+ const useStyles = makeStyles()({
27
+ root: {
28
+ whiteSpace: 'nowrap',
29
+ color: themeColors.shade11,
30
+ '& span': {
31
+ position: 'relative',
32
+ '&::before': {
33
+ borderColor: 'currentColor',
34
+ content: '""',
35
+ position: 'absolute',
36
+ left: 0,
37
+ right: 0,
38
+ top: '50%'
39
+ }
40
+ }
41
+ },
42
+ strikeActive: {
43
+ '& span': {
44
+ '&::before': {
45
+ borderTop: '1px solid',
46
+ transform: 'rotate(calc(var(--price-strike-deg) * -1deg))'
47
+ }
48
+ }
49
+ }
50
+ });
27
51
 
28
52
  /**
29
53
  * The price striked component
@@ -33,80 +57,46 @@ const calcAngle = element => {
33
57
  * @param {string} [props.className] CSS classes
34
58
  * @return {JSX}
35
59
  */
36
- let PriceStriked = /*#__PURE__*/function (_Component) {
37
- /**
38
- * Constructor
39
- * @param {Object} props The component props
40
- */
41
- function PriceStriked(props) {
42
- var _this;
43
- _this = _Component.call(this, props) || this;
44
- /**
45
- * Sets the calculated angle for the DOM element
46
- * and returns true if succeeded.
47
- * @returns {boolean}
48
- */
49
- _this.setAngle = () => {
50
- if (_this.element) {
51
- _this.angle = calcAngle(_this.element);
52
- return true;
53
- }
54
- return false;
55
- };
56
- _this.angle = null;
57
- _this.element = null;
58
- return _this;
59
- }
60
-
61
- /**
62
- * Updates the component one more time with the calculated angle
63
- * based on the DOM element.
64
- */
65
- _inheritsLoose(PriceStriked, _Component);
66
- var _proto = PriceStriked.prototype;
67
- _proto.componentDidMount = function componentDidMount() {
68
- if (this.setAngle()) {
69
- this.forceUpdate();
60
+ const PriceStriked = ({
61
+ className,
62
+ currency,
63
+ value
64
+ }) => {
65
+ const {
66
+ classes,
67
+ cx
68
+ } = useStyles();
69
+ const [angle, setAngle] = useState(null);
70
+ const elementRef = useRef(null);
71
+ useLayoutEffect(() => {
72
+ if (elementRef.current) {
73
+ setAngle(calcAngle(elementRef.current));
70
74
  }
71
- };
72
- /**
73
- * Renders the component.
74
- * @returns {JSX.Element}
75
- */
76
- _proto.render = function render() {
77
- const {
78
- __,
79
- _p
80
- } = this.context.i18n();
81
- const angleStyle = this.angle ? styles.getAngleStyle(this.angle) : '';
82
- return /*#__PURE__*/_jsxs(_Fragment, {
83
- children: [/*#__PURE__*/_jsx("div", {
84
- className: `${styles.basic} ${this.props.className} ${angleStyle} price-striked ui-shared__price-striked`,
85
- children: /*#__PURE__*/_jsx("span", {
86
- "aria-hidden": true,
87
- ref: ref => {
88
- this.element = ref;
89
- },
90
- "data-test-id": `strikedPrice: ${this.props.value}`,
91
- children: /*#__PURE__*/_jsx(I18n.Price, {
92
- price: this.props.value,
93
- currency: this.props.currency
94
- })
95
- })
96
- }), /*#__PURE__*/_jsx("span", {
97
- className: "sr-only",
98
- children: __('price.label_old_price', {
99
- price: _p(this.props.value, this.props.currency, true)
75
+ }, []);
76
+ return /*#__PURE__*/_jsxs(_Fragment, {
77
+ children: [/*#__PURE__*/_jsx("div", {
78
+ className: cx(classes.root, angle != null && classes.strikeActive, className, 'price-striked', 'ui-shared__price-striked'),
79
+ style: angle != null ? {
80
+ '--price-strike-deg': angle
81
+ } : undefined,
82
+ children: /*#__PURE__*/_jsx("span", {
83
+ "aria-hidden": true,
84
+ ref: elementRef,
85
+ "data-test-id": `strikedPrice: ${value}`,
86
+ children: /*#__PURE__*/_jsx(I18n.Price, {
87
+ price: value,
88
+ currency: currency
100
89
  })
101
- })]
102
- });
103
- };
104
- return PriceStriked;
105
- }(Component);
90
+ })
91
+ }), /*#__PURE__*/_jsx("span", {
92
+ className: "sr-only",
93
+ children: i18n.text('price.label_old_price', {
94
+ price: i18n.price(value, currency, true)
95
+ })
96
+ })]
97
+ });
98
+ };
106
99
  PriceStriked.defaultProps = {
107
100
  className: ''
108
101
  };
109
- PriceStriked.contextTypes = {
110
- i18n: PropTypes.func
111
- };
112
102
  export default PriceStriked;