@tamagui/core 1.125.34 → 1.126.0

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.
@@ -5869,12 +5869,12 @@ var require_useThemeState_native = __commonJS({
5869
5869
  function getNewThemeName() {
5870
5870
  var parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", { name, reset, componentName, inverse, debug } = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
5871
5871
  if (name && reset) throw new Error("Cannot reset and set a new name at the same time.");
5872
+ var { themes: themes2 } = (0, import_config.getConfig)();
5872
5873
  if (reset) {
5873
- if (!parentName) throw new Error("\u203C\uFE0F");
5874
- var lastPartIndex = parentName.lastIndexOf("_");
5875
- return lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);
5874
+ var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
5875
+ return result;
5876
5876
  }
5877
- var { themes: themes2 } = (0, import_config.getConfig)(), parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
5877
+ var parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
5878
5878
  lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
5879
5879
  for (var subNames = [
5880
5880
  name && componentName ? `${name}_${componentName}` : void 0,
@@ -5903,8 +5903,8 @@ var require_useThemeState_native = __commonJS({
5903
5903
  }
5904
5904
  if (inverse) {
5905
5905
  found || (found = parentName);
5906
- var scheme = found.split("_")[0];
5907
- found = found.replace(new RegExp(`^${scheme}`), scheme === "light" ? "dark" : "light");
5906
+ var scheme1 = found.split("_")[0];
5907
+ found = found.replace(new RegExp(`^${scheme1}`), scheme1 === "light" ? "dark" : "light");
5908
5908
  }
5909
5909
  return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
5910
5910
  // and we want to avoid reparenting
@@ -7037,7 +7037,16 @@ var require_createComponent_native = __commonJS({
7037
7037
  });
7038
7038
  return;
7039
7039
  }
7040
+ var tm;
7040
7041
  if (state.unmounted) {
7042
+ var _config_animations2, _animationDriver_supportsCSSVars;
7043
+ if ((_animationDriver_supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars) !== null && _animationDriver_supportsCSSVars !== void 0 ? _animationDriver_supportsCSSVars : !(config == null || (_config_animations2 = config.animations) === null || _config_animations2 === void 0) && _config_animations2.supportsCSSVars) return tm = setTimeout(function() {
7044
+ setStateShallow({
7045
+ unmounted: !1
7046
+ });
7047
+ }), function() {
7048
+ return clearTimeout(tm);
7049
+ };
7041
7050
  setStateShallow({
7042
7051
  unmounted: !1
7043
7052
  });