@shopgate/pwa-ui-shared 7.31.4-beta.1 → 7.32.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/ActionButton/spec.js +25 -28
  2. package/AddToCartButton/index.js +14 -14
  3. package/Availability/index.js +11 -28
  4. package/Availability/spec.js +11 -11
  5. package/Button/index.js +6 -9
  6. package/ButtonLink/spec.js +11 -7
  7. package/Card/index.js +5 -8
  8. package/CardList/components/Item/index.js +1 -2
  9. package/CartTotalLine/index.js +8 -12
  10. package/Checkbox/index.js +3 -4
  11. package/Chip/index.js +9 -10
  12. package/ContextMenu/components/Item/index.js +18 -28
  13. package/ContextMenu/index.js +3 -4
  14. package/Dialog/components/HtmlContentDialog/spec.js +7 -1
  15. package/DiscountBadge/index.js +35 -32
  16. package/DiscountBadge/spec.js +5 -5
  17. package/FavoritesButton/connector.js +1 -1
  18. package/FavoritesButton/index.js +26 -23
  19. package/Form/Checkbox/index.js +1 -1
  20. package/Form/InfoField/spec.js +3 -3
  21. package/Form/Password/index.js +3 -7
  22. package/Form/RadioGroup/components/Item/index.js +1 -3
  23. package/Form/Select/index.js +4 -5
  24. package/Form/Select/spec.js +3 -3
  25. package/Form/SelectContextChoices/index.js +8 -8
  26. package/Form/SelectContextChoices/spec.js +3 -3
  27. package/Form/TextField/index.js +3 -5
  28. package/FormElement/components/ErrorText/index.js +7 -8
  29. package/FormElement/components/Label/index.js +2 -2
  30. package/FormElement/components/Placeholder/index.js +3 -3
  31. package/FormElement/components/Underline/index.js +9 -17
  32. package/Glow/index.js +1 -2
  33. package/Glow/spec.js +3 -3
  34. package/IndicatorCircle/index.js +3 -4
  35. package/LoadingIndicator/index.js +3 -3
  36. package/Manufacturer/index.js +2 -2
  37. package/NoResults/components/Icon/index.js +3 -4
  38. package/NoResults/index.js +5 -5
  39. package/Placeholder/index.js +2 -2
  40. package/PlaceholderLabel/index.js +2 -3
  41. package/Price/index.js +4 -3
  42. package/PriceInfo/index.js +3 -4
  43. package/PriceStriked/index.js +3 -4
  44. package/ProgressBar/index.js +7 -12
  45. package/RadioButton/index.js +3 -4
  46. package/RatingStars/index.js +4 -5
  47. package/Ripple/components/RippleAnimation/index.js +1 -2
  48. package/Ripple/index.js +1 -2
  49. package/ScannerOverlay/components/CameraOverlay/index.js +1 -2
  50. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +4 -4
  51. package/ScannerOverlay/components/ScannerBar/index.js +3 -4
  52. package/Sheet/components/Header/components/SearchBar/index.js +6 -7
  53. package/Sheet/components/Header/index.js +15 -11
  54. package/Sheet/components/Header/spec.js +3 -1
  55. package/Sheet/index.js +2 -2
  56. package/TaxDisclaimer/index.js +11 -10
  57. package/TaxDisclaimer/spec.js +2 -1
  58. package/TextField/components/ErrorText/index.js +7 -7
  59. package/TextField/components/FormElement/index.js +3 -3
  60. package/TextField/components/Hint/index.js +3 -4
  61. package/TextField/components/Label/index.js +2 -2
  62. package/TextField/components/Underline/index.js +9 -17
  63. package/package.json +5 -5
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { I18n } from '@shopgate/engage/components';
4
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
4
  import { makeStyles } from '@shopgate/engage/styles';
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
@@ -11,12 +10,12 @@ const ellipsisLine = {
11
10
  whiteSpace: 'nowrap',
12
11
  textOverflow: 'ellipsis'
13
12
  };
