@shopgate/engage 7.32.0-beta.1 → 7.32.0-beta.3

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 (80) hide show
  1. package/README.md +0 -1
  2. package/admin-preview/constants/index.d.ts +0 -12
  3. package/admin-preview/constants/index.d.ts.map +1 -1
  4. package/admin-preview/constants/index.js +0 -16
  5. package/admin-preview/helpers/_internal/detection.d.ts +53 -0
  6. package/admin-preview/helpers/_internal/detection.d.ts.map +1 -0
  7. package/admin-preview/helpers/_internal/detection.js +93 -0
  8. package/admin-preview/helpers/index.d.ts +7 -0
  9. package/admin-preview/helpers/index.d.ts.map +1 -1
  10. package/admin-preview/helpers/index.js +12 -4
  11. package/cart/components/CartItem/CartItemProductProvider.connector.js +0 -2
  12. package/cart/components/CartItem/CartItemProductProvider.js +3 -30
  13. package/cart/components/CartItem/CartItemProductProvider.types.js +0 -1
  14. package/cart/components/PaymentBar/PaymentBarContent.js +1 -1
  15. package/components/Logo/index.d.ts.map +1 -1
  16. package/components/Logo/index.js +3 -6
  17. package/components/PickerUtilize/index.d.ts +2 -1
  18. package/components/PickerUtilize/index.d.ts.map +1 -1
  19. package/components/View/components/Above/index.d.ts.map +1 -1
  20. package/components/View/components/Above/index.js +3 -1
  21. package/components/View/components/Below/index.d.ts.map +1 -1
  22. package/components/View/components/Below/index.js +3 -1
  23. package/components/View/components/Content/index.d.ts +2 -1
  24. package/components/View/components/Content/index.d.ts.map +1 -1
  25. package/components/v2/ButtonBase/Ripple.d.ts +2 -1
  26. package/components/v2/ButtonBase/Ripple.d.ts.map +1 -1
  27. package/development/components/SimulatedInsets/SimulatedInsetBottom.js +3 -3
  28. package/development/components/SimulatedInsets/SimulatedInsetTop.js +2 -2
  29. package/favorites/components/Item/Item.js +5 -2
  30. package/favorites/components/Lists/Lists.js +13 -1
  31. package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +4 -8
  32. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +1 -5
  33. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +1 -5
  34. package/package.json +11 -11
  35. package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +2 -2
  36. package/page/constants/index.js +5 -3
  37. package/product/components/FilterBar/components/Content/components/FilterButton/index.js +2 -6
  38. package/product/components/FilterBar/components/Content/components/Sort/index.js +1 -5
  39. package/product/components/ProductName/ProductName.d.ts +1 -1
  40. package/product/components/ProductName/ProductName.d.ts.map +1 -1
  41. package/product/components/ProductName/ProductNameContent.d.ts +2 -1
  42. package/product/components/ProductName/ProductNameContent.d.ts.map +1 -1
  43. package/product/components/ProductRatingStars/ProductRatingStars.d.ts +1 -1
  44. package/product/components/RelationsSlider/RelationsSheet.js +1 -5
  45. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +1 -1
  46. package/styles/index.d.ts +1 -1
  47. package/styles/index.d.ts.map +1 -1
  48. package/styles/index.js +1 -1
  49. package/styles/theme/createTheme/createComponents.d.ts +2 -2
  50. package/styles/theme/createTheme/createComponents.d.ts.map +1 -1
  51. package/styles/theme/createTheme/createComponents.js +0 -1
  52. package/styles/theme/createTheme/createComponents.types.d.ts +20 -0
  53. package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
  54. package/styles/theme/createTheme/createComponents.types.js +20 -0
  55. package/styles/theme/createTheme/createSpacing.js +4 -1
  56. package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +2 -2
  57. package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
  58. package/styles/theme/createTheme/index.d.ts.map +1 -1
  59. package/styles/theme/createTheme/index.js +2 -1
  60. package/styles/theme/createTheme/layout.d.ts +23 -0
  61. package/styles/theme/createTheme/layout.d.ts.map +1 -0
  62. package/styles/theme/createTheme/layout.js +20 -0
  63. package/styles/theme/createTheme/transitions.d.ts +4 -0
  64. package/styles/theme/createTheme/transitions.js +3 -1
  65. package/styles/theme/createTheme/types.d.ts +25 -4
  66. package/styles/theme/createTheme/types.d.ts.map +1 -1
  67. package/styles/theme/createTheme/types.js +8 -1
  68. package/styles/theme/hocs/index.d.ts +2 -0
  69. package/styles/theme/hocs/index.d.ts.map +1 -0
  70. package/styles/theme/hocs/index.js +1 -0
  71. package/styles/theme/hocs/withTheme.d.ts +21 -0
  72. package/styles/theme/hocs/withTheme.d.ts.map +1 -0
  73. package/styles/theme/hocs/withTheme.js +33 -0
  74. package/styles/theme/index.d.ts +1 -0
  75. package/styles/theme/index.d.ts.map +1 -1
  76. package/styles/theme/index.js +2 -1
  77. package/styles/theme/providers/ActiveBreakpointProvider.d.ts +1 -1
  78. package/styles/theme/providers/ThemeProvider.d.ts +3 -3
  79. package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
  80. package/styles/theme/providers/ThemeProvider.js +11 -15
