@arim-aisdc/public-components 0.0.43 → 0.0.45
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.
|
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
7
7
|
import { PublicThemeVariablesConfig } from "../../themes/variablesConfig";
|
|
8
8
|
import { useContext, useEffect, useMemo } from 'react';
|
|
9
9
|
import ConfigContext, { DEFAULT_CONTEXT } from "./context";
|
|
10
|
-
import {
|
|
10
|
+
import { setCssVars } from "./cssVars";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
export var ConfigProvider = function ConfigProvider(_ref) {
|
|
13
13
|
var _ref$config = _ref.config,
|
|
@@ -16,11 +16,11 @@ export var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
16
16
|
var memoedConfig = useMemo(function () {
|
|
17
17
|
return _objectSpread(_objectSpread({}, DEFAULT_CONTEXT), config);
|
|
18
18
|
}, [JSON.stringify(config)]);
|
|
19
|
-
var
|
|
20
|
-
variablesJson =
|
|
19
|
+
var theme = config.theme,
|
|
20
|
+
variablesJson = config.variablesJson;
|
|
21
21
|
useEffect(function () {
|
|
22
|
-
|
|
23
|
-
}, [
|
|
22
|
+
setCssVars(_objectSpread(_objectSpread({}, PublicThemeVariablesConfig[theme]), variablesJson));
|
|
23
|
+
}, [theme, variablesJson]);
|
|
24
24
|
return /*#__PURE__*/_jsx(ConfigContext.Provider, {
|
|
25
25
|
value: memoedConfig,
|
|
26
26
|
children: children
|