@tamagui/core 1.115.5 → 1.116.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.
package/dist/native.js CHANGED
@@ -2858,8 +2858,8 @@ var require_useMedia_native = __commonJS({
2858
2858
  }), mod);
2859
2859
  }, useMedia_exports = {};
2860
2860
  __export2(useMedia_exports, {
2861
- _dmt: function() {
2862
- return _dmt;
2861
+ _disableMediaTouch: function() {
2862
+ return _disableMediaTouch2;
2863
2863
  },
2864
2864
  configureMedia: function() {
2865
2865
  return configureMedia2;
@@ -2908,7 +2908,7 @@ var require_useMedia_native = __commonJS({
2908
2908
  }
2909
2909
  });
2910
2910
  module2.exports = __toCommonJS2(useMedia_exports);
2911
- var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = (
2911
+ var import_constants2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = (
2912
2912
  // development only safeguard
2913
2913
  process.env.NODE_ENV === "development" ? new Proxy({}, {
2914
2914
  get(target, key) {
@@ -2937,7 +2937,7 @@ var require_useMedia_native = __commonJS({
2937
2937
  for (var key in media) mediaState2[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || !1, mediaKeys.add(`$${key}`);
2938
2938
  Object.assign(mediaQueryConfig2, media), initState = {
2939
2939
  ...mediaState2
2940
- }, mediaKeysOrdered = Object.keys(media), config.disableSSR ? setupMediaListeners() : updateCurrentState();
2940
+ }, mediaKeysOrdered = Object.keys(media), setupMediaListeners();
2941
2941
  }
2942
2942
  };
2943
2943
  function unlisten() {
@@ -2990,48 +2990,64 @@ var require_useMedia_native = __commonJS({
2990
2990
  listeners.delete(subscriber);
2991
2991
  };
2992
2992
  }
2993
- function useMedia2(uidIn, componentContext, debug) {
2994
- var uid = uidIn ?? import_react3.default.useRef(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !import_constants2.isWeb ? mediaState2 : initState) || {}, componentState = States.get(uid);
2995
- componentState || (componentState = {
2996
- prev: initialState
2997
- }, States.set(uid, componentState));
2998
- var getSnapshot = function() {
2999
- if (!componentState) return initialState;
3000
- var { enabled, keys, prev = initialState } = componentState;
3001
- if (enabled === !1) return prev;
3002
- var _ref, testKeys = (_ref = (keys != null || enabled) && keys) !== null && _ref !== void 0 ? _ref : null, hasntUpdated = !testKeys || Object.keys(testKeys).every(function(key) {
3003
- return mediaState2[key] === prev[key];
3004
- });
3005
- return hasntUpdated ? prev : (componentState.prev = mediaState2, mediaState2);
3006
- }, state;
3007
- if (process.env.TAMAGUI_SYNC_MEDIA_QUERY) state = import_react3.default.useSyncExternalStore(subscribe, getSnapshot, function() {
3008
- return initialState;
3009
- });
3010
- else {
3011
- var [_state, setState] = import_react3.default.useState(initialState);
3012
- state = _state, (0, import_constants2.useIsomorphicLayoutEffect)(function() {
3013
- function update() {
3014
- setState(getSnapshot);
2993
+ function useMedia2(cc, debug) {
2994
+ var disableSSR = (0, import_config.getSetting)("disableSSR") || (0, import_useDisableSSR.getDisableSSR)(cc), initialState = disableSSR || !import_constants2.isWeb ? mediaState2 : initState, [state, setState] = import_react3.default.useState(initialState), currentKeys, getCurrentKeys = function() {
2995
+ return currentKeys;
2996
+ };
2997
+ function getSnapshot(cur) {
2998
+ var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cur.lastKeys;
2999
+ if (!keys) return cur;
3000
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3001
+ try {
3002
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3003
+ var key = _step.value;
3004
+ if (mediaState2[key] !== cur[key]) return process.env.NODE_ENV === "development" && debug && console.warn("useMedia()\u270D\uFE0F", key, cur[key], ">", mediaState2[key]), {
3005
+ ...mediaState2,
3006
+ lastKeys: new Set(keys)
3007
+ };
3015
3008
  }
3016
- return update(), disableSSR || Promise.resolve().then(function() {
3017
- update();
3018
- }), subscribe(update);
3019
- }, []);
3009
+ } catch (err) {
3010
+ _didIteratorError = !0, _iteratorError = err;
3011
+ } finally {
3012
+ try {
3013
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3014
+ } finally {
3015
+ if (_didIteratorError) throw _iteratorError;
3016
+ }
3017
+ }
3018
+ return cur;
3020
3019
  }
3021
- return new Proxy(state, {
3020
+ var isRendering = !0, isInitialState = state === initialState;
3021
+ return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
3022
+ isRendering = !1;
3023
+ }), (0, import_constants2.useIsomorphicLayoutEffect)(function() {
3024
+ var update = function() {
3025
+ return setState(function(prev) {
3026
+ return getSnapshot(
3027
+ prev,
3028
+ // because the !didHydrateOnce logic we can't update as we render
3029
+ // we need to get the current keys in case we added
3030
+ // these only ever add keys so likely ok?
3031
+ getCurrentKeys()
3032
+ );
3033
+ });
3034
+ };
3035
+ return update(), subscribe(update);
3036
+ }, []), new Proxy(state, {
3022
3037
  get(_, key) {
3023
- if (!disableMediaTouch) {
3024
- if (typeof key == "string") {
3025
- var _componentState;
3026
- (_componentState = componentState).keys || (_componentState.keys = {}), componentState.keys[key] = !0, process.env.NODE_ENV === "development" && debug && console.info("useMedia() TOUCH", key);
3038
+ if (isRendering && !disableMediaTouch && typeof key == "string") {
3039
+ var needsUpdateKeys = !state.lastKeys || !state.lastKeys.has(key);
3040
+ if ((needsUpdateKeys || state[key] !== mediaState2[key]) && (process.env.NODE_ENV === "development" && debug && console.info("useMedia() TOUCH", key), currentKeys || (currentKeys = /* @__PURE__ */ new Set()), currentKeys.add(key), !isInitialState)) {
3041
+ var next = getSnapshot(state, currentKeys);
3042
+ next !== state && setState(next);
3027
3043
  }
3028
- return Reflect.get(state, key);
3029
3044
  }
3045
+ return Reflect.get(state, key);
3030
3046
  }
3031
3047
  });
3032
3048
  }
3033
3049
  var disableMediaTouch = !1;
3034
- function _dmt(val) {
3050
+ function _disableMediaTouch2(val) {
3035
3051
  disableMediaTouch = val;
3036
3052
  }
3037
3053
  function getMediaState(mediaGroups, layout) {
@@ -4463,9 +4479,6 @@ var require_defaultComponentState_native = __commonJS({
4463
4479
  },
4464
4480
  defaultComponentStateMounted: function() {
4465
4481
  return defaultComponentStateMounted;
4466
- },
4467
- defaultComponentStateShouldEnter: function() {
4468
- return defaultComponentStateShouldEnter;
4469
4482
  }
4470
4483
  });
4471
4484
  module2.exports = __toCommonJS2(defaultComponentState_exports);
@@ -4480,9 +4493,6 @@ var require_defaultComponentState_native = __commonJS({
4480
4493
  }, defaultComponentStateMounted = {
4481
4494
  ...defaultComponentState,
4482
4495
  unmounted: !1
4483
- }, defaultComponentStateShouldEnter = {
4484
- ...defaultComponentState,
4485
- unmounted: "should-enter"
4486
4496
  };
4487
4497
  }
4488
4498
  });
@@ -5675,11 +5685,11 @@ var require_log_native = __commonJS({
5675
5685
  function log() {
5676
5686
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
5677
5687
  if (process.env.NODE_ENV !== "production") {
5678
- (0, import_useMedia._dmt)(!0);
5688
+ (0, import_useMedia._disableMediaTouch)(!0);
5679
5689
  try {
5680
5690
  return console.log(...args);
5681
5691
  } finally {
5682
- (0, import_useMedia._dmt)(!1);
5692
+ (0, import_useMedia._disableMediaTouch)(!1);
5683
5693
  }
5684
5694
  }
5685
5695
  }
@@ -6920,7 +6930,7 @@ var require_getSplitStyles_native = __commonJS({
6920
6930
  }
6921
6931
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
6922
6932
  conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
6923
- var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
6933
+ var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
6924
6934
  classNames,
6925
6935
  conf,
6926
6936
  props,
@@ -6968,7 +6978,7 @@ var require_getSplitStyles_native = __commonJS({
6968
6978
  }), console.groupEnd()), "continue";
6969
6979
  if (isPseudo) {
6970
6980
  if (!val) return "continue";
6971
- var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
6981
+ var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClass), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
6972
6982
  if (!descriptor) return "continue";
6973
6983
  if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
6974
6984
  var _pseudos, _key;
@@ -7136,7 +7146,7 @@ var require_getSplitStyles_native = __commonJS({
7136
7146
  if (accept) {
7137
7147
  var accepted = accept[keyInit];
7138
7148
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
7139
- viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
7149
+ viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass);
7140
7150
  continue;
7141
7151
  }
7142
7152
  }
@@ -7797,7 +7807,7 @@ var require_Theme_native = __commonJS({
7797
7807
  function getThemedChildren(themeState, children, props) {
7798
7808
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { themeManager, isNewTheme } = themeState;
7799
7809
  if (!themeManager) return children;
7800
- var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
7810
+ var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props || stateRef.current.hasEverThemed;
7801
7811
  if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
7802
7812
  process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug === "verbose" && (0, import_log.log)(`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`, props);
7803
7813
  var next = children;
@@ -7821,7 +7831,7 @@ var require_Theme_native = __commonJS({
7821
7831
  function wrapThemeElements(param) {
7822
7832
  var { children, themeState, forceClassName, isRoot } = param;
7823
7833
  if (isRoot && forceClassName === !1) return children;
7824
- var inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7834
+ var inverse = themeState.inversed, requiresExtraWrapper = typeof inverse == "boolean" || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7825
7835
  className: `${className} _dsp_contents is_Theme`,
7826
7836
  style,
7827
7837
  children
@@ -7923,13 +7933,13 @@ var require_themeable_native = __commonJS({
7923
7933
  ...rest,
7924
7934
  "data-disable-theme": !0
7925
7935
  })
7926
- ), contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
7927
- componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName),
7928
- name: theme,
7936
+ ), filteredProps = {
7937
+ componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName)
7938
+ };
7939
+ "debug" in props && (filteredProps.debug = props.debug), "theme" in props && (filteredProps.name = props.theme), "themeInverse" in props && (filteredProps.inverse = props.themeInverse), "themeReset" in props && (filteredProps.reset = themeReset);
7940
+ var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
7929
7941
  "disable-child-theme": !0,
7930
- debug: props.debug,
7931
- inverse: themeInverse,
7932
- reset: themeReset,
7942
+ ...filteredProps,
7933
7943
  children: element
7934
7944
  });
7935
7945
  if (context) {
@@ -7997,75 +8007,6 @@ var require_wrapStyleTags_native = __commonJS({
7997
8007
  }
7998
8008
  });
7999
8009
 
8000
- // ../web/dist/cjs/hooks/useDidHydrateOnce.native.js
8001
- var require_useDidHydrateOnce_native = __commonJS({
8002
- "../web/dist/cjs/hooks/useDidHydrateOnce.native.js"(exports2, module2) {
8003
- "use strict";
8004
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
8005
- for (var name in all) __defProp2(target, name, {
8006
- get: all[name],
8007
- enumerable: !0
8008
- });
8009
- }, __copyProps2 = function(to, from, except, desc) {
8010
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
8011
- if (from && typeof from == "object" || typeof from == "function") try {
8012
- for (var _loop = function() {
8013
- var key = _step.value;
8014
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
8015
- get: function() {
8016
- return from[key];
8017
- },
8018
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
8019
- });
8020
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
8021
- } catch (err) {
8022
- _didIteratorError = !0, _iteratorError = err;
8023
- } finally {
8024
- try {
8025
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
8026
- } finally {
8027
- if (_didIteratorError)
8028
- throw _iteratorError;
8029
- }
8030
- }
8031
- return to;
8032
- }, __toESM2 = function(mod, isNodeMode, target) {
8033
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
8034
- // If the importer is in node compatibility mode or this is not an ESM
8035
- // file that has been converted to a CommonJS file using a Babel-
8036
- // compatible transform (i.e. "__esModule" has not been set), then set
8037
- // "default" to the CommonJS "module.exports" for node compatibility.
8038
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
8039
- value: mod,
8040
- enumerable: !0
8041
- }) : target,
8042
- mod
8043
- );
8044
- }, __toCommonJS2 = function(mod) {
8045
- return __copyProps2(__defProp2({}, "__esModule", {
8046
- value: !0
8047
- }), mod);
8048
- }, useDidHydrateOnce_exports = {};
8049
- __export2(useDidHydrateOnce_exports, {
8050
- useDidHydrateOnce: function() {
8051
- return useDidHydrateOnce;
8052
- },
8053
- useDidHydrateOnceRoot: function() {
8054
- return useDidHydrateOnceRoot;
8055
- }
8056
- });
8057
- module2.exports = __toCommonJS2(useDidHydrateOnce_exports);
8058
- var import_react3 = __toESM2(require("react")), import_config = require_config_native();
8059
- function useDidHydrateOnceRoot() {
8060
- return !0;
8061
- }
8062
- var last = Date.now();
8063
- function useDidHydrateOnce() {
8064
- return !0;
8065
- }
8066
- }
8067
- });
8068
-
8069
8010
  // ../web/dist/cjs/hooks/useComponentState.native.js
8070
8011
  var require_useComponentState_native = __commonJS({
8071
8012
  "../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
@@ -8109,7 +8050,7 @@ var require_useComponentState_native = __commonJS({
8109
8050
  }
8110
8051
  });
8111
8052
  module2.exports = __toCommonJS2(useComponentState_exports);
8112
- var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"), import_constants2 = require_index_native3(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
8053
+ var import_constants2 = require_index_native3(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
8113
8054
  var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
8114
8055
  stateRef.current || (stateRef.current = {});
8115
8056
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
@@ -8117,20 +8058,22 @@ var require_useComponentState_native = __commonJS({
8117
8058
  return !!(next || curStateRef.hasAnimated);
8118
8059
  }(), willBeAnimated = !import_constants2.isServer && willBeAnimatedClient;
8119
8060
  willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
8120
- var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationDriver == null ? void 0 : animationDriver.isReactNative), hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants2.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
8061
+ var { disableClassName } = props, presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasAnimationThatNeedsHydrate = hasAnimationProp && ((animationDriver == null ? void 0 : animationDriver.isReactNative) || !supportsCSSVars), hasEnterState = hasEnterStyle || isEntering, shouldEnter = hasEnterState || hasAnimationThatNeedsHydrate || // disableClassName doesnt work server side, only client, so needs hydrate
8062
+ // this is just for a better ux, supports css variables for light/dark, media queries, etc
8063
+ disableClassName, initialState = shouldEnter ? (
8121
8064
  // on the very first render we switch all spring animation drivers to css rendering
8122
8065
  // this is because we need to use css variables, which they don't support to do proper SSR
8123
8066
  // without flickers of the wrong colors.
8124
8067
  // but once we do that initial hydration and we are in client side rendering mode,
8125
8068
  // we can avoid the extra re-render on mount
8126
- shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
8069
+ import_defaultComponentState.defaultComponentState
8127
8070
  ) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
8128
8071
  disabled != null && (initialState.disabled = disabled);
8129
8072
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
8130
8073
  ...states[0],
8131
8074
  [props.forceStyle]: !0
8132
- } : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
8133
- import_constants2.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
8075
+ } : states[0], setState = states[1], isHydrated = state.unmounted === !1, isAnimated = willBeAnimated;
8076
+ import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
8134
8077
  ...state
8135
8078
  }));
8136
8079
  var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
@@ -8141,10 +8084,10 @@ var require_useComponentState_native = __commonJS({
8141
8084
  var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
8142
8085
  state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
8143
8086
  }
8144
- var shouldAvoidClasses = !import_constants2.isWeb;
8145
- if (import_constants2.isWeb) {
8146
- var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants2.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants2.isServer && didHydrateOnce && state.unmounted === !0;
8147
- (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
8087
+ var noClass = !import_constants2.isWeb || !!props.forceStyle;
8088
+ if (import_constants2.isWeb && (!import_constants2.isServer || isHydrated)) {
8089
+ var isAnimatedAndHydrated = isAnimated && !supportsCSSVars, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
8090
+ (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
8148
8091
  isAnimatedAndHydrated,
8149
8092
  isDisabledManually,
8150
8093
  isClassNameDisabled
@@ -8193,7 +8136,7 @@ var require_useComponentState_native = __commonJS({
8193
8136
  presenceState,
8194
8137
  setState,
8195
8138
  setStateShallow,
8196
- shouldAvoidClasses,
8139
+ noClass,
8197
8140
  state,
8198
8141
  stateRef,
8199
8142
  supportsCSSVars,
@@ -8540,7 +8483,7 @@ var require_createComponent_native = __commonJS({
8540
8483
  ]), !1)
8541
8484
  var timer;
8542
8485
  process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`, process.env.NODE_ENV === "development" && time && time`stateref`;
8543
- var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
8486
+ var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
8544
8487
  process.env.NODE_ENV === "development" && time && time`use-state`;
8545
8488
  var hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText);
8546
8489
  process.env.NODE_ENV === "development" && time && time`use-context`;
@@ -8557,11 +8500,10 @@ var require_createComponent_native = __commonJS({
8557
8500
  if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = function() {
8558
8501
  return stateRef.current.isListeningToTheme;
8559
8502
  }), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
8560
- var name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (shouldAvoidClasses ? "(shouldAvoidClasses)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
8503
+ var name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (noClass ? "(noClass)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
8561
8504
  if (console.info(`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`, "background: green; color: white;"), import_constants2.isServer) (0, import_log.log)({
8562
- noClassNames,
8505
+ noClass,
8563
8506
  isAnimated,
8564
- shouldAvoidClasses,
8565
8507
  isWeb: import_constants2.isWeb,
8566
8508
  supportsCSSVars
8567
8509
  });
@@ -8590,14 +8532,14 @@ var require_createComponent_native = __commonJS({
8590
8532
  elementType = Component || elementType;
8591
8533
  var isStringElement = typeof elementType == "string";
8592
8534
  process.env.NODE_ENV === "development" && time && time`theme`;
8593
- var mediaState2 = (0, import_useMedia.useMedia)(stateRef, componentContext, debugProp);
8535
+ var mediaState2 = (0, import_useMedia.useMedia)(componentContext, debugProp);
8594
8536
  (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
8595
8537
  var resolveValues = (
8596
8538
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
8597
8539
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
8598
8540
  ), styleProps = {
8599
8541
  mediaState: mediaState2,
8600
- noClassNames,
8542
+ noClass,
8601
8543
  resolveValues,
8602
8544
  isExiting,
8603
8545
  isAnimated,
@@ -8609,7 +8551,7 @@ var require_createComponent_native = __commonJS({
8609
8551
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
8610
8552
  }
8611
8553
  process.env.NODE_ENV === "development" && time && time`split-styles`, curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8612
- var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8554
+ var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8613
8555
  process.env.NODE_ENV === "development" && debugProp === "verbose" && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(stateRef, shouldListenForMedia, mediaListeningKeys);
8614
8556
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
8615
8557
  asChild,
@@ -8691,23 +8633,20 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8691
8633
  }
8692
8634
  }), import_react3.default.useEffect(function() {
8693
8635
  if (!disabled) {
8636
+ var tm;
8694
8637
  if (state.unmounted === !0 && hasEnterStyle) {
8695
8638
  setStateShallow({
8696
8639
  unmounted: "should-enter"
8697
8640
  });
8698
8641
  return;
8699
8642
  }
8700
- var tm;
8701
- if (state.unmounted) {
8702
- animationDriver != null && animationDriver.supportsCSSVars ? tm = setTimeout(function() {
8703
- setStateShallow({
8704
- unmounted: !1
8705
- });
8706
- }) : setStateShallow({
8643
+ if (state.unmounted) return tm = setTimeout(function() {
8644
+ setStateShallow({
8707
8645
  unmounted: !1
8708
8646
  });
8709
- return;
8710
- }
8647
+ }), function() {
8648
+ return clearTimeout(tm);
8649
+ };
8711
8650
  var dispose = (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8712
8651
  disabled,
8713
8652
  componentContext,
@@ -8730,7 +8669,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8730
8669
  ...mediaGroups
8731
8670
  ]).join("") : 0
8732
8671
  ]);
8733
- var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle);
8672
+ var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle);
8734
8673
  process.env.NODE_ENV === "development" && time && time`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
8735
8674
  runtimeFocusStyle,
8736
8675
  runtimePressStyle,
@@ -8899,8 +8838,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8899
8838
  mediaListeningKeys,
8900
8839
  pseudos,
8901
8840
  shouldAttach,
8902
- shouldAvoidClasses,
8903
- shouldForcePseudo,
8841
+ noClass,
8904
8842
  shouldListenForMedia,
8905
8843
  splitStyles,
8906
8844
  splitStylesStyle,
@@ -10769,22 +10707,14 @@ var require_index_native7 = __commonJS({
10769
10707
  },
10770
10708
  useDidFinishSSR: function() {
10771
10709
  return useDidFinishSSR;
10772
- },
10773
- useDidFinishSSRSync: function() {
10774
- return useDidFinishSSRSync;
10775
10710
  }
10776
10711
  });
10777
10712
  module2.exports = __toCommonJS2(src_exports2);
10778
10713
  var React3 = __toESM2(require("react"));
10779
- function useDidFinishSSR(value, options) {
10714
+ function useDidFinishSSR(value) {
10780
10715
  return value ?? !0;
10781
10716
  var cur, setCur;
10782
10717
  }
10783
- function useDidFinishSSRSync(value) {
10784
- return useDidFinishSSR(value, {
10785
- sync: !0
10786
- });
10787
- }
10788
10718
  function useClientValue(value) {
10789
10719
  var done = useDidFinishSSR();
10790
10720
  return done ? typeof value == "function" ? value() : value : void 0;
@@ -10980,7 +10910,7 @@ var require_useProps_native = __commonJS({
10980
10910
  mediaState: mediaState2,
10981
10911
  noSkip: !0,
10982
10912
  noMergeStyle: !0,
10983
- noClassNames: !0,
10913
+ noClass: !0,
10984
10914
  resolveValues: "auto",
10985
10915
  ...opts
10986
10916
  }, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
@@ -11351,10 +11281,10 @@ var require_TamaguiProvider_native = __commonJS({
11351
11281
  }
11352
11282
  });
11353
11283
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
11354
- var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native();
11284
+ var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_ThemeProvider = require_ThemeProvider_native();
11355
11285
  function TamaguiProvider(param) {
11356
11286
  var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
11357
- return (0, import_useMedia.setupMediaListeners)(), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
11287
+ return process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
11358
11288
  if (config && !disableInjectCSS) {
11359
11289
  var style = document.createElement("style");
11360
11290
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
@@ -11676,6 +11606,9 @@ var require_index_native9 = __commonJS({
11676
11606
  }), mod);
11677
11607
  }, src_exports2 = {};
11678
11608
  __export2(src_exports2, {
11609
+ _disableMediaTouch: function() {
11610
+ return import_useMedia._disableMediaTouch;
11611
+ },
11679
11612
  configureMedia: function() {
11680
11613
  return import_useMedia.configureMedia;
11681
11614
  },