@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
@@ -61,6 +61,7 @@ const useStyles = makeStyles()((theme, {
61
61
  fontWeight,
62
62
  height: '100%',
63
63
  width: '100%',
64
+ color: theme.contrastColor(inputBgColor || theme.components.input.background),
64
65
  ...(inputColor && {
65
66
  color: `${inputColor}`
66
67
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/reducers/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa/E,KAAK,iBAAiB,GAAG,wBAAwB,GAAG,aAAa,CAAC;AAQlE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBA4DlC,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,WAAW,EAAE,OAAO,CAAC,gBAAgB,EAAE,iBAAiB,CAmC7D,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/reducers/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAa/E,KAAK,iBAAiB,GAAG,wBAAwB,GAAG,aAAa,CAAC;AAQlE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBA+DlC,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,WAAW,EAAE,OAAO,CAAC,gBAAgB,EAAE,iBAAiB,CAuC7D,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -42,7 +42,7 @@ export const DEFAULT_APP_SETTINGS = {
42
42
  }
43
43
  },
44
44
  rating: {
45
- showEmptyStars: false
45
+ showEmptyStars: true
46
46
  },
47
47
  card: {
48
48
  productName: {
@@ -64,6 +64,9 @@ export const DEFAULT_APP_SETTINGS = {
64
64
  typography: {
65
65
  variants: {}
66
66
  },
67
+ appearance: {
68
+ defaultColorSchemeMode: 'light'
69
+ },
67
70
  images: {
68
71
  quality: DEFAULT_IMAGE_QUALITY,
69
72
  // Already in the image service's format, so the unhydrated path needs no conversion.
@@ -91,7 +94,8 @@ const appSettings = (state, action = {
91
94
  if (isReceiveAppSettingsAction(action)) {
92
95
  const {
93
96
  images,
94
- typography
97
+ typography,
98
+ appearance
95
99
  } = action.settings ?? {};
96
100
 
97
101
  // Merged over the defaults rather than over the current state, so a field an incoming payload
@@ -109,6 +113,10 @@ const appSettings = (state, action = {
109
113
  typography: typography === null ? undefined : {
110
114
  ...typography,
111
115
  variants: typography?.variants ?? undefined
116
+ },
117
+ appearance: appearance === null ? undefined : {
118
+ ...appearance,
119
+ defaultColorSchemeMode: appearance?.defaultColorSchemeMode ?? undefined
112
120
  }
113
121
  }, {
114
122
  isHydrated: true
@@ -1,4 +1,4 @@
1
- import type { AppSettingsSlice, AppSettingsState } from '../types/appSettings';
1
+ import type { AppSettingsSlice, AppSettingsState, ColorSchemeMode } from '../types/appSettings';
2
2
  /**
3
3
  * Retrieves the appSettings state from the store. Falls back to the built-in
4
4
  * defaults when the slice is not present in the store yet.
@@ -114,7 +114,26 @@ export declare const getCardSettings: ((state: AppSettingsState) => import("../t
114
114
  /**
115
115
  * Selects the effective card shadow size. `none` unless the shadow style is selected.
116
116
  */
117
- export declare const getCardShadowSize: ((state: AppSettingsState) => import("../../styles").ShadowSize) & import("reselect").OutputSelectorFields<(args_0: import("../types/appSettings").CardSettings) => import("../../styles").ShadowSize, {
117
+ export declare const getCardShadowSize: ((state: AppSettingsState) => import("../types/appSettings").ShadowSize) & import("reselect").OutputSelectorFields<(args_0: import("../types/appSettings").CardSettings) => import("../types/appSettings").ShadowSize, {
118
+ clearCache: () => void;
119
+ }> & {
120
+ clearCache: () => void;
121
+ };
122
+ /**
123
+ * Selects the color scheme mode that applies while the visitor has no own preference stored. A
124
+ * mode rather than a scheme name, since it can also ask to follow the operating system: a
125
+ * `selectable` setting starts there, so the theme layer only ever sees its own vocabulary.
126
+ */
127
+ export declare const getDefaultColorSchemeMode: ((state: AppSettingsState) => ColorSchemeMode) & import("reselect").OutputSelectorFields<(args_0: import("../types/appSettings").DefaultColorSchemeMode) => ColorSchemeMode, {
128
+ clearCache: () => void;
129
+ }> & {
130
+ clearCache: () => void;
131
+ };
132
+ /**
133
+ * Selects whether visitors may pick a color scheme themselves. False while a binding `light` or
134
+ * `dark` is configured, in which case a stored pick of theirs does not apply.
135
+ */
136
+ export declare const getCanSelectColorScheme: ((state: AppSettingsState) => boolean) & import("reselect").OutputSelectorFields<(args_0: import("../types/appSettings").DefaultColorSchemeMode) => boolean, {
118
137
  clearCache: () => void;
119
138
  }> & {
120
139
  clearCache: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/selectors/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG/E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,gBAAgB,KAAG,gBACR,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;CAGrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CAG7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAGjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAGzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAG5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM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;CAIrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAGjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;CAMpC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { createSelector } from 'reselect';
2
+ import { COLOR_SCHEME_SELECTABLE } from "../types/appSettings";
2
3
  import { DEFAULT_APP_SETTINGS } from "../reducers/appSettings";
3
4
 
4
5
  /**
@@ -67,6 +68,24 @@ export const getCardSettings = createSelector(getAppSettingsState, appSettings =
67
68
  */
68
69
  export const getCardShadowSize = createSelector(getCardSettings, cards => cards.style === 'shadow' ? cards.shadow.size : 'none');
69
70
 
71
+ /**
72
+ * Selects the raw appearance setting: a binding color scheme, or `selectable`.
73
+ */
74
+ const getConfiguredColorSchemeMode = createSelector(getAppSettingsState, appSettings => appSettings.appearance?.defaultColorSchemeMode ?? DEFAULT_APP_SETTINGS.appearance.defaultColorSchemeMode);
75
+
76
+ /**
77
+ * Selects the color scheme mode that applies while the visitor has no own preference stored. A
78
+ * mode rather than a scheme name, since it can also ask to follow the operating system: a
79
+ * `selectable` setting starts there, so the theme layer only ever sees its own vocabulary.
80
+ */
81
+ export const getDefaultColorSchemeMode = createSelector(getConfiguredColorSchemeMode, configured => configured === COLOR_SCHEME_SELECTABLE ? 'system' : configured);
82
+
83
+ /**
84
+ * Selects whether visitors may pick a color scheme themselves. False while a binding `light` or
85
+ * `dark` is configured, in which case a stored pick of theirs does not apply.
86
+ */
87
+ export const getCanSelectColorScheme = createSelector(getConfiguredColorSchemeMode, configured => configured === COLOR_SCHEME_SELECTABLE);
88
+
70
89
  /**
71
90
  * Selects the typography settings.
72
91
  */
@@ -1,5 +1,13 @@
1
- import type { ShadowSize, TypographyVariant } from '@shopgate/engage/styles/theme';
2
- export type { ShadowSize, TypographyVariant };
1
+ import type { ColorSchemeMode, ColorSchemeName, ShadowSize, TypographyVariant } from '@shopgate/engage/styles/theme';
2
+ export type { ColorSchemeMode, ColorSchemeName, ShadowSize, TypographyVariant, };
3
+ export declare const COLOR_SCHEME_SELECTABLE = "selectable";
4
+ /**
5
+ * What the app settings can configure: a color scheme that is binding, or `selectable` to let
6
+ * visitors pick one themselves. Distinct from the theme's `ColorSchemeMode`, which is what a
7
+ * visitor can pick - `selectable` is a permission rather than an appearance, and maps to the
8
+ * theme's `system` mode.
9
+ */
10
+ export type DefaultColorSchemeMode = ColorSchemeName | typeof COLOR_SCHEME_SELECTABLE;
3
11
  /**
4
12
  * Recursively optional variant of `T`. The settings sources send only what a merchant configured,
5
13
  * and the admin preview additionally prunes the fields its visibility conditions hide.
@@ -190,6 +198,16 @@ export interface ImageSettings {
190
198
  */
191
199
  product: ProductImageSettings;
192
200
  }
201
+ /**
202
+ * Settings for the app's overall appearance.
203
+ */
204
+ export interface AppearanceSettings {
205
+ /**
206
+ * The color scheme the app renders in. A binding `light` or `dark` always applies, while
207
+ * `selectable` starts from the operating system preference and lets the visitor pick another.
208
+ */
209
+ defaultColorSchemeMode: DefaultColorSchemeMode;
210
+ }
193
211
  export interface AppSettings {
194
212
  navigation: {
195
213
  tabBar: {
@@ -215,6 +233,7 @@ export interface AppSettings {
215
233
  images: ImageSettings;
216
234
  cards: CardSettings;
217
235
  typography: TypographySettings;
236
+ appearance: AppearanceSettings;
218
237
  }
219
238
  /**
220
239
  * A font stylesheet to load. The file carries the `@font-face` rules and points its target at the
@@ -1 +1 @@
1
- {"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/types/appSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKnF,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAA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AAM,GAAG,OAAO,CAAC;YAC7B,UAAU,EAAE,OAAO,CAAC;YACpB,YAAY,EAAE,OAAO,CAAC;YACtB,KAAK,EAAE;gBACL,aAAa,EAAE,OAAO,CAAC;aACxB,CAAA;YACD,SAAS,EAAE;gBACT;;mBAEG;gBACH,WAAW,EAAE,OAAO,CAAC;aACtB,CAAA;SACF,CAAA;KACF,CAAA;IACD,OAAO,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC,CAAC;CAC/D;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/types/appSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAChE,MAAM,+BAA+B,CAAC;AAKvC,YAAY,EACV,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,GAChE,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG,OAAO,uBAAuB,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KA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sB,CAAC;CAChD;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE;QACV,MAAM,EAAE;YACN,OAAO,EAAE,OAAO,GAAG,UAAU,CAAA;YAC7B,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;YAC7B,UAAU,EAAE,OAAO,CAAC;YACpB,YAAY,EAAE,OAAO,CAAC;YACtB,KAAK,EAAE;gBACL,aAAa,EAAE,OAAO,CAAC;aACxB,CAAA;YACD,SAAS,EAAE;gBACT;;mBAEG;gBACH,WAAW,EAAE,OAAO,CAAC;aACtB,CAAA;SACF,CAAA;KACF,CAAA;IACD,OAAO,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC,CAAC;CAC/D;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -1 +1,124 @@
1
- export {};
1
+ // Re-exported so consumers of these settings do not have to reach into the styles layer, which
2
+ // owns the type because it owns the elevation scale the sizes map to. `TypographyVariant` and the
3
+ // color scheme types are reused for the same reason - the theme owns the variant and scheme lists.
4
+
5
+ export const COLOR_SCHEME_SELECTABLE = 'selectable';
6
+
7
+ /**
8
+ * What the app settings can configure: a color scheme that is binding, or `selectable` to let
9
+ * visitors pick one themselves. Distinct from the theme's `ColorSchemeMode`, which is what a
10
+ * visitor can pick - `selectable` is a permission rather than an appearance, and maps to the
11
+ * theme's `system` mode.
12
+ */
13
+
14
+ /**
15
+ * Recursively optional variant of `T`. The settings sources send only what a merchant configured,
16
+ * and the admin preview additionally prunes the fields its visibility conditions hide.
17
+ */
18
+
19
+ /**
20
+ * The merchant-facing screen sizes for the product list types. Each maps to a theme
21
+ * breakpoint inside the consuming hook (small → xs, medium → sm, large → md).
22
+ */
23
+
24
+ /**
25
+ * A value keyed by screen size. Partial: any unset size cascades down to the next smaller
26
+ * defined value (see useResponsiveValue).
27
+ */
28
+
29
+ /**
30
+ * Number of product columns to render, keyed by screen size.
31
+ */
32
+
33
+ /**
34
+ * Settings for the ProductGrid list type.
35
+ */
36
+
37
+ /**
38
+ * Name-clamping shared by the card and tile product surfaces.
39
+ */
40
+
41
+ /**
42
+ * Drop shadow of the card surface.
43
+ */
44
+
45
+ /**
46
+ * Number of slides to render side by side, keyed by screen size. Fractional values are allowed.
47
+ */
48
+
49
+ /**
50
+ * Settings for the ProductSlider list type.
51
+ */
52
+
53
+ /**
54
+ * Settings for the product rating stars.
55
+ */
56
+
57
+ /**
58
+ * Settings for product presentation across the app.
59
+ */
60
+
61
+ /**
62
+ * The visual style of the card surface.
63
+ */
64
+
65
+ /**
66
+ * Settings for the themed card surface (checkout sections, address cards, sliders).
67
+ */
68
+
69
+ /**
70
+ * An aspect ratio expressed as width and height parts. Only the proportion matters -
71
+ * { width: 4, height: 5 } and { width: 8, height: 10 } are equivalent.
72
+ */
73
+
74
+ /**
75
+ * A single image resolution requested from the image service.
76
+ */
77
+
78
+ /**
79
+ * The product image contexts. pdp drives the product detail page, gallery the fullscreen gallery,
80
+ * and list every grid, slider, list and row tile.
81
+ */
82
+
83
+ /**
84
+ * Settings for a single product image context. The pixel dimensions are not configurable - they
85
+ * are derived from the built-in base widths for the context (see PRODUCT_IMAGE_BASE_WIDTHS) so
86
+ * that image weight stays under the theme's control.
87
+ */
88
+
89
+ /**
90
+ * Settings for the product image contexts.
91
+ */
92
+
93
+ /**
94
+ * Settings for images that are served through the image service.
95
+ *
96
+ * quality, fillColor and fillTransparent sit here rather than under product because they are not
97
+ * product specific - getFullImageSource applies them to every image that goes through the image
98
+ * service, including category images, carrier logos and page builder widget images.
99
+ */
100
+
101
+ /**
102
+ * Settings for the app's overall appearance.
103
+ */
104
+
105
+ /**
106
+ * A font stylesheet to load. The file carries the `@font-face` rules and points its target at the
107
+ * new family itself, e.g. `:root { --sg-typography-h1-fontFamily: 'Recoleta'; }`.
108
+ */
109
+
110
+ /**
111
+ * Typography settings. The top level file applies to everything, a variant entry only to that
112
+ * variant. Variant files are loaded after the global one, so they win at equal specificity.
113
+ */
114
+
115
+ /**
116
+ * What a settings source actually sends. Every field is optional, so the reducer fills the gaps
117
+ * from its defaults instead of leaving consumers with undefined.
118
+ */
119
+
120
+ /**
121
+ * The stored app settings slice. Extends the raw {@link AppSettings} values
122
+ * with metadata that is derived by the reducer rather than supplied by a
123
+ * source (admin sync / jsonp).
124
+ */
package/styles/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './helpers';
2
- export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme, type Theme, type ShadowSize, type ColorSchemeName, type PaletteColorsWithMain, type WithThemeProps, } from './theme';
2
+ export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme, type Theme, type ShadowSize, type ColorSchemeName, type ColorSchemeMode, type ColorSchemeContextValue, type PaletteColorsWithMain, type WithThemeProps, } from './theme';
3
3
  export { makeStyles, withStyles, useStyles, css, cx, tss, GlobalStyles, injectGlobal, keyframes, } from './tss';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,SAAS,EACT,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,GAAG,EACH,EAAE,EACF,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,SAAS,EACT,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,GAAG,EACH,EAAE,EACF,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createDefaultThemeOptions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,YAuH3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createDefaultThemeOptions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,YAkN3C,CAAC"}
@@ -118,12 +118,103 @@ export const createDefaultThemeOptions = () => ({
118
118
  },
119
119
  dark: {
120
120
  palette: {
121
+ // No primary or secondary here on purpose. Both inherit from the light scheme, so a
122
+ // merchant's brand colors carry over instead of being replaced by a hard coded pair.
123
+ error: {
124
+ main: '#FF6B6B'
125
+ },
126
+ warning: {
127
+ main: '#FFA726'
128
+ },
129
+ success: {
130
+ main: '#5DD954'
131
+ },
121
132
  background: {
122
- default: '#000'
133
+ default: '#000000',
134
+ surface: '#1C1C1E',
135
+ emphasized: '#2C2C2E'
123
136
  },
124
137
  text: {
125
- primary: '#fff',
126
- secondary: '#808080'
138
+ primary: '#F2F2F7',
139
+ secondary: '#AEAEB2'
140
+ },
141
+ grey: {
142
+ light: '#2C2C2E',
143
+ medium: '#48484A',
144
+ dark: '#8E8E93'
145
+ },
146
+ action: {
147
+ disabled: '#8E8E93',
148
+ disabledBackground: '#48484A'
149
+ }
150
+ },
151
+ components: {
152
+ border: {
153
+ vars: {
154
+ light: '#38383A',
155
+ medium: '#48484A',
156
+ dark: '#8E8E93'
157
+ }
158
+ },
159
+ input: {
160
+ vars: {
161
+ background: '#2C2C2E',
162
+ border: '#48484A'
163
+ }
164
+ },
165
+ separatorLine: {
166
+ vars: {
167
+ borderColor: '#38383A'
168
+ }
169
+ },
170
+ snackbar: {
171
+ vars: {
172
+ background: '#2C2C2E'
173
+ }
174
+ },
175
+ tabBar: {
176
+ vars: {
177
+ background: '#1C1C1E',
178
+ border: '#374151',
179
+ inactive: '#9CA3AF',
180
+ floatingBoxShadow: '0 0 12px rgba(0, 0, 0, 0.6)'
181
+ }
182
+ },
183
+ appBar: {
184
+ vars: {
185
+ background: '#1C1C1E'
186
+ }
187
+ },
188
+ discountBadge: {
189
+ vars: {
190
+ background: '#FF0000'
191
+ }
192
+ },
193
+ ratingStars: {
194
+ vars: {
195
+ empty: '#48484A'
196
+ }
197
+ },
198
+ cards: {
199
+ vars: {
200
+ backgroundColor: '#1C1C1E',
201
+ borderColor: '#38383A'
202
+ }
203
+ },
204
+ tiles: {
205
+ vars: {
206
+ backgroundColor: '#1C1C1E',
207
+ borderColor: '#38383A'
208
+ }
209
+ },
210
+ swiper: {
211
+ vars: {
212
+ paginationBulletColor: '#AEAEB2',
213
+ paginationBulletActiveColor: '#F2F2F7',
214
+ paginationFractionBackground: '#2C2C2E',
215
+ paginationProgressbarBackground: '#48484A',
216
+ paginationProgressbarActiveColor: '#FFFFFF'
217
+ }
127
218
  }
128
219
  }
129
220
  }
@@ -284,7 +284,7 @@ export const componentsDefaults = {
284
284
  },
285
285
  discountBadge: {
286
286
  vars: {
287
- background: '#857500'
287
+ background: '#FF0000'
288
288
  }
289
289
  },
290
290
  icon: {
@@ -367,8 +367,8 @@ export const componentsDefaults = {
367
367
  borderColor: 'transparent',
368
368
  border: 'var(--sg-components-tiles-borderWidth) solid var(--sg-components-tiles-borderColor)',
369
369
  padding: 0,
370
- textPadding: 8,
371
- textPaddingTop: 'max(var(--sg-components-tiles-textPadding), 16px)',
370
+ textPadding: 0,
371
+ textPaddingTop: 'max(var(--sg-components-tiles-textPadding), 12px)',
372
372
  imagePadding: 0
373
373
  }
374
374
  },
@@ -1,6 +1,6 @@
1
1
  import { type ThemeOptions, type ThemeInternal } from './types';
2
- export type { Theme, BaseTheme, ThemeInternal, ThemeOptions, Breakpoint, ColorSchemeName, ColorSchemeSelectorType, PaletteColorsWithMain, } from './types';
3
- export { COLOR_SCHEME_NAMES } from './types';
2
+ export type { Theme, BaseTheme, ThemeInternal, ThemeOptions, Breakpoint, ColorSchemeName, ColorSchemeMode, ColorSchemeSelectorType, PaletteColorsWithMain, } from './types';
3
+ export { COLOR_SCHEME_NAMES, COLOR_SCHEME_SYSTEM } from './types';
4
4
  /**
5
5
  * Creates a theme object for the ThemeProvider.
6
6
  * @param options The theme options.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAS,YAAiB,KAAG,aAkExD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAS,YAAiB,KAAG,aAkExD,CAAC"}
@@ -9,7 +9,7 @@ import createThemeFromColorScheme from "./createThemeFromColorScheme";
9
9
  import createCssVarsForColorSchemeThemes from "./createCssVarsForColorSchemeThemes";
10
10
  import applyStyles from "./applyStyles";
11
11
  import { createGetColorSchemeSelector, createSetActiveColorScheme } from "./helpers";
12
- export { COLOR_SCHEME_NAMES } from "./types";
12
+ export { COLOR_SCHEME_NAMES, COLOR_SCHEME_SYSTEM } from "./types";
13
13
 
14
14
  /**
15
15
  * Creates a theme object for the ThemeProvider.
@@ -15,6 +15,11 @@ export type { Breakpoint } from './createBreakpoints';
15
15
  export type { PaletteColorsWithMain } from './createPalette';
16
16
  export declare const COLOR_SCHEME_NAMES: readonly ["light", "dark"];
17
17
  export type ColorSchemeName = (typeof COLOR_SCHEME_NAMES)[number];
18
+ export declare const COLOR_SCHEME_SYSTEM = "system";
19
+ /**
20
+ * A selectable color scheme: one the theme provides, or `system` to follow the operating system.
21
+ */
22
+ export type ColorSchemeMode = ColorSchemeName | typeof COLOR_SCHEME_SYSTEM;
18
23
  declare const selectorTypes: readonly ["data", "class"];
19
24
  export type ColorSchemeSelectorType = (typeof selectorTypes)[number];
20
25
  type DeepPartial<T> = T extends object ? {
@@ -28,7 +33,8 @@ type DeepPartial<T> = T extends object ? {
28
33
  export type ColorSchemeOptions = Pick<ThemeOptions, 'palette' | 'typography' | 'components' | 'shape'>;
29
34
  export interface ThemeOptions {
30
35
  /**
31
- * The default color scheme to use when the user has not specified a preference.
36
+ * The color scheme to fall back to when the configured mode resolves to a scheme this theme does
37
+ * not style. The scheme the app starts in comes from the app settings.
32
38
  * @default 'light'
33
39
  */
34
40
  defaultColorScheme?: ColorSchemeName;
@@ -129,7 +135,8 @@ export interface BaseTheme {
129
135
  }
130
136
  export interface Theme extends BaseTheme {
131
137
  /**
132
- * The default color scheme to use when the user has not specified a preference.
138
+ * The color scheme to fall back to when the configured mode resolves to a scheme this theme does
139
+ * not style. The scheme the app starts in comes from the app settings.
133
140
  */
134
141
  defaultColorScheme?: ColorSchemeName;
135
142
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,E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AI,CAAC,4CAA4C,EAAE,qBAAqB,CAAC,GAAG;IAC9E;;OAEG;IACH,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C;;OAEG;IACH,oBAAoB,EAAE,yBAAyB,CAAC;CACjD,CAAC"}
@@ -1,4 +1,10 @@
1
1
  export const COLOR_SCHEME_NAMES = ['light', 'dark'];
2
+ export const COLOR_SCHEME_SYSTEM = 'system';
3
+
4
+ /**
5
+ * A selectable color scheme: one the theme provides, or `system` to follow the operating system.
6
+ */
7
+
2
8
  const selectorTypes = ['data', 'class'];
3
9
 
4
10
  /**
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Provides access to the color scheme context.
3
3
  * @returns The color scheme context value, containing the current `mode`, a `setMode` function to
4
- * update it, and the list of `modes` the active theme actually provides.
4
+ * update it, and the `modes` that can be set.
5
5
  */
6
- declare const useColorScheme: () => import("../providers/ColorSchemeContext").ColorSchemeContextValue;
6
+ declare const useColorScheme: () => import("..").ColorSchemeContextValue;
7
7
  export default useColorScheme;
8
8
  //# sourceMappingURL=useColorScheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hooks/useColorScheme.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,QAAA,MAAM,cAAc,yEAAuC,CAAC;AAE5D,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hooks/useColorScheme.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,QAAA,MAAM,cAAc,4CAAuC,CAAC;AAE5D,eAAe,cAAc,CAAC"}
@@ -4,7 +4,7 @@ import { ColorSchemeContext } from "../providers/ColorSchemeContext";
4
4
  /**
5
5
  * Provides access to the color scheme context.
6
6
  * @returns The color scheme context value, containing the current `mode`, a `setMode` function to
7
- * update it, and the list of `modes` the active theme actually provides.
7
+ * update it, and the `modes` that can be set.
8
8
  */
9
9
  const useColorScheme = () => useContext(ColorSchemeContext);
10
10
  export default useColorScheme;
@@ -1,4 +1,11 @@
1
1
  import { type Theme } from '..';
2
+ /**
3
+ * React hook to check if a media query matches the current viewport. Independent of the theme
4
+ * context, so it can be used by the provider that establishes it.
5
+ * @param query A media query string, e.g. '(min-width: 600px)'
6
+ * @returns Returns true if the media query matches, false otherwise.
7
+ */
8
+ export declare const useMatchMedia: (query: string) => boolean;
2
9
  /**
3
10
  * @callback ThemeFn
4
11
  * @param {Theme} theme The current theme object.
@@ -1 +1 @@
1
- {"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,IAAI,CAAC;AA8BhC;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa,GAAI,YAAY,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,KAAG,OASxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,IAAI,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,OAoB7C,CAAC;AAEF;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa,GAAI,YAAY,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,KAAG,OASxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -2,12 +2,12 @@ import "core-js/modules/es.string.replace.js";
2
2
  import { useState, useEffect } from 'react';
3
3
  import useTheme from "./useTheme";
4
4
  /**
5
- * React hook to check if a media query matches the current viewport.
6
- * Doesn't accept media query strings that start with '@media'.
5
+ * React hook to check if a media query matches the current viewport. Independent of the theme
6
+ * context, so it can be used by the provider that establishes it.
7
7
  * @param query A media query string, e.g. '(min-width: 600px)'
8
8
  * @returns Returns true if the media query matches, false otherwise.
9
9
  */
10
- const useMediaQueryInternal = query => {
10
+ export const useMatchMedia = query => {
11
11
  const [match, setMatch] = useState(() => window.matchMedia(query).matches);
12
12
  useEffect(() => {
13
13
  const queryList = window.matchMedia(query);
@@ -60,9 +60,9 @@ const useMediaQueryInternal = query => {
60
60
  const useMediaQuery = queryInput => {
61
61
  const theme = useTheme();
62
62
  let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
63
- // Remove the '@media' prefix if it exists, as useMediaQueryInternal expects a plain media query.
63
+ // Remove the '@media' prefix if it exists, as useMatchMedia expects a plain media query.
64
64
  query = query.replace(/^@media( ?)/m, '');
65
- const match = useMediaQueryInternal(query);
65
+ const match = useMatchMedia(query);
66
66
  return match;
67
67
  };
68
68
  export default useMediaQuery;
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ThemeContext } from "../providers/ThemeProvider";
2
+ import { ThemeContext } from "../providers/ThemeContext";
3
3
 
4
4
  /**
5
5
  * Returns the theme object.
@@ -2,7 +2,8 @@ export { default as ThemeProvider } from './providers/ThemeProvider';
2
2
  export { createTheme } from './createTheme';
3
3
  export { type ShadowSize } from './createTheme/shadows';
4
4
  export type { Variant as TypographyVariant } from './createTheme/createTypography';
5
- export type { Theme, Breakpoint, PaletteColorsWithMain, ColorSchemeName, } from './createTheme';
5
+ export type { Theme, Breakpoint, PaletteColorsWithMain, ColorSchemeName, ColorSchemeMode, } from './createTheme';
6
6
  export { useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, } from './hooks';
7
7
  export { withTheme, type WithThemeProps } from './hocs';
8
+ export type { ColorSchemeContextValue } from './providers/ColorSchemeContext';
8
9
  //# sourceMappingURL=index.d.ts.map