@crystaldesign/diva-core 26.3.0-beta.48 → 26.3.0-beta.50

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.
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext } from './index-4b8262c5.js';
1
+ import { s as styleInject, u as useDivaCoreContext } from './index-d6783684.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-4b8262c5.js';
1
+ import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-d6783684.js';
2
2
  import { forwardRef, useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -45,7 +45,7 @@ import { actions } from '@storybook/addon-actions';
45
45
  import * as Styles from '@mui/styles';
46
46
 
47
47
  (function() {
48
- const env = {"STAGE":"production","VERSION":"26.3.0-beta.48"};
48
+ const env = {"STAGE":"production","VERSION":"26.3.0-beta.50"};
49
49
  try {
50
50
  if (process) {
51
51
  process.env = Object.assign({}, process.env);
@@ -2086,8 +2086,6 @@ var THEME_VARIABLES = [['--diva-theme-palette-primary-main', function (t) {
2086
2086
  return t.palette.text.secondary;
2087
2087
  }], ['--diva-typography-font-family', function (t) {
2088
2088
  return t.typography.fontFamily;
2089
- }], ['font-family', function (t) {
2090
- return t.typography.fontFamily;
2091
2089
  }]];
2092
2090
  function applyToElement(element, theme) {
2093
2091
  THEME_VARIABLES.forEach(function (_ref) {
@@ -2099,10 +2097,14 @@ function applyToElement(element, theme) {
2099
2097
  }
2100
2098
 
2101
2099
  /**
2102
- * Applies theme as CSS variables to the given element and to document.body.
2103
- * Body is included so portaled content (e.g. MUI Drawer without container) inherits the variables.
2100
+ * Applies theme CSS variables to the planner root and to document.body.
2101
+ * Body is included so portaled content (e.g. MUI Drawer without container) inherits CSS variables.
2102
+ * The raw `font-family` style is intentionally scoped to the planner root only,
2103
+ * so embedded integrations do not override the host page font.
2104
2104
  */
2105
2105
  function updateCssThemeVariables (ref, theme) {
2106
+ applyToElement(ref, theme);
2107
+ ref.style.setProperty('font-family', theme.typography.fontFamily);
2106
2108
  if (typeof document !== 'undefined') {
2107
2109
  applyToElement(document.body, theme);
2108
2110
  }
@@ -10123,7 +10125,7 @@ var DrawerMenu$1 = observer(DrawerMenu);
10123
10125
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10124
10126
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10125
10127
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
10126
- return import('./ModalsWrapper-a9a015c6.js');
10128
+ return import('./ModalsWrapper-ca5d8abc.js');
10127
10129
  });
10128
10130
  function Fullscreen(_ref) {
10129
10131
  var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
@@ -10583,10 +10585,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
10583
10585
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10584
10586
  var LOG$2 = getLogger('Framework', 'Root');
10585
10587
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
10586
- return import('./index-249d709f.js');
10588
+ return import('./index-8a929444.js');
10587
10589
  });
10588
10590
  var LazyModals = /*#__PURE__*/React.lazy(function () {
10589
- return import('./ModalsWrapper-a9a015c6.js');
10591
+ return import('./ModalsWrapper-ca5d8abc.js');
10590
10592
  });
10591
10593
  function ContentComponent() {
10592
10594
  var context = useDivaCoreContext();
@@ -1,4 +1,4 @@
1
- export { c as AnalyticsHandler, A as AuthorizationHandler, e as ClientArticleHandler, C as Content, f as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, d as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, i as i18n, h as storyBookCoreMock, a as useDivaCore } from './index-4b8262c5.js';
1
+ export { c as AnalyticsHandler, A as AuthorizationHandler, e as ClientArticleHandler, C as Content, f as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, d as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, i as i18n, h as storyBookCoreMock, a as useDivaCore } from './index-d6783684.js';
2
2
  export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
3
3
  export { Trans, useTranslation } from 'react-i18next';
4
4
  export * from '@crystaldesign/basket-model';
@@ -1,7 +1,9 @@
1
1
  import { Theme } from '../types';
2
2
  /**
3
- * Applies theme as CSS variables to the given element and to document.body.
4
- * Body is included so portaled content (e.g. MUI Drawer without container) inherits the variables.
3
+ * Applies theme CSS variables to the planner root and to document.body.
4
+ * Body is included so portaled content (e.g. MUI Drawer without container) inherits CSS variables.
5
+ * The raw `font-family` style is intentionally scoped to the planner root only,
6
+ * so embedded integrations do not override the host page font.
5
7
  */
6
8
  export default function (ref: HTMLDivElement, theme: Theme): void;
7
9
  //# sourceMappingURL=updateCssThemeVariables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateCssThemeVariables.d.ts","sourceRoot":"","sources":["../../../../../src/utils/updateCssThemeVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAuBjC;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,QAIzD"}
1
+ {"version":3,"file":"updateCssThemeVariables.d.ts","sourceRoot":"","sources":["../../../../../src/utils/updateCssThemeVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAsBjC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAW,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,QAOzD"}