@shopgate/engage 7.32.0-beta.8 → 7.32.0-beta.9

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/account/components/Profile/Profile.provider.d.ts +1 -1
  2. package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.js +1 -1
  3. package/cart/components/CartItem/CartItemQuantityPicker.js +1 -0
  4. package/components/Badge/spec.js +6 -29
  5. package/components/NavigationHandler/index.d.ts +2 -2
  6. package/components/Paper/spec.js +5 -22
  7. package/components/Typography/Typography.d.ts +1 -1
  8. package/components/v2/Button/Button.d.ts +1 -1
  9. package/components/v2/Button/Button.d.ts.map +1 -1
  10. package/components/v2/Button/Button.js +53 -7
  11. package/components/v2/ButtonBase/ButtonBase.d.ts.map +1 -1
  12. package/components/v2/ButtonBase/ButtonBase.js +39 -1
  13. package/components/v2/ButtonGroup/ButtonGroup.d.ts +1 -1
  14. package/components/v2/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  15. package/components/v2/ButtonGroup/ButtonGroup.js +19 -8
  16. package/locations/components/StoreList/StoreListSearch.js +1 -0
  17. package/package.json +7 -7
  18. package/product/components/ProductCard/index.js +7 -1
  19. package/product/components/ProductGrid/components/Item/components/ItemDetails/index.js +6 -1
  20. package/product/components/ProductGrid/components/Layout/index.js +2 -1
  21. package/product/components/ProductGridPrice/index.js +0 -1
  22. package/product/components/ProductSlider/index.js +1 -1
  23. package/product/components/UnitQuantityPicker/UnitQuantityPicker.d.ts.map +1 -1
  24. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +1 -0
  25. package/settings/reducers/appSettings.d.ts.map +1 -1
  26. package/settings/reducers/appSettings.js +10 -2
  27. package/settings/selectors/appSettings.d.ts +21 -2
  28. package/settings/selectors/appSettings.d.ts.map +1 -1
  29. package/settings/selectors/appSettings.js +19 -0
  30. package/settings/types/appSettings.d.ts +21 -2
  31. package/settings/types/appSettings.d.ts.map +1 -1
  32. package/settings/types/appSettings.js +124 -1
  33. package/styles/index.d.ts +1 -1
  34. package/styles/index.d.ts.map +1 -1
  35. package/styles/theme/createDefaultThemeOptions/index.d.ts.map +1 -1
  36. package/styles/theme/createDefaultThemeOptions/index.js +94 -3
  37. package/styles/theme/createTheme/createComponents.types.js +3 -3
  38. package/styles/theme/createTheme/index.d.ts +2 -2
  39. package/styles/theme/createTheme/index.d.ts.map +1 -1
  40. package/styles/theme/createTheme/index.js +1 -1
  41. package/styles/theme/createTheme/types.d.ts +9 -2
  42. package/styles/theme/createTheme/types.d.ts.map +1 -1
  43. package/styles/theme/createTheme/types.js +6 -0
  44. package/styles/theme/hooks/useColorScheme.d.ts +2 -2
  45. package/styles/theme/hooks/useColorScheme.d.ts.map +1 -1
  46. package/styles/theme/hooks/useColorScheme.js +1 -1
  47. package/styles/theme/hooks/useMediaQuery.d.ts +7 -0
  48. package/styles/theme/hooks/useMediaQuery.d.ts.map +1 -1
  49. package/styles/theme/hooks/useMediaQuery.js +5 -5
  50. package/styles/theme/hooks/useTheme.js +1 -1
  51. package/styles/theme/index.d.ts +2 -1
  52. package/styles/theme/index.d.ts.map +1 -1
  53. package/styles/theme/providers/ColorSchemeContext.d.ts +30 -9
  54. package/styles/theme/providers/ColorSchemeContext.d.ts.map +1 -1
  55. package/styles/theme/providers/ColorSchemeContext.js +8 -0
  56. package/styles/theme/providers/ThemeContext.d.ts +3 -0
  57. package/styles/theme/providers/ThemeContext.d.ts.map +1 -0
  58. package/styles/theme/providers/ThemeContext.js +2 -0
  59. package/styles/theme/providers/ThemeProvider.d.ts +2 -2
  60. package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
  61. package/styles/theme/providers/ThemeProvider.js +58 -16
  62. package/styles/theme/utils/color.d.ts +12 -12
  63. package/styles/theme/utils/color.d.ts.map +1 -1
@@ -37,8 +37,8 @@ declare const _default: import("react-redux").ConnectedComponent<{
37
37
  formContainerRef: null;
38
38
  };
