@tamagui/core 1.122.7 → 1.122.8
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.
- package/dist/native.js +6 -5
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +6 -5
- package/dist/test.native.js.map +2 -2
- package/package.json +7 -7
package/dist/native.js
CHANGED
|
@@ -10203,22 +10203,23 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
10203
10203
|
});
|
|
10204
10204
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
10205
10205
|
var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_constants2 = require_index_native2(), import_constants22 = require_constants_native2(), import_Theme = require_Theme_native(), import_config = require_config_native(), ThemeProvider = function(props) {
|
|
10206
|
+
var _props_disableRootThemeClass, disableRootThemeClass = (_props_disableRootThemeClass = props.disableRootThemeClass) !== null && _props_disableRootThemeClass !== void 0 ? _props_disableRootThemeClass : (0, import_config.getSetting)("disableRootThemeClass"), _props_themeClassNameOnRoot, themeClassNameOnRoot = (_props_themeClassNameOnRoot = props.themeClassNameOnRoot) !== null && _props_themeClassNameOnRoot !== void 0 ? _props_themeClassNameOnRoot : (0, import_config.getSetting)("themeClassNameOnRoot");
|
|
10206
10207
|
return import_constants2.isClient && import_react3.default.useLayoutEffect(function() {
|
|
10207
|
-
if (!
|
|
10208
|
-
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`,
|
|
10208
|
+
if (!disableRootThemeClass) {
|
|
10209
|
+
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = themeClassNameOnRoot ? document.documentElement : document.body;
|
|
10209
10210
|
return target.classList.add(cn), function() {
|
|
10210
10211
|
target.classList.remove(cn);
|
|
10211
10212
|
};
|
|
10212
10213
|
}
|
|
10213
10214
|
}, [
|
|
10214
10215
|
props.defaultTheme,
|
|
10215
|
-
|
|
10216
|
-
|
|
10216
|
+
disableRootThemeClass,
|
|
10217
|
+
themeClassNameOnRoot
|
|
10217
10218
|
]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
|
|
10218
10219
|
className: props.className,
|
|
10219
10220
|
name: props.defaultTheme,
|
|
10220
10221
|
// if root class disabled, force class here
|
|
10221
|
-
forceClassName: !
|
|
10222
|
+
forceClassName: !disableRootThemeClass && !themeClassNameOnRoot,
|
|
10222
10223
|
// @ts-expect-error
|
|
10223
10224
|
_isRoot: !0,
|
|
10224
10225
|
children: props.children
|