tamagui 1.131.0 → 1.131.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.
@@ -3036,22 +3036,22 @@ var require_useMedia_native = __commonJS({
3036
3036
  listeners.delete(subscriber);
3037
3037
  };
3038
3038
  }
3039
- function useMedia3(cc, debug) {
3040
- var componentState = cc ? States.get(cc) : null, internalRef = (0, import_react3.useRef)(null);
3039
+ function useMedia3(componentContext, debug) {
3040
+ var componentState = componentContext ? States.get(componentContext) : null, internalRef = (0, import_react3.useRef)(null);
3041
3041
  internalRef.current || (internalRef.current = {
3042
- keys: /* @__PURE__ */ new Set()
3043
- });
3044
- var { keys, lastState = mediaState3 } = internalRef.current;
3042
+ keys: /* @__PURE__ */ new Set(),
3043
+ lastState: mediaState3
3044
+ }), internalRef.current.pendingState && (internalRef.current.lastState = internalRef.current.pendingState, internalRef.current.pendingState = void 0);
3045
+ var { keys } = internalRef.current;
3045
3046
  keys.size && keys.clear();
3046
3047
  var state = (0, import_react3.useSyncExternalStore)(subscribe, function() {
3047
- if (componentState != null && componentState.enabled) return internalRef.current.lastState = mediaState3, mediaState3;
3048
- var curKeys = (componentState == null ? void 0 : componentState.keys) || keys;
3048
+ var curKeys = (componentState == null ? void 0 : componentState.keys) || keys, { lastState, pendingState } = internalRef.current;
3049
3049
  if (!curKeys.size) return lastState;
3050
3050
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3051
3051
  try {
3052
3052
  for (var _iterator = curKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3053
3053
  var key = _step.value;
3054
- if (mediaState3[key] !== lastState[key]) return internalRef.current.lastState = mediaState3, mediaState3;
3054
+ if (mediaState3[key] !== (pendingState || lastState)[key]) return componentContext != null && componentContext.mediaEmit ? (componentContext.mediaEmit(mediaState3), internalRef.current.pendingState = mediaState3, lastState) : (internalRef.current.lastState = mediaState3, mediaState3);
3055
3055
  }
3056
3056
  } catch (err) {
3057
3057
  _didIteratorError = !0, _iteratorError = err;
@@ -7166,6 +7166,8 @@ var require_useThemeState_native = __commonJS({
7166
7166
  if (name && reset) throw new Error("Cannot reset and set a new name at the same time.");
7167
7167
  var { themes: themes2 } = (0, import_config.getConfig)();
7168
7168
  if (reset) {
7169
+ var isSchemeOnly = parentName === "light" || parentName === "dark";
7170
+ if (isSchemeOnly) return parentName === "light" ? "dark" : "light";
7169
7171
  var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
7170
7172
  return result;
7171
7173
  }
@@ -8221,7 +8223,7 @@ var require_createComponent_native = __commonJS({
8221
8223
  }
8222
8224
  });
8223
8225
  module2.exports = __toCommonJS2(createComponent_exports);
8224
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_is_equal_shallow = require_index_native12(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), NextState = /* @__PURE__ */ new WeakMap(), componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
8226
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_is_equal_shallow = require_index_native12(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), NextState = /* @__PURE__ */ new WeakMap(), NextMedia = /* @__PURE__ */ new WeakMap(), componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
8225
8227
  "hover",
8226
8228
  "press",
8227
8229
  "pressIn",
@@ -8376,6 +8378,18 @@ var require_createComponent_native = __commonJS({
8376
8378
  }
8377
8379
  if (splitStyles && (hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
8378
8380
  var useStyleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8381
+ componentContext.mediaEmit = function(next) {
8382
+ NextMedia.set(stateRef, next), updateStyleListener();
8383
+ };
8384
+ var updateStyleListener = function() {
8385
+ var updatedState = NextState.get(stateRef) || state, mediaState22 = NextMedia.get(stateRef), { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
8386
+ groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
8387
+ var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, mediaState22 ? {
8388
+ ...styleProps,
8389
+ mediaState: mediaState22
8390
+ } : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
8391
+ useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
8392
+ };
8379
8393
  stateRef.current.setStateShallow = function(nextOrGetNext) {
8380
8394
  var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
8381
8395
  if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
@@ -8387,11 +8401,7 @@ var require_createComponent_native = __commonJS({
8387
8401
  ...prev,
8388
8402
  ...next
8389
8403
  };
8390
- NextState.set(stateRef, updatedState);
8391
- var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
8392
- groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
8393
- var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
8394
- useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
8404
+ NextState.set(stateRef, updatedState), updateStyleListener();
8395
8405
  } else ogSetStateShallow(next);
8396
8406
  }
8397
8407
  }, setStateShallow = function(state2) {
@@ -23384,7 +23394,8 @@ var require_ListItem_native = __commonJS({
23384
23394
  });
23385
23395
  }), ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
23386
23396
  Text: ListItemText,
23387
- Subtitle: ListItemSubtitle
23397
+ Subtitle: ListItemSubtitle,
23398
+ Title: ListItemTitle
23388
23399
  });
23389
23400
  }
23390
23401
  });
@@ -23958,7 +23969,7 @@ var require_Popper_native = __commonJS({
23958
23969
  });
23959
23970
  }
23960
23971
  var PopperAnchor = import_stacks3.YStack.extractable(/* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
23961
- var { virtualRef, scope, ...anchorProps } = props, { getReferenceProps, refs, update } = usePopperContextSlow(scope), ref = React4.useRef(null);
23972
+ var { virtualRef, scope, ...anchorProps } = props, context = usePopperContextSlow(scope), { getReferenceProps, refs, update } = context, ref = React4.useRef(null);
23962
23973
  React4.useEffect(function() {
23963
23974
  virtualRef && refs.setReference(virtualRef.current);
23964
23975
  }, [
@@ -23966,6 +23977,7 @@ var require_Popper_native = __commonJS({
23966
23977
  ]);
23967
23978
  var stackProps = anchorProps, refProps = getReferenceProps ? getReferenceProps(stackProps) : null, composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
23968
23979
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
23980
+ ...stackProps,
23969
23981
  ...refProps,
23970
23982
  ref: composedRefs,
23971
23983
  // this helps us with handling scoped poppers with many different targets
@@ -23979,7 +23991,7 @@ var require_Popper_native = __commonJS({
23979
23991
  },
23980
23992
  onMouseLeave: function(e) {
23981
23993
  var _refProps_onMouseLeave;
23982
- refProps == null || (_refProps_onMouseLeave = refProps.onMouseLeave) === null || _refProps_onMouseLeave === void 0 || _refProps_onMouseLeave.call(refProps, e), refs.setReference(null);
23994
+ refProps == null || (_refProps_onMouseLeave = refProps.onMouseLeave) === null || _refProps_onMouseLeave === void 0 || _refProps_onMouseLeave.call(refProps, e);
23983
23995
  }
23984
23996
  });
23985
23997
  })), PopperContentFrame = (0, import_core12.styled)(import_stacks3.ThemeableStack, {