@@ -3,11 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { RippleButton, I18n, Typography } from '@shopgate/engage/components';
4
4
  import { i18n } from '@shopgate/engage/core/helpers';
5
5
  import { makeStyles } from '@shopgate/engage/styles';
6
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
7
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- const {
9
- variables
10
- } = themeConfig;
11
7
  const useStyles = makeStyles()(theme => ({
12
8
  wrapper: {
13
9
  color: theme.palette.text.primary,
@@ -19,7 +15,7 @@ const useStyles = makeStyles()(theme => ({
19
15
  margin: theme.spacing(0, 2),
20
16
  borderBottom: `1px solid ${theme.components.border.light}`,
21
17
  alignItems: 'center',
22
- height: variables.filterbar.height
18
+ height: theme.components.filterBar.height
23
19
  },
24
20
  innerStandalone: {
25
21
  borderBottom: 'none'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.32.0-beta.1",
3
+ "version": "7.32.0-beta.3",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -18,18 +18,18 @@
18
18
  "dependencies": {
19
19
  "@emotion/react": "^11.14.0",
20
20
  "@shopgate/native-modules": "1.0.0-beta.25",
21
- "@shopgate/pwa-common": "7.32.0-beta.1",
22
- "@shopgate/pwa-common-commerce": "7.32.0-beta.1",
23
- "@shopgate/pwa-core": "7.32.0-beta.1",
24
- "@shopgate/pwa-ui-ios": "7.32.0-beta.1",
25
- "@shopgate/pwa-ui-material": "7.32.0-beta.1",
26
- "@shopgate/pwa-ui-shared": "7.32.0-beta.1",
21
+ "@shopgate/pwa-common": "7.32.0-beta.3",
22
+ "@shopgate/pwa-common-commerce": "7.32.0-beta.3",
23
+ "@shopgate/pwa-core": "7.32.0-beta.3",
24
+ "@shopgate/pwa-ui-ios": "7.32.0-beta.3",
25
+ "@shopgate/pwa-ui-material": "7.32.0-beta.3",
26
+ "@shopgate/pwa-ui-shared": "7.32.0-beta.3",
27
27
  "@stripe/react-stripe-js": "^1.16.5",
28
28
  "@stripe/stripe-js": "^1.44.1",
29
29
  "@virtuous/conductor": "~2.5.0",
30
30
  "color": "^4.2.3",
31
31
  "focus-trap-react": "^10.3.1",
32
- "immer": "^11.1.3",
32
+ "immer": "^11.1.11",
33
33
  "intersection-observer": "^0.6.0",
34
34
  "leaflet": "^1.8.0",
35
35
  "leaflet-gesture-handling": "^1.2.2",
@@ -37,16 +37,16 @@
37
37
  "moment": "^2.30.1",
38
38
  "react-helmet": "^6.1.0",
39
39
  "react-leaflet": "^3.2.5",
40
- "react-phone-number-input": "^3.4.14",
40
+ "react-phone-number-input": "^3.4.17",
41
41
  "react-player": "1.11.0",
42
42
  "react-portal": "^3.1.0",
43
43
  "react-scroll-parallax": "^3.5.0",
44
44
  "react-transition-group": "^4.4.5",
45
- "tss-react": "4.9.20",
45
+ "tss-react": "4.9.21",
46
46
  "validate.js": "^0.13.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@shopgate/pwa-unit-test": "7.32.0-beta.1",
49
+ "@shopgate/pwa-unit-test": "7.32.0-beta.3",
50
50
  "@types/color": "^4.2.0",
51
51
  "@types/lodash": "^4.17.24",
52
52
  "@types/react-dom": "^17.0.2",
@@ -2,7 +2,7 @@ import React, { useMemo, useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { makeStyles, useResponsiveValue } from '@shopgate/engage/styles';
4
4
  import { useParallax } from 'react-scroll-parallax';
5
- import { IS_PAGE_PREVIEW_ACTIVE } from "../../constants";
5
+ import { isAdminPreviewActive } from '@shopgate/engage/admin-preview/helpers';
6
6
  import { parseImageUrl } from "../../helpers";
7
7
 
8
8
  /**
@@ -143,7 +143,7 @@ const ResponsiveWidgetImage = ({
143
143
  // height 0 until a resize forces the browser to re-evaluate. Load eagerly there; keep lazy
144
144
  // loading for the live app.
145
145
  ,
146
- loading: IS_PAGE_PREVIEW_ACTIVE ? 'eager' : 'lazy',
146
+ loading: isAdminPreviewActive() ? 'eager' : 'lazy',
147
147
  className: cx(classes.preventSave, classes.image, {
148
148
  [classes.banner]: isBanner
149
149
  }, className),
@@ -1,4 +1,4 @@
1
- import { IS_ADMIN_PREVIEW_ACTIVE } from '@shopgate/engage/admin-preview/constants';
1
+ import { isAdminPreviewActive } from '@shopgate/engage/admin-preview/helpers';
2
2
  import { PAGE_PATH, PAGE_PATTERN } from '@shopgate/pwa-common/constants/RoutePaths';
3
3
  export { PAGE_PREVIEW_PATTERN } from '@shopgate/engage/admin-preview/constants';
4
4
  export * from '@shopgate/pwa-common/constants/PageIDs';
@@ -15,9 +15,11 @@ export const PAGE_PREVIEW_SLUG = 'page_preview';
15
15
  /**
16
16
  * Checks if the app is currently in page preview mode.
17
17
  * @todo For backwards compatibility, this constant is still exported from the page package and
18
- * mapped to the IS_ADMIN_PREVIEW_ACTIVE constant. It should be removed in the future.
18
+ * mapped to the isAdminPreviewActive helper. It should be removed in the future. Note that this
19
+ * is a snapshot taken when this module is evaluated - consumers that can call
20
+ * isAdminPreviewActive() at usage time should do that instead.
19
21
  */
20
- export const IS_PAGE_PREVIEW_ACTIVE = IS_ADMIN_PREVIEW_ACTIVE;
22
+ export const IS_PAGE_PREVIEW_ACTIVE = isAdminPreviewActive();
21
23
 
22
24
  /**
23
25
  * One hour in milliseconds
@@ -1,20 +1,16 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { makeStyles } from '@shopgate/engage/styles';
4
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
4
  import { Grid, I18n, Ripple, FilterIcon, Typography } from '@shopgate/engage/components';
6
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- const {
8
- variables
9
- } = themeConfig;
10
6
  const useStyles = makeStyles()(theme => ({
11
7
  button: {
12
8
  color: 'inherit',
13
9
  fontSize: theme.components.icon.medium,
14
10
  outline: 0,
15
11
  padding: 0,
16
- minWidth: variables.navigator.height,
17
- height: variables.filterbar.height,
12
+ minWidth: theme.components.navigator.height,
13
+ height: theme.components.filterBar.height,
18
14
  position: 'relative',
19
15
  zIndex: 1,
20
16
  overflow: 'hidden'
@@ -2,12 +2,8 @@ import React from 'react';
2
2
  import { SelectBox, ArrowDropIcon, SurroundPortals } from '@shopgate/engage/components';
3
3
  import { useSort, PORTAL_FILTER_SORT_OPTIONS } from '@shopgate/engage/filter';
4
4
  import { makeStyles, responsiveMediaQuery } from '@shopgate/engage/styles';
5
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
6
5
  import Item from "./components/Item";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const {
9
- variables
10
- } = themeConfig;
11
7
  const useStyles = makeStyles()(theme => ({
12
8
  button: {
13
9
  color: 'inherit',
@@ -17,7 +13,7 @@ const useStyles = makeStyles()(theme => ({
17
13
  alignItems: 'center',
18
14
  textOverflow: 'ellipsis',
19
15
  justifyContent: 'center',
20
- height: variables.filterbar.height,
16
+ height: theme.components.filterBar.height,
21
17
  whiteSpace: 'nowrap'
22
18
  },
23
19
  selection: {
@@ -13,6 +13,6 @@ export interface ProductNameProps {
13
13
  /**
14
14
  * The ProductName component.
15
15
  */
16
- declare const ProductName: ({ name, className, testId, ellipsis, portalName, portalProps, itemProp, rows, style, }: ProductNameProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const ProductName: ({ name, className, testId, ellipsis, portalName, portalProps, itemProp, rows, style, }: ProductNameProps) => React.JSX.Element;
17
17
  export default ProductName;
18
18
  //# sourceMappingURL=ProductName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductName.d.ts","sourceRoot":"","sources":["../../../../product/components/ProductName/ProductName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAWD;;GAEG;AACH,QAAA,MAAM,WAAW,GAAI,wFAUlB,gBAAgB,4CAuBlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ProductName.d.ts","sourceRoot":"","sources":["../../../../product/components/ProductName/ProductName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAWD;;GAEG;AACH,QAAA,MAAM,WAAW,GAAI,wFAUlB,gBAAgB,sBAuBlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export interface ProductNameContentProps {
2
3
  name?: string | null;
3
4
  ellipsis?: boolean;
@@ -7,6 +8,6 @@ export interface ProductNameContentProps {
7
8
  * The ProductNameContent component.
8
9
  * @returns The ProductNameContent component.
9
10
  */
10
- declare const ProductNameContent: ({ name, ellipsis, rows, }: ProductNameContentProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const ProductNameContent: ({ name, ellipsis, rows, }: ProductNameContentProps) => React.JSX.Element;
11
12
  export default ProductNameContent;
12
13
  //# sourceMappingURL=ProductNameContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductNameContent.d.ts","sourceRoot":"","sources":["../../../../product/components/ProductName/ProductNameContent.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GAAI,2BAIzB,uBAAuB,4CAczB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ProductNameContent.d.ts","sourceRoot":"","sources":["../../../../product/components/ProductName/ProductNameContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,QAAA,MAAM,kBAAkB,GAAI,2BAIzB,uBAAuB,sBAczB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -9,6 +9,6 @@ interface RatingProps {
9
9
  */
10
10
  size?: 'big' | 'small' | 'large';
11
11
  }
12
- declare const _default: import("react").MemoExoticComponent<({ productId, size, }: RatingProps) => import("react/jsx-runtime").JSX.Element | null>;
12
+ declare const _default: import("react").MemoExoticComponent<({ productId, size, }: RatingProps) => import("react").JSX.Element | null>;
13
13
  export default _default;
14
14
  //# sourceMappingURL=ProductRatingStars.d.ts.map
@@ -1,15 +1,11 @@
1
1
  import React, { useState, useCallback, memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { makeStyles } from '@shopgate/engage/styles';
4
- import { themeConfig } from '@shopgate/pwa-common/helpers/config';
5
4
  import { useWidgetSettings, useTheme } from "../../../core";
6
5
  import { SheetDrawer, I18n, Button } from "../../../components";
7
6
  import { WIDGET_ID } from "./constants";
8
7
  import connect from "./RelationsSheet.connector";
9
8
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
10
- const {
11
- variables
12
- } = themeConfig;
13
9
  const useStyles = makeStyles()(theme => ({
14
10
  showMore: {
15
11
  position: 'absolute !important',
@@ -18,7 +14,7 @@ const useStyles = makeStyles()(theme => ({
18
14
  padding: `${theme.spacing(0.5, 0)} !important`
19
15
  },
20
16
  sheet: {
21
- maxHeight: `calc(100vh - ${variables.navigator.height}px)`
17
+ maxHeight: `calc(100vh - ${theme.components.navigator.height})`
22
18
  }
23
19
  }));
24
20
 
@@ -145,7 +145,7 @@ const UnitQuantityPicker = ({
145
145
  return {};
146
146
  }
147
147
  return {
148
- buttonColor: theme.contrastColor(theme.palette.primary.main),
148
+ buttonColor: theme.palette.primary.contrastText,
149
149
  buttonBgColor: theme.palette.primary.main,
150
150
  inputColor: theme.palette.text.primary,
151
151
  inputBgColor: theme.palette.grey.light,
package/styles/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './helpers';
2
- export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, type Theme, type PaletteColorsWithMain, } from './theme';
2
+ export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme, type Theme, 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,KAAK,KAAK,EACV,KAAK,qBAAqB,GAC3B,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,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"}
package/styles/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from "./helpers";
2
- export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme } from "./theme";
2
+ export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme } from "./theme";
3
3
  export { makeStyles, withStyles, useStyles, css, cx, tss, GlobalStyles, injectGlobal, keyframes } from "./tss";
@@ -1,4 +1,4 @@
1
- import type { ComponentsOptions, ComponentVars, ComponentsFromSchema } from './createComponents.types';
1
+ import type { ComponentsOptions, Components, ComponentsFromSchema } from './createComponents.types';
2
2
  export type { ComponentsOptions, Components, ComponentVars } from './createComponents.types';
3
3
  /**
4
4
  * Deeply resolves a components object:
@@ -30,6 +30,6 @@ export declare function flattenComponentVars<T extends AnyObject>(input: T): { [
30
30
  * @param inputComponents The input components options
31
31
  * @returns The components object
32
32
  */
33
- declare const createComponents: (inputComponents: ComponentsOptions) => ComponentVars;
33
+ declare const createComponents: (inputComponents: ComponentsOptions) => Components;
34
34
  export default createComponents;
35
35
  //# sourceMappingURL=createComponents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createComponents.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EACb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE7F;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EACpD,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAAC,MAAM,CAAC,CAmB9B;AAGD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAErC;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,GAa/C,GACd,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAC1D,CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,GAAI,iBAAiB,iBAAiB,KAAG,aAS9D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"createComponents.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE7F;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EACpD,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAAC,MAAM,CAAC,CAmB9B;AAGD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAErC;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,GAa/C,GACd,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAC1D,CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,GAAI,iBAAiB,iBAAiB,KAAG,UAQ9D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -62,7 +62,6 @@ export function flattenComponentVars(input) {
62
62
  */
63
63
  const createComponents = inputComponents => {
64
64
  const mergedComponents = merge({}, componentsSchema, componentsDefaults, inputComponents);
65
- // @ts-expect-error - We are sure about the type here
66
65
  return mergedComponents;
67
66
  };
68
67
  export default createComponents;
@@ -182,6 +182,16 @@ export declare const componentsSchema: {
182
182
  readonly paginationProgressbarActiveColor: "";
183
183
  };
184
184
  };
185
+ readonly navigator: {
186
+ readonly vars: {
187
+ readonly height: "";
188
+ };
189
+ };
190
+ readonly filterBar: {
191
+ readonly vars: {
192
+ readonly height: "";
193
+ };
194
+ };
185
195
  };
186
196
  /**
187
197
  * Default component tokens.
@@ -271,6 +281,16 @@ export declare const componentsDefaults: {
271
281
  paginationProgressbarActiveColor: (t: Theme) => string;
272
282
  };
273
283
  };
284
+ navigator: {
285
+ vars: {
286
+ height: number;
287
+ };
288
+ };
289
+ filterBar: {
290
+ vars: {
291
+ height: number;
292
+ };
293
+ };
274
294
  };
275
295
  /** Internal defaults type (must cover full schema). */
276
296
  export type ComponentsDefaults = ComponentsOverrideFromSchema<typeof componentsSchema, Theme>;
@@ -1 +1 @@
1
- {"version":3,"file":"createComponents.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE3C;;;GAGG;AACH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,IAClC,MAAM,GACN,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oB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,GACnB,OAAO,CAAC,CAAC,CAAC,SAAS;QAAE,IAAI,EAAE,MAAM,KAAK,CAAA;KAAE,GACtC,oBAAoB,CAAC,KAAK,CAAC,GAC3B,KAAK;CACR,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFnB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFD,CAAC;AAE/B,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAC5B,4BAA4B,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAG/D,MAAM,MAAM,iBAAiB,GAC3B,4BAA4B,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAG/D,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"createComponents.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE3C;;;GAGG;AACH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,IAClC,MAAM,GACN,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GA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M,MAAM,uBAAuB,CAAC,OAAO,IAAI;KAC5C,CAAC,IAAI,MAAM,OAAO,GACnB,OAAO,CAAC,CAAC,CAAC,SAAS;QAAE,IAAI,EAAE,MAAM,KAAK,CAAA;KAAE,GACtC,oBAAoB,CAAC,KAAK,CAAC,GAC3B,KAAK;CACR,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkGnB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0FD,CAAC;AAE/B,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAC5B,4BAA4B,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAG/D,MAAM,MAAM,iBAAiB,GAC3B,4BAA4B,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAG/D,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -169,6 +169,16 @@ export const componentsSchema = {
169
169
  paginationProgressbarBackground: '',
170
170
  paginationProgressbarActiveColor: ''
171
171
  }
172
+ },
173
+ navigator: {
174
+ vars: {
175
+ height: ''
176
+ }
177
+ },
178
+ filterBar: {
179
+ vars: {
180
+ height: ''
181
+ }
172
182
  }
173
183
  };
174
184
 
@@ -259,6 +269,16 @@ export const componentsDefaults = {
259
269
  paginationProgressbarBackground: t => t.palette.grey.light,
260
270
  paginationProgressbarActiveColor: t => t.palette.common.black
261
271
  }
272
+ },
273
+ navigator: {
274
+ vars: {
275
+ height: 44
276
+ }
277
+ },
278
+ filterBar: {
279
+ vars: {
280
+ height: 48
281
+ }
262
282
  }
263
283
  };
264
284
 
@@ -1,4 +1,7 @@
1
- import { isDev } from '@shopgate/engage/core/helpers';
1
+ // Import `isDev` from the leaf environment module rather than the `@shopgate/engage/core/helpers`
2
+ // barrel: the barrel pulls in providers -> toast -> the theme, creating an import cycle back into
3
+ // createTheme (which uses this module) and breaking theme creation during module init.
4
+ import { isDev } from '@shopgate/pwa-common/helpers/environment';
2
5
  const spacingUnit = 8;
3
6
 
4
7
  /**
@@ -1,4 +1,4 @@
1
- import type { ColorSchemeOptions, BaseTheme } from './types';
1
+ import type { ColorSchemeOptions, ColorSchemeTheme } from './types';
2
2
  /**
3
3
  * Helper function to add an alpha value to a color.
4
4
  * @param color The color to modify.
@@ -32,6 +32,6 @@ export declare const contrastColor: (color: string) => string;
32
32
  * @param colorScheme The color scheme options.
33
33
  * @returns A theme object for the given color scheme.
34
34
  */
35
- declare const createThemeFromColorScheme: (colorScheme: ColorSchemeOptions) => BaseTheme;
35
+ declare const createThemeFromColorScheme: (colorScheme: ColorSchemeOptions) => ColorSchemeTheme;
36
36
  export default createThemeFromColorScheme;
37
37
  //# sourceMappingURL=createThemeFromColorScheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeFromColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createThemeFromColorScheme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAc7D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,MAAM,EACb,aAAa,MAAM,GAAG,MAAM,KAC3B,MAAkH,CAAC;AAEtH;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,KACZ,MAA4D,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,GAAI,aAAa,kBAAkB,KAAG,SA2BrE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"createThemeFromColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createThemeFromColorScheme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAcpE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,MAAM,EACb,aAAa,MAAM,GAAG,MAAM,KAC3B,MAAkH,CAAC;AAEtH;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,KACZ,MAA4D,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,GAAI,aAAa,kBAAkB,KAAG,gBA2BrE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/index.ts"],"names":[],"mappings":"AASA,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;;;;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,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAS,YAAiB,KAAG,aAkExD,CAAC"}
@@ -4,6 +4,7 @@ import createBreakpoints from "./createBreakpoints";
4
4
  import createSpacing from "./createSpacing";
5
5
  import transitions from "./transitions";
6
6
  import zIndex from "./zIndex";
7
+ import layout from "./layout";
7
8
  import createThemeFromColorScheme from "./createThemeFromColorScheme";
8
9
  import createCssVarsForColorSchemeThemes from "./createCssVarsForColorSchemeThemes";
9
10
  import applyStyles from "./applyStyles";
@@ -58,7 +59,7 @@ export const createTheme = (options = {}) => {
58
59
  spacing,
59
60
  transitions,
60
61
  zIndex,
61
- // @ts-expect-error - Sure about the type here
62
+ layout,
62
63
  colorSchemes,
63
64
  getColorSchemeSelector,
64
65
  setActiveColorScheme,
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Runtime layout dimensions exposed as global CSS variables.
3
+ *
4
+ * These are NOT design tokens and are not generated by the theme's CSS-variable pipeline.
5
+ * The `--safe-area-inset-*` variables are set at runtime by `updatePageInsets` based on the
6
+ * device page insets.
7
+ *
8
+ * This node only maps theme properties to those existing variables (`var(--...)`), so consumers
9
+ * can read `theme.layout.*` instead of hardcoding the variable names.
10
+ */
11
+ export interface SafeArea {
12
+ top: string;
13
+ bottom: string;
14
+ left: string;
15
+ right: string;
16
+ }
17
+ export interface Layout {
18
+ /** Device safe-area insets (`--safe-area-inset-*`). */
19
+ safeArea: SafeArea;
20
+ }
21
+ declare const layout: Layout;
22
+ export default layout;
23
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,MAAM;IACrB,uDAAuD;IACvD,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,EAAE,MAOb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Runtime layout dimensions exposed as global CSS variables.
3
+ *
4
+ * These are NOT design tokens and are not generated by the theme's CSS-variable pipeline.
5
+ * The `--safe-area-inset-*` variables are set at runtime by `updatePageInsets` based on the
6
+ * device page insets.
7
+ *
8
+ * This node only maps theme properties to those existing variables (`var(--...)`), so consumers
9
+ * can read `theme.layout.*` instead of hardcoding the variable names.
10
+ */
11
+
12
+ const layout = {
13
+ safeArea: {
14
+ top: 'var(--safe-area-inset-top)',
15
+ bottom: 'var(--safe-area-inset-bottom)',
16
+ left: 'var(--safe-area-inset-left)',
17
+ right: 'var(--safe-area-inset-right)'
18
+ }
19
+ };
20
+ export default layout;
@@ -39,6 +39,10 @@ export interface Duration {
39
39
  * Recommended when something is leaving screen
40
40
  */
41
41
  leavingScreen: number;
42
+ /**
43
+ * How long a toast stays visible before auto-dismissing
44
+ */
45
+ toast: number;
42
46
  }
43
47
 
44
48
  export const duration: Duration;
@@ -27,7 +27,9 @@ export const duration = {
27
27
  // recommended when something is entering screen
28
28
  enteringScreen: 225,
29
29
  // recommended when something is leaving screen
30
- leavingScreen: 195
30
+ leavingScreen: 195,
31
+ // how long a toast stays visible before auto-dismissing
32
+ toast: 5000
31
33
  };
32
34
 
33
35
  /**
@@ -1,10 +1,11 @@
1
1
  import type { PaletteOptions, Palette } from './createPalette';
2
2
  import type { Typography, TypographyOptions } from './createTypography';
3
- import type { ComponentsOptions, ComponentVars } from './createComponents';
3
+ import type { ComponentsOptions, ComponentVars, Components } from './createComponents';
4
4
  import type { Breakpoints } from './createBreakpoints';
5
5
  import type { Spacing } from './createSpacing';
6
6
  import type { Transitions } from './transitions';
7
7
  import type { ZIndex } from './zIndex';
8
+ import type { Layout } from './layout';
8
9
  import type { ApplyStyles } from './applyStyles';
9
10
  import type { GetColorSchemeSelector, ActiveColorSchemeSwitcher } from './helpers';
10
11
  import type { CreateCssVarsForColorSchemeThemesReturnValue } from './createCssVarsForColorSchemeThemes';
@@ -143,6 +144,12 @@ export interface Theme extends BaseTheme {
143
144
  * Reference to z-index values for multiple components.
144
145
  */
145
146
  zIndex: ZIndex;
147
+ /**
148
+ * Mappings to runtime layout CSS variables (safe-area insets).
149
+ * The values are `var(--...)` references to variables updated at runtime elsewhere in the app;
150
+ * this node does not generate any new CSS variables.
151
+ */
152
+ layout: Layout;
146
153
  /**
147
154
  * An object that contains the CSS variable references for the theme properties.
148
155
  * It has the same structure as the theme, but the values are CSS variable references
@@ -171,12 +178,26 @@ export interface Theme extends BaseTheme {
171
178
  */
172
179
  applyStyles: ApplyStyles<ColorSchemeName>;
173
180
  }
181
+ /**
182
+ * A single fully-resolved color-scheme theme. Identical to {@link BaseTheme} except that its
183
+ * `components` keep the nested `vars` level (the raw per-scheme token defaults produced by
184
+ * `createComponents`), whereas the flattened `BaseTheme['components']` shape is only produced for
185
+ * the final merged theme.
186
+ */
187
+ export type ColorSchemeTheme = Omit<BaseTheme, 'components'> & {
188
+ components: Components;
189
+ };
174
190
  /**
175
191
  * A record of themes for each color scheme. Each key is a color scheme name (e.g., 'light', 'dark'),
176
- * and the value is a theme object that contains e.g. the palette and typography for that color scheme.
192
+ * and the value is a fully-resolved color-scheme theme ({@link ColorSchemeTheme}).
177
193
  */
178
- export type ColorSchemeThemes = Record<ColorSchemeName, BaseTheme>;
179
- export type ThemeInternal = Theme & Pick<CreateCssVarsForColorSchemeThemesReturnValue, 'generateStyleSheets'> & {
194
+ export type ColorSchemeThemes = Record<ColorSchemeName, ColorSchemeTheme>;
195
+ export type ThemeInternal = Omit<Theme, 'colorSchemes'> & {
196
+ /**
197
+ * Internal runtime map of fully resolved color-scheme themes.
198
+ */
199
+ colorSchemes: ColorSchemeThemes;
200
+ } & Pick<CreateCssVarsForColorSchemeThemesReturnValue, 'generateStyleSheets'> & {
180
201
  /**
181
202
  * Function that generates a CSS selector string for a given color scheme.
182
203
  */
@@ -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,EAAc,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,qCAAqC,CAAC;AACxG,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KA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1F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAA;AAEzE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG;IACxD;;OAEG;IACH,YAAY,EAAE,iBAAiB,CAAC;CACjC,GAAG,IAAI,CAAC,4CAA4C,EAAE,qBAAqB,CAAC,GAAG;IAC9E;;OAEG;IACH,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C;;OAEG;IACH,oBAAoB,EAAE,yBAAyB,CAAC;CACjD,CAAC"}
@@ -7,8 +7,15 @@ const selectorTypes = ['data', 'class'];
7
7
  * dynamically based on user preference or system settings.
8
8
  */
9
9
 
10
+ /**
11
+ * A single fully-resolved color-scheme theme. Identical to {@link BaseTheme} except that its
12
+ * `components` keep the nested `vars` level (the raw per-scheme token defaults produced by
13
+ * `createComponents`), whereas the flattened `BaseTheme['components']` shape is only produced for
14
+ * the final merged theme.
15
+ */
16
+
10
17
  /**
11
18
  * A record of themes for each color scheme. Each key is a color scheme name (e.g., 'light', 'dark'),
12
- * and the value is a theme object that contains e.g. the palette and typography for that color scheme.
19
+ * and the value is a fully-resolved color-scheme theme ({@link ColorSchemeTheme}).
13
20
  */
14
21
  export {};
@@ -0,0 +1,2 @@
1
+ export { withTheme, type WithThemeProps } from './withTheme';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../styles/theme/hocs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export { withTheme } from "./withTheme";