@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.
@@ -2682,8 +2682,8 @@ var require_useMedia_native = __commonJS({
2682
2682
  }), mod);
2683
2683
  }, useMedia_exports = {};
2684
2684
  __export2(useMedia_exports, {
2685
- _dmt: function() {
2686
- return _dmt;
2685
+ _disableMediaTouch: function() {
2686
+ return _disableMediaTouch2;
2687
2687
  },
2688
2688
  configureMedia: function() {
2689
2689
  return configureMedia2;
@@ -2732,7 +2732,7 @@ var require_useMedia_native = __commonJS({
2732
2732
  }
2733
2733
  });
2734
2734
  module2.exports = __toCommonJS2(useMedia_exports);
2735
- 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 = {}, mediaQueryConfig2 = {}, getMedia2 = function() {
2735
+ 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 = {}, mediaQueryConfig2 = {}, getMedia2 = function() {
2736
2736
  return mediaState2;
2737
2737
  }, mediaKeys = /* @__PURE__ */ new Set(), mediaKeyRegex = /\$(platform|theme|group)-/, isMediaKey = function(key) {
2738
2738
  if (mediaKeys.has(key)) return !0;
@@ -2751,7 +2751,7 @@ var require_useMedia_native = __commonJS({
2751
2751
  for (var key in media) mediaState2[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || !1, mediaKeys.add(`$${key}`);
2752
2752
  Object.assign(mediaQueryConfig2, media), initState = {
2753
2753
  ...mediaState2
2754
- }, mediaKeysOrdered = Object.keys(media), config.disableSSR ? setupMediaListeners() : updateCurrentState();
2754
+ }, mediaKeysOrdered = Object.keys(media), setupMediaListeners();
2755
2755
  }
2756
2756
  };
2757
2757
  function unlisten() {
@@ -2804,48 +2804,64 @@ var require_useMedia_native = __commonJS({
2804
2804
  listeners.delete(subscriber);
2805
2805
  };
2806
2806
  }
2807
- function useMedia2(uidIn, componentContext, debug) {
2808
- var uid = uidIn ?? import_react3.default.useRef(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !import_constants2.isWeb ? mediaState2 : initState) || {}, componentState = States.get(uid);
2809
- componentState || (componentState = {
2810
- prev: initialState
2811
- }, States.set(uid, componentState));
2812
- var getSnapshot = function() {
2813
- if (!componentState) return initialState;
2814
- var { enabled, keys, prev = initialState } = componentState;
2815
- if (enabled === !1) return prev;
2816
- var _ref, testKeys = (_ref = (keys != null || enabled) && keys) !== null && _ref !== void 0 ? _ref : null, hasntUpdated = !testKeys || Object.keys(testKeys).every(function(key) {
2817
- return mediaState2[key] === prev[key];
2818
- });
2819
- return hasntUpdated ? prev : (componentState.prev = mediaState2, mediaState2);
2820
- }, state;
2821
- if (process.env.TAMAGUI_SYNC_MEDIA_QUERY) state = import_react3.default.useSyncExternalStore(subscribe, getSnapshot, function() {
2822
- return initialState;
2823
- });
2824
- else {
2825
- var [_state, setState] = import_react3.default.useState(initialState);
2826
- state = _state, (0, import_constants2.useIsomorphicLayoutEffect)(function() {
2827
- function update() {
2828
- setState(getSnapshot);
2807
+ function useMedia2(cc, debug) {
2808
+ 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() {
2809
+ return currentKeys;
2810
+ };
2811
+ function getSnapshot(cur) {
2812
+ var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : cur.lastKeys;
2813
+ if (!keys) return cur;
2814
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2815
+ try {
2816
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2817
+ var key = _step.value;
2818
+ if (mediaState2[key] !== cur[key]) return {
2819
+ ...mediaState2,
2820
+ lastKeys: new Set(keys)
2821
+ };
2829
2822
  }
2830
- return update(), disableSSR || Promise.resolve().then(function() {
2831
- update();
2832
- }), subscribe(update);
2833
- }, []);
2823
+ } catch (err) {
2824
+ _didIteratorError = !0, _iteratorError = err;
2825
+ } finally {
2826
+ try {
2827
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2828
+ } finally {
2829
+ if (_didIteratorError) throw _iteratorError;
2830
+ }
2831
+ }
2832
+ return cur;
2834
2833
  }
2835
- return new Proxy(state, {
2834
+ var isRendering = !0, isInitialState = state === initialState;
2835
+ return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
2836
+ isRendering = !1;
2837
+ }), (0, import_constants2.useIsomorphicLayoutEffect)(function() {
2838
+ var update = function() {
2839
+ return setState(function(prev) {
2840
+ return getSnapshot(
2841
+ prev,
2842
+ // because the !didHydrateOnce logic we can't update as we render
2843
+ // we need to get the current keys in case we added
2844
+ // these only ever add keys so likely ok?
2845
+ getCurrentKeys()
2846
+ );
2847
+ });
2848
+ };
2849
+ return update(), subscribe(update);
2850
+ }, []), new Proxy(state, {
2836
2851
  get(_, key) {
2837
- if (!disableMediaTouch) {
2838
- if (typeof key == "string") {
2839
- var _componentState;
2840
- (_componentState = componentState).keys || (_componentState.keys = {}), componentState.keys[key] = !0;
2852
+ if (isRendering && !disableMediaTouch && typeof key == "string") {
2853
+ var needsUpdateKeys = !state.lastKeys || !state.lastKeys.has(key);
2854
+ if ((needsUpdateKeys || state[key] !== mediaState2[key]) && (currentKeys || (currentKeys = /* @__PURE__ */ new Set()), currentKeys.add(key), !isInitialState)) {
2855
+ var next = getSnapshot(state, currentKeys);
2856
+ next !== state && setState(next);
2841
2857
  }
2842
- return Reflect.get(state, key);
2843
2858
  }
2859
+ return Reflect.get(state, key);
2844
2860
  }
2845
2861
  });
2846
2862
  }
2847
2863
  var disableMediaTouch = !1;
2848
- function _dmt(val) {
2864
+ function _disableMediaTouch2(val) {
2849
2865
  disableMediaTouch = val;
2850
2866
  }
2851
2867
  function getMediaState(mediaGroups, layout) {
@@ -4153,9 +4169,6 @@ var require_defaultComponentState_native = __commonJS({
4153
4169
  },
4154
4170
  defaultComponentStateMounted: function() {
4155
4171
  return defaultComponentStateMounted;
4156
- },
4157
- defaultComponentStateShouldEnter: function() {
4158
- return defaultComponentStateShouldEnter;
4159
4172
  }
4160
4173
  });
4161
4174
  module2.exports = __toCommonJS2(defaultComponentState_exports);
@@ -4170,9 +4183,6 @@ var require_defaultComponentState_native = __commonJS({
4170
4183
  }, defaultComponentStateMounted = {
4171
4184
  ...defaultComponentState,
4172
4185
  unmounted: !1
4173
- }, defaultComponentStateShouldEnter = {
4174
- ...defaultComponentState,
4175
- unmounted: "should-enter"
4176
4186
  };
4177
4187
  }
4178
4188
  });
@@ -5364,11 +5374,11 @@ var require_log_native = __commonJS({
5364
5374
  var import_useMedia = require_useMedia_native();
5365
5375
  function log() {
5366
5376
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
5367
- (0, import_useMedia._dmt)(!0);
5377
+ (0, import_useMedia._disableMediaTouch)(!0);
5368
5378
  try {
5369
5379
  return console.log(...args);
5370
5380
  } finally {
5371
- (0, import_useMedia._dmt)(!1);
5381
+ (0, import_useMedia._disableMediaTouch)(!1);
5372
5382
  }
5373
5383
  }
5374
5384
  }
@@ -6587,7 +6597,7 @@ var require_getSplitStyles_native = __commonJS({
6587
6597
  }
6588
6598
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
6589
6599
  conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
6590
- 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 = {
6600
+ 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 = {
6591
6601
  classNames,
6592
6602
  conf,
6593
6603
  props,
@@ -6617,7 +6627,7 @@ var require_getSplitStyles_native = __commonJS({
6617
6627
  if (shouldPassThrough2) return passDownProp(viewProps, key, val, isMediaOrPseudo1), "continue";
6618
6628
  if (isPseudo) {
6619
6629
  if (!val) return "continue";
6620
- var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
6630
+ var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClass), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
6621
6631
  if (!descriptor) return "continue";
6622
6632
  if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
6623
6633
  var _pseudos, _key;
@@ -6755,7 +6765,7 @@ var require_getSplitStyles_native = __commonJS({
6755
6765
  if (accept) {
6756
6766
  var accepted = accept[keyInit];
6757
6767
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
6758
- viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
6768
+ viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass);
6759
6769
  continue;
6760
6770
  }
6761
6771
  }
@@ -7353,7 +7363,7 @@ var require_Theme_native = __commonJS({
7353
7363
  function getThemedChildren(themeState, children, props) {
7354
7364
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { themeManager, isNewTheme } = themeState;
7355
7365
  if (!themeManager) return children;
7356
- var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
7366
+ var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || "inverse" in props || "name" in props || "reset" in props || "forceClassName" in props || stateRef.current.hasEverThemed;
7357
7367
  if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
7358
7368
  var next = children;
7359
7369
  shallow && (next = import_react3.Children.toArray(children).map(function(child) {
@@ -7376,7 +7386,7 @@ var require_Theme_native = __commonJS({
7376
7386
  function wrapThemeElements(param) {
7377
7387
  var { children, themeState, forceClassName, isRoot } = param;
7378
7388
  if (isRoot && forceClassName === !1) return children;
7379
- var inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7389
+ var inverse = themeState.inversed, requiresExtraWrapper = typeof inverse == "boolean" || forceClassName, { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
7380
7390
  className: `${className} _dsp_contents is_Theme`,
7381
7391
  style,
7382
7392
  children
@@ -7478,13 +7488,13 @@ var require_themeable_native = __commonJS({
7478
7488
  ...rest,
7479
7489
  "data-disable-theme": !0
7480
7490
  })
7481
- ), contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
7482
- componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName),
7483
- name: theme,
7491
+ ), filteredProps = {
7492
+ componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName)
7493
+ };
7494
+ "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);
7495
+ var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {
7484
7496
  "disable-child-theme": !0,
7485
- debug: props.debug,
7486
- inverse: themeInverse,
7487
- reset: themeReset,
7497
+ ...filteredProps,
7488
7498
  children: element
7489
7499
  });
7490
7500
  if (context) {
@@ -7552,75 +7562,6 @@ var require_wrapStyleTags_native = __commonJS({
7552
7562
  }
7553
7563
  });
7554
7564
 
7555
- // ../web/dist/cjs/hooks/useDidHydrateOnce.native.js
7556
- var require_useDidHydrateOnce_native = __commonJS({
7557
- "../web/dist/cjs/hooks/useDidHydrateOnce.native.js"(exports2, module2) {
7558
- "use strict";
7559
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
7560
- for (var name in all) __defProp2(target, name, {
7561
- get: all[name],
7562
- enumerable: !0
7563
- });
7564
- }, __copyProps2 = function(to, from, except, desc) {
7565
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
7566
- if (from && typeof from == "object" || typeof from == "function") try {
7567
- for (var _loop = function() {
7568
- var key = _step.value;
7569
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
7570
- get: function() {
7571
- return from[key];
7572
- },
7573
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
7574
- });
7575
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
7576
- } catch (err) {
7577
- _didIteratorError = !0, _iteratorError = err;
7578
- } finally {
7579
- try {
7580
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
7581
- } finally {
7582
- if (_didIteratorError)
7583
- throw _iteratorError;
7584
- }
7585
- }
7586
- return to;
7587
- }, __toESM2 = function(mod, isNodeMode, target) {
7588
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
7589
- // If the importer is in node compatibility mode or this is not an ESM
7590
- // file that has been converted to a CommonJS file using a Babel-
7591
- // compatible transform (i.e. "__esModule" has not been set), then set
7592
- // "default" to the CommonJS "module.exports" for node compatibility.
7593
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
7594
- value: mod,
7595
- enumerable: !0
7596
- }) : target,
7597
- mod
7598
- );
7599
- }, __toCommonJS2 = function(mod) {
7600
- return __copyProps2(__defProp2({}, "__esModule", {
7601
- value: !0
7602
- }), mod);
7603
- }, useDidHydrateOnce_exports = {};
7604
- __export2(useDidHydrateOnce_exports, {
7605
- useDidHydrateOnce: function() {
7606
- return useDidHydrateOnce;
7607
- },
7608
- useDidHydrateOnceRoot: function() {
7609
- return useDidHydrateOnceRoot;
7610
- }
7611
- });
7612
- module2.exports = __toCommonJS2(useDidHydrateOnce_exports);
7613
- var import_react3 = __toESM2(require("react")), import_config = require_config_native();
7614
- function useDidHydrateOnceRoot() {
7615
- return !0;
7616
- }
7617
- var last = Date.now();
7618
- function useDidHydrateOnce() {
7619
- return !0;
7620
- }
7621
- }
7622
- });
7623
-
7624
7565
  // ../web/dist/cjs/hooks/useComponentState.native.js
7625
7566
  var require_useComponentState_native = __commonJS({
7626
7567
  "../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
@@ -7664,7 +7605,7 @@ var require_useComponentState_native = __commonJS({
7664
7605
  }
7665
7606
  });
7666
7607
  module2.exports = __toCommonJS2(useComponentState_exports);
7667
- 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) {
7608
+ 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) {
7668
7609
  var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7669
7610
  stateRef.current || (stateRef.current = {});
7670
7611
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
@@ -7672,20 +7613,22 @@ var require_useComponentState_native = __commonJS({
7672
7613
  return !!(next || curStateRef.hasAnimated);
7673
7614
  }(), willBeAnimated = !import_constants2.isServer && willBeAnimatedClient;
7674
7615
  willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
7675
- 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 ? (
7616
+ 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
7617
+ // this is just for a better ux, supports css variables for light/dark, media queries, etc
7618
+ disableClassName, initialState = shouldEnter ? (
7676
7619
  // on the very first render we switch all spring animation drivers to css rendering
7677
7620
  // this is because we need to use css variables, which they don't support to do proper SSR
7678
7621
  // without flickers of the wrong colors.
7679
7622
  // but once we do that initial hydration and we are in client side rendering mode,
7680
7623
  // we can avoid the extra re-render on mount
7681
- shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
7624
+ import_defaultComponentState.defaultComponentState
7682
7625
  ) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
7683
7626
  disabled != null && (initialState.disabled = disabled);
7684
7627
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
7685
7628
  ...states[0],
7686
7629
  [props.forceStyle]: !0
7687
- } : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
7688
- 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({
7630
+ } : states[0], setState = states[1], isHydrated = state.unmounted === !1, isAnimated = willBeAnimated;
7631
+ 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({
7689
7632
  ...state
7690
7633
  }));
7691
7634
  var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
@@ -7695,10 +7638,10 @@ var require_useComponentState_native = __commonJS({
7695
7638
  var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
7696
7639
  state.unmounted && env && staticConfig.variants[env] ? props[env] = !0 : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
7697
7640
  }
7698
- var shouldAvoidClasses = !import_constants2.isWeb;
7699
- if (import_constants2.isWeb) {
7700
- 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;
7701
- (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0);
7641
+ var noClass = !import_constants2.isWeb || !!props.forceStyle;
7642
+ if (import_constants2.isWeb && (!import_constants2.isServer || isHydrated)) {
7643
+ var isAnimatedAndHydrated = isAnimated && !supportsCSSVars, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
7644
+ (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0);
7702
7645
  }
7703
7646
  var groupName = props.group;
7704
7647
  if (groupName && !curStateRef.group) {
@@ -7743,7 +7686,7 @@ var require_useComponentState_native = __commonJS({
7743
7686
  presenceState,
7744
7687
  setState,
7745
7688
  setStateShallow,
7746
- shouldAvoidClasses,
7689
+ noClass,
7747
7690
  state,
7748
7691
  stateRef,
7749
7692
  supportsCSSVars,
@@ -8042,7 +7985,7 @@ var require_createComponent_native = __commonJS({
8042
7985
  var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
8043
7986
  if (0)
8044
7987
  var timer;
8045
- 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, hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
7988
+ 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), hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8046
7989
  animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
8047
7990
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8048
7991
  props.themeShallow && (curStateRef.themeShallow = !0);
@@ -8060,14 +8003,14 @@ var require_createComponent_native = __commonJS({
8060
8003
  }
8061
8004
  var [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
8062
8005
  elementType = Component || elementType;
8063
- var isStringElement = typeof elementType == "string", mediaState2 = (0, import_useMedia.useMedia)(stateRef, componentContext, debugProp);
8006
+ var isStringElement = typeof elementType == "string", mediaState2 = (0, import_useMedia.useMedia)(componentContext, debugProp);
8064
8007
  (0, import_createVariable.setDidGetVariableValue)(!1);
8065
8008
  var resolveValues = (
8066
8009
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
8067
8010
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
8068
8011
  ), styleProps = {
8069
8012
  mediaState: mediaState2,
8070
- noClassNames,
8013
+ noClass,
8071
8014
  resolveValues,
8072
8015
  isExiting,
8073
8016
  isAnimated,
@@ -8079,7 +8022,7 @@ var require_createComponent_native = __commonJS({
8079
8022
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
8080
8023
  }
8081
8024
  curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8082
- var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8025
+ var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8083
8026
  (0, import_useMedia.setMediaShouldUpdate)(stateRef, shouldListenForMedia, mediaListeningKeys);
8084
8027
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
8085
8028
  asChild,
@@ -8145,23 +8088,20 @@ var require_createComponent_native = __commonJS({
8145
8088
  };
8146
8089
  import_react3.default.useEffect(function() {
8147
8090
  if (!disabled) {
8091
+ var tm;
8148
8092
  if (state.unmounted === !0 && hasEnterStyle) {
8149
8093
  setStateShallow({
8150
8094
  unmounted: "should-enter"
8151
8095
  });
8152
8096
  return;
8153
8097
  }
8154
- var tm;
8155
- if (state.unmounted) {
8156
- animationDriver != null && animationDriver.supportsCSSVars ? tm = setTimeout(function() {
8157
- setStateShallow({
8158
- unmounted: !1
8159
- });
8160
- }) : setStateShallow({
8098
+ if (state.unmounted) return tm = setTimeout(function() {
8099
+ setStateShallow({
8161
8100
  unmounted: !1
8162
8101
  });
8163
- return;
8164
- }
8102
+ }), function() {
8103
+ return clearTimeout(tm);
8104
+ };
8165
8105
  var dispose = (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8166
8106
  disabled,
8167
8107
  componentContext,
@@ -8184,7 +8124,7 @@ var require_createComponent_native = __commonJS({
8184
8124
  ...mediaGroups
8185
8125
  ]).join("") : 0
8186
8126
  ]);
8187
- 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), events = shouldAttach ? {
8127
+ 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), events = shouldAttach ? {
8188
8128
  onPressOut: attachPress ? function(e) {
8189
8129
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
8190
8130
  } : void 0,
@@ -10160,22 +10100,14 @@ var require_index_native7 = __commonJS({
10160
10100
  },
10161
10101
  useDidFinishSSR: function() {
10162
10102
  return useDidFinishSSR;
10163
- },
10164
- useDidFinishSSRSync: function() {
10165
- return useDidFinishSSRSync;
10166
10103
  }
10167
10104
  });
10168
10105
  module2.exports = __toCommonJS2(src_exports2);
10169
10106
  var React3 = __toESM2(require("react"));
10170
- function useDidFinishSSR(value, options) {
10107
+ function useDidFinishSSR(value) {
10171
10108
  return value ?? !0;
10172
10109
  var cur, setCur;
10173
10110
  }
10174
- function useDidFinishSSRSync(value) {
10175
- return useDidFinishSSR(value, {
10176
- sync: !0
10177
- });
10178
- }
10179
10111
  function useClientValue(value) {
10180
10112
  var done = useDidFinishSSR();
10181
10113
  return done ? typeof value == "function" ? value() : value : void 0;
@@ -10371,7 +10303,7 @@ var require_useProps_native = __commonJS({
10371
10303
  mediaState: mediaState2,
10372
10304
  noSkip: !0,
10373
10305
  noMergeStyle: !0,
10374
- noClassNames: !0,
10306
+ noClass: !0,
10375
10307
  resolveValues: "auto",
10376
10308
  ...opts
10377
10309
  }, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
@@ -10742,10 +10674,10 @@ var require_TamaguiProvider_native = __commonJS({
10742
10674
  }
10743
10675
  });
10744
10676
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
10745
- 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();
10677
+ 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();
10746
10678
  function TamaguiProvider(param) {
10747
10679
  var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
10748
- return (0, import_useMedia.setupMediaListeners)(), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
10680
+ return process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
10749
10681
  if (config && !disableInjectCSS) {
10750
10682
  var style = document.createElement("style");
10751
10683
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
@@ -11067,6 +10999,9 @@ var require_index_native9 = __commonJS({
11067
10999
  }), mod);
11068
11000
  }, src_exports2 = {};
11069
11001
  __export2(src_exports2, {
11002
+ _disableMediaTouch: function() {
11003
+ return import_useMedia._disableMediaTouch;
11004
+ },
11070
11005
  configureMedia: function() {
11071
11006
  return import_useMedia.configureMedia;
11072
11007
  },