tamagui 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 +54 -54
package/dist/test.native.js
CHANGED
|
@@ -10689,22 +10689,23 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
10689
10689
|
});
|
|
10690
10690
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
10691
10691
|
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) {
|
|
10692
|
+
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");
|
|
10692
10693
|
return import_constants4.isClient && import_react3.default.useLayoutEffect(function() {
|
|
10693
|
-
if (!
|
|
10694
|
-
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`,
|
|
10694
|
+
if (!disableRootThemeClass) {
|
|
10695
|
+
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = themeClassNameOnRoot ? document.documentElement : document.body;
|
|
10695
10696
|
return target.classList.add(cn), function() {
|
|
10696
10697
|
target.classList.remove(cn);
|
|
10697
10698
|
};
|
|
10698
10699
|
}
|
|
10699
10700
|
}, [
|
|
10700
10701
|
props.defaultTheme,
|
|
10701
|
-
|
|
10702
|
-
|
|
10702
|
+
disableRootThemeClass,
|
|
10703
|
+
themeClassNameOnRoot
|
|
10703
10704
|
]), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Theme.Theme, {
|
|
10704
10705
|
className: props.className,
|
|
10705
10706
|
name: props.defaultTheme,
|
|
10706
10707
|
// if root class disabled, force class here
|
|
10707
|
-
forceClassName: !
|
|
10708
|
+
forceClassName: !disableRootThemeClass && !themeClassNameOnRoot,
|
|
10708
10709
|
// @ts-expect-error
|
|
10709
10710
|
_isRoot: !0,
|
|
10710
10711
|
children: props.children
|