@shopgate/pwa-ui-shared 7.30.0-alpha.7 → 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
@@ -1,32 +1,148 @@
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{css}from'glamor';import spring from'css-spring';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var options={stiffness:381.47,damping:15};var buttonSize=40;var iconSize=20;/**
1
+ import { css } from 'glamor';
2
+ import spring from 'css-spring';
3
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
4
+ const options = {
5
+ stiffness: 381.47,
6
+ damping: 15
7
+ };
8
+ const buttonSize = 40;
9
+ const iconSize = 20;
10
+
11
+ /**
2
12
  * Keyframe animations to create spring animation.
3
13
  * spring(..) automatically calculates all steps for the keyframe animation.
4
- */var springFromTopKeyframes=css.keyframes(spring({transform:'translate3d(0, 300%, 0)'},{transform:'translate3d(0, -50%, 0)'},options));var springFromBottomKeyframes=css.keyframes(spring({transform:'translate3d(0, -300%, 0)'},{transform:'translate3d(0, -50%, 0)'},options));var springToTopKeyframes=css.keyframes(spring({transform:'translate3d(0, -50%, 0)'},{transform:'translate3d(0, 300%, 0)'},options));var springToBottomKeyframes=css.keyframes(spring({transform:'translate3d(0, -50%, 0)'},{transform:'translate3d(0, -300%, 0)'},options));var springFromBottom=css({animation:"".concat(springFromBottomKeyframes," 600ms")}).toString();var springFromTop=css({animation:"".concat(springFromTopKeyframes," 600ms")}).toString();var springToTop=css({animation:"".concat(springToTopKeyframes," 600ms")}).toString();var springToBottom=css({animation:"".concat(springToBottomKeyframes," 600ms")}).toString();/**
14
+ */
15
+ const springFromTopKeyframes = css.keyframes(spring({
16
+ transform: 'translate3d(0, 300%, 0)'
17
+ }, {
18
+ transform: 'translate3d(0, -50%, 0)'
19
+ }, options));
20
+ const springFromBottomKeyframes = css.keyframes(spring({
21
+ transform: 'translate3d(0, -300%, 0)'
22
+ }, {
23
+ transform: 'translate3d(0, -50%, 0)'
24
+ }, options));
25
+ const springToTopKeyframes = css.keyframes(spring({
26
+ transform: 'translate3d(0, -50%, 0)'
27
+ }, {
28
+ transform: 'translate3d(0, 300%, 0)'
29
+ }, options));
30
+ const springToBottomKeyframes = css.keyframes(spring({
31
+ transform: 'translate3d(0, -50%, 0)'
32
+ }, {
33
+ transform: 'translate3d(0, -300%, 0)'
34
+ }, options));
35
+ const springFromBottom = css({
36
+ animation: `${springFromBottomKeyframes} 600ms`
37
+ }).toString();
38
+ const springFromTop = css({
39
+ animation: `${springFromTopKeyframes} 600ms`
40
+ }).toString();
41
+ const springToTop = css({
42
+ animation: `${springToTopKeyframes} 600ms`
43
+ }).toString();
44
+ const springToBottom = css({
45
+ animation: `${springToBottomKeyframes} 600ms`
46
+ }).toString();
47
+
48
+ /**
5
49
  * Circular button and container for the icons.
6
50
  * Default styles.
7
51
  * @param {number} bSize Size of the button.
8
52
  * @param {number} iSize Size of the icon.
9
53
  * @return {string} Class name
10
- */var buttonWrapperDefault=function buttonWrapperDefault(bSize,iSize){return{transition:'background 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',borderRadius:'50%',width:bSize,height:bSize,position:'relative',fontSize:iSize,outline:0,paddingLeft:(bSize-iSize)/2,paddingRight:(bSize-iSize)/2,zIndex:2,// Prevents the icons to be visible outside of the circle
11
- overflow:'hidden',flexShrink:0};};/**
54
+ */
55
+ const buttonWrapperDefault = (bSize, iSize) => ({
56
+ transition: 'background 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',
57
+ borderRadius: '50%',
58
+ width: bSize,
59
+ height: bSize,
60
+ position: 'relative',
61
+ fontSize: iSize,
62
+ outline: 0,
63
+ paddingLeft: (bSize - iSize) / 2,
64
+ paddingRight: (bSize - iSize) / 2,
65
+ zIndex: 2,
66
+ // Prevents the icons to be visible outside of the circle
67
+ overflow: 'hidden',
68
+ flexShrink: 0
69
+ });
70
+ /**
12
71
  * Circular button and container for the icons.
13
72
  * @param {number} bSize Size of the button.
14
73
  * @param {number} iSize Size of the icon.
15
74
  * @return {string} Class name
16
- */var buttonWrapper=function buttonWrapper(bSize,iSize){return css(_extends({},buttonWrapperDefault(bSize,iSize))).toString();};/**
75
+ */
76
+ const buttonWrapper = (bSize, iSize) => css({
77
+ ...buttonWrapperDefault(bSize, iSize)
78
+ }).toString();
79
+
80
+ /**
17
81
  * Circular button and container for the icons.
18
82
  * Without shadow.
19
83
  * @param {number} bSize Size of the button.
20
84
  * @param {number} iSize Size of the icon.
21
85
  * @return {string} Class name
22
- */var buttonWrapperNoShadow=function buttonWrapperNoShadow(bSize,iSize){return css(_extends({},buttonWrapperDefault(bSize,iSize))).toString();};/**
86
+ */
87
+ const buttonWrapperNoShadow = (bSize, iSize) => css({
88
+ ...buttonWrapperDefault(bSize, iSize)
89
+ }).toString();
90
+
91
+ /**
23
92
  * Styling that is applied to the button when cart icon is shown.
24
- */var buttonReady=css({background:"var(--color-button-cta, ".concat(themeConfig.colors.cta,")"),color:"var(--color-button-cta-contrast, ".concat(themeConfig.colors.ctaContrast,")")}).toString();/**
93
+ */
94
+ const buttonReady = css({
95
+ background: `var(--color-button-cta, ${themeConfig.colors.cta})`,
96
+ color: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`
97
+ }).toString();
98
+
99
+ /**
25
100
  * Styling that is applied to the button when checkmark is shown.
26
- */var buttonSuccess=css({background:"var(--color-button-cta-contrast, ".concat(themeConfig.colors.ctaContrast,")"),color:"var(--color-button-cta, ".concat(themeConfig.colors.cta,")")}).toString();/**
101
+ */
102
+ const buttonSuccess = css({
103
+ background: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`,
104
+ color: `var(--color-button-cta, ${themeConfig.colors.cta})`
105
+ }).toString();
106
+
107
+ /**
27
108
  * Styling that is applied to the button when it is disabled.
28
- */var buttonDisabled=css({background:themeConfig.colors.shade5,color:"var(--color-button-cta-contrast, ".concat(themeConfig.colors.ctaContrast,")"),boxShadow:themeConfig.shadows.buttons.disabled}).toString();/**
109
+ */
110
+ const buttonDisabled = css({
111
+ background: themeConfig.colors.shade5,
112
+ color: `var(--color-button-cta-contrast, ${themeConfig.colors.ctaContrast})`,
113
+ boxShadow: themeConfig.shadows.buttons.disabled
114
+ }).toString();
115
+
116
+ /**
29
117
  * Basic icon style that is always applied to all icons.
30
- */var icon=css({transition:'opacity 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',opacity:1,position:'absolute'}).toString();/**
118
+ */
119
+ const icon = css({
120
+ transition: 'opacity 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',
121
+ opacity: 1,
122
+ position: 'absolute'
123
+ }).toString();
124
+
125
+ /**
31
126
  * Icon style that is applied only to the spinner icon.
32
- */var spinnerIcon=css({left:'50%',top:'50%',marginTop:-themeConfig.variables.loadingIndicator.size/2,marginLeft:-themeConfig.variables.loadingIndicator.size/2}).toString();export default{buttonWrapper:buttonWrapper,buttonWrapperNoShadow:buttonWrapperNoShadow,buttonReady:buttonReady,buttonSuccess:buttonSuccess,buttonDisabled:buttonDisabled,buttonSize:buttonSize,icon:icon,iconSize:iconSize,spinnerIcon:spinnerIcon,springFromBottom:springFromBottom,springFromTop:springFromTop,springToBottom:springToBottom,springToTop:springToTop};
127
+ */
128
+ const spinnerIcon = css({
129
+ left: '50%',
130
+ top: '50%',
131
+ marginTop: -themeConfig.variables.loadingIndicator.size / 2,
132
+ marginLeft: -themeConfig.variables.loadingIndicator.size / 2
133
+ }).toString();
134
+ export default {
135
+ buttonWrapper,
136
+ buttonWrapperNoShadow,
137
+ buttonReady,
138
+ buttonSuccess,
139
+ buttonDisabled,
140
+ buttonSize,
141
+ icon,
142
+ iconSize,
143
+ spinnerIcon,
144
+ springFromBottom,
145
+ springFromTop,
146
+ springToBottom,
147
+ springToTop
148
+ };
@@ -1,4 +1,9 @@
1
- import React from'react';import PropTypes from'prop-types';import{AVAILABILITY_STATE_OK,AVAILABILITY_STATE_WARNING,AVAILABILITY_STATE_ALERT}from'@shopgate/pwa-common-commerce/product/constants';import styles from"./style";/**
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { AVAILABILITY_STATE_OK, AVAILABILITY_STATE_WARNING, AVAILABILITY_STATE_ALERT } from '@shopgate/pwa-common-commerce/product/constants';
4
+ import styles from "./style";
5
+
6
+ /**
2
7
  * This component renders the availability text for a product
3
8
  * @param {Object} props The component props
4
9
  * @param {string} props.text The availability text
@@ -7,4 +12,31 @@ import React from'react';import PropTypes from'prop-types';import{AVAILABILITY_S
7
12
  * state of the availability text is "ok"
8
13
  * @param {string} [props.className] CSS classes
9
14
  * @return {JSX}
10
- */var Availability=function Availability(_ref){var text=_ref.text,state=_ref.state,_ref$showWhenAvailabl=_ref.showWhenAvailable,showWhenAvailable=_ref$showWhenAvailabl===void 0?false:_ref$showWhenAvailabl,_ref$className=_ref.className,className=_ref$className===void 0?null:_ref$className;if(!text||state===AVAILABILITY_STATE_OK&&!showWhenAvailable){return null;}var style=styles.stateOk;if(state===AVAILABILITY_STATE_WARNING){style=styles.stateWarning;}if(state===AVAILABILITY_STATE_ALERT){style=styles.stateAlert;}return React.createElement("div",{className:"ui-shared__availability ".concat(className," ").concat(style),"data-test-id":"availabilityText: ".concat(text)},text);};Availability.defaultProps={className:'',showWhenAvailable:false,state:AVAILABILITY_STATE_OK};export default Availability;
15
+ */
16
+ const Availability = ({
17
+ text,
18
+ state,
19
+ showWhenAvailable = false,
20
+ className = null
21
+ }) => {
22
+ if (!text || state === AVAILABILITY_STATE_OK && !showWhenAvailable) {
23
+ return null;
24
+ }
25
+ let style = styles.stateOk;
26
+ if (state === AVAILABILITY_STATE_WARNING) {
27
+ style = styles.stateWarning;
28
+ }
29
+ if (state === AVAILABILITY_STATE_ALERT) {
30
+ style = styles.stateAlert;
31
+ }
32
+ return /*#__PURE__*/React.createElement("div", {
33
+ className: `ui-shared__availability ${className} ${style}`,
34
+ "data-test-id": `availabilityText: ${text}`
35
+ }, text);
36
+ };
37
+ Availability.defaultProps = {
38
+ className: '',
39
+ showWhenAvailable: false,
40
+ state: AVAILABILITY_STATE_OK
41
+ };
42
+ export default Availability;
@@ -1 +1,41 @@
1
- import React from'react';import{mount}from'enzyme';import{AVAILABILITY_STATE_OK,AVAILABILITY_STATE_WARNING,AVAILABILITY_STATE_ALERT}from'@shopgate/pwa-common-commerce/product/constants';import Availability from"./index";describe('<Availability />',function(){it('should not render when text is empty',function(){var wrapper=mount(React.createElement(Availability,{text:""}));expect(wrapper).toMatchSnapshot();});it('should not render by default if state is "ok"',function(){var wrapper=mount(React.createElement(Availability,{state:AVAILABILITY_STATE_OK,text:"Available"}));expect(wrapper).toMatchSnapshot();});it('should render if state is "ok" when "showWhenAvailable" is set',function(){var wrapper=mount(React.createElement(Availability,{state:AVAILABILITY_STATE_OK,text:"Available",showWhenAvailable:true}));expect(wrapper).toMatchSnapshot();});it('should render if state is "warning"',function(){var wrapper=mount(React.createElement(Availability,{state:AVAILABILITY_STATE_WARNING,text:"Only 5 left"}));expect(wrapper).toMatchSnapshot();});it('should render if state is "warning"',function(){var wrapper=mount(React.createElement(Availability,{state:AVAILABILITY_STATE_ALERT,text:"Out of stock"}));expect(wrapper).toMatchSnapshot();});});
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import { AVAILABILITY_STATE_OK, AVAILABILITY_STATE_WARNING, AVAILABILITY_STATE_ALERT } from '@shopgate/pwa-common-commerce/product/constants';
4
+ import Availability from "./index";
5
+ describe('<Availability />', () => {
6
+ it('should not render when text is empty', () => {
7
+ const wrapper = mount(/*#__PURE__*/React.createElement(Availability, {
8
+ text: ""
9
+ }));
10
+ expect(wrapper).toMatchSnapshot();
11
+ });
12
+ it('should not render by default if state is "ok"', () => {
13
+ const wrapper = mount(/*#__PURE__*/React.createElement(Availability, {
14
+ state: AVAILABILITY_STATE_OK,
15
+ text: "Available"
16
+ }));
17
+ expect(wrapper).toMatchSnapshot();
18
+ });
19
+ it('should render if state is "ok" when "showWhenAvailable" is set', () => {
20
+ const wrapper = mount(/*#__PURE__*/React.createElement(Availability, {
21
+ state: AVAILABILITY_STATE_OK,
22
+ text: "Available",
23
+ showWhenAvailable: true
24
+ }));
25
+ expect(wrapper).toMatchSnapshot();
26
+ });
27
+ it('should render if state is "warning"', () => {
28
+ const wrapper = mount(/*#__PURE__*/React.createElement(Availability, {
29
+ state: AVAILABILITY_STATE_WARNING,
30
+ text: "Only 5 left"
31
+ }));
32
+ expect(wrapper).toMatchSnapshot();
33
+ });
34
+ it('should render if state is "warning"', () => {
35
+ const wrapper = mount(/*#__PURE__*/React.createElement(Availability, {
36
+ state: AVAILABILITY_STATE_ALERT,
37
+ text: "Out of stock"
38
+ }));
39
+ expect(wrapper).toMatchSnapshot();
40
+ });
41
+ });
@@ -1 +1,19 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var stateOk=css({fontSize:'0.875rem',color:"var(--color-state-ok, ".concat(themeConfig.colors.success,")")}).toString();var stateWarning=css({fontSize:'0.875rem',color:"var(--color-state-warning, ".concat(themeConfig.colors.warning,")")}).toString();var stateAlert=css({fontSize:'0.875rem',color:"var(--color-state-alert, ".concat(themeConfig.colors.error,")")}).toString();export default{stateOk:stateOk,stateWarning:stateWarning,stateAlert:stateAlert};
1
+ import { css } from 'glamor';
2
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+ const stateOk = css({
4
+ fontSize: '0.875rem',
5
+ color: `var(--color-state-ok, ${themeConfig.colors.success})`
6
+ }).toString();
7
+ const stateWarning = css({
8
+ fontSize: '0.875rem',
9
+ color: `var(--color-state-warning, ${themeConfig.colors.warning})`
10
+ }).toString();
11
+ const stateAlert = css({
12
+ fontSize: '0.875rem',
13
+ color: `var(--color-state-alert, ${themeConfig.colors.error})`
14
+ }).toString();
15
+ export default {
16
+ stateOk,
17
+ stateWarning,
18
+ stateAlert
19
+ };
package/Button/index.js CHANGED
@@ -1,14 +1,85 @@
1
- var _excluded=["className","disabled","onClick","testId","type","wrapContent","flat"];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 _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;}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';import BaseButton from'@shopgate/pwa-common/components/Button';import styles from"./style";/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { Component } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import BaseButton from '@shopgate/pwa-common/components/Button';
5
+ import styles from "./style";
6
+ /**
2
7
  * The basic button component. This components applies Material Design styles and acts as
3
8
  * base to more feature-rich button components such as ActionButton and RippleButton, but can
4
9
  * also be used as standalone component or any other kind of new button.
5
- */var Button=/*#__PURE__*/function(_Component){function Button(){_classCallCheck(this,Button);return _callSuper(this,Button,arguments);}_inherits(Button,_Component);return _createClass(Button,[{key:"style",get:/**
10
+ */
11
+ class Button extends Component {
12
+ /**
6
13
  * Getter for style depending on prop type.
7
14
  * @returns {Object}
8
- */function get(){var _this$props=this.props,flat=_this$props.flat,disabled=_this$props.disabled;switch(this.props.type){case'plain':return styles.plain();case'regular':return styles.regular(disabled);case'simple':return styles.simple(disabled);default:case'primary':return styles.primary(disabled,flat);case'secondary':return styles.secondary(disabled,flat);}}/**
15
+ */
16
+ get style() {
17
+ const {
18
+ flat,
19
+ disabled
20
+ } = this.props;
21
+ switch (this.props.type) {
22
+ case 'plain':
23
+ return styles.plain();
24
+ case 'regular':
25
+ return styles.regular(disabled);
26
+ case 'simple':
27
+ return styles.simple(disabled);
28
+ default:
29
+ case 'primary':
30
+ return styles.primary(disabled, flat);
31
+ case 'secondary':
32
+ return styles.secondary(disabled, flat);
33
+ }
34
+ }
35
+
36
+ /**
9
37
  * Getter for the calculated button props.
10
38
  * @returns {Object}
11
- */},{key:"buttonProps",get:function get(){var _this$props2=this.props,className=_this$props2.className,disabled=_this$props2.disabled,onClick=_this$props2.onClick,testId=_this$props2.testId,type=_this$props2.type,wrapContent=_this$props2.wrapContent,flat=_this$props2.flat,rest=_objectWithoutProperties(_this$props2,_excluded);var buttonProps=_extends({className:className,disabled:disabled,onClick:onClick},rest);return buttonProps;}/**
39
+ */
40
+ get buttonProps() {
41
+ const {
42
+ className,
43
+ disabled,
44
+ onClick,
45
+ testId,
46
+ type,
47
+ wrapContent,
48
+ flat,
49
+ ...rest
50
+ } = this.props;
51
+ const buttonProps = {
52
+ className,
53
+ disabled,
54
+ onClick,
55
+ ...rest
56
+ };
57
+ return buttonProps;
58
+ }
59
+
60
+ /**
12
61
  * Renders the component.
13
62
  * @return {JSX}
14
- */},{key:"render",value:function render(){var style=this.style;var content=this.props.wrapContent?React.createElement("div",{className:style.content},this.props.children):this.props.children;return React.createElement(BaseButton,_extends({},this.buttonProps,{className:"ui-shared__button ".concat(style.button," ").concat(this.props.className),testId:this.props.testId}),content);}}]);}(Component);_defineProperty(Button,"defaultProps",_extends({},BaseButton.defaultProps,{className:'',flat:false,type:'primary',wrapContent:true,testId:'Button'}));export default Button;
63
+ */
64
+ render() {
65
+ const {
66
+ style
67
+ } = this;
68
+ const content = this.props.wrapContent ? /*#__PURE__*/React.createElement("div", {
69
+ className: style.content
70
+ }, this.props.children) : this.props.children;
71
+ return /*#__PURE__*/React.createElement(BaseButton, _extends({}, this.buttonProps, {
72
+ className: `ui-shared__button ${style.button} ${this.props.className}`,
73
+ testId: this.props.testId
74
+ }), content);
75
+ }
76
+ }
77
+ Button.defaultProps = {
78
+ ...BaseButton.defaultProps,
79
+ className: '',
80
+ flat: false,
81
+ type: 'primary',
82
+ wrapContent: true,
83
+ testId: 'Button'
84
+ };
85
+ export default Button;
package/Button/spec.js CHANGED
@@ -1 +1,33 @@
1
- import trim from'lodash/trim';import React from'react';import{shallow}from'enzyme';import Button from"./index";import styles from"./style";describe('<Button />',function(){it('should render as a regular button if type is omitted',function(){var wrapper=shallow(React.createElement(Button,null,"Press me"));expect(wrapper).toMatchSnapshot();expect(wrapper.render().text()).toEqual('Press me');});it('should render as a regular button if type is explicitly defined',function(){var wrapper=shallow(React.createElement(Button,{type:"regular"},"Press me"));expect(wrapper).toMatchSnapshot();expect(trim(wrapper.prop('className'))).toEqual("ui-shared__button ".concat(styles.regular(false).button));});it('should render as a primary button',function(){var wrapper=shallow(React.createElement(Button,{type:"primary"},"Press me"));expect(trim(wrapper.prop('className'))).toEqual("ui-shared__button ".concat(styles.primary(false,false).button));expect(wrapper).toMatchSnapshot();});it('should render as a secondary button',function(){var wrapper=shallow(React.createElement(Button,{type:"secondary"},"Press me"));expect(trim(wrapper.prop('className'))).toEqual("ui-shared__button ".concat(styles.secondary(false,false).button));expect(wrapper).toMatchSnapshot();});});
1
+ import trim from 'lodash/trim';
2
+ import React from 'react';
3
+ import { shallow } from 'enzyme';
4
+ import Button from "./index";
5
+ import styles from "./style";
6
+ describe('<Button />', () => {
7
+ it('should render as a regular button if type is omitted', () => {
8
+ const wrapper = shallow(/*#__PURE__*/React.createElement(Button, null, "Press me"));
9
+ expect(wrapper).toMatchSnapshot();
10
+ expect(wrapper.render().text()).toEqual('Press me');
11
+ });
12
+ it('should render as a regular button if type is explicitly defined', () => {
13
+ const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
14
+ type: "regular"
15
+ }, "Press me"));
16
+ expect(wrapper).toMatchSnapshot();
17
+ expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.regular(false).button}`);
18
+ });
19
+ it('should render as a primary button', () => {
20
+ const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
21
+ type: "primary"
22
+ }, "Press me"));
23
+ expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.primary(false, false).button}`);
24
+ expect(wrapper).toMatchSnapshot();
25
+ });
26
+ it('should render as a secondary button', () => {
27
+ const wrapper = shallow(/*#__PURE__*/React.createElement(Button, {
28
+ type: "secondary"
29
+ }, "Press me"));
30
+ expect(trim(wrapper.prop('className'))).toEqual(`ui-shared__button ${styles.secondary(false, false).button}`);
31
+ expect(wrapper).toMatchSnapshot();
32
+ });
33
+ });
package/Button/style.js CHANGED
@@ -1,46 +1,155 @@
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{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors;var buttonPadding="0 ".concat(themeConfig.variables.gap.big,"px 0");/**
1
+ import { css } from 'glamor';
2
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+ const {
4
+ colors
5
+ } = themeConfig;
6
+ const buttonPadding = `0 ${themeConfig.variables.gap.big}px 0`;
7
+
8
+ /**
2
9
  * Creates the button style.
3
10
  * @param {string} text The text color.
4
11
  * @param {string|null} background The fill color.
5
12
  * @return {Object} The button style.
6
- */var button=function button(text,background){return _extends({position:'relative',display:'inline-block',outline:0,color:text,backgroundColor:background,minWidth:64,overflow:'hidden',':disabled':{cursor:'not-allowed'}},themeConfig.variables.buttonBase);};/**
13
+ */
14
+ const button = (text, background) => ({
15
+ position: 'relative',
16
+ display: 'inline-block',
17
+ outline: 0,
18
+ color: text,
19
+ backgroundColor: background,
20
+ minWidth: 64,
21
+ overflow: 'hidden',
22
+ ':disabled': {
23
+ cursor: 'not-allowed'
24
+ },
25
+ ...themeConfig.variables.buttonBase
26
+ });
27
+
28
+ /**
7
29
  * The basic content wrapper styles.
8
- */var contentWrapper=css({padding:buttonPadding}).toString();/**
30
+ */
31
+ const contentWrapper = css({
32
+ padding: buttonPadding
33
+ }).toString();
34
+
35
+ /**
9
36
  * Creates the button styles object.
10
37
  * @param {string} textColor The text color.
11
38
  * @param {string|null} fillColor The fill color.
12
39
  * @return {Object} The styles object.
13
- */var createButtonStyles=function createButtonStyles(textColor,fillColor){var buttonStyle=_extends({},button(textColor,fillColor));var contentStyle={padding:buttonPadding,color:buttonStyle.color};return{button:css(buttonStyle).toString(),content:css(contentStyle).toString()};};/**
40
+ */
41
+ const createButtonStyles = (textColor, fillColor) => {
42
+ const buttonStyle = {
43
+ ...button(textColor, fillColor)
44
+ };
45
+ const contentStyle = {
46
+ padding: buttonPadding,
47
+ color: buttonStyle.color
48
+ };
49
+ return {
50
+ button: css(buttonStyle).toString(),
51
+ content: css(contentStyle).toString()
52
+ };
53
+ };
54
+
55
+ /**
14
56
  * Creates a plain button style object without any styling.
15
57
  * @return {Object}
16
- */var plain=function plain(){return{button:css({padding:0,outline:0,border:0,textAlign:'left'}).toString(),content:''};};/**
58
+ */
59
+ const plain = () => ({
60
+ button: css({
61
+ padding: 0,
62
+ outline: 0,
63
+ border: 0,
64
+ textAlign: 'left'
65
+ }).toString(),
66
+ content: ''
67
+ });
68
+
69
+ /**
17
70
  * Creates a simple button style object.
18
71
  * @param {boolean} disabled Whether this button is disabled.
19
72
  * @return {Object}
20
- */var simple=function simple(disabled){if(disabled){// simple disabled button style.
21
- return createButtonStyles(themeConfig.colors.shade4,themeConfig.colors.shade7);}// simple enabled button style.
22
- return createButtonStyles(themeConfig.colors.dark,themeConfig.colors.shade7);};/**
73
+ */
74
+ const simple = disabled => {
75
+ if (disabled) {
76
+ // simple disabled button style.
77
+ return createButtonStyles(themeConfig.colors.shade4, themeConfig.colors.shade7);
78
+ }
79
+
80
+ // simple enabled button style.
81
+ return createButtonStyles(themeConfig.colors.dark, themeConfig.colors.shade7);
82
+ };
83
+
84
+ /**
23
85
  * The regular flat button style.
24
86
  * @param {boolean} disabled Whether this button is disabled.
25
87
  * @return {Object} An object of style definitions.
26
- */var regular=function regular(disabled){if(disabled){// Flat disabled button style.
27
- return createButtonStyles(colors.shade4,null);}// Flat enabled button style.
28
- return createButtonStyles(colors.dark,null);};/**
88
+ */
89
+ const regular = disabled => {
90
+ if (disabled) {
91
+ // Flat disabled button style.
92
+ return createButtonStyles(colors.shade4, null);
93
+ }
94
+
95
+ // Flat enabled button style.
96
+ return createButtonStyles(colors.dark, null);
97
+ };
98
+
99
+ /**
29
100
  * The primary button style.
30
101
  * @param {boolean} disabled Whether this button is disabled.
31
102
  * @param {boolean} flat Whether this button should be rendered flat.
32
103
  * @return {Object} An object of style definitions.
33
- */var primary=function primary(disabled,flat){if(!flat){if(disabled){// Regular disabled button style.
34
- return createButtonStyles(colors.shade4,colors.shade7);}// Regular enabled button style.
35
- return createButtonStyles("var(--color-secondary-contrast, ".concat(colors.accentContrast,")"),"var(--color-secondary, ".concat(colors.accent,")"));}if(disabled){// Flat disabled button style.
36
- return createButtonStyles(colors.shade4,null);}// Flat enabled button style.
37
- return createButtonStyles("var(--color-secondary, ".concat(colors.accent,")"),null);};/**
104
+ */
105
+ const primary = (disabled, flat) => {
106
+ if (!flat) {
107
+ if (disabled) {
108
+ // Regular disabled button style.
109
+ return createButtonStyles(colors.shade4, colors.shade7);
110
+ }
111
+
112
+ // Regular enabled button style.
113
+ return createButtonStyles(`var(--color-secondary-contrast, ${colors.accentContrast})`, `var(--color-secondary, ${colors.accent})`);
114
+ }
115
+ if (disabled) {
116
+ // Flat disabled button style.
117
+ return createButtonStyles(colors.shade4, null);
118
+ }
119
+
120
+ // Flat enabled button style.
121
+ return createButtonStyles(`var(--color-secondary, ${colors.accent})`, null);
122
+ };
123
+
124
+ /**
38
125
  * The secondary button style.
39
126
  * @param {boolean} disabled Whether this button is disabled.
40
127
  * @param {boolean} flat Whether this button should be rendered flat.
41
128
  * @return {Object} An object of style definitions.
42
- */var secondary=function secondary(disabled,flat){if(!flat){if(disabled){// Regular disabled button style.
43
- return createButtonStyles(colors.shade4,colors.shade7);}// Regular enabled button style.
44
- return createButtonStyles("var(--color-primary-contrast, ".concat(colors.primaryContrast,")"),"var(--color-primary, ".concat(colors.primary,")"));}if(disabled){// Flat disabled button style.
45
- return createButtonStyles(colors.shade4,null);}// Flat enabled button style.
46
- return createButtonStyles("var(--color-primary, ".concat(colors.primary,")"),null);};export default{plain:plain,regular:regular,simple:simple,primary:primary,secondary:secondary,contentWrapper:contentWrapper};
129
+ */
130
+ const secondary = (disabled, flat) => {
131
+ if (!flat) {
132
+ if (disabled) {
133
+ // Regular disabled button style.
134
+ return createButtonStyles(colors.shade4, colors.shade7);
135
+ }
136
+
137
+ // Regular enabled button style.
138
+ return createButtonStyles(`var(--color-primary-contrast, ${colors.primaryContrast})`, `var(--color-primary, ${colors.primary})`);
139
+ }
140
+ if (disabled) {
141
+ // Flat disabled button style.
142
+ return createButtonStyles(colors.shade4, null);
143
+ }
144
+
145
+ // Flat enabled button style.
146
+ return createButtonStyles(`var(--color-primary, ${colors.primary})`, null);
147
+ };
148
+ export default {
149
+ plain,
150
+ regular,
151
+ simple,
152
+ primary,
153
+ secondary,
154
+ contentWrapper
155
+ };
@@ -1,4 +1,13 @@
1
- import{connect}from'react-redux';import{historyPush}from'@shopgate/pwa-common/actions/router';/**
1
+ import { connect } from 'react-redux';
2
+ import { historyPush } from '@shopgate/pwa-common/actions/router';
3
+
4
+ /**
2
5
  * @param {Function} dispatch The redux dispatch function.
3
6
  * @return {Object}
4
- */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{navigate:function navigate(pathname){return dispatch(historyPush({pathname:pathname}));}};};export default connect(null,mapDispatchToProps);
7
+ */
8
+ const mapDispatchToProps = dispatch => ({
9
+ navigate: pathname => dispatch(historyPush({
10
+ pathname
11
+ }))
12
+ });
13
+ export default connect(null, mapDispatchToProps);