tamagui 1.122.6 → 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 +54 -54
package/dist/native.js
CHANGED
|
@@ -11302,22 +11302,23 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
11302
11302
|
});
|
|
11303
11303
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
11304
11304
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_constants4 = require_index_native6(), import_constants22 = require_constants_native2(), import_Theme = require_Theme_native(), import_config = require_config_native(), ThemeProvider = function(props) {
|
|
11305
|
+
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");
|
|
11305
11306
|
return import_constants4.isClient && import_react3.default.useLayoutEffect(function() {
|
|
11306
|
-
if (!
|
|
11307
|
-
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`,
|
|
11307
|
+
if (!disableRootThemeClass) {
|
|
11308
|
+
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = themeClassNameOnRoot ? document.documentElement : document.body;
|
|
11308
11309
|
return target.classList.add(cn), function() {
|
|
11309
11310
|
target.classList.remove(cn);
|
|
11310
11311
|
};
|
|
11311
11312
|
}
|
|
11312
11313
|
}, [
|
|
11313
11314
|
props.defaultTheme,
|
|
11314
|
-
|
|
11315
|
-
|
|
11315
|
+
disableRootThemeClass,
|
|
11316
|
+
themeClassNameOnRoot
|
|
11316
11317
|
]), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Theme.Theme, {
|
|
11317
11318
|
className: props.className,
|
|
11318
11319
|
name: props.defaultTheme,
|
|
11319
11320
|
// if root class disabled, force class here
|
|
11320
|
-
forceClassName: !
|
|
11321
|
+
forceClassName: !disableRootThemeClass && !themeClassNameOnRoot,
|
|
11321
11322
|
// @ts-expect-error
|
|
11322
11323
|
_isRoot: !0,
|
|
11323
11324
|
children: props.children
|