tamagui 1.103.0 → 1.103.2

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.
@@ -9043,7 +9043,7 @@ var require_createComponent_native = __commonJS({
9043
9043
  staticConfig,
9044
9044
  stateRef
9045
9045
  });
9046
- (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles);
9046
+ (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = "".concat(viewProps.className || "", " ").concat(animations.className)));
9047
9047
  }
9048
9048
  groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
9049
9049
  stateRef.current.group.emit(groupName, {
@@ -12107,7 +12107,7 @@ var require_TamaguiProvider_native = __commonJS({
12107
12107
  "@swc/helpers - typeof";
12108
12108
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
12109
12109
  }
12110
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
12110
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
12111
12111
  for (var name in all) __defProp2(target, name, {
12112
12112
  get: all[name],
12113
12113
  enumerable: !0
@@ -12135,18 +12135,6 @@ var require_TamaguiProvider_native = __commonJS({
12135
12135
  }
12136
12136
  }
12137
12137
  return to;
12138
- }, __toESM2 = function(mod, isNodeMode, target) {
12139
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
12140
- // If the importer is in node compatibility mode or this is not an ESM
12141
- // file that has been converted to a CommonJS file using a Babel-
12142
- // compatible transform (i.e. "__esModule" has not been set), then set
12143
- // "default" to the CommonJS "module.exports" for node compatibility.
12144
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
12145
- value: mod,
12146
- enumerable: !0
12147
- }) : target,
12148
- mod
12149
- );
12150
12138
  }, __toCommonJS2 = function(mod) {
12151
12139
  return __copyProps2(__defProp2({}, "__esModule", {
12152
12140
  value: !0
@@ -12158,64 +12146,51 @@ var require_TamaguiProvider_native = __commonJS({
12158
12146
  }
12159
12147
  });
12160
12148
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
12161
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), React2 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native();
12162
- function _define_property9(obj, key, value) {
12163
- return key in obj ? Object.defineProperty(obj, key, {
12164
- value,
12165
- enumerable: !0,
12166
- configurable: !0,
12167
- writable: !0
12168
- }) : obj[key] = value, obj;
12149
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react4 = require("react"), import_ComponentContext = require_ComponentContext_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native();
12150
+ function _array_like_to_array2(arr, len) {
12151
+ (len == null || len > arr.length) && (len = arr.length);
12152
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
12153
+ return arr2;
12169
12154
  }
12170
- function _object_spread9(target) {
12171
- for (var i = 1; i < arguments.length; i++) {
12172
- var source = arguments[i] != null ? arguments[i] : {}, ownKeys22 = Object.keys(source);
12173
- typeof Object.getOwnPropertySymbols == "function" && (ownKeys22 = ownKeys22.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
12174
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
12175
- }))), ownKeys22.forEach(function(key) {
12176
- _define_property9(target, key, source[key]);
12177
- });
12178
- }
12179
- return target;
12155
+ function _array_with_holes(arr) {
12156
+ if (Array.isArray(arr)) return arr;
12180
12157
  }
12181
- function ownKeys8(object, enumerableOnly) {
12182
- var keys = Object.keys(object);
12183
- if (Object.getOwnPropertySymbols) {
12184
- var symbols = Object.getOwnPropertySymbols(object);
12185
- enumerableOnly && (symbols = symbols.filter(function(sym) {
12186
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
12187
- })), keys.push.apply(keys, symbols);
12158
+ function _iterable_to_array_limit(arr, i) {
12159
+ var _i = arr == null ? null : (typeof Symbol > "u" ? "undefined" : _type_of3(Symbol)) < "u" && arr[Symbol.iterator] || arr["@@iterator"];
12160
+ if (_i != null) {
12161
+ var _arr = [], _n = !0, _d = !1, _s, _e;
12162
+ try {
12163
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0) ;
12164
+ } catch (err) {
12165
+ _d = !0, _e = err;
12166
+ } finally {
12167
+ try {
12168
+ !_n && _i.return != null && _i.return();
12169
+ } finally {
12170
+ if (_d) throw _e;
12171
+ }
12172
+ }
12173
+ return _arr;
12188
12174
  }
12189
- return keys;
12190
12175
  }
12191
- function _object_spread_props8(target, source) {
12192
- return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys8(Object(source)).forEach(function(key) {
12193
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12194
- }), target;
12176
+ function _non_iterable_rest() {
12177
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
12195
12178
  }
12196
- function _object_without_properties5(source, excluded) {
12197
- if (source == null) return {};
12198
- var target = _object_without_properties_loose5(source, excluded), key, i;
12199
- if (Object.getOwnPropertySymbols) {
12200
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
12201
- for (i = 0; i < sourceSymbolKeys.length; i++) key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
12202
- }
12203
- return target;
12179
+ function _sliced_to_array(arr, i) {
12180
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array2(arr, i) || _non_iterable_rest();
12204
12181
  }
12205
- function _object_without_properties_loose5(source, excluded) {
12206
- if (source == null) return {};
12207
- var target = {}, sourceKeys = Object.keys(source), key, i;
12208
- for (i = 0; i < sourceKeys.length; i++) key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
12209
- return target;
12182
+ function _unsupported_iterable_to_array2(o, minLen) {
12183
+ if (o) {
12184
+ if (typeof o == "string") return _array_like_to_array2(o, minLen);
12185
+ var n = Object.prototype.toString.call(o).slice(8, -1);
12186
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
12187
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array2(o, minLen);
12188
+ }
12210
12189
  }
12211
- function TamaguiProvider2(_param) {
12212
- var children = _param.children, disableInjectCSS = _param.disableInjectCSS, config = _param.config, themePropsProvider = _object_without_properties5(_param, [
12213
- "children",
12214
- "disableInjectCSS",
12215
- "config"
12216
- ]);
12217
- (0, import_useMedia.setupMediaListeners)(), import_constants4.isClient && ((0, import_useDidHydrateOnce.useDidHydrateOnceRoot)(), React2.useInsertionEffect(function() {
12218
- if (config && (config.disableSSR || document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), !disableInjectCSS)) {
12190
+ function TamaguiProvider2(param) {
12191
+ var children = param.children, disableInjectCSS = param.disableInjectCSS, config = param.config, className = param.className, defaultTheme = param.defaultTheme, disableRootThemeClass = param.disableRootThemeClass, reset = param.reset, themeClassNameOnRoot = param.themeClassNameOnRoot;
12192
+ (0, import_useMedia.setupMediaListeners)(), import_constants4.isClient && ((0, import_useDidHydrateOnce.useDidHydrateOnceRoot)(), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
12193
+ if (config && !disableInjectCSS) {
12219
12194
  var style = document.createElement("style");
12220
12195
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
12221
12196
  document.head.removeChild(style);
@@ -12225,18 +12200,32 @@ var require_TamaguiProvider_native = __commonJS({
12225
12200
  config,
12226
12201
  disableInjectCSS
12227
12202
  ]));
12228
- var _themePropsProvider_defaultTheme;
12229
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
12230
- animationDriver: config == null ? void 0 : config.animations,
12231
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeProvider.ThemeProvider, _object_spread_props8(_object_spread9({
12232
- themeClassNameOnRoot: config == null ? void 0 : config.themeClassNameOnRoot,
12233
- disableRootThemeClass: config == null ? void 0 : config.disableRootThemeClass
12234
- }, themePropsProvider), {
12235
- defaultTheme: (_themePropsProvider_defaultTheme = themePropsProvider.defaultTheme) !== null && _themePropsProvider_defaultTheme !== void 0 ? _themePropsProvider_defaultTheme : config ? Object.keys(config.themes)[0] : "",
12236
- children
12237
- }))
12203
+ var contents = (0, import_react4.useMemo)(function() {
12204
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
12205
+ animationDriver: config == null ? void 0 : config.animations,
12206
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeProvider.ThemeProvider, {
12207
+ themeClassNameOnRoot: themeClassNameOnRoot ?? (config == null ? void 0 : config.themeClassNameOnRoot),
12208
+ disableRootThemeClass: disableRootThemeClass ?? (config == null ? void 0 : config.disableRootThemeClass),
12209
+ defaultTheme: defaultTheme ?? (config ? Object.keys(config.themes)[0] : ""),
12210
+ reset,
12211
+ className,
12212
+ children
12213
+ })
12214
+ });
12215
+ }, []);
12216
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(UnmountedClassName, {
12217
+ children: contents
12238
12218
  });
12239
12219
  }
12220
+ function UnmountedClassName(props) {
12221
+ var _useState = _sliced_to_array((0, import_react4.useState)(!1), 2), mounted = _useState[0], setMounted = _useState[1];
12222
+ return (0, import_react4.useEffect)(function() {
12223
+ setMounted(!0);
12224
+ }, []), import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
12225
+ className: mounted ? "" : "t_unmounted",
12226
+ children: props.children
12227
+ }) : props.children;
12228
+ }
12240
12229
  TamaguiProvider2.displayName = "TamaguiProvider";
12241
12230
  }
12242
12231
  });