@shopgate/pwa-ui-shared 7.32.0-beta.7 → 7.32.0-beta.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.
@@ -21,6 +21,10 @@ const CLICK_DELAY = 300;
21
21
 
22
22
  /**
23
23
  * The action button component.
24
+ * @deprecated Use `Button` from `@shopgate/engage/components/v2` instead. It defaults to
25
+ * `variant="contained"`, so pass `variant="text"` to match this component's `flat` default. Map
26
+ * `type="secondary"` to `color="primary"`, and `type="primary"` or the default to
27
+ * `color="secondary"`.
24
28
  * @param {Object} props Props.
25
29
  * @returns {JSX.Element}
26
30
  */
@@ -49,7 +49,10 @@ const useStyles = makeStyles()(theme => ({
49
49
  icon: {
50
50
  transition: 'opacity 450ms cubic-bezier(0.4, 0.0, 0.2, 1)',
51
51
  opacity: 1,
52
- position: 'absolute'
52
+ position: 'absolute',
53
+ display: 'flex',
54
+ left: '50%',
55
+ marginLeft: '-0.5em'
53
56
  },
54
57
  spinnerIcon: {
55
58
  left: '50%',
package/Button/index.js CHANGED
@@ -7,9 +7,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  /**
8
8
  * @param {string} text Text color.
9
9
  * @param {string|null} background Fill color.
10
+ * @param {Object} theme Theme with button border radius.
10
11
  * @returns {Object} JSS for root button.
11
12
  */
12
- const baseButton = (text, background) => ({
13
+ const baseButton = (text, background, theme) => ({
13
14
  position: 'relative',
14
15
  display: 'inline-block',
15
16
  outline: 0,
@@ -20,7 +21,9 @@ const baseButton = (text, background) => ({
20
21
  ':disabled': {
21
22
  cursor: 'not-allowed'
22
23
  },
23
- ...themeConfig.variables.buttonBase
24
+ ...themeConfig.variables.buttonBase,
25
+ borderRadius: theme.components.button.borderRadius,
26
+ ...theme.typography.button
24
27
  });
25
28
 
26
29
  /**
@@ -30,7 +33,7 @@ const baseButton = (text, background) => ({
30
33
  * @returns {Object} Object with `button` and `content` style maps.
31
34
  */
32
35
  const pairFromColors = (textColor, fillColor, theme) => ({
33
- button: baseButton(textColor, fillColor),
36
+ button: baseButton(textColor, fillColor, theme),
34
37
  content: {
35
38
  padding: theme.spacing(0, 2, 0),
36
39
  color: textColor
@@ -71,6 +74,10 @@ const useStyles = makeStyles()((theme, {
71
74
 
72
75
  /**
73
76
  * The basic button component.
77
+ * @deprecated Use `Button` from `@shopgate/engage/components/v2` instead. Map `flat` to
78
+ * `variant="text"` and omit it for `variant="contained"`. The colors are named differently:
79
+ * `type="secondary"` becomes `color="primary"`, while `type="primary"` and the default become
80
+ * `color="secondary"`. `type="plain"` is unstyled — use `ButtonBase` for it.
74
81
  * @param {Object} props Props.
75
82
  * @returns {JSX.Element}
76
83
  */
@@ -44,6 +44,10 @@ let ButtonLink = /*#__PURE__*/function (_Component) {
44
44
  };
45
45
  return ButtonLink;
46
46
  }(Component);
47
+ /**
48
+ * @deprecated Use `Button` from `@shopgate/engage/components/v2` with `variant="link"` and
49
+ * `color="primary"` instead. It takes the same `href` and routes through the app router itself.
50
+ */
47
51
  ButtonLink.defaultProps = {
48
52
  disabled: false,
49
53
  className: '',
package/CardList/index.js CHANGED
@@ -2,6 +2,7 @@ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
2
2
  import React, { Component, Children, isValidElement } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import List from '@shopgate/pwa-common/components/List';
5
+ import { cx } from '@shopgate/engage/styles';
5
6
  import Item from "./components/Item";
6
7
 
7
8
  /**
@@ -27,7 +28,7 @@ let CardList = /*#__PURE__*/function (_Component) {
27
28
  return null;
28
29
  }
29
30
  return /*#__PURE__*/_jsx(List, {
30
- className: `ui-shared__card-list ${className}`,
31
+ className: cx('ui-shared__card-list', className),
31
32
  children: Children.map(children, child => {
32
33
  if (! /*#__PURE__*/isValidElement(child)) {
33
34
  return null;
@@ -24,7 +24,7 @@ const useStyles = makeStyles()(theme => ({
24
24
  },
25
25
  grandTotal: {
26
26
  color: theme.palette.text.primary,
27
- fontSize: `${theme.typography.body1.fontSize} !important`
27
+ fontSize: theme.typography.body1.fontSize
28
28
  }
29
29
  }));
30
30
 
@@ -48,7 +48,7 @@ const NoResults = props => {
48
48
  } = useStyles();
49
49
  const imageSRC = useMemo(() => svgToDataUrl(noResultsImage), []);
50
50
  return /*#__PURE__*/_jsxs("div", {
51
- className: cx(classes.wrapper, props.className, ' ui-shared__no-results'),
51
+ className: cx(classes.wrapper, props.className, 'ui-shared__no-results'),
52
52
  "data-test-id": "noResults",
53
53
  children: [/*#__PURE__*/_jsx("div", {
54
54
  className: cx(classes.icon, 'no-results__image'),
@@ -14,6 +14,10 @@ const useStyles = makeStyles()(theme => ({
14
14
  /**
15
15
  * The ripple button component is a special derivation of the basic button component
16
16
  * that adds a ripple effect when clicked.
17
+ * @deprecated Use `Button` from `@shopgate/engage/components/v2` instead — it ripples by default,
18
+ * so `rippleClassName` and `rippleSize` are gone and `disableRipple` turns the effect off. Map
19
+ * `flat` to `variant="text"`, `type="secondary"` to `color="primary"`, and `type="primary"` or the
20
+ * default to `color="secondary"`.
17
21
  * @param {Object} props Props.
18
22
  * @returns {JSX.Element}
19
23
  */
@@ -34,7 +38,7 @@ const RippleButton = ({
34
38
  classes
35
39
  } = useStyles();
36
40
  const buttonProps = {
37
- className: `${className} ui-shared__ripple-button`,
41
+ className: cx(className, 'ui-shared__ripple-button'),
38
42
  disabled,
39
43
  onClick,
40
44
  flat,
package/Sheet/index.js CHANGED
@@ -106,7 +106,17 @@ const useStyles = makeStyles()(theme => ({
106
106
  },
107
107
  paddingBottom: [theme.layout.safeArea.bottom],
108
108
  overflowY: 'scroll',
109
- WebkitOverflowScrolling: 'touch'
109
+ WebkitOverflowScrolling: 'touch',
110
+ '@media (hover: hover) and (pointer: fine)': {
111
+ '::-webkit-scrollbar': {
112
+ width: 6,
113
+ background: 'transparent'
114
+ },
115
+ '::-webkit-scrollbar-thumb': {
116
+ background: theme.components.border.medium,
117
+ borderRadius: 4
118
+ }
119
+ }
110
120
  },
111
121
  drawerAnimIn: {
112
122
  [responsiveMediaQuery('<=sm', {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-ui-shared",
3
- "version": "7.32.0-beta.7",
3
+ "version": "7.32.0-beta.8",
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.32.0-beta.7",
9
- "@shopgate/pwa-ui-material": "7.32.0-beta.7"
8
+ "@shopgate/pwa-ui-ios": "7.32.0-beta.8",
9
+ "@shopgate/pwa-ui-material": "7.32.0-beta.8"
10
10
  },
11
11
  "devDependencies": {
12
- "@shopgate/pwa-common": "7.32.0-beta.7",
13
- "@shopgate/pwa-common-commerce": "7.32.0-beta.7",
12
+ "@shopgate/pwa-common": "7.32.0-beta.8",
13
+ "@shopgate/pwa-common-commerce": "7.32.0-beta.8",
14
14
  "classnames": "2.5.1",
15
15
  "react": "^17.0.2"
16
16
  },