39
39
  }, {
40
- children: NonNullable<PropTypes.ReactNodeLike>;
41
40
  push: (...args: any[]) => any;
41
+ children: NonNullable<PropTypes.ReactNodeLike>;
42
42
  userLocation: NonNullable<PropTypes.InferProps<PropTypes.ValidationMap<any>>>;
43
43
  fetchContacts: (...args: any[]) => any;
44
44
  deleteContact: (...args: any[]) => any;
@@ -47,7 +47,7 @@ const FrontendSettingsPreviewBridge = () => {
47
47
 
48
48
  // setMode rejects unsupported schemes as well, but this message arrives from another origin,
49
49
  // so it is worth naming the admin as the source of the bad value. The `colorScheme` guard also
50
- // narrows away the defensive `undefined`, so `modes.includes` and `setMode` typecheck strictly.
50
+ // narrows away the defensive `undefined`, so the check and `setMode` typecheck strictly.
51
51
  if (!colorScheme || !modes.includes(colorScheme)) {
52
52
  logger.warn(`FrontendSettingsPreviewBridge: received unsupported color scheme "${colorScheme}"`);
53
53
  return;
@@ -8,6 +8,7 @@ const useStyles = makeStyles()(theme => ({
8
8
  inputStyle: {
9
9
  border: 'none',
10
10
  background: theme.palette.background.emphasized,
11
+ color: theme.contrastColor(theme.palette.background.emphasized),
11
12
  display: 'block',
12
13
  fontSize: theme.typography.caption.fontSize,
13
14
  textAlign: 'center',
@@ -2,46 +2,23 @@ import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  // Loaded at runtime by utils/unit-tests/envSetup.js; imported here for the matcher types.
4
4
  import '@testing-library/jest-dom';
5
- import { ThemeProvider, createTheme } from '@shopgate/engage/styles';
6
5
  import Badge from "./Badge";
7
-
8
- // ThemeProvider resolves the active breakpoint via matchMedia, which jsdom doesn't implement.
9
6
  import { jsx as _jsx } from "react/jsx-runtime";
10
- Object.defineProperty(window, 'matchMedia', {
11
- writable: true,
12
- value: query => ({
13
- matches: false,
14
- media: query,
15
- addEventListener: jest.fn(),
16
- removeEventListener: jest.fn()
17
- })
18
- });
19
- const theme = createTheme();
20
-
21
- /**
22
- * Renders the subject within a theme context.
23
- * @param ui The element to render.
24
- * @returns The render result.
25
- */
26
- const renderWithTheme = ui => render(/*#__PURE__*/_jsx(ThemeProvider, {
27
- theme: theme,
28
- children: ui
29
- }));
30
7
  describe('<Badge />', () => {
31
8
  it('should render the count', () => {
32
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
9
+ render(/*#__PURE__*/_jsx(Badge, {
33
10
  count: 3
34
11
  }));
35
12
  expect(screen.getByText('3')).toBeInTheDocument();
36
13
  });
37
14
  it('should render nothing when the count is zero', () => {
38
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
15
+ render(/*#__PURE__*/_jsx(Badge, {
39
16
  count: 0
40
17
  }));
41
18
  expect(screen.queryByText('0')).not.toBeInTheDocument();
42
19
  });
43
20
  it('should cap the count at max', () => {
44
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
21
+ render(/*#__PURE__*/_jsx(Badge, {
45
22
  count: 6,
46
23
  max: 5
47
24
  }));
@@ -49,14 +26,14 @@ describe('<Badge />', () => {
49
26
  expect(screen.queryByText('6')).not.toBeInTheDocument();
50
27
  });
51
28
  it('should render the exact count when it equals max', () => {
52
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
29
+ render(/*#__PURE__*/_jsx(Badge, {
53
30
  count: 5,
54
31
  max: 5
55
32
  }));
56
33
  expect(screen.getByText('5')).toBeInTheDocument();
57
34
  });
58
35
  it('should render an empty bubble when showCount is false', () => {
59
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
36
+ render(/*#__PURE__*/_jsx(Badge, {
60
37
  count: 7,
61
38
  showCount: false
62
39
  }));
@@ -64,7 +41,7 @@ describe('<Badge />', () => {
64
41
  expect(document.querySelector('.theme__badge')).toBeInTheDocument();
65
42
  });
66
43
  it('should apply the shared badge class so themes can target it', () => {
67
- renderWithTheme(/*#__PURE__*/_jsx(Badge, {
44
+ render(/*#__PURE__*/_jsx(Badge, {
68
45
  count: 1,
69
46
  className: "custom-position"
70
47
  }));
@@ -1,15 +1,15 @@
1
1
  declare const _default: import("react-redux").ConnectedComponent<typeof NavigationHandler, {
2
- children: NonNullable<PropTypes.ReactNodeLike>;
3
2
  pop?: ((...args: any[]) => any) | null | undefined;
4
3
  push?: ((...args: any[]) => any) | null | undefined;
4
+ children: NonNullable<PropTypes.ReactNodeLike>;
5
5
  reset?: ((...args: any[]) => any) | null | undefined;
6
6
  replace?: ((...args: any[]) => any) | null | undefined;
7
7
  context?: import("react-redux/es/components/Context").ReactReduxContextInstance | undefined;
8
8
  store?: import("redux").Store | undefined;
9
9
  } | {
10
- children: NonNullable<PropTypes.ReactNodeLike>;
11
10
  pop?: ((...args: any[]) => any) | null | undefined;
12
11
  push?: ((...args: any[]) => any) | null | undefined;
12
+ children: NonNullable<PropTypes.ReactNodeLike>;
13
13
  reset?: ((...args: any[]) => any) | null | undefined;
14
14
  replace?: ((...args: any[]) => any) | null | undefined;
15
15
  store?: import("redux").Store | undefined;
@@ -1,28 +1,11 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import '@testing-library/jest-dom';
4
- import { ThemeProvider, createTheme } from '@shopgate/engage/styles';
5
4
  import Paper from "./Paper";
6
5
 
7
- // ThemeProvider resolves the active breakpoint via matchMedia, which jsdom doesn't implement.
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- Object.defineProperty(window, 'matchMedia', {
10
- writable: true,
11
- value: query => ({
12
- matches: false,
13
- media: query,
14
- addEventListener: jest.fn(),
15
- removeEventListener: jest.fn()
16
- })
17
- });
18
- const theme = createTheme();
19
- const renderWithTheme = ui => render(/*#__PURE__*/_jsx(ThemeProvider, {
20
- theme: theme,
21
- children: ui
22
- }));
23
-
24
6
  // tss keeps injected rules in the document across tests, so assertions have to be scoped to the
25
7
  // element under test — a global sweep would also match rules another test left behind.
8
+ import { jsx as _jsx } from "react/jsx-runtime";
26
9
  const styleTextFor = element => Array.from(document.styleSheets).flatMap(sheet => {
27
10
  try {
28
11
  return Array.from(sheet.cssRules);
@@ -31,12 +14,12 @@ const styleTextFor = element => Array.from(document.styleSheets).flatMap(sheet =
31
14
  }
32
15
  }).filter(rule => rule instanceof CSSStyleRule && element.matches(rule.selectorText)).map(rule => rule.cssText).join('');
33
16
  const renderPaper = ui => {
34
- renderWithTheme(ui);
17
+ render(ui);
35
18
  return styleTextFor(screen.getByTestId('paper'));
36
19
  };
37
20
  describe('<Paper />', () => {
38
21
  it('renders children and the engage__paper class next to a caller className', () => {
39
- renderWithTheme(/*#__PURE__*/_jsx(Paper, {
22
+ render(/*#__PURE__*/_jsx(Paper, {
40
23
  className: "custom",
41
24
  "data-testid": "paper",
42
25
  children: "content"
@@ -47,7 +30,7 @@ describe('<Paper />', () => {
47
30
  expect(el).toHaveClass('custom');
48
31
  });
49
32
  it('renders as the given component', () => {
50
- renderWithTheme(/*#__PURE__*/_jsx(Paper, {
33
+ render(/*#__PURE__*/_jsx(Paper, {
51
34
  component: "section",
52
35
  "data-testid": "paper",
53
36
  children: "x"
@@ -55,7 +38,7 @@ describe('<Paper />', () => {
55
38
  expect(screen.getByTestId('paper').tagName).toBe('SECTION');
56
39
  });
57
40
  it('passes data attributes through to the element', () => {
58
- renderWithTheme(/*#__PURE__*/_jsx(Paper, {
41
+ render(/*#__PURE__*/_jsx(Paper, {
59
42
  "data-testid": "paper",
60
43
  "data-foo": "bar",
61
44
  children: "x"
@@ -9,7 +9,7 @@ declare const useStyles: (params: void, muiStyleOverridesParams?: {
9
9
  props: Record<string, unknown>;
10
10
  ownerState?: Record<string, unknown> | undefined;
11
11
  } | undefined) => {
12
- classes: Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "root" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "fontWeightLight" | "fontWeightRegular" | "fontWeightMedium" | "fontWeightBold" | "gutterBottom" | "noWrap" | "paragraph" | "srOnly" | "alignLeft" | "alignCenter" | "alignRight" | "alignJustify" | "colorInherit" | "colorPrimary" | "colorSecondary" | "colorTextPrimary" | "colorTextSecondary" | "colorError" | "colorWarning" | "colorSuccess" | "displayInline" | "displayBlock", string>;
12
+ classes: Record<"h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "root" | "fontWeightLight" | "fontWeightRegular" | "fontWeightMedium" | "fontWeightBold" | "gutterBottom" | "noWrap" | "paragraph" | "srOnly" | "alignLeft" | "alignCenter" | "alignRight" | "alignJustify" | "colorInherit" | "colorPrimary" | "colorSecondary" | "colorTextPrimary" | "colorTextSecondary" | "colorError" | "colorWarning" | "colorSuccess" | "displayInline" | "displayBlock", string>;
13
13
  theme: import("@shopgate/engage/styles").Theme;
14
14
  css: import("tss-react").Css;
15
15
  cx: import("tss-react").Cx;
@@ -5,7 +5,7 @@ declare const useStyles: (params: ButtonOwnProps, muiStyleOverridesParams?: {
5
5
  props: Record<string, unknown>;
6
6
  ownerState?: Record<string, unknown> | undefined;
7
7
  } | undefined) => {
8
- classes: Record<"text" | "icon" | "small" | "large" | "label" | "link" | "root" | "disabled" | "dense" | "denseSmall" | "denseLarge" | "outlined" | "contained" | "enableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loader" | "loadingPlaceholder" | "loadingIndicator", string>;
8
+ classes: Record<"small" | "large" | "text" | "icon" | "label" | "link" | "root" | "disabled" | "dense" | "denseSmall" | "denseLarge" | "outlined" | "contained" | "enableElevation" | "fullWidth" | "startIcon" | "endIcon" | "loader" | "loadingPlaceholder" | "loadingIndicator", string>;
9
9
  theme: import("@shopgate/engage/styles").Theme;
10
10
  css: import("tss-react").Css;
11
11
  cx: import("tss-react").Cx;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../components/v2/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,eAAe,CAAC;AAsHzE,QAAA,MAAM,SAAS;;cAlBI,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C;CAC5D;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAC5D,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;wBAON,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EACrE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;CAAE,KACpE,KAAK,CAAC,YAAY,GAAG,IAAI;AAF9B,wBAE+B"}
@@ -105,6 +105,22 @@ function Button(props, ref) {
105
105
  })
106
106
  });
107
107
  }
108
+
109
+ /**
110
+ * Opacity of the overlay that the text and outlined variants tint themselves with on hover. The
111
+ * dark scheme needs more of it: the overlay takes the color of the label, and a light tint over a
112
+ * dark surface reads as a far smaller change than a dark tint over a light one.
113
+ */
114
+ const HOVER_OVERLAY_OPACITY = 0.1;
115
+ const HOVER_OVERLAY_OPACITY_DARK = 0.28;
116
+
117
+ /**
118
+ * Opacity the outlined border rests at, leaving it somewhere to go on hover where it returns to the
119
+ * full color. The dark scheme keeps more of it: fading toward a dark backdrop cuts the brightness
120
+ * of the border, where fading toward a light one mostly cuts its saturation.
121
+ */
122
+ const OUTLINED_BORDER_OPACITY = 0.5;
123
+ const OUTLINED_BORDER_OPACITY_DARK = 0.7;
108
124
  const useStyles = makeStyles({
109
125
  name: 'Button'
110
126
  })((theme, props) => {
@@ -118,6 +134,7 @@ const useStyles = makeStyles({
118
134
  } = props;
119
135
  let cssColor = '';
120
136
  let contrastText = '';
137
+ let darkCssColor = '';
121
138
  if (color === 'cta') {
122
139
  // The call to action color is not part of the palette. It's a component token so that merchants
123
140
  // can configure it separately from the primary color via `--color-button-cta`.
@@ -127,8 +144,12 @@ const useStyles = makeStyles({
127
144
  cssColor = color && theme.palette?.[color]?.main ? theme.palette[color].main : theme.palette.primary.main;
128
145
  contrastText = color && theme.palette?.[color]?.contrastText ? theme.palette[color].contrastText : theme.palette.primary.contrastText;
129
146
  } else if (variant === 'contained') {
147
+ // The numeric grey scale is absolute rather than per scheme, so it stays light in both. The
148
+ // light value is kept as it is and only the dark scheme swaps in a surface that its inherited
149
+ // text color can be read on.
130
150
  // eslint-disable-next-line prefer-destructuring
131
151
  cssColor = theme.palette.grey[200];
152
+ darkCssColor = theme.palette.background.emphasized;
132
153
  contrastText = 'inherit';
133
154
  } else {
134
155
  cssColor = 'currentColor';
@@ -141,12 +162,20 @@ const useStyles = makeStyles({
141
162
  // turn these into `var(undefined, ...)`.
142
163
  '--button-color': `var(${theme.vars.components.button.color}, ${cssColor})`,
143
164
  '--text-color': `var(${theme.vars.components.button.textColor}, ${contrastText})`,
165
+ // A single `applyStyles` call for the whole scheme. A second one would land on the same
166
+ // object key and quietly replace this one.
167
+ ...theme.applyStyles('dark', {
168
+ ...(darkCssColor ? {
169
+ '--button-color': `var(${theme.vars.components.button.color}, ${darkCssColor})`
170
+ } : {}),
171
+ '--variant-outlinedBorder': theme.alpha('var(--button-color)', OUTLINED_BORDER_OPACITY_DARK)
172
+ }),
144
173
  '--border-radius': theme.components.button.borderRadius,
145
174
  '--font-size': theme.typography.button.fontSize,
146
175
  '--variant-textColor': 'var(--button-color)',
147
176
  '--variant-textDisabledColor': theme.palette.action.disabled,
148
177
  '--variant-outlinedColor': 'var(--button-color)',
149
- '--variant-outlinedBorder': 'var(--button-color)',
178
+ '--variant-outlinedBorder': theme.alpha('var(--button-color)', OUTLINED_BORDER_OPACITY),
150
179
  '--variant-outlinedDisabledColor': theme.palette.action.disabled,
151
180
  '--variant-outlinedDisabledBorder': theme.palette.action.disabled,
152
181
  '--variant-containedColor': 'var(--text-color)',
@@ -166,16 +195,31 @@ const useStyles = makeStyles({
166
195
  }),
167
196
  borderRadius: 'var(--border-radius)',
168
197
  '&:hover': {
169
- '--variant-textBg': theme.alpha(cssColor, 0.1),
170
- '--variant-outlinedBg': theme.alpha(cssColor, 0.1),
171
198
  textDecoration: 'none',
172
- '&:disabled, &[aria-disabled="true"]': {
173
- backgroundColor: 'transparent'
174
- },
175
199
  // Reset on touch devices, it doesn't add specificity
176
200
  '@media (hover: none)': {
177
201
  backgroundColor: 'transparent'
178
202
  }
203
+ },
204
+ // A disabled button keeps taking pointer events so that it can show a not-allowed cursor,
205
+ // which leaves it matching `:hover`. Its hover backgrounds stay unset instead, so the colors
206
+ // the variants give it while disabled are what remains visible.
207
+ '&:hover:not(:disabled):not([aria-disabled="true"])': {
208
+ '--variant-textBg': theme.alpha(cssColor, HOVER_OVERLAY_OPACITY),
209
+ '--variant-outlinedBg': theme.alpha(cssColor, HOVER_OVERLAY_OPACITY),
210
+ // The resting border sits at a fraction of the color, so hover brings it back to the full
211
+ // one. The root transition covers `border`, which carries the change over.
212
+ '--variant-outlinedBorder': 'var(--button-color)',
213
+ ...theme.applyStyles('dark', {
214
+ '--variant-textBg': theme.alpha(cssColor, HOVER_OVERLAY_OPACITY_DARK),
215
+ '--variant-outlinedBg': theme.alpha(cssColor, HOVER_OVERLAY_OPACITY_DARK)
216
+ }),
217
+ '@media (hover: none)': {
218
+ '--variant-outlinedBorder': theme.alpha('var(--button-color)', OUTLINED_BORDER_OPACITY),
219
+ ...theme.applyStyles('dark', {
220
+ '--variant-outlinedBorder': theme.alpha('var(--button-color)', OUTLINED_BORDER_OPACITY_DARK)
221
+ })
222
+ }
179
223
  }
180
224
  },
181
225
  small: {
@@ -203,7 +247,9 @@ const useStyles = makeStyles({
203
247
  border: 0,
204
248
  textTransform: 'none',
205
249
  color: 'var(--variant-textColor)',
206
- '&:active': {
250
+ // Scoped like the hover backgrounds are: a disabled button stays hit testable for its
251
+ // not-allowed cursor, so it would otherwise dim on press like an operable one.
252
+ '&:active:not(:disabled):not([aria-disabled="true"])': {
207
253
  opacity: 0.5
208
254
  },
209
255
  '&:disabled, &[aria-disabled="true"]': {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.ts","sourceR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AAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAChE,kBAAkB,CAAC,CAAC,CAAC,GACrB,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;wBAQhC,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EACzE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;CAAE,KACxE,KAAK,CAAC,YAAY,GAAG,IAAI;AAF9B,wBAE+B"}
@@ -12,6 +12,23 @@ import { usePressRipple } from "./hooks";
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const supportedButtonTypes = ['button', 'submit', 'reset'];
14
14
 
15
+ /**
16
+ * Whether a pointer position sits within the bounds of an element.
17
+ * @param element The element to measure.
18
+ * @param clientX Horizontal position of the pointer.
19
+ * @param clientY Vertical position of the pointer.
20
+ * @returns Whether the position is inside the element.
21
+ */
22
+ const containsPoint = (element, clientX, clientY) => {
23
+ const {
24
+ top,
25
+ right,
26
+ bottom,
27
+ left
28
+ } = element.getBoundingClientRect();
29
+ return clientX >= left && clientX <= right && clientY >= top && clientY <= bottom;
30
+ };
31
+
15
32
  /**
16
33
  * Props read off the resolved element rather than declared on `ButtonBaseOwnProps`. Typed loosely
17
34
  * because the element type is generic - `React.ComponentPropsWithRef<C>` keeps consumers exact.
@@ -114,6 +131,15 @@ function ButtonBase(props, ref) {
114
131
  event.preventDefault();
115
132
  return;
116
133
  }
134
+
135
+ // The pointer capture taken on pointer down redirects the release to this element, so a pointer
136
+ // that went up somewhere else still arrives here as a click. Without the capture the browser
137
+ // would have dropped it. Keyboard activation reports no button presses and carries no position,
138
+ // so it never takes this path.
139
+ if (event.detail > 0 && !containsPoint(event.currentTarget, event.clientX, event.clientY)) {
140
+ event.preventDefault();
141
+ return;
142
+ }
117
143
  onClick?.(event);
118
144
  if (!href || event.defaultPrevented) {
119
145
  return;
@@ -136,7 +162,10 @@ function ButtonBase(props, ref) {
136
162
  event.currentTarget.click();
137
163
  };
138
164
  const handlePointerDown = event => {
139
- if (!disabled && !disableRipple) {
165
+ if (disabled) {
166
+ return;
167
+ }
168
+ if (!disableRipple) {
140
169
  event.currentTarget.setPointerCapture?.(event.pointerId);
141
170
  start(event);
142
171
  }
@@ -159,6 +188,9 @@ function ButtonBase(props, ref) {
159
188
  if (!disableRipple) {
160
189
  end(event.pointerId);
161
190
  }
191
+ if (disabled) {
192
+ return;
193
+ }
162
194
  onPointerUp?.(event);
163
195
  };
164
196
  const handlePointerCancel = event => {
@@ -166,6 +198,9 @@ function ButtonBase(props, ref) {
166
198
  if (!disableRipple) {
167
199
  end(event.pointerId);
168
200
  }
201
+ if (disabled) {
202
+ return;
203
+ }
169
204
  onPointerCancel?.(event);
170
205
  };
171
206
 
@@ -183,6 +218,9 @@ function ButtonBase(props, ref) {
183
218
  if (!disableRipple && event.buttons === 1) {
184
219
  end(event.pointerId);
185
220
  }
221
+ if (disabled) {
222
+ return;
223
+ }
186
224
  onPointerLeave?.(event);
187
225
  };
188
226
  return /*#__PURE__*/_jsxs(Component, {
@@ -8,7 +8,7 @@ declare const useStyles: (params: Omit<ButtonGroupOwnProps, "children">, muiStyl
8
8
  props: Record<string, unknown>;
9
9
  ownerState?: Record<string, unknown> | undefined;
10
10
  } | undefined) => {
11
- classes: Record<"root" | "disabled" | "enableElevation" | "fullWidth" | "vertical" | "grouped" | "groupedHorizontal" | "groupedVertical" | "groupedContained" | "groupedContainedHorizontal" | "groupedContainedVertical" | "groupedOutlined" | "groupedOutlinedHorizontal" | "groupedOutlinedVertical" | "groupedText" | "groupedTextHorizontal" | "groupedTextVertical", string>;
11
+ classes: Record<"root" | "disabled" | "vertical" | "enableElevation" | "fullWidth" | "grouped" | "groupedHorizontal" | "groupedVertical" | "groupedContained" | "groupedContainedHorizontal" | "groupedContainedVertical" | "groupedOutlined" | "groupedOutlinedHorizontal" | "groupedOutlinedVertical" | "groupedText" | "groupedTextHorizontal" | "groupedTextVertical", string>;
12
12
  theme: import("@shopgate/engage/styles").Theme;
13
13
  css: import("tss-react").Css;
14
14
  cx: import("tss-react").Cx;
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../../components/v2/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE;;GAEG;AACH,QAAA,MAAM,WAAW,mIAsEf,CAAC;AAEH,QAAA,MAAM,SAAS;;cAqCX,CAAJ;;;;;;CAiGE,CAAC;AAEH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IAC5C;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,qBAAqB,GAAG,SAAS,GAAG,KAAK,CAAC;IAClD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,M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,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;AAIzF,eAAe,WAAW,CAAC"}
@@ -70,6 +70,12 @@ const ButtonGroup = /*#__PURE__*/forwardRef((props, ref) => {
70
70
  })
71
71
  });
72
72
  });
73
+
74
+ /**
75
+ * Opacity the separator between grouped text buttons defaults to. Published as a custom property
76
+ * below, so the value is not baked into the border declarations.
77
+ */
78
+ const SEPARATOR_OPACITY = '0.5';
73
79
  const useStyles = makeStyles({
74
80
  name: 'ButtonGroup'
75
81
  })((theme, props) => {
@@ -78,6 +84,7 @@ const useStyles = makeStyles({
78
84
  variant
79
85
  } = props;
80
86
  let cssColor = '';
87
+ let darkCssColor = '';
81
88
  if (color === 'cta') {
82
89
  cssColor = theme.components.ctaButton.background;
83
90
  } else if (color !== 'inherit') {
@@ -85,13 +92,21 @@ const useStyles = makeStyles({
85
92
  } else if (variant === 'contained') {
86
93
  // eslint-disable-next-line prefer-destructuring
87
94
  cssColor = theme.palette.grey[200];
95
+ darkCssColor = theme.palette.background.emphasized;
88
96
  } else {
89
97
  cssColor = 'currentColor';
90
98
  }
91
99
  return {
92
100
  root: {
93
101
  '--button-group-color': `var(${theme.vars.components.button.color}, ${cssColor})`,
102
+ '--button-group-divider': theme.darken('var(--button-group-color)'),
103
+ ...(darkCssColor ? theme.applyStyles('dark', {
104
+ '--button-group-color': `var(${theme.vars.components.button.color}, ${darkCssColor})`,
105
+ '--button-group-divider': theme.lighten('var(--button-group-color)')
106
+ }) : {}),
94
107
  '--disabledColor': theme.palette.action.disabled,
108
+ '--button-group-separator-opacity': SEPARATOR_OPACITY,
109
+ '--button-group-separator': theme.alpha('var(--button-group-color)', 'var(--button-group-separator-opacity)'),
95
110
  display: 'inline-flex',
96
111
  borderRadius: theme.components.button.borderRadius
97
112
  },
@@ -136,7 +151,7 @@ const useStyles = makeStyles({
136
151
  '&:not(:last-of-type)': {
137
152
  borderRightWidth: 1,
138
153
  borderRightStyle: 'solid',
139
- borderRightColor: theme.darken('var(--button-group-color)'),
154
+ borderRightColor: 'var(--button-group-divider)',
140
155
  '&:disabled, &[aria-disabled="true"]': {
141
156
  borderRightColor: 'var(--disabledColor)'
142
157
  }
@@ -146,17 +161,13 @@ const useStyles = makeStyles({
146
161
  '&:not(:last-of-type)': {
147
162
  borderBottomWidth: 1,
148
163
  borderBottomStyle: 'solid',
149
- borderBottomColor: theme.darken('var(--button-group-color)'),
164
+ borderBottomColor: 'var(--button-group-divider)',
150
165
  '&:disabled, &[aria-disabled="true"]': {
151
166
  borderBottomColor: 'var(--disabledColor)'
152
167
  }
153
168
  }
154
169
  },
155
170
  groupedOutlined: {
156
- borderColor: `${theme.lighten('var(--button-group-color)', 0.5)} !important`,
157
- '&:hover': {
158
- borderColor: 'var(--button-group-color)'
159
- },
160
171
  '&:disabled, &[aria-disabled="true"]': {
161
172
  borderColor: 'var(--disabledColor) !important'
162
173
  }
@@ -184,7 +195,7 @@ const useStyles = makeStyles({
184
195
  '&&:not(:last-of-type)': {
185
196
  borderRightWidth: 1,
186
197
  borderRightStyle: 'solid',
187
- borderRightColor: `${theme.lighten('var(--button-group-color)', 0.5)}`,
198
+ borderRightColor: 'var(--button-group-separator)',
188
199
  '&:disabled, &[aria-disabled="true"]': {
189
200
  borderRightColor: 'var(--disabledColor)'
190
201
  }
@@ -194,7 +205,7 @@ const useStyles = makeStyles({
194
205
  '&&:not(:last-of-type)': {
195
206
  borderBottomWidth: 1,
196
207
  borderBottomStyle: 'solid',
197
- borderBottomColor: `${theme.lighten('var(--button-group-color)', 0.5)}`,
208
+ borderBottomColor: 'var(--button-group-separator)',
198
209
  '&:disabled, &[aria-disabled="true"]': {
199
210
  borderBottomColor: 'var(--disabledColor)'
200
211
  }
@@ -76,6 +76,7 @@ const useStyles = makeStyles()(theme => ({
76
76
  },
77
77
  input: {
78
78
  margin: '3px 0',
79
+ color: theme.palette.text.primary,
79
80
  width: '100%',
80
81
  lineHeight: '28px',
81
82
  outline: 'none',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.32.0-beta.8",
3
+ "version": "7.32.0-beta.9",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -18,12 +18,12 @@
18
18
  "dependencies": {
19
19
  "@emotion/react": "^11.14.0",
20
20
  "@shopgate/native-modules": "1.0.0-beta.34",
21
- "@shopgate/pwa-common": "7.32.0-beta.8",
22
- "@shopgate/pwa-common-commerce": "7.32.0-beta.8",
23
- "@shopgate/pwa-core": "7.32.0-beta.8",
24
- "@shopgate/pwa-ui-ios": "7.32.0-beta.8",
25
- "@shopgate/pwa-ui-material": "7.32.0-beta.8",
26
- "@shopgate/pwa-ui-shared": "7.32.0-beta.8",
21
+ "@shopgate/pwa-common": "7.32.0-beta.9",
22
+ "@shopgate/pwa-common-commerce": "7.32.0-beta.9",
23
+ "@shopgate/pwa-core": "7.32.0-beta.9",
24
+ "@shopgate/pwa-ui-ios": "7.32.0-beta.9",
25
+ "@shopgate/pwa-ui-material": "7.32.0-beta.9",
26
+ "@shopgate/pwa-ui-shared": "7.32.0-beta.9",
27
27
  "@stripe/react-stripe-js": "^1.16.5",
28
28
  "@stripe/stripe-js": "^1.44.1",
29
29
  "@virtuous/conductor": "~2.5.0",
@@ -19,7 +19,13 @@ const useStyles = makeStyles()(theme => ({
19
19
  padding: theme.components.productCard.imagePadding
20
20
  },
21
21
  details: {
22
- padding: theme.components.productCard.textPadding
22
+ display: 'flex',
23
+ flexDirection: 'column',
24
+ gap: 4,
25
+ padding: theme.components.productCard.textPadding,
26
+ '& div:empty': {
27
+ display: 'none'
28
+ }
23
29
  },
24
30
  title: {
25
31
  fontSize: theme.typography.body2.fontSize,
@@ -11,6 +11,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
11
11
  const useStyles = makeStyles()(theme => ({
12
12
  root: {
13
13
  lineHeight: 1.2,
14
+ display: 'flex',
15
+ flexDirection: 'column',
16
+ gap: theme.spacing(0.5),
14
17
  ':not(:empty)': {
15
18
  padding: theme.components.tiles.textPadding,
16
19
  // Floored at the favorites button overhang so a small configured inner padding
@@ -19,7 +22,9 @@ const useStyles = makeStyles()(theme => ({
19
22
  }
20
23
  },
21
24
  quantityHint: {
22
- paddingTop: 8
25
+ ':empty': {
26
+ display: 'none'
27
+ }
23
28
  }
24
29
  }));
25
30
 
@@ -9,7 +9,8 @@ const useStyles = makeStyles()((theme, {
9
9
  root: {
10
10
  padding: '0 16px',
11
11
  ':not(:empty)': {
12
- marginTop: 16
12
+ marginTop: 16,
13
+ marginBottom: 16
13
14
  },
14
15
  ...(columns <= 2 ? {
15
16
  rowGap: 16,
@@ -7,7 +7,6 @@ import { makeStyles } from '@shopgate/engage/styles';
7
7
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
8
  const useStyles = makeStyles()(theme => ({
9
9
  priceWrapper: {
10
- marginTop: 4,
11
10
  alignItems: 'center'
12
11
  },
13
12
  strikedPrice: {
@@ -9,7 +9,7 @@ import { WIDGET_ID } from "./constants";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  const useStyles = makeStyles()({
11
11
  container: {
12
- padding: '8px 9px 16px !important'
12
+ padding: '8px 0 16px !important'
13
13
  }
14
14
  });
15
15
  const items = {
@@ -1 +1 @@
1
- {"version":3,"file":"UnitQuantityPicker.d.ts","sourceRoot":"","sources":["../../../../product/components/UnitQuantityPicker/UnitQuantityPicker.jsx"],"names":[],"mappings":";AA6FA;;;GAGG;AACH;;;;;;;;;;;;;;;;;IAFa,GAAG,CAAC,OAAO,CAqMvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAjSqB,YAAY"}
1
+ {"version":3,"file":"UnitQuantityPicker.d.ts","sourceRoot":"","sources":["../../../../product/components/UnitQuantityPicker/UnitQuantityPicker.jsx"],"names":[],"mappings":";AA8FA;;;GAGG;AACH;;;;;;;;;;;;;;;;;IAFa,GAAG,CAAC,OAAO,CAqMvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAlSqB,YAAY"}