@codebit-programando-solucoes/codebit-web-antd 1.1.49 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.cjs +1 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -779,6 +779,7 @@ var __webpack_exports__ = {};
779
779
  document.documentElement.classList.remove('dark-theme');
780
780
  target.classList.remove('dark-theme');
781
781
  }
782
+ document.documentElement.style.colorScheme = isDarkMode ? 'dark' : 'light';
782
783
  document.documentElement.style.setProperty('--color-primary', resolvedColors.primary[isDarkMode ? 'dark' : 'light']);
783
784
  }, [
784
785
  isDarkMode,
@@ -1169,11 +1170,6 @@ var __webpack_exports__ = {};
1169
1170
  const ThemeToggle = ()=>{
1170
1171
  const config = (0, external_react_.useContext)(CodebitThemeContext);
1171
1172
  if (!config) throw new Error('ThemeToggle must be used within CodebitThemeContext');
1172
- (0, external_react_.useEffect)(()=>{
1173
- document.documentElement.style.colorScheme = config.isDarkMode ? 'dark' : 'light';
1174
- }, [
1175
- config.isDarkMode
1176
- ]);
1177
1173
  return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Switch, {
1178
1174
  theme: config.isDarkMode ? 'dark' : 'light',
1179
1175
  checked: config.isDarkMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebit-programando-solucoes/codebit-web-antd",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
4
4
  "main": "./dist/index.cjs",
5
5
  "type": "module",
6
6
  "types": "./src/index.d.ts",