14
- const useStyles = makeStyles()({
13
+ const useStyles = makeStyles()(theme => ({
15
14
  hint: {
16
15
  position: 'absolute',
17
16
  pointerEvents: 'none',
18
17
  bottom: 12,
19
- color: themeConfig.colors.shade4,
18
+ color: theme.palette.grey.medium,
20
19
  willChange: 'transform',
21
20
  transition: `opacity ${easing}`,
22
21
  ...ellipsisLine
@@ -24,7 +23,7 @@ const useStyles = makeStyles()({
24
23
  hintInactive: {
25
24
  opacity: 0
26
25
  }
27
- });
26
+ }));
28
27
 
29
28
  /**
30
29
  * The form element hint component.
@@ -18,7 +18,7 @@ const useStyles = makeStyles()(theme => ({
18
18
  lineHeight: '19px',
19
19
  pointerEvents: 'none',
20
20
  userSelect: 'none',
21
- color: 'var(--color-text-medium-emphasis)',
21
+ color: theme.palette.text.secondary,
22
22
  transformOrigin: 'left top 0px',
23
23
  willChange: 'transform, color',
24
24
  transition: `transform ${easing}, color ${easing}`,
@@ -28,7 +28,7 @@ const useStyles = makeStyles()(theme => ({
28
28
  transform: 'translate3d(0, -22px, 0) scale3d(0.75, 0.75, 0.75)'
29
29
  },
30
30
  labelRegular: {
31
- color: 'var(--color-text-medium-emphasis)'
31
+ color: theme.palette.text.secondary
32
32
  },
33
33
  labelError: {
34
34
  color: theme.palette.error.main
@@ -1,18 +1,13 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import color from 'color';
4
- import { getCSSCustomProp, makeStyles, useTheme } from '@shopgate/engage/styles';
5
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+ import { makeStyles, useTheme } from '@shopgate/engage/styles';
6
4
  import { jsx as _jsx } from "react/jsx-runtime";
7
- const {
8
- colors
9
- } = themeConfig;
10
5
  const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
11
- const useStyles = makeStyles()({
6
+ const useStyles = makeStyles()(theme => ({
12
7
  underlineWrapper: {
13
8
  position: 'relative',
14
9
  width: '100%',
15
- borderBottom: `1px solid ${colors.shade12}`,
10
+ borderBottom: `1px solid ${theme.components.border.dark}`,
16
11
  marginTop: 2,
17
12
  marginBottom: 7
18
13
  },
@@ -25,23 +20,20 @@ const useStyles = makeStyles()({
25
20
  willChange: 'transform',
26
21
  transition: `transform ${easing}`
27
22
  }
28
- });
23
+ }));
29
24
 
30
25
  /**
31
26
  * Returns the underline inline style.
27
+ * @param {Object} theme The theme object.
32
28
  * @param {boolean} focused Is focused set or not.
33
29
  * @param {boolean} hasError Has error set or not.
34
30
  * @param {string} errorColor Theme error main color.
35
31
  * @return {Object} style
36
32
  */
37
- const getUnderlineStyle = (focused, hasError, errorColor) => {
38
- const primaryColor = getCSSCustomProp('--color-primary') || colors.primary;
39
- let focusColor = '--color-primary';
40
- if (color(primaryColor).luminosity() >= 0.8) {
41
- focusColor = '--color-secondary';
42
- }
33
+ const getUnderlineStyle = (theme, focused, hasError, errorColor) => {
34
+ const focusColor = theme.palette.primary.main;
43
35
  return {
44
- borderBottomColor: hasError ? errorColor : `var(${focusColor}, ${colors.focus})`,
36
+ borderBottomColor: hasError ? errorColor : focusColor,
45
37
  ...(!focused && !hasError && {
46
38
  transform: 'scale3d(0,1,1)'
47
39
  })
@@ -64,7 +56,7 @@ const Underline = props => {
64
56
  "aria-hidden": true,
65
57
  children: /*#__PURE__*/_jsx("div", {
66
58
  className: classes.underline,
67
- style: getUnderlineStyle(props.isFocused, props.hasErrorMessage, theme.palette.error.main)
59
+ style: getUnderlineStyle(theme, props.isFocused, props.hasErrorMessage, theme.palette.error.main)
68
60
  })
69
61
  });
70
62
  };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-ui-shared",
3
- "version": "7.31.4-beta.1",
3
+ "version": "7.32.0-beta.1",
4
4
  "description": "Shopgate's shared UI components.",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
8
- "@shopgate/pwa-ui-ios": "7.31.4-beta.1",
9
- "@shopgate/pwa-ui-material": "7.31.4-beta.1"
8
+ "@shopgate/pwa-ui-ios": "7.32.0-beta.1",
9
+ "@shopgate/pwa-ui-material": "7.32.0-beta.1"
10
10
  },
11
11
  "devDependencies": {
12
- "@shopgate/pwa-common": "7.31.4-beta.1",
13
- "@shopgate/pwa-common-commerce": "7.31.4-beta.1",
12
+ "@shopgate/pwa-common": "7.32.0-beta.1",
13
+ "@shopgate/pwa-common-commerce": "7.32.0-beta.1",
14
14
  "classnames": "2.5.1",
15
15
  "react": "^17.0.2"
16
16
  },