@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
package/Chip/style.js DELETED
@@ -1,78 +0,0 @@
1
- import { css } from 'glamor';
2
- import { responsiveMediaQuery } from '@shopgate/engage/styles';
3
- import { hasNewServices } from '@shopgate/engage/core/helpers';
4
- import { themeConfig } from '@shopgate/engage';
5
-
6
- /**
7
- * Gets a basic style object for the chip layout.
8
- * @param {boolean} hasRemoveButton Whether this chip has a remove button.
9
- * @returns {Object} The style object.
10
- */
11
- const chipBase = (hasRemoveButton = true) => ({
12
- display: 'flex',
13
- alignItems: 'center',
14
- borderRadius: 26,
15
- outline: 0,
16
- height: 26,
17
- paddingRight: themeConfig.variables.gap.small,
18
- paddingLeft: themeConfig.variables.gap.small * (hasRemoveButton ? 0.5 : 1),
19
- marginRight: 5,
20
- marginTop: 4,
21
- marginBottom: 4,
22
- minWidth: 0
23
- });
24
-
25
- /**
26
- * Gets a style class for the chip layout.
27
- * @param {boolean} hasRemoveButton Whether this chip has a remove button.
28
- * @param {boolean} inverted Whether the colors of the chip are inverted.
29
- * @returns {string} The style class name.
30
- */
31
- const chip = (hasRemoveButton = true, inverted = false) => css({
32
- ...chipBase(hasRemoveButton),
33
- ...(hasNewServices() ? {
34
- backgroundColor: inverted ? 'var(--color-primary)' : 'var(--color-primary-contrast)',
35
- color: inverted ? 'var(--color-primary-contrast)' : 'var(--color-primary)'
36
- } : {
37
- backgroundColor: inverted ? 'var(--color-secondary)' : 'var(--color-secondary-contrast)',
38
- color: inverted ? 'var(--color-secondary-contrast)' : 'var(--color-secondary)',
39
- '--color-text-high-emphasis': inverted ? 'var(--color-secondary-contrast)' : 'var(--color-secondary)'
40
- })
41
- }).toString();
42
- const removeButton = css({
43
- flexShrink: 0,
44
- padding: 0,
45
- [responsiveMediaQuery('>xs', {
46
- webOnly: true
47
- })]: {
48
- padding: '0 5px',
49
- fontSize: '1.125rem'
50
- }
51
- }).toString();
52
- const name = css({
53
- paddingLeft: themeConfig.variables.gap.small * 0.5,
54
- paddingRight: themeConfig.variables.gap.small * 0.5,
55
- paddingTop: 3,
56
- paddingBottom: 3,
57
- fontSize: 12,
58
- fontWeight: 500,
59
- textOverflow: 'ellipsis',
60
- maxWidth: '100%',
61
- whiteSpace: 'nowrap',
62
- overflow: 'hidden',
63
- display: 'block',
64
- lineHeight: '1',
65
- color: 'inherit',
66
- [responsiveMediaQuery('>xs', {
67
- webOnly: true
68
- })]: {
69
- fontSize: '0.875rem',
70
- lineHeight: '1.25rem',
71
- padding: '6px 8px 6px 0'
72
- }
73
- }).toString();
74
- export default {
75
- chip,
76
- removeButton,
77
- name
78
- };
@@ -1,34 +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
-
6
- /**
7
- * Get the item class.
8
- * @param {boolean} disabled Disabled.
9
- * @returns {string}
10
- */
11
- export const getItemClass = disabled => {
12
- let background = themeConfig.colors.shade8;
13
- const customPropColor = getCSSCustomProp('--color-primary');
14
- if (customPropColor) {
15
- background = Color(customPropColor).alpha(0.04);
16
- }
17
- return css({
18
- position: 'relative',
19
- whiteSpace: 'nowrap',
20
- marginBottom: 2,
21
- padding: `${themeConfig.variables.gap.big * 0.875}px ${themeConfig.variables.gap.big * 1.375}px`,
22
- lineHeight: 1,
23
- zIndex: 1,
24
- color: disabled ? 'var(--color-text-low-emphasis)' : 'inherits',
25
- ...(!disabled ? {
26
- cursor: 'pointer',
27
- ':hover': {
28
- background
29
- }
30
- } : {
31
- cursor: 'default'
32
- })
33
- }).toString();
34
- };
@@ -1,11 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const outerGap = themeConfig.variables.gap.small;
4
- const container = css({
5
- position: 'absolute',
6
- margin: outerGap
7
- }).toString();
8
- export default {
9
- container,
10
- outerGap
11
- };
@@ -1,45 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const container = css({
4
- position: 'relative'
5
- }).toString();
6
- const button = css({
7
- display: 'block',
8
- fontSize: '1.5rem',
9
- outline: 0,
10
- padding: 0,
11
- color: 'inherit'
12
- }).toString();
13
- const disabled = css({
14
- cursor: 'not-allowed'
15
- }).toString();
16
- const overlay = css({
17
- position: 'fixed',
18
- top: 0,
19
- right: 0,
20
- bottom: 0,
21
- left: 0,
22
- zIndex: 10
23
- }).toString();
24
- const menu = css({
25
- position: 'absolute',
26
- top: 0,
27
- left: 0,
28
- padding: `${themeConfig.variables.gap.small}px 0`,
29
- minWidth: 130,
30
- background: themeConfig.colors.light,
31
- borderRadius: 2,
32
- boxShadow: themeConfig.shadows.contextMenu
33
- }).toString();
34
- const scrollable = css({
35
- maxHeight: '30vh',
36
- overflowY: 'auto'
37
- }).toString();
38
- export default {
39
- container,
40
- button,
41
- menu,
42
- overlay,
43
- disabled,
44
- scrollable
45
- };
@@ -1,36 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
- const badge = {
7
- background: `var(--color-primary, ${colors.primary})`,
8
- borderRadius: 2,
9
- color: `var(--color-primary-contrast, ${colors.primaryContrast})`,
10
- padding: 5,
11
- width: '100%',
12
- fontWeight: 700,
13
- textAlign: 'center',
14
- display: 'flex',
15
- justifyContent: 'center',
16
- alignItems: 'center',
17
- lineHeight: 1,
18
- whiteSpace: 'nowrap',
19
- ...themeConfig.variables.discountBadgeBase
20
- };
21
-
22
- /**
23
- * The discount badge styles that can be selected by passing the style key.
24
- * @type {Object}
25
- */
26
- export default {
27
- small: css({
28
- ...badge
29
- }).toString(),
30
- big: css({
31
- ...badge,
32
- paddingTop: 5,
33
- paddingLeft: 5,
34
- paddingRight: 5
35
- }).toString()
36
- };
@@ -1,26 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeShadows, themeColors } from '@shopgate/pwa-common/helpers/config';
3
- const buttonProto = {
4
- display: 'block',
5
- position: 'relative',
6
- background: themeColors.light,
7
- borderRadius: '50%',
8
- padding: 0,
9
- fontSize: 20,
10
- lineHeight: 1,
11
- color: `var(--color-secondary, ${themeColors.accent})`,
12
- outline: 0
13
- };
14
- const buttonFlat = css(buttonProto).toString();
15
- const button = css({
16
- ...buttonProto,
17
- boxShadow: themeShadows.buttons.elevated
18
- }).toString();
19
- const ripple = css({
20
- padding: 6
21
- }).toString();
22
- export default {
23
- buttonFlat,
24
- button,
25
- ripple
26
- };
@@ -1,25 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const root = css({
4
- marginLeft: -2,
5
- // Removes margin caused by svg.
6
- cursor: 'pointer',
7
- '& svg': {
8
- float: 'left'
9
- }
10
- }).toString();
11
- const label = css({
12
- lineHeight: 1.6
13
- }).toString();
14
- const labelWrapper = css({
15
- marginLeft: themeConfig.variables.gap.xbig
16
- }).toString();
17
- const checked = css({
18
- color: `var(--color-primary, ${themeConfig.colors.primary})`
19
- }).toString();
20
- export default {
21
- root,
22
- label,
23
- labelWrapper,
24
- checked
25
- };
@@ -1,11 +0,0 @@
1
- import { css } from 'glamor';
2
- const info = css({
3
- paddingTop: 24
4
- }).toString();
5
- const element = css({
6
- marginTop: 16
7
- }).toString();
8
- export default {
9
- info,
10
- element
11
- };
@@ -1,11 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const {
4
- colors
5
- } = themeConfig;
6
- const visOff = css({
7
- color: colors.shade4
8
- }).toString();
9
- export default {
10
- visOff
11
- };
@@ -1,32 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const container = css({
4
- display: 'flex',
5
- marginLeft: -1 // Removes margin of svg.
6
- }).toString();
7
- const icon = css({
8
- width: 24,
9
- height: 24,
10
- flexShrink: 0
11
- }).toString();
12
- const disabled = css({
13
- opacity: 0.25,
14
- pointerEvents: 'none'
15
- }).toString();
16
- const label = css({
17
- flex: 1,
18
- fontSize: '1rem',
19
- lineHeight: 1.5,
20
- marginLeft: themeConfig.variables.gap.small,
21
- marginBottom: themeConfig.variables.gap.small
22
- }).toString();
23
- const active = css({
24
- color: `var(--color-primary, ${themeConfig.colors.primary})`
25
- }).toString();
26
- export default {
27
- icon,
28
- disabled,
29
- container,
30
- label,
31
- active
32
- };
@@ -1,20 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
-
4
- /**
5
- * @param {string} direction flex direction
6
- * @returns {*}
7
- */
8
- const container = direction => css({
9
- display: 'flex',
10
- flexDirection: direction
11
- }).toString();
12
- const label = css({
13
- fontSize: '0.8rem',
14
- paddingBottom: themeConfig.variables.gap.small,
15
- color: themeConfig.colors.shade12
16
- }).toString();
17
- export default {
18
- container,
19
- label
20
- };
@@ -1,27 +0,0 @@
1
- import { css } from 'glamor';
2
- const select = css({
3
- appearance: 'none',
4
- position: 'relative',
5
- overflow: 'hidden',
6
- whiteSpace: 'nowrap',
7
- textOverflow: 'ellipsis',
8
- padding: '0 20px 0 0',
9
- width: '100%',
10
- margin: '24px 0 0 0',
11
- outline: 0,
12
- fontSize: 16,
13
- lineHeight: '19px',
14
- zIndex: 10
15
- }).toString();
16
- const chevron = css({
17
- position: 'absolute',
18
- top: '50%',
19
- right: 0,
20
- transform: 'translateY(-50%) rotateZ(-90deg)',
21
- fontSize: '1.3em !important',
22
- marginTop: -3
23
- }).toString();
24
- export default {
25
- select,
26
- chevron
27
- };
@@ -1,23 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- const chevron = css({
4
- position: 'absolute',
5
- top: '50%',
6
- right: 0,
7
- transform: 'translateY(-50%) rotateZ(-90deg)',
8
- fontSize: '1.3em !important',
9
- marginTop: -3
10
- }).toString();
11
- const toggle = css({
12
- fontSize: '1rem',
13
- paddingRight: '2rem'
14
- });
15
- const itemSelected = css({
16
- backgroundColor: themeConfig.colors.shade8,
17
- fontWeight: 500
18
- }).toString();
19
- export default {
20
- chevron,
21
- toggle,
22
- itemSelected
23
- };
@@ -1,70 +0,0 @@
1
- import { css } from 'glamor';
2
-
3
- // Selects a date input that is not focused.
4
- const bluredDateSelector = 'input[type="date"]:in-range:not(:focus)';
5
-
6
- /**
7
- * The styles for the container element.
8
- */
9
- const container = css({
10
- // Fixes layout issue with webkit. Height is 0 in some webkit browsers.
11
- '& input[type="date"]': {
12
- minHeight: '1.3rem',
13
- appearance: 'none',
14
- paddingLeft: 0,
15
- marginLeft: 0
16
- },
17
- // Removes placeholder texts on chrome when input is not focused.
18
- [`& ${bluredDateSelector}::-webkit-datetime-edit-year-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-month-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-day-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-text`]: {
19
- padding: 0,
20
- color: 'transparent'
21
- }
22
- }).toString();
23
-
24
- /**
25
- * The styles for the input field.
26
- */
27
- const input = css({
28
- position: 'relative',
29
- padding: 0,
30
- width: '100%',
31
- marginTop: 24,
32
- outline: 0,
33
- fontSize: 16,
34
- lineHeight: '19px'
35
- }).toString();
36
-
37
- /**
38
- * The styles for the multiLine.
39
- */
40
- const multiLine = css({
41
- position: 'relative',
42
- marginTop: 24,
43
- marginBottom: 3,
44
- padding: 0,
45
- width: '100%',
46
- outline: 0,
47
- height: 19,
48
- minHeight: 19,
49
- lineHeight: '19px',
50
- verticalAlign: 'top' // Important to avoid bottom whitespace.
51
- }).toString();
52
- const element = css({
53
- marginTop: 16,
54
- display: 'flex',
55
- alignItems: 'flex-end'
56
- }).toString();
57
-
58
- /**
59
- * Additional left spacing when a left element is present
60
- */
61
- const leftOffset = css({
62
- marginLeft: 2
63
- }).toString();
64
- export default {
65
- container,
66
- input,
67
- multiLine,
68
- element,
69
- leftOffset
70
- };
@@ -1,13 +0,0 @@
1
- import { css } from 'glamor';
2
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
- export default css({
4
- bottom: 2,
5
- color: `var(--color-state-alert, ${themeConfig.colors.error})`,
6
- fontSize: 12,
7
- lineHeight: '14px',
8
- overflow: 'hidden',
9
- position: 'absolute',
10
- textOverflow: 'ellipsis',
11
- whiteSpace: 'nowrap',
12
- width: '100%'
13
- }).toString();
@@ -1,89 +0,0 @@
1
- import { css } from 'glamor';
2
- import classNames from 'classnames';
3
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
4
-
5
- /**
6
- * The style object for a one line text element with an ellipsis on overflow.
7
- */
8
- const ellipsisLine = {
9
- overflow: 'hidden',
10
- width: '100%',
11
- whiteSpace: 'nowrap',
12
- textOverflow: 'ellipsis'
13
- };
14
- const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
15
-
16
- /**
17
- * The styles for the error label.
18
- */
19
- const labelError = css({
20
- color: `var(--color-state-alert, ${themeConfig.colors.error})`
21
- }).toString();
22
-
23
- /**
24
- * Regular label is hidden, because placeholder is visible
25
- */
26
- const labelRegular = css({
27
- opacity: 0
28
- }).toString();
29
-
30
- /**
31
- * The styles for the focused label.
32
- */
33
- const labelFocus = css({
34
- color: themeConfig.colors.focus
35
- }).toString();
36
-
37
- /**
38
- * The styles for the floating label.
39
- */
40
- const labelFloating = css({
41
- transform: 'translate3d(0, -22px, 0) scale3d(0.75, 0.75, 0.75)',
42
- opacity: 1
43
- }).toString();
44
-
45
- /**
46
- * The basic styles for the label.
47
- * @type {string}
48
- */
49
- const label = css({
50
- position: 'absolute',
51
- left: 0,
52
- top: 24,
53
- lineHeight: '19px',
54
- pointerEvents: 'none',
55
- userSelect: 'none',
56
- color: themeConfig.colors.shade12,
57
- transformOrigin: 'left top 0px',
58
- willChange: 'transform, color',
59
- overflow: 'visible',
60
- transition: `transform ${easing}, color ${easing}`,
61
- ...ellipsisLine
62
- }).toString();
63
- const labelStatic = css({
64
- opacity: 1,
65
- lineHeight: '19px',
66
- pointerEvents: 'none',
67
- userSelect: 'none',
68
- color: themeConfig.colors.shade12
69
- }).toString();
70
-
71
- /**
72
- * Gets the style classes for the label.
73
- * @param {boolean} focused Whether the input field is focused.
74
- * @param {boolean} floating Whether the label is floating.
75
- * @param {boolean} error Whether the input field shows an error message.
76
- * @param {boolean} isStatic Whether the label is static.
77
- * @return {string} The style classes.
78
- */
79
- const labelStyles = (focused = false, floating = false, error = false, isStatic = false) => classNames({
80
- [label]: !isStatic,
81
- [labelStatic]: isStatic,
82
- [labelFloating]: floating,
83
- [labelRegular]: !focused,
84
- [labelFocus]: !error && focused,
85
- [labelError]: error && focused
86
- });
87
- export default {
88
- labelStyles
89
- };
@@ -1,56 +0,0 @@
1
- import { css } from 'glamor';
2
- import classNames from 'classnames';
3
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
4
-
5
- /**
6
- * The style object for a one line text element with an ellipsis on overflow.
7
- */
8
- const ellipsisLine = {
9
- overflow: 'hidden',
10
- width: '100%',
11
- whiteSpace: 'nowrap',
12
- textOverflow: 'ellipsis'
13
- };
14
- const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
15
-
16
- /**
17
- * The styles for the placeholder text.
18
- */
19
- const placeholder = css({
20
- position: 'absolute',
21
- pointerEvents: 'none',
22
- top: 24,
23
- color: `var(--color-text-medium-emphasis, ${themeConfig.colors.shade6})`,
24
- willChange: 'transform',
25
- transition: `opacity ${easing}`,
26
- ...ellipsisLine
27
- }).toString();
28
-
29
- /**
30
- * The styles for the invisible hint text.
31
- */
32
- const placeholderInactive = css({
33
- opacity: 0
34
- }).toString();
35
-
36
- /**
37
- * Additional left spacing when a left element is present
38
- */
39
- const leftOffset = css({
40
- left: 'var(--form-element-left-offset, 26px)',
41
- width: 'calc(100% - var(--form-element-left-offset, 26px))'
42
- }).toString();
43
-
44
- /**
45
- * Gets the style classes for the underline element.
46
- * @param {boolean} visible Whether the hint is visible.
47
- * @param {boolean} hasLeftElement - Whether a left element is present.
48
- * @return {string} The style classes.
49
- */
50
- const placeholderStyles = (visible = false, hasLeftElement = false) => classNames(placeholder, {
51
- [placeholderInactive]: !visible,
52
- [leftOffset]: hasLeftElement
53
- });
54
- export default {
55
- placeholderStyles
56
- };
@@ -1,60 +0,0 @@
1
- import { css } from 'glamor';
2
- import color from 'color';
3
- import { getCSSCustomProp } from '@shopgate/engage/styles';
4
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
- const {
6
- colors
7
- } = themeConfig;
8
- const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
9
-
10
- /**
11
- * The styles for the underline wrapper element.
12
- */
13
- const underlineWrapper = css({
14
- position: 'relative',
15
- width: '100%',
16
- borderBottom: `1px solid ${colors.shade12}`,
17
- marginTop: 2,
18
- marginBottom: 7
19
- }).toString();
20
-
21
- /**
22
- * The styles for the underline element.
23
- * @param {boolean} focused Whether the input field is focused.
24
- * @param {boolean} error Whether the input field shows an error message.
25
- * @return {string} The style class.
26
- */
27
- const underline = css({
28
- position: 'relative',
29
- width: '100%',
30
- top: 1,
31
- borderBottomWidth: 2,
32
- borderBottomStyle: 'solid',
33
- willChange: 'transform',
34
- transition: `transform ${easing}`
35
- }).toString();
36
-
37
- /**
38
- * Returns the underline style.
39
- * @param {boolean} focused Is focused set or not.
40
- * @param {boolean} hasError Has error set or not.
41
- * @return {Object} style
42
- */
43
- const underlineStyle = (focused, hasError) => {
44
- const primaryColor = getCSSCustomProp('--color-primary') || colors.primary;
45
- let focusColor = '--color-primary';
46
- if (color(primaryColor).luminosity() >= 0.8) {
47
- focusColor = '--color-secondary';
48
- }
49
- return {
50
- borderBottomColor: hasError ? `var(--color-state-alert, ${colors.error})` : `var(${focusColor}, ${colors.focus})`,
51
- ...(!focused && !hasError && {
52
- transform: 'scale3d(0,1,1)'
53
- })
54
- };
55
- };
56
- export default {
57
- underline,
58
- underlineWrapper,
59
- underlineStyle
60
- };