@shopgate/pwa-ui-shared 7.30.4-beta.1 → 7.31.0-alpha.2

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/AddToCartButton/style.js +8 -0
  4. package/Availability/index.js +24 -6
  5. package/Button/index.js +105 -82
  6. package/Button/spec.js +3 -4
  7. package/Card/index.js +26 -7
  8. package/CardList/components/Item/index.js +15 -3
  9. package/CartTotalLine/components/Amount/index.js +13 -4
  10. package/CartTotalLine/components/Hint/index.js +13 -4
  11. package/CartTotalLine/components/Label/index.js +23 -10
  12. package/CartTotalLine/index.js +41 -7
  13. package/Checkbox/index.js +41 -17
  14. package/Chip/index.js +82 -7
  15. package/ContextMenu/components/Item/index.js +38 -20
  16. package/ContextMenu/components/Position/index.js +38 -56
  17. package/ContextMenu/index.js +64 -28
  18. package/Dialog/components/BasicDialog/index.js +1 -0
  19. package/Dialog/components/HtmlContentDialog/spec.js +39 -0
  20. package/Dialog/components/PipelineErrorDialog/index.js +108 -157
  21. package/Dialog/components/PipelineErrorDialog/spec.js +12 -18
  22. package/Dialog/components/TextMessageDialog/index.js +1 -1
  23. package/Dialog/components/VariantSelectModal/index.js +1 -1
  24. package/Dialog/index.js +1 -1
  25. package/DiscountBadge/index.js +48 -15
  26. package/FavoritesButton/index.js +95 -100
  27. package/FavoritesButton/spec.js +5 -2
  28. package/Form/Builder/classes/ActionListener/index.js +1 -0
  29. package/Form/Checkbox/index.js +64 -56
  30. package/Form/InfoField/index.js +18 -6
  31. package/Form/Password/index.js +39 -52
  32. package/Form/RadioGroup/components/Item/index.js +72 -56
  33. package/Form/RadioGroup/index.js +79 -90
  34. package/Form/Select/index.js +108 -130
  35. package/Form/SelectContextChoices/index.js +30 -8
  36. package/Form/TextField/index.js +106 -82
  37. package/Form/TextField/spec.js +4 -3
  38. package/FormElement/components/ErrorText/index.js +32 -14
  39. package/FormElement/components/Label/index.js +56 -6
  40. package/FormElement/components/Placeholder/index.js +44 -11
  41. package/FormElement/components/Underline/index.js +63 -12
  42. package/FormElement/index.js +62 -85
  43. package/Glow/index.js +73 -83
  44. package/IndicatorCircle/index.js +73 -17
  45. package/IndicatorCircle/spec.js +2 -5
  46. package/LoadingIndicator/index.js +34 -12
  47. package/Manufacturer/index.js +21 -10
  48. package/MessageBar/index.js +12 -38
  49. package/NoResults/components/Icon/index.js +30 -14
  50. package/NoResults/index.js +35 -7
  51. package/Placeholder/index.js +34 -23
  52. package/PlaceholderLabel/index.js +17 -3
  53. package/Price/index.js +34 -21
  54. package/PriceInfo/index.js +23 -9
  55. package/PriceStriked/index.js +67 -77
  56. package/ProgressBar/index.js +112 -77
  57. package/RadioButton/index.js +29 -11
  58. package/RatingStars/index.js +122 -137
  59. package/Ripple/components/RippleAnimation/index.js +13 -3
  60. package/Ripple/index.js +158 -212
  61. package/RippleButton/index.js +63 -60
  62. package/RippleButton/spec.js +15 -9
  63. package/ScannerOverlay/components/CameraOverlay/index.js +54 -10
  64. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +53 -27
  65. package/ScannerOverlay/components/ScannerBar/index.js +50 -26
  66. package/Sheet/components/Header/components/SearchBar/index.js +54 -10
  67. package/Sheet/components/Header/index.js +96 -76
  68. package/Sheet/index.js +295 -157
  69. package/Sheet/spec.js +8 -6
  70. package/TaxDisclaimer/index.js +17 -4
  71. package/TaxDisclaimer/spec.js +16 -5
  72. package/TextField/components/ErrorText/index.js +35 -14
  73. package/TextField/components/FormElement/index.js +29 -4
  74. package/TextField/components/Hint/index.js +39 -10
  75. package/TextField/components/Label/index.js +43 -6
  76. package/TextField/components/Underline/index.js +64 -13
  77. package/TextField/index.js +157 -171
  78. package/TextField/spec.js +5 -3
  79. package/icons/AccountBoxIcon.d.ts +7 -0
  80. package/icons/AccountBoxIcon.d.ts.map +1 -0
  81. package/icons/AccountBoxIcon.js +1 -4
  82. package/icons/AddMoreIcon.d.ts +7 -0
  83. package/icons/AddMoreIcon.d.ts.map +1 -0
  84. package/icons/AddMoreIcon.js +0 -3
  85. package/icons/ArrowDropIcon.d.ts +7 -0
  86. package/icons/ArrowDropIcon.d.ts.map +1 -0
  87. package/icons/ArrowDropIcon.js +0 -3
  88. package/icons/ArrowIcon.d.ts +10 -0
  89. package/icons/ArrowIcon.d.ts.map +1 -0
  90. package/icons/ArrowIcon.js +2 -11
  91. package/icons/BarcodeScannerIcon.d.ts +7 -0
  92. package/icons/BarcodeScannerIcon.d.ts.map +1 -0
  93. package/icons/BarcodeScannerIcon.js +0 -3
  94. package/icons/BoxIcon.d.ts +7 -0
  95. package/icons/BoxIcon.d.ts.map +1 -0
  96. package/icons/BoxIcon.js +0 -3
  97. package/icons/BrowseIcon.d.ts +7 -0
  98. package/icons/BrowseIcon.d.ts.map +1 -0
  99. package/icons/BrowseIcon.js +1 -3
  100. package/icons/BurgerIcon.d.ts +7 -0
  101. package/icons/BurgerIcon.d.ts.map +1 -0
  102. package/icons/BurgerIcon.js +0 -3
  103. package/icons/CalendarIcon.d.ts +7 -0
  104. package/icons/CalendarIcon.d.ts.map +1 -0
  105. package/icons/CalendarIcon.js +0 -2
  106. package/icons/CartCouponIcon.d.ts +7 -0
  107. package/icons/CartCouponIcon.d.ts.map +1 -0
  108. package/icons/CartCouponIcon.js +0 -2
  109. package/icons/CartIcon.d.ts +7 -0
  110. package/icons/CartIcon.d.ts.map +1 -0
  111. package/icons/CartIcon.js +0 -2
  112. package/icons/CartPlusIcon.d.ts +7 -0
  113. package/icons/CartPlusIcon.d.ts.map +1 -0
  114. package/icons/CartPlusIcon.js +0 -2
  115. package/icons/CheckIcon.d.ts +7 -0
  116. package/icons/CheckIcon.d.ts.map +1 -0
  117. package/icons/CheckIcon.js +0 -2
  118. package/icons/CheckedIcon.d.ts +7 -0
  119. package/icons/CheckedIcon.d.ts.map +1 -0
  120. package/icons/CheckedIcon.js +0 -3
  121. package/icons/ChevronIcon.d.ts +7 -0
  122. package/icons/ChevronIcon.d.ts.map +1 -0
  123. package/icons/ChevronIcon.js +0 -2
  124. package/icons/CreditCardIcon.d.ts +7 -0
  125. package/icons/CreditCardIcon.d.ts.map +1 -0
  126. package/icons/CreditCardIcon.js +0 -2
  127. package/icons/CrossIcon.d.ts +7 -0
  128. package/icons/CrossIcon.d.ts.map +1 -0
  129. package/icons/CrossIcon.js +0 -2
  130. package/icons/DescriptionIcon.d.ts +7 -0
  131. package/icons/DescriptionIcon.d.ts.map +1 -0
  132. package/icons/DescriptionIcon.js +0 -2
  133. package/icons/FilterIcon.d.ts +7 -0
  134. package/icons/FilterIcon.d.ts.map +1 -0
  135. package/icons/FilterIcon.js +0 -2
  136. package/icons/FlashDisabledIcon.d.ts +7 -0
  137. package/icons/FlashDisabledIcon.d.ts.map +1 -0
  138. package/icons/FlashDisabledIcon.js +0 -2
  139. package/icons/FlashEnabledIcon.d.ts +7 -0
  140. package/icons/FlashEnabledIcon.d.ts.map +1 -0
  141. package/icons/FlashEnabledIcon.js +0 -2
  142. package/icons/GridIcon.d.ts +7 -0
  143. package/icons/GridIcon.d.ts.map +1 -0
  144. package/icons/GridIcon.js +1 -3
  145. package/icons/HeartIcon.d.ts +7 -0
  146. package/icons/HeartIcon.d.ts.map +1 -0
  147. package/icons/HeartIcon.js +0 -2
  148. package/icons/HeartOutlineIcon.d.ts +7 -0
  149. package/icons/HeartOutlineIcon.d.ts.map +1 -0
  150. package/icons/HeartOutlineIcon.js +1 -3
  151. package/icons/HeartPlusIcon.d.ts +7 -0
  152. package/icons/HeartPlusIcon.d.ts.map +1 -0
  153. package/icons/HeartPlusIcon.js +1 -3
  154. package/icons/HeartPlusOutlineIcon.d.ts +7 -0
  155. package/icons/HeartPlusOutlineIcon.d.ts.map +1 -0
  156. package/icons/HeartPlusOutlineIcon.js +1 -3
  157. package/icons/HomeIcon.d.ts +7 -0
  158. package/icons/HomeIcon.d.ts.map +1 -0
  159. package/icons/HomeIcon.js +0 -2
  160. package/icons/InfoIcon.d.ts +7 -0
  161. package/icons/InfoIcon.d.ts.map +1 -0
  162. package/icons/InfoIcon.js +0 -2
  163. package/icons/InfoOutlineIcon.d.ts +7 -0
  164. package/icons/InfoOutlineIcon.d.ts.map +1 -0
  165. package/icons/InfoOutlineIcon.js +0 -2
  166. package/icons/ListIcon.d.ts +7 -0
  167. package/icons/ListIcon.d.ts.map +1 -0
  168. package/icons/ListIcon.js +0 -2
  169. package/icons/LocalShippingIcon.d.ts +7 -0
  170. package/icons/LocalShippingIcon.d.ts.map +1 -0
  171. package/icons/LocalShippingIcon.js +0 -2
  172. package/icons/LocationIcon.d.ts +7 -0
  173. package/icons/LocationIcon.d.ts.map +1 -0
  174. package/icons/LocationIcon.js +1 -4
  175. package/icons/LocatorIcon.d.ts +7 -0
  176. package/icons/LocatorIcon.d.ts.map +1 -0
  177. package/icons/LocatorIcon.js +1 -3
  178. package/icons/LockIcon.d.ts +9 -0
  179. package/icons/LockIcon.d.ts.map +1 -0
  180. package/icons/LockIcon.js +1 -2
  181. package/icons/LogoutIcon.d.ts +7 -0
  182. package/icons/LogoutIcon.d.ts.map +1 -0
  183. package/icons/LogoutIcon.js +0 -2
  184. package/icons/MagnifierIcon.d.ts +7 -0
  185. package/icons/MagnifierIcon.d.ts.map +1 -0
  186. package/icons/MagnifierIcon.js +0 -2
  187. package/icons/MapMarkerIcon.d.ts +7 -0
  188. package/icons/MapMarkerIcon.d.ts.map +1 -0
  189. package/icons/MapMarkerIcon.js +1 -3
  190. package/icons/MoreIcon.d.ts +7 -0
  191. package/icons/MoreIcon.d.ts.map +1 -0
  192. package/icons/MoreIcon.js +1 -3
  193. package/icons/MoreVertIcon.d.ts +7 -0
  194. package/icons/MoreVertIcon.d.ts.map +1 -0
  195. package/icons/MoreVertIcon.js +1 -3
  196. package/icons/NotificationIcon.d.ts +7 -0
  197. package/icons/NotificationIcon.d.ts.map +1 -0
  198. package/icons/NotificationIcon.js +1 -3
  199. package/icons/PersonIcon.d.ts +9 -0
  200. package/icons/PersonIcon.d.ts.map +1 -0
  201. package/icons/PersonIcon.js +0 -3
  202. package/icons/PhoneIcon.d.ts +7 -0
  203. package/icons/PhoneIcon.d.ts.map +1 -0
  204. package/icons/PhoneIcon.js +1 -4
  205. package/icons/PlaceholderIcon.d.ts +7 -0
  206. package/icons/PlaceholderIcon.d.ts.map +1 -0
  207. package/icons/PlaceholderIcon.js +0 -2
  208. package/icons/RadioCheckedIcon.d.ts +10 -0
  209. package/icons/RadioCheckedIcon.d.ts.map +1 -0
  210. package/icons/RadioCheckedIcon.js +0 -2
  211. package/icons/RadioUncheckedIcon.d.ts +10 -0
  212. package/icons/RadioUncheckedIcon.d.ts.map +1 -0
  213. package/icons/RadioUncheckedIcon.js +0 -2
  214. package/icons/SecurityIcon.d.ts +7 -0
  215. package/icons/SecurityIcon.d.ts.map +1 -0
  216. package/icons/SecurityIcon.js +0 -2
  217. package/icons/ShippingMethodIcon.d.ts +7 -0
  218. package/icons/ShippingMethodIcon.d.ts.map +1 -0
  219. package/icons/ShippingMethodIcon.js +0 -2
  220. package/icons/ShoppingCartIcon.d.ts +7 -0
  221. package/icons/ShoppingCartIcon.d.ts.map +1 -0
  222. package/icons/ShoppingCartIcon.js +0 -2
  223. package/icons/SortIcon.d.ts +7 -0
  224. package/icons/SortIcon.d.ts.map +1 -0
  225. package/icons/SortIcon.js +0 -2
  226. package/icons/StarHalfIcon.d.ts +7 -0
  227. package/icons/StarHalfIcon.d.ts.map +1 -0
  228. package/icons/StarHalfIcon.js +0 -9
  229. package/icons/StarIcon.d.ts +7 -0
  230. package/icons/StarIcon.d.ts.map +1 -0
  231. package/icons/StarIcon.js +0 -9
  232. package/icons/StarOutlineIcon.d.ts +7 -0
  233. package/icons/StarOutlineIcon.d.ts.map +1 -0
  234. package/icons/StarOutlineIcon.js +0 -2
  235. package/icons/StopIcon.d.ts +7 -0
  236. package/icons/StopIcon.d.ts.map +1 -0
  237. package/icons/StopIcon.js +0 -2
  238. package/icons/TickIcon.d.ts +7 -0
  239. package/icons/TickIcon.d.ts.map +1 -0
  240. package/icons/TickIcon.js +0 -2
  241. package/icons/TimeIcon.d.ts +7 -0
  242. package/icons/TimeIcon.d.ts.map +1 -0
  243. package/icons/TimeIcon.js +0 -2
  244. package/icons/TrashIcon.d.ts +7 -0
  245. package/icons/TrashIcon.d.ts.map +1 -0
  246. package/icons/TrashIcon.js +0 -3
  247. package/icons/TrashOutlineIcon.d.ts +8 -0
  248. package/icons/TrashOutlineIcon.d.ts.map +1 -0
  249. package/icons/TrashOutlineIcon.js +0 -2
  250. package/icons/UncheckedIcon.d.ts +7 -0
  251. package/icons/UncheckedIcon.d.ts.map +1 -0
  252. package/icons/UncheckedIcon.js +0 -2
  253. package/icons/ViewListIcon.d.ts +7 -0
  254. package/icons/ViewListIcon.d.ts.map +1 -0
  255. package/icons/ViewListIcon.js +0 -2
  256. package/icons/VisibilityIcon.d.ts +8 -0
  257. package/icons/VisibilityIcon.d.ts.map +1 -0
  258. package/icons/VisibilityIcon.js +2 -4
  259. package/icons/VisibilityOffIcon.d.ts +8 -0
  260. package/icons/VisibilityOffIcon.d.ts.map +1 -0
  261. package/icons/VisibilityOffIcon.js +2 -4
  262. package/icons/WarningIcon.d.ts +7 -0
  263. package/icons/WarningIcon.d.ts.map +1 -0
  264. package/icons/WarningIcon.js +1 -3
  265. package/package.json +5 -5
  266. package/tsconfig.build.json +16 -0
  267. package/tsconfig.json +3 -0
  268. package/ActionButton/style.js +0 -22
  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,14 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
-
4
- /**
5
- * The styles for the container element.
6
- */
7
- const formElement = css({
8
- position: 'relative',
9
- paddingBottom: themeConfig.variables.gap.big,
10
- width: '100%'
11
- }).toString();
12
- export default {
13
- formElement
14
- };
package/Glow/style.js DELETED
@@ -1,18 +0,0 @@
1
- import { css } from 'glamor';
2
- const container = css({
3
- position: 'relative'
4
- }).toString();
5
- const glow = css({
6
- position: 'absolute',
7
- left: 0,
8
- top: 0,
9
- width: '100%',
10
- height: '100%',
11
- background: 'transparent',
12
- transition: 'background 100ms cubic-bezier(0.25, 0.1, 0.25, 1)',
13
- zIndex: 0
14
- }).toString();
15
- export default {
16
- container,
17
- glow
18
- };
@@ -1,65 +0,0 @@
1
- import { css } from 'glamor';
2
- const rotate = css.keyframes({
3
- '100%': {
4
- transform: 'rotate(360deg)'
5
- }
6
- });
7
-
8
- /**
9
- * Styles for spinner.
10
- * @param {boolean} paused Animation should be paused.
11
- * @returns {string}
12
- */
13
- const spinner = paused => {
14
- const styles = {
15
- margin: 'auto',
16
- transformOrigin: 'center center',
17
- maxWidth: '100%',
18
- maxHeight: '100%'
19
- };
20
- if (!paused) {
21
- styles.animation = `${rotate} 1.6s linear infinite`;
22
- }
23
- return css(styles).toString();
24
- };
25
- const dash = css.keyframes({
26
- '0%': {
27
- strokeDasharray: '1, 200',
28
- strokeDashoffset: '0'
29
- },
30
- '50%': {
31
- strokeDasharray: '89, 200',
32
- strokeDashoffset: '-35px'
33
- },
34
- '100%': {
35
- strokeDasharray: '89, 200',
36
- strokeDashoffset: '-124px'
37
- }
38
- });
39
-
40
- /**
41
- * Styles for the rotating circle.
42
- * @param {string} color The color of the circle. Default color is "accent".
43
- * @param {string} strokeWidth The stroke width of the circle.
44
- * @param {boolean} paused Animation should be paused.
45
- * @return {string} CSS class name.
46
- */
47
- const circle = (color, strokeWidth, paused) => {
48
- const styles = {
49
- fill: 'none',
50
- stroke: color,
51
- strokeDasharray: '1, 200',
52
- strokeDashoffset: 0,
53
- strokeLinecap: 'round',
54
- strokeMiterlimit: 10,
55
- strokeWidth
56
- };
57
- if (!paused) {
58
- styles.animation = `${dash} 1.2s ease-in-out infinite`;
59
- }
60
- return css(styles).toString();
61
- };
62
- export default {
63
- spinner,
64
- circle
65
- };
@@ -1,20 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
- export const container = css({
7
- display: 'block',
8
- padding: '1em',
9
- textAlign: 'center',
10
- fontSize: '1.5em',
11
- color: `var(--color-secondary, ${colors.accent})`
12
- });
13
- export const imgContainer = css({
14
- display: 'flex',
15
- justifyContent: 'center',
16
- ' img': {
17
- maxWidth: '50vw',
18
- maxHeight: '50vh'
19
- }
20
- });
@@ -1,5 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- export default css({
4
- color: `var(--color-primary, ${themeConfig.colors.primary})`
5
- }).toString();
@@ -1,80 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import MessageBar from "./index";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- const MESSAGE1 = 'This is some information';
6
- const MESSAGE2 = 'This is an error that happened here.';
7
- const MESSAGE3 = 'This is just a warning. Nothing to freak out about.';
8
- const MESSAGE4 = 'Normal pre-translated message.';
9
- const MESSAGE5 = 'Normal pre-translated message two.';
10
- const MESSAGE6 = 'some.translation.string';
11
- const MESSAGE7 = 'Message with messageParams';
12
- describe('<MessageBar />', () => {
13
- describe('General rendering', () => {
14
- it('should be empty if no messages have been set', () => {
15
- const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
16
- messages: []
17
- }));
18
- expect(wrapper).toMatchSnapshot();
19
- });
20
- it('should render a message as info if type is missing', () => {
21
- const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
22
- messages: [{
23
- message: 'something'
24
- }]
25
- }));
26
- expect(wrapper).toMatchSnapshot();
27
- });
28
- });
29
- describe('Multiple messages rendering', () => {
30
- it('should render messages without frontend translation', () => {
31
- const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
32
- messages: [{
33
- type: 'info',
34
- message: MESSAGE1
35
- }, {
36
- type: 'error',
37
- message: MESSAGE2
38
- }, {
39
- type: 'warning',
40
- message: MESSAGE3
41
- }, {
42
- message: MESSAGE4,
43
- translated: null
44
- }, {
45
- message: MESSAGE5,
46
- translated: true
47
- }]
48
- }));
49
- expect(wrapper).toMatchSnapshot();
50
- });
51
- it('should translate and render all given messages', () => {
52
- const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
53
- messages: [{
54
- message: MESSAGE6,
55
- translated: false
56
- }, {
57
- message: MESSAGE7,
58
- messageParams: {
59
- myCustomParam1: '-> TEST-VALUE #1 <-',
60
- myCustomParam2: '-> TEST-VALUE #2 <-'
61
- },
62
- translated: false
63
- }]
64
- }));
65
- expect(wrapper).toMatchSnapshot();
66
- });
67
- it('should render with custom classNames', () => {
68
- const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
69
- messages: [{
70
- message: MESSAGE1
71
- }],
72
- classNames: {
73
- container: 'cls-container',
74
- message: 'cls-message'
75
- }
76
- }));
77
- expect(wrapper).toMatchSnapshot();
78
- });
79
- });
80
- });
@@ -1,38 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors,
5
- variables
6
- } = themeConfig;
7
- const container = css({
8
- background: colors.background,
9
- display: 'flex',
10
- flexDirection: 'column',
11
- flexShrink: 0
12
- }).toString();
13
- const messageBase = {
14
- padding: `${variables.gap.small}px ${variables.gap.big}px`,
15
- fontSize: '0.875rem',
16
- fontWeight: 500,
17
- ':not(:last-child)': {
18
- marginBottom: variables.gap.small * 0.5
19
- }
20
- };
21
- const info = css(messageBase, {
22
- background: `var(--color-secondary, ${colors.accent})`,
23
- color: `var(--color-secondary-contrast, ${colors.accentContrast})`
24
- }).toString();
25
- const error = css(messageBase, {
26
- background: colors.error,
27
- color: colors.light
28
- }).toString();
29
- const warning = css(messageBase, {
30
- background: colors.warning,
31
- color: colors.light
32
- }).toString();
33
- export default {
34
- container,
35
- info,
36
- error,
37
- warning
38
- };
@@ -1,17 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeColors } from '@shopgate/pwa-common/helpers/config';
3
- const magnifier = css({
4
- fill: 'currentColor'
5
- }).toString();
6
- const background = css({
7
- fill: themeColors.light
8
- }).toString();
9
- const circle = css({
10
- fill: 'currentColor',
11
- opacity: 0.065
12
- }).toString();
13
- export default {
14
- magnifier,
15
- background,
16
- circle
17
- };
@@ -1,31 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const wrapper = css({
4
- alignItems: 'center',
5
- display: 'flex',
6
- flexDirection: 'column',
7
- height: '100%',
8
- width: '100%',
9
- justifyContent: 'center',
10
- textAlign: 'center',
11
- background: `var(--page-background-color, ${themeConfig.colors.shade8})`
12
- }).toString();
13
- const icon = css({
14
- width: 216,
15
- color: `var(--color-primary, ${themeConfig.colors.primary})`
16
- }).toString();
17
- const headline = css({
18
- fontSize: '1.25rem',
19
- fontWeight: 500,
20
- marginTop: 30
21
- }).toString();
22
- const text = css({
23
- marginTop: themeConfig.variables.gap.big,
24
- padding: `0 ${themeConfig.variables.gap.big}px`
25
- }).toString();
26
- export default {
27
- wrapper,
28
- icon,
29
- headline,
30
- text
31
- };
@@ -1,11 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors: {
5
- shade7
6
- }
7
- } = themeConfig;
8
- export default css({
9
- background: `var(--color-background-accent, ${shade7})`,
10
- position: 'relative'
11
- });
@@ -1,12 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const label = css({
4
- background: themeConfig.colors.dark,
5
- opacity: 0.1,
6
- width: '100%',
7
- height: 16,
8
- marginBottom: 12
9
- }).toString();
10
- export default {
11
- label
12
- };
package/Price/style.js DELETED
@@ -1,22 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const container = css({
4
- display: 'flex',
5
- position: 'relative',
6
- whiteSpace: 'nowrap'
7
- }).toString();
8
- const disclaimer = css({
9
- color: 'initial',
10
- fontSize: 14,
11
- position: 'absolute',
12
- right: -10,
13
- top: 0
14
- }).toString();
15
- const discounted = css({
16
- color: `var(--color-primary, ${themeConfig.colors.primary})`
17
- }).toString();
18
- export default {
19
- container,
20
- disclaimer,
21
- discounted
22
- };
@@ -1,5 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- export default css({
4
- color: themeConfig.colors.shade3
5
- }).toString();
@@ -1,36 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeColors } from '@shopgate/pwa-common/helpers/config';
3
- const basic = css({
4
- whiteSpace: 'nowrap',
5
- '& span': {
6
- position: 'relative',
7
- ':before': {
8
- // The strike-through effect is achieved by using the :before pseudo-class.
9
- borderColor: 'currentColor',
10
- content: '""',
11
- position: 'absolute',
12
- left: 0,
13
- right: 0,
14
- top: '50%'
15
- }
16
- },
17
- color: themeColors.shade11
18
- }).toString();
19
-
20
- /**
21
- * Returns a class for the rotated strike-through line.
22
- * @param {number} angle The calculated angle for the strike-through line.
23
- * @returns {string} Classname
24
- */
25
- const getAngleStyle = angle => css({
26
- '& span': {
27
- ':before': {
28
- borderTop: '1px solid',
29
- transform: `rotate(-${angle}deg)`
30
- }
31
- }
32
- }).toString();
33
- export default {
34
- basic,
35
- getAngleStyle
36
- };
@@ -1,85 +0,0 @@
1
- import { css } from 'glamor';
2
- import Color from 'color';
3
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
4
- import { getCSSCustomProp } from '@shopgate/engage/styles';
5
- const {
6
- colors
7
- } = themeConfig;
8
- const progressBarHeight = 4;
9
-
10
- /**
11
- * Dynamically creates the class for the ProgressBar wrapper
12
- * @returns {string}
13
- */
14
- const wrapper = () => css({
15
- position: 'absolute',
16
- bottom: 0,
17
- background: Color(getCSSCustomProp('--color-secondary') || colors.accent).fade(0.6),
18
- width: '100%',
19
- height: progressBarHeight,
20
- overflow: 'hidden',
21
- transition: 'transform 150ms cubic-bezier(0.25, 0.1, 0.25, 1)',
22
- zIndex: '10'
23
- }).toString();
24
- const innerElement = css({
25
- ':before': {
26
- content: '""',
27
- position: 'absolute',
28
- background: `var(--color-secondary, ${colors.accent})`,
29
- top: 0,
30
- left: 0,
31
- bottom: 0,
32
- willChange: 'left, right'
33
- },
34
- ':after': {
35
- content: '""',
36
- position: 'absolute',
37
- background: `var(--color-secondary, ${colors.accent})`,
38
- top: 0,
39
- left: 0,
40
- bottom: 0,
41
- willChange: 'left, right'
42
- }
43
- }).toString();
44
- const indeterminateLong = css.keyframes({
45
- '0%': {
46
- left: '-35%',
47
- right: '100%'
48
- },
49
- '60%': {
50
- left: '100%',
51
- right: '-90%'
52
- },
53
- '100%': {
54
- left: '100%',
55
- right: '-90%'
56
- }
57
- });
58
- const indeterminateShort = css.keyframes({
59
- '0%': {
60
- left: '-200%',
61
- right: '100%'
62
- },
63
- '60%': {
64
- left: '107%',
65
- right: '-8%'
66
- },
67
- '100%': {
68
- left: '107%',
69
- right: '-8%'
70
- }
71
- });
72
- const animating = css({
73
- ':before': {
74
- animation: `${indeterminateLong} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
75
- },
76
- ':after': {
77
- animation: `${indeterminateShort} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite`,
78
- animationDelay: '1.15s'
79
- }
80
- }).toString();
81
- export default {
82
- wrapper,
83
- innerElement,
84
- animating
85
- };
@@ -1,21 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
- const baseIcon = {
7
- width: 24,
8
- height: 24
9
- };
10
- const checkedIcon = css({
11
- ...baseIcon,
12
- color: `var(--color-secondary, ${colors.accent})`
13
- }).toString();
14
- const uncheckedIcon = css({
15
- ...baseIcon,
16
- color: colors.shade6
17
- }).toString();
18
- export default {
19
- checkedIcon,
20
- uncheckedIcon
21
- };
@@ -1,53 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
- const container = css({
7
- position: 'relative'
8
- }).toString();
9
- const icon = css({
10
- display: 'inline-block',
11
- verticalAlign: 'top',
12
- outline: 0
13
- }).toString();
14
- const emptyStars = css({
15
- color: themeConfig.colors.shade7
16
- }).toString();
17
- const filledStars = css({
18
- position: 'absolute',
19
- color: `var(--color-primary, ${colors.primary})`,
20
- top: 0
21
- }).toString();
22
-
23
- /**
24
- * The rating stars styles that can be selected by passing the style key to the
25
- * @type {Object}
26
- */
27
- const iconStyles = {
28
- small: {
29
- iconSize: '1em',
30
- iconStyle: css({
31
- marginRight: '0.1em'
32
- }).toString()
33
- },
34
- big: {
35
- iconSize: '1.24em',
36
- iconStyle: css({
37
- marginRight: '0.12em'
38
- }).toString()
39
- },
40
- large: {
41
- iconSize: '2.3em',
42
- iconStyle: css({
43
- marginRight: '0.23em'
44
- }).toString()
45
- }
46
- };
47
- export default {
48
- container,
49
- icon,
50
- iconStyles,
51
- emptyStars,
52
- filledStars
53
- };
package/Ripple/style.js DELETED
@@ -1,18 +0,0 @@
1
- import { css } from 'glamor';
2
- const ripple = css({
3
- position: 'absolute',
4
- borderRadius: '50%',
5
- transformOrigin: '50% 50% 0'
6
- }).toString();
7
- const container = css({
8
- position: 'absolute',
9
- zIndex: 0,
10
- top: 0,
11
- left: 0,
12
- width: '100%',
13
- height: '100%'
14
- }).toString();
15
- export default {
16
- ripple,
17
- container
18
- };
@@ -1,40 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeVariables, themeColors } from '@shopgate/pwa-common/helpers/config';
3
- const edgeHeight = 45;
4
- const edgeWidth = 35;
5
- const edgeBorderWidth = 3;
6
- const edgeOffsetHorizontal = themeVariables.gap.xbig;
7
- const edgeOffsetVertical = themeVariables.gap.xxbig;
8
- export default css({
9
- height: '90%',
10
- width: '100%',
11
- ':before,:after,>:before,>:after': {
12
- display: 'block',
13
- content: ' ',
14
- width: edgeWidth,
15
- height: edgeHeight,
16
- position: 'absolute',
17
- borderStyle: 'solid',
18
- borderColor: themeColors.light
19
- },
20
- ':before': {
21
- top: edgeOffsetVertical,
22
- left: edgeOffsetHorizontal,
23
- borderWidth: `${edgeBorderWidth}px 0 0 ${edgeBorderWidth}px`
24
- },
25
- ':after': {
26
- top: edgeOffsetVertical,
27
- right: edgeOffsetHorizontal,
28
- borderWidth: `${edgeBorderWidth}px ${edgeBorderWidth}px 0 0`
29
- },
30
- '>:before': {
31
- bottom: edgeOffsetVertical,
32
- left: edgeOffsetHorizontal,
33
- borderWidth: `0 0 ${edgeBorderWidth}px ${edgeBorderWidth}px`
34
- },
35
- '>:after': {
36
- bottom: edgeOffsetVertical,
37
- right: edgeOffsetHorizontal,
38
- borderWidth: `0 ${edgeBorderWidth}px ${edgeBorderWidth}px 0`
39
- }
40
- }).toString();
@@ -1,28 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const button = css({
4
- alignItems: 'center',
5
- color: 'inherit',
6
- display: 'flex',
7
- flexShrink: 0,
8
- fontSize: 24,
9
- height: 44,
10
- justifyContent: 'center',
11
- outline: 0,
12
- padding: 0,
13
- position: 'relative',
14
- width: 44,
15
- zIndex: 1
16
- }).toString();
17
- const iconWrapper = css({
18
- width: 72
19
- }).toString();
20
- const icon = css({
21
- boxSizing: 'content-box',
22
- color: `var(--color-secondary, ${themeConfig.colors.accent})`
23
- }).toString();
24
- export default {
25
- button,
26
- iconWrapper,
27
- icon
28
- };
@@ -1,20 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeShadows, themeColors, themeVariables } from '@shopgate/pwa-common/helpers/config';
3
- const container = css({
4
- bottom: 0,
5
- backgroundColor: themeColors.overlay,
6
- boxShadow: themeShadows.scannerBar,
7
- fontSize: 14,
8
- alignItems: 'center',
9
- paddingBottom: 'var(--safe-area-inset-bottom)'
10
- }).toString();
11
- const column = css({
12
- margin: `${themeVariables.gap.big}px`,
13
- ':not(:first-child)': {
14
- marginLeft: 0
15
- }
16
- }).toString();
17
- export default {
18
- container,
19
- column
20
- };