@tamagui/core 2.0.0-rc.3 → 2.0.0-rc.30

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.
Files changed (55) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/bundle-native.mjs +22 -0
  3. package/dist/cjs/index.cjs +1 -0
  4. package/dist/cjs/index.js +68 -46
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/index.native.js +1 -0
  7. package/dist/cjs/index.native.js.map +1 -1
  8. package/dist/esm/index.js +50 -65
  9. package/dist/esm/index.js.map +1 -6
  10. package/dist/esm/index.mjs +2 -4
  11. package/dist/esm/index.mjs.map +1 -1
  12. package/dist/esm/index.native.js +2 -2
  13. package/dist/esm/index.native.js.map +1 -1
  14. package/dist/native.cjs +2001 -2703
  15. package/dist/test.native.cjs +993 -596
  16. package/inject-styles/index.cjs +2 -0
  17. package/inject-styles/index.js +2 -0
  18. package/inject-styles.cjs +1 -0
  19. package/native/index.cjs +2 -0
  20. package/native/index.js +2 -0
  21. package/native-test/index.cjs +2 -0
  22. package/native-test/index.js +2 -0
  23. package/package.json +27 -30
  24. package/reactNativeTypes/index.cjs +2 -0
  25. package/reactNativeTypes/index.js +2 -0
  26. package/reactNativeTypes/index.native.cjs +2 -0
  27. package/reactNativeTypes/index.native.js +2 -0
  28. package/reactNativeTypes.cjs +1 -0
  29. package/src/createOptimizedView.native.tsx +2 -2
  30. package/src/index.tsx +1 -0
  31. package/tsconfig.json +30 -0
  32. package/types/createOptimizedView.native.d.ts +4 -6
  33. package/types/createOptimizedView.native.d.ts.map +1 -1
  34. package/types/index.d.ts +1 -1
  35. package/types/index.d.ts.map +1 -1
  36. package/dist/cjs/createOptimizedView.js +0 -22
  37. package/dist/cjs/createOptimizedView.js.map +0 -6
  38. package/dist/cjs/getBaseViews.js +0 -23
  39. package/dist/cjs/getBaseViews.js.map +0 -6
  40. package/dist/cjs/inject-styles.js +0 -28
  41. package/dist/cjs/inject-styles.js.map +0 -6
  42. package/dist/cjs/reactNativeTypes.js +0 -14
  43. package/dist/cjs/reactNativeTypes.js.map +0 -6
  44. package/dist/cjs/vendor/Pressability.js +0 -22
  45. package/dist/cjs/vendor/Pressability.js.map +0 -6
  46. package/dist/esm/createOptimizedView.js +0 -6
  47. package/dist/esm/createOptimizedView.js.map +0 -6
  48. package/dist/esm/getBaseViews.js +0 -7
  49. package/dist/esm/getBaseViews.js.map +0 -6
  50. package/dist/esm/inject-styles.js +0 -12
  51. package/dist/esm/inject-styles.js.map +0 -6
  52. package/dist/esm/reactNativeTypes.js +0 -1
  53. package/dist/esm/reactNativeTypes.js.map +0 -6
  54. package/dist/esm/vendor/Pressability.js +0 -6
  55. package/dist/esm/vendor/Pressability.js.map +0 -6
@@ -50,25 +50,6 @@ function _interopNamespaceDefault(e) {
50
50
  n.default = e;
51
51
  return Object.freeze(n);
52
52
  }
53
- function _mergeNamespaces(n, m) {
54
- for (var i = 0; i < m.length; i++) {
55
- const e = m[i];
56
- if (typeof e !== "string" && !Array.isArray(e)) {
57
- for (const k in e) {
58
- if (k !== "default" && !(k in n)) {
59
- const d = Object.getOwnPropertyDescriptor(e, k);
60
- if (d) {
61
- Object.defineProperty(n, k, d.get ? d : {
62
- enumerable: true,
63
- get: () => e[k]
64
- });
65
- }
66
- }
67
- }
68
- }
69
- }
70
- return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
71
- }
72
53
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
73
54
  var pseudoDescriptorsBase = {
74
55
  // order of keys here important! in priority order
@@ -167,9 +148,9 @@ function objectIdentityKey(obj) {
167
148
  return k;
168
149
  }
169
150
  var cache$5 = /* @__PURE__ */ new WeakMap();
170
- var createReactContext = React["createContext"];
171
- function createStyledContext(defaultValues) {
172
- var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), LastScopeInNamespace = createReactContext(namespace);
151
+ var createStyledContext = function(defaultValues) {
152
+ "use no memo";
153
+ var namespace = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", createReactContext = React["createContext"], useReactMemo = React["useMemo"], useReactContext = React["useContext"], OGContext = createReactContext(defaultValues), OGProvider = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map(), LastScopeInNamespace = createReactContext(namespace);
173
154
  function getOrCreateScopedContext(scope) {
174
155
  var ScopedContext = scopedContexts.get(scope);
175
156
  return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
@@ -186,7 +167,7 @@ function createStyledContext(defaultValues) {
186
167
  "scope",
187
168
  // performance: avoid creating objects
188
169
  "__disableMergeDefaultValues"
189
- ]), scope = getNamespacedScope(scopeIn), next = React.useMemo(function() {
170
+ ]), scope = getNamespacedScope(scopeIn), next = useReactMemo(function() {
190
171
  return __disableMergeDefaultValues ? values : mergeProps(defaultValues, values);
191
172
  }, [objectIdentityKey(values)]), ScopedProvider = OGProvider;
192
173
  return scope && (ScopedProvider = getOrCreateScopedContext(scope).Provider), /* @__PURE__ */ jsxRuntime.jsx(LastScopeInNamespace.Provider, {
@@ -197,11 +178,11 @@ function createStyledContext(defaultValues) {
197
178
  })
198
179
  });
199
180
  }, useStyledContext = function() {
200
- var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = React.useContext(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = React.useContext(context);
181
+ var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = useReactContext(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = useReactContext(context);
201
182
  return value;
202
183
  };
203
184
  return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
204
- }
185
+ };
205
186
  var ComponentContext = createStyledContext({
206
187
  disableSSR: void 0,
207
188
  inText: false,
@@ -228,20 +209,11 @@ function isEqualShallow(prev, next) {
228
209
  for (var key in next) if (prev[key] !== next[key]) return false;
229
210
  return true;
230
211
  }
231
- var isWeb = false, isBrowser = false, isServer = false, isClient = true, isWindowDefined = false, useIsomorphicLayoutEffect = React.useLayoutEffect, isChrome = false, isWebTouchable = false, isTouchable = true, isAndroid = reactNative.Platform.OS === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = reactNative.Platform.OS === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
212
+ var isWeb = false, isBrowser = false, isServer$1 = false, isClient = true, isWindowDefined = false, useIsomorphicLayoutEffect = React.useLayoutEffect, isChrome = false, isWebTouchable = false, isTouchable = true, isAndroid = (reactNative.Platform === null || reactNative.Platform === void 0 ? void 0 : reactNative.Platform.OS) === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = (reactNative.Platform === null || reactNative.Platform === void 0 ? void 0 : reactNative.Platform.OS) === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
232
213
  ios: "ios",
233
214
  android: "android"
234
- }, currentPlatform = platforms[reactNative.Platform.OS] || "native";
235
- var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", viewDefaultStyles = {}, webViewFlexCompatStyles = {
236
- display: "flex",
237
- alignItems: "stretch",
238
- flexDirection: "column",
239
- flexBasis: "auto",
240
- boxSizing: "border-box",
241
- minHeight: 0,
242
- minWidth: 0,
243
- flexShrink: 0
244
- }, MISSING_THEME_MESSAGE = "Missing theme.";
215
+ }, currentPlatform = (!(reactNative.Platform === null || reactNative.Platform === void 0) && reactNative.Platform.OS ? platforms[reactNative.Platform.OS] : void 0) || "native";
216
+ var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", MISSING_THEME_MESSAGE = "Missing theme.";
245
217
  var conf$1, getConfigFromGlobalOrLocal = function() {
246
218
  return conf$1 || (globalThis.__tamaguiConfig ? globalThis.__tamaguiConfig : null);
247
219
  }, getSetting = function(key) {
@@ -316,6 +288,28 @@ function loadAnimationDriver(name, driver) {
316
288
  [name]: driver
317
289
  };
318
290
  }
291
+ function camelToHyphen(str) {
292
+ return str.replace(/[A-Z]/g, function(m) {
293
+ return `-${m.toLowerCase()}`;
294
+ }).toLowerCase();
295
+ }
296
+ var cache$4 = /* @__PURE__ */ new WeakMap();
297
+ function mediaObjectToString(query) {
298
+ if (typeof query == "string") return query;
299
+ if (cache$4.has(query)) return cache$4.get(query);
300
+ var res = Object.entries(query).map(function(param) {
301
+ var [feature, value] = param;
302
+ return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
303
+ }).join(" and ");
304
+ return cache$4.set(query, res), res;
305
+ }
306
+ exports.mediaState = // development only safeguard
307
+ {};
308
+ var setMediaState = function(next) {
309
+ exports.mediaState = next;
310
+ }, mediaQueryConfig = {}, getMedia = function() {
311
+ return exports.mediaState;
312
+ }, mediaKeys = /* @__PURE__ */ new Set();
319
313
  function kebabToCamel(str) {
320
314
  return str.replace(/-([a-z])/g, function(_2, c) {
321
315
  return c.toUpperCase();
@@ -340,7 +334,7 @@ var groupPseudoToPseudoCSSMap = {
340
334
  press: "active",
341
335
  focusVisible: "focus-visible",
342
336
  focusWithin: "focus-within"
343
- }, specificities = new Array(5).fill(0).map(function(_2, i) {
337
+ }, specificities = new Array(12).fill(0).map(function(_2, i) {
344
338
  return new Array(i).fill(":root").join("");
345
339
  });
346
340
  function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
@@ -349,7 +343,7 @@ function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
349
343
  }
350
344
  var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
351
345
  var [property, , identifier, pseudoIn, rules] = styleObject, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
352
- return rule.replace(identifier, nextIdentifier);
346
+ return rule.replaceAll(identifier, nextIdentifier);
353
347
  }).join(";"), isHover = false;
354
348
  if (isNonWindowMedia) {
355
349
  var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
@@ -362,7 +356,10 @@ var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, neg
362
356
  groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = true);
363
357
  var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
364
358
  styleRule = styleInner.replace(selector, nextSelector);
365
- } else styleRule = `${specificities[specificity]}${styleInner}`;
359
+ } else {
360
+ var prefix = specificities[specificity];
361
+ styleRule = prefix && styleInner[0] === "@" ? styleInner.replace("{", `{${prefix}`) : `${prefix}${styleInner}`;
362
+ }
366
363
  }
367
364
  if (!isNonWindowMedia || groupMediaKey) {
368
365
  if (!selectors) {
@@ -373,8 +370,8 @@ var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, neg
373
370
  return [k, new Array(index2 + 1).fill(":root").join("")];
374
371
  }));
375
372
  }
376
- var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : prefixes[mediaKey], prefix = groupMediaKey ? `@container ${containerName}` : "@media";
377
- groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${getSetting("webContainerType") || "inline-size"}) {${styleRule}}`);
373
+ var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : prefixes[mediaKey], prefix1 = groupMediaKey ? `@container ${containerName}` : "@media";
374
+ groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix1) ? styleRule = styleInner.replace("{", ` and ${mediaQuery} {`).replace("and screen and", "and") : styleRule = `${prefix1} ${mediaQuery}{${precedenceImportancePrefix}${styleInner}}`, groupMediaKey && (styleRule = `@supports (contain: ${getSetting("webContainerType") || "inline-size"}) {${styleRule}}`);
378
375
  }
379
376
  return isHover && (styleRule = `@media (hover:hover){${styleRule}}`), [property, void 0, nextIdentifier, void 0, [styleRule]];
380
377
  };
@@ -397,11 +394,7 @@ function matchMediaFallback(query) {
397
394
  function setupMatchMedia(_2) {
398
395
  matchMediaImpl = _2, globalThis.matchMedia = _2;
399
396
  }
400
- exports.mediaState = // development only safeguard
401
- {};
402
- var mediaQueryConfig = {}, getMedia = function() {
403
- return exports.mediaState;
404
- }, mediaKeys = /* @__PURE__ */ new Set(), mediaKeyRegex = /\$(platform|theme|group)-/, getMediaKey = function(key) {
397
+ var mediaKeyRegex = /\$(platform|theme|group)-/, getMediaKey = function(key) {
405
398
  if (key[0] !== "$") return false;
406
399
  if (mediaKeys.has(key)) return true;
407
400
  var match = key.match(mediaKeyRegex);
@@ -414,8 +407,8 @@ var mediaQueryConfig = {}, getMedia = function() {
414
407
  } = config, mediaQueryDefaultActive = getSetting("mediaQueryDefaultActive");
415
408
  if (media) {
416
409
  mediaVersion++, resetMediaStyleCache();
417
- for (var key in media) exports.mediaState[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || false, mediaKeys.add(`$${key}`);
418
- Object.assign(mediaQueryConfig, media), initState = __spreadValues({}, exports.mediaState), mediaKeysOrdered = Object.keys(media), setupMediaListeners();
410
+ for (var key in media) getMedia()[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || false, mediaKeys.add(`$${key}`);
411
+ Object.assign(mediaQueryConfig, media), initState = __spreadValues({}, getMedia()), mediaKeysOrdered = Object.keys(media), setupMediaListeners();
419
412
  }
420
413
  };
421
414
  function unlisten() {
@@ -435,9 +428,9 @@ function setupMediaListeners() {
435
428
  });
436
429
  function update() {
437
430
  var next = !!getMatch().matches;
438
- next !== exports.mediaState[key2] && (exports.mediaState = __spreadProps(__spreadValues({}, exports.mediaState), {
431
+ next !== getMedia()[key2] && (setMediaState(__spreadProps(__spreadValues({}, getMedia()), {
439
432
  [key2]: next
440
- }), updateMediaListeners());
433
+ })), updateMediaListeners());
441
434
  }
442
435
  update();
443
436
  };
@@ -449,7 +442,7 @@ function setupMediaListeners() {
449
442
  var listeners = /* @__PURE__ */ new Set();
450
443
  function updateMediaListeners() {
451
444
  listeners.forEach(function(cb) {
452
- return cb(exports.mediaState);
445
+ return cb(getMedia());
453
446
  });
454
447
  }
455
448
  var States = /* @__PURE__ */ new WeakMap();
@@ -466,26 +459,27 @@ function subscribe(subscriber) {
466
459
  };
467
460
  }
468
461
  function useMedia(componentContext, debug) {
462
+ "use no memo";
469
463
  var componentState = componentContext ? States.get(componentContext) : null, internalRef = React.useRef(null);
470
464
  internalRef.current || (internalRef.current = {
471
465
  keys: /* @__PURE__ */ new Set(),
472
- lastState: exports.mediaState
466
+ lastState: getMedia()
473
467
  }), internalRef.current.pendingState && (internalRef.current.lastState = internalRef.current.pendingState, internalRef.current.pendingState = void 0);
474
468
  var {
475
469
  keys
476
470
  } = internalRef.current;
477
471
  keys.size && keys.clear();
478
- var state = React.useSyncExternalStore(subscribe, function() {
472
+ var state2 = React.useSyncExternalStore(subscribe, function() {
479
473
  var curKeys2 = (componentState == null ? void 0 : componentState.keys) || keys, {
480
474
  lastState,
481
475
  pendingState
482
476
  } = internalRef.current;
483
477
  if (!curKeys2.size) return lastState;
484
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
478
+ var ms = getMedia(), _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
485
479
  try {
486
480
  for (var _iterator = curKeys2[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
487
481
  var key = _step.value;
488
- if (exports.mediaState[key] !== (pendingState || lastState)[key]) return false, (componentContext == null ? void 0 : componentContext.mediaEmit) ? (componentContext.mediaEmit(exports.mediaState), internalRef.current.pendingState = exports.mediaState, lastState) : (internalRef.current.lastState = exports.mediaState, exports.mediaState);
482
+ if (ms[key] !== (pendingState || lastState)[key]) return false, (componentContext == null ? void 0 : componentContext.mediaEmit) ? (componentContext.mediaEmit(ms), internalRef.current.pendingState = ms, lastState) : (internalRef.current.lastState = ms, ms);
489
483
  }
490
484
  } catch (err) {
491
485
  _didIteratorError = true, _iteratorError = err;
@@ -498,9 +492,9 @@ function useMedia(componentContext, debug) {
498
492
  }
499
493
  return lastState;
500
494
  }, getServerSnapshot);
501
- return new Proxy(state, {
495
+ return new Proxy(state2, {
502
496
  get(_2, key) {
503
- return !disableMediaTouch && typeof key == "string" && keys.add(key), Reflect.get(state, key);
497
+ return !disableMediaTouch && typeof key == "string" && keys.add(key), Reflect.get(state2, key);
504
498
  }
505
499
  });
506
500
  }
@@ -526,21 +520,6 @@ var getMediaImportanceIfMoreImportant = function(mediaKey, key, styleState, isSi
526
520
  var importance = isSizeMedia ? getMediaKeyImportance(mediaKey) : defaultMediaImportance, usedKeys = styleState.usedKeys;
527
521
  return !usedKeys[key] || importance > usedKeys[key] ? importance : null;
528
522
  };
529
- function camelToHyphen(str) {
530
- return str.replace(/[A-Z]/g, function(m) {
531
- return `-${m.toLowerCase()}`;
532
- }).toLowerCase();
533
- }
534
- var cache$4 = /* @__PURE__ */ new WeakMap();
535
- function mediaObjectToString(query, key) {
536
- if (typeof query == "string") return query;
537
- if (cache$4.has(query)) return cache$4.get(query);
538
- var res = Object.entries(query).map(function(param) {
539
- var [feature, value] = param;
540
- return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
541
- }).join(" and ");
542
- return cache$4.set(query, res), res;
543
- }
544
523
  function mediaKeyMatch(key, dimensions) {
545
524
  var mediaQueries = mediaQueryConfig[key], result = Object.keys(mediaQueries).every(function(query) {
546
525
  var expectedVal = +mediaQueries[query], isMax = query.startsWith("max"), isWidth = query.endsWith("Width"), givenVal = dimensions[isWidth ? "width" : "height"];
@@ -630,75 +609,29 @@ function resolvePlatformNames(nativeProp) {
630
609
  ) : Array.isArray(nativeProp) ? nativeProp : [nativeProp], set = new Set(platforms2);
631
610
  return set.has("mobile") && (set.add("android"), set.add("ios"), set.delete("mobile")), set;
632
611
  }
633
- var webOnlyStylePropsView = {
634
- transition: true,
635
- textWrap: true,
636
- backdropFilter: true,
637
- WebkitBackdropFilter: true,
638
- background: true,
639
- borderTop: true,
640
- borderRight: true,
641
- borderBottom: true,
642
- borderLeft: true,
643
- backgroundAttachment: true,
644
- backgroundBlendMode: true,
645
- backgroundClip: true,
646
- backgroundOrigin: true,
647
- backgroundPosition: true,
648
- backgroundRepeat: true,
649
- backgroundSize: true,
612
+ var cssShorthandLonghands = {
613
+ // border longhands
614
+ borderWidth: true,
615
+ borderStyle: true,
616
+ borderColor: true,
617
+ borderTopWidth: true,
618
+ borderTopStyle: true,
619
+ borderTopColor: true,
620
+ borderRightWidth: true,
621
+ borderRightStyle: true,
622
+ borderRightColor: true,
623
+ borderBottomWidth: true,
650
624
  borderBottomStyle: true,
651
- borderImage: true,
625
+ borderBottomColor: true,
626
+ borderLeftWidth: true,
652
627
  borderLeftStyle: true,
653
- borderRightStyle: true,
654
- borderTopStyle: true,
655
- caretColor: true,
656
- clipPath: true,
657
- contain: true,
658
- containerType: true,
659
- content: true,
660
- float: true,
661
- mask: true,
662
- maskBorder: true,
663
- maskBorderMode: true,
664
- maskBorderOutset: true,
665
- maskBorderRepeat: true,
666
- maskBorderSlice: true,
667
- maskBorderSource: true,
668
- maskBorderWidth: true,
669
- maskClip: true,
670
- maskComposite: true,
671
- maskImage: true,
672
- maskMode: true,
673
- maskOrigin: true,
674
- maskPosition: true,
675
- maskRepeat: true,
676
- maskSize: true,
677
- maskType: true,
678
- objectFit: true,
679
- objectPosition: true,
680
- overflowBlock: true,
681
- overflowInline: true,
682
- overflowX: true,
683
- overflowY: true,
684
- // NOTE: pointerEvents is NOT web-only - it's a core React Native View prop (not a style)
685
- pointerEvents: true,
686
- scrollbarWidth: true,
687
- textEmphasis: true,
688
- touchAction: true,
689
- transformStyle: true,
690
- userSelect: true,
691
- willChange: true
692
- }, webOnlyStylePropsText = {
693
- whiteSpace: true,
694
- wordWrap: true,
695
- textOverflow: true,
696
- textDecorationDistance: true,
697
- // cursor: now cross-platform - in stylePropsView
698
- WebkitLineClamp: true,
699
- WebkitBoxOrient: true
700
- };
701
- var textColors = {
628
+ borderLeftColor: true,
629
+ // outline longhands
630
+ outlineWidth: true,
631
+ outlineStyle: true,
632
+ outlineColor: true,
633
+ outlineOffset: true
634
+ }, textColors = {
702
635
  color: true,
703
636
  textDecorationColor: true,
704
637
  textShadowColor: true
@@ -752,8 +685,47 @@ var textColors = {
752
685
  // outlineColor is supported on RN 0.77+ (New Architecture)
753
686
  outlineColor: true
754
687
  })
755
- }, stylePropsUnitless = {
688
+ }, nonAnimatableViewProps = {
689
+ alignContent: true,
690
+ alignItems: true,
691
+ alignSelf: true,
692
+ backfaceVisibility: true,
693
+ borderCurve: true,
694
+ borderStyle: true,
695
+ borderBlockStyle: true,
696
+ borderBlockEndStyle: true,
697
+ borderBlockStartStyle: true,
698
+ borderInlineStyle: true,
699
+ borderInlineEndStyle: true,
700
+ borderInlineStartStyle: true,
701
+ boxSizing: true,
702
+ cursor: true,
703
+ direction: true,
704
+ display: true,
705
+ flexDirection: true,
706
+ flexWrap: true,
707
+ isolation: true,
708
+ justifyContent: true,
709
+ mixBlendMode: true,
710
+ outlineStyle: true,
711
+ overflow: true,
712
+ position: true
713
+ }, nonAnimatableFontProps = {
714
+ fontFamily: true,
715
+ fontStyle: true,
716
+ fontVariant: true,
717
+ textTransform: true
718
+ }, nonAnimatableTextOnlyProps = {
719
+ textAlign: true,
720
+ textDecorationLine: true,
721
+ textDecorationStyle: true,
722
+ userSelect: true
723
+ }, nonAnimatableUnitlessProps = {
756
724
  WebkitLineClamp: true,
725
+ lineClamp: true,
726
+ gridTemplateColumns: true,
727
+ gridTemplateAreas: true
728
+ }, nonAnimatableStyleProps = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, nonAnimatableViewProps), nonAnimatableFontProps), nonAnimatableTextOnlyProps), nonAnimatableUnitlessProps), stylePropsUnitless = __spreadProps(__spreadValues({}, nonAnimatableUnitlessProps), {
757
729
  animationIterationCount: true,
758
730
  aspectRatio: true,
759
731
  borderImageOutset: true,
@@ -775,9 +747,6 @@ var textColors = {
775
747
  gridColumnEnd: true,
776
748
  gridColumnGap: true,
777
749
  gridColumnStart: true,
778
- gridTemplateColumns: true,
779
- gridTemplateAreas: true,
780
- lineClamp: true,
781
750
  opacity: true,
782
751
  order: true,
783
752
  orphans: true,
@@ -790,7 +759,7 @@ var textColors = {
790
759
  scaleY: true,
791
760
  scaleZ: true,
792
761
  shadowOpacity: true
793
- }, stylePropsTransform = {
762
+ }), stylePropsTransform = {
794
763
  x: true,
795
764
  y: true,
796
765
  scale: true,
@@ -804,10 +773,7 @@ var textColors = {
804
773
  rotateY: true,
805
774
  rotateX: true,
806
775
  rotateZ: true
807
- }, stylePropsView = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
808
- backfaceVisibility: true,
809
- borderCurve: true,
810
- cursor: true,
776
+ }, stylePropsView = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, nonAnimatableViewProps), {
811
777
  borderBottomEndRadius: true,
812
778
  borderBottomStartRadius: true,
813
779
  borderBottomWidth: true,
@@ -819,34 +785,20 @@ var textColors = {
819
785
  borderInlineWidth: true,
820
786
  borderInlineEndWidth: true,
821
787
  borderInlineStartWidth: true,
822
- borderStyle: true,
823
- borderBlockStyle: true,
824
- borderBlockEndStyle: true,
825
- borderBlockStartStyle: true,
826
- borderInlineStyle: true,
827
- borderInlineEndStyle: true,
828
- borderInlineStartStyle: true,
829
788
  borderTopEndRadius: true,
830
789
  borderTopStartRadius: true,
831
790
  borderTopWidth: true,
832
791
  borderWidth: true,
833
792
  transform: true,
834
793
  transformOrigin: true,
835
- alignContent: true,
836
- alignItems: true,
837
- alignSelf: true,
838
794
  borderEndWidth: true,
839
795
  borderStartWidth: true,
840
796
  bottom: true,
841
- display: true,
842
797
  end: true,
843
798
  flexBasis: true,
844
- flexDirection: true,
845
- flexWrap: true,
846
799
  gap: true,
847
800
  columnGap: true,
848
801
  rowGap: true,
849
- justifyContent: true,
850
802
  left: true,
851
803
  margin: true,
852
804
  marginBlock: true,
@@ -863,7 +815,6 @@ var textColors = {
863
815
  marginStart: true,
864
816
  marginTop: true,
865
817
  marginVertical: true,
866
- overflow: true,
867
818
  padding: true,
868
819
  paddingBottom: true,
869
820
  paddingInline: true,
@@ -878,7 +829,6 @@ var textColors = {
878
829
  paddingStart: true,
879
830
  paddingTop: true,
880
831
  paddingVertical: true,
881
- position: true,
882
832
  right: true,
883
833
  start: true,
884
834
  top: true,
@@ -889,10 +839,9 @@ var textColors = {
889
839
  insetInline: true,
890
840
  insetInlineEnd: true,
891
841
  insetInlineStart: true,
892
- direction: true,
893
842
  shadowOffset: true,
894
843
  shadowRadius: true
895
- }, tokenCategories.color), tokenCategories.radius), tokenCategories.size), tokenCategories.radius), stylePropsTransform), stylePropsUnitless), isAndroid ? {
844
+ }), tokenCategories.color), tokenCategories.radius), tokenCategories.size), stylePropsTransform), stylePropsUnitless), isAndroid ? {
896
845
  elevationAndroid: true
897
846
  } : {}), {
898
847
  boxShadow: true,
@@ -903,31 +852,19 @@ var textColors = {
903
852
  // the actual RN 0.76+ prop name (backgroundImage expands to this on native)
904
853
  experimental_backgroundImage: true,
905
854
  // RN 0.76/0.77+ style props (New Architecture)
906
- boxSizing: true,
907
- mixBlendMode: true,
908
- isolation: true,
855
+ outline: true,
909
856
  outlineColor: true,
910
857
  outlineOffset: true,
911
- outlineStyle: true,
912
858
  outlineWidth: true
913
- }), stylePropsFont = {
914
- fontFamily: true,
859
+ }), stylePropsFont = __spreadProps(__spreadValues({}, nonAnimatableFontProps), {
915
860
  fontSize: true,
916
- fontStyle: true,
917
861
  fontWeight: true,
918
- fontVariant: true,
919
862
  letterSpacing: true,
920
- lineHeight: true,
921
- textTransform: true
922
- }, stylePropsTextOnly = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, stylePropsFont), {
923
- textAlign: true,
924
- textDecorationLine: true,
925
- textDecorationStyle: true
926
- }), textColors), {
863
+ lineHeight: true
864
+ }), stylePropsTextOnly = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, stylePropsFont), nonAnimatableTextOnlyProps), textColors), {
927
865
  textShadow: true,
928
866
  textShadowOffset: true,
929
867
  textShadowRadius: true,
930
- userSelect: true,
931
868
  verticalAlign: true
932
869
  }), stylePropsText = __spreadValues(__spreadValues({}, stylePropsView), stylePropsTextOnly), stylePropsAll = stylePropsText, validPseudoKeys = {
933
870
  enterStyle: true,
@@ -941,6 +878,76 @@ var textColors = {
941
878
  var Decorated = /* @__PURE__ */ Symbol(), withStaticProperties = function(component, staticProps) {
942
879
  return Object.assign(component, staticProps), component[Decorated] = true, component;
943
880
  };
881
+ var nonAnimatableWebViewProps = {
882
+ backgroundAttachment: true,
883
+ backgroundBlendMode: true,
884
+ backgroundClip: true,
885
+ backgroundOrigin: true,
886
+ backgroundRepeat: true,
887
+ borderBottomStyle: true,
888
+ borderLeftStyle: true,
889
+ borderRightStyle: true,
890
+ borderTopStyle: true,
891
+ contain: true,
892
+ containerType: true,
893
+ content: true,
894
+ float: true,
895
+ maskBorderMode: true,
896
+ maskBorderRepeat: true,
897
+ maskClip: true,
898
+ maskComposite: true,
899
+ maskMode: true,
900
+ maskOrigin: true,
901
+ maskRepeat: true,
902
+ maskType: true,
903
+ objectFit: true,
904
+ overflowBlock: true,
905
+ overflowInline: true,
906
+ overflowX: true,
907
+ overflowY: true,
908
+ // NOTE: pointerEvents is NOT web-only - it's a core React Native View prop (not a style)
909
+ pointerEvents: true,
910
+ scrollbarWidth: true,
911
+ textWrap: true,
912
+ touchAction: true,
913
+ transformStyle: true,
914
+ willChange: true
915
+ }, nonAnimatableWebTextProps = {
916
+ whiteSpace: true,
917
+ wordWrap: true,
918
+ textOverflow: true,
919
+ WebkitBoxOrient: true
920
+ }, webOnlyStylePropsView = __spreadProps(__spreadValues({}, nonAnimatableWebViewProps), {
921
+ transition: true,
922
+ backdropFilter: true,
923
+ WebkitBackdropFilter: true,
924
+ background: true,
925
+ borderTop: true,
926
+ borderRight: true,
927
+ borderBottom: true,
928
+ borderLeft: true,
929
+ backgroundPosition: true,
930
+ backgroundSize: true,
931
+ borderImage: true,
932
+ caretColor: true,
933
+ clipPath: true,
934
+ mask: true,
935
+ maskBorder: true,
936
+ maskBorderOutset: true,
937
+ maskBorderSlice: true,
938
+ maskBorderSource: true,
939
+ maskBorderWidth: true,
940
+ maskImage: true,
941
+ maskPosition: true,
942
+ maskSize: true,
943
+ objectPosition: true,
944
+ textEmphasis: true,
945
+ userSelect: true
946
+ }), webOnlyStylePropsText = __spreadProps(__spreadValues({}, nonAnimatableWebTextProps), {
947
+ textDecorationDistance: true,
948
+ // cursor: now cross-platform - in stylePropsView
949
+ WebkitLineClamp: true
950
+ });
944
951
  function _type_of$6(obj) {
945
952
  "@swc/helpers - typeof";
946
953
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
@@ -1047,16 +1054,17 @@ function extractValueFromDynamic(val, scheme) {
1047
1054
  return (val == null ? void 0 : val.dynamic) ? val.dynamic[scheme] : val;
1048
1055
  }
1049
1056
  var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), HadTheme = /* @__PURE__ */ new WeakMap(), PendingUpdate = /* @__PURE__ */ new Map(), states = /* @__PURE__ */ new Map(), localStates = /* @__PURE__ */ new Map(), shouldForce = false, forceUpdateThemes = function() {
1050
- shouldForce = true, allListeners.forEach(function(cb) {
1057
+ cacheVersion++, shouldForce = true, allListeners.forEach(function(cb) {
1051
1058
  return cb();
1052
1059
  });
1053
1060
  }, getThemeState = function(id) {
1054
1061
  return states.get(id);
1055
- }, themes = null, rootThemeState = null, getRootThemeState = function() {
1062
+ }, cacheVersion = 0, themeNameCache = /* @__PURE__ */ new Map(), themeNameCacheVer = -1, themes = null, rootThemeState = null, getRootThemeState = function() {
1056
1063
  return rootThemeState;
1057
1064
  }, getThemeBaseName = function(name) {
1058
1065
  return name.replace(/^(light|dark)_/, "");
1059
1066
  }, useThemeState = function(props) {
1067
+ "use no memo";
1060
1068
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, {
1061
1069
  disable
1062
1070
  } = props, parentId = React.useContext(ThemeStateContext);
@@ -1067,17 +1075,18 @@ var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */
1067
1075
  theme: getConfig().themes.light
1068
1076
  };
1069
1077
  var id = React.useId(), subscribe2 = React.useCallback(function(cb) {
1070
- var _listenersByParent, _parentId;
1071
- return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, function() {
1078
+ return listenersByParent[parentId] = listenersByParent[parentId] || /* @__PURE__ */ new Set(), listenersByParent[parentId].add(id), allListeners.set(id, function() {
1072
1079
  PendingUpdate.set(id, shouldForce ? "force" : true), cb();
1073
1080
  }), function() {
1074
1081
  allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id), PendingUpdate.delete(id);
1075
1082
  };
1076
1083
  }, [id, parentId]), propsKey = getPropsKey(props), getSnapshot = function() {
1077
- var _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate, local = localStates.get(id), parentState = states.get(parentId), isSchemeOnlyChange = isIos && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name), _keys_current_size, keysSize = (_keys_current_size = keys == null || (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) !== null && _keys_current_size !== void 0 ? _keys_current_size : 0, _schemeKeys_current_size, schemeKeysSize = (_schemeKeys_current_size = schemeKeys == null || (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) !== null && _schemeKeys_current_size !== void 0 ? _schemeKeys_current_size : 0, allKeysSchemeOptimized = schemeKeysSize === keysSize && keysSize > 0, canSkipForSchemeChange = isSchemeOnlyChange && allKeysSchemeOptimized, needsUpdate = props.passThrough ? false : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : HasRenderedOnce.get(keys) ? canSkipForSchemeChange ? false : !(keys == null || (_keys_current1 = keys.current) === null || _keys_current1 === void 0) && _keys_current1.size ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : true, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
1078
- return PendingUpdate.delete(id), (!local || rerender) && (local = __spreadValues({}, next), localStates.set(id, local)), Object.assign(local, next), local.id = id, states.set(id, next), local;
1084
+ var _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate, local = localStates.get(id), parentState = states.get(parentId);
1085
+ if (local && !PendingUpdate.has(id) && parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;
1086
+ var isSchemeOnlyChange = isIos && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name), _keys_current_size, keysSize = (_keys_current_size = keys == null || (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) !== null && _keys_current_size !== void 0 ? _keys_current_size : 0, _schemeKeys_current_size, schemeKeysSize = (_schemeKeys_current_size = schemeKeys == null || (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) !== null && _schemeKeys_current_size !== void 0 ? _schemeKeys_current_size : 0, allKeysSchemeOptimized = schemeKeysSize === keysSize && keysSize > 0, canSkipForSchemeChange = isSchemeOnlyChange && allKeysSchemeOptimized, needsUpdate = props.passThrough ? false : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : HasRenderedOnce.get(keys) ? canSkipForSchemeChange ? false : !(keys == null || (_keys_current1 = keys.current) === null || _keys_current1 === void 0) && _keys_current1.size ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : true, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
1087
+ return PendingUpdate.delete(id), (!local || rerender) && (local = __spreadValues({}, next), localStates.set(id, local)), next !== local && (Object.assign(local, next), local.id = id), local._parentName = parentState == null ? void 0 : parentState.name, local._propsKey = propsKey, states.set(id, next), local;
1079
1088
  };
1080
- var state = React.useSyncExternalStore(subscribe2, getSnapshot, getSnapshot);
1089
+ var state2 = React.useSyncExternalStore(subscribe2, getSnapshot, getSnapshot);
1081
1090
  return useIsomorphicLayoutEffect(function() {
1082
1091
  if (!HasRenderedOnce.get(keys)) {
1083
1092
  HasRenderedOnce.set(keys, true);
@@ -1088,7 +1097,7 @@ var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */
1088
1097
  return;
1089
1098
  }
1090
1099
  scheduleUpdate(id), HadTheme.set(keys, true);
1091
- }, [keys, propsKey]), state;
1100
+ }, [keys, propsKey]), state2;
1092
1101
  }, getNextState = function(lastState, props, propsKey) {
1093
1102
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0, {
1094
1103
  debug
@@ -1098,7 +1107,7 @@ var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */
1098
1107
  }];
1099
1108
  themes || (themes = getConfig().themes);
1100
1109
  var name = !propsKey && (!lastState || !(lastState == null ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(pendingUpdate === "force" || needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
1101
- if (isSameAsParent) return [shouldRerender, __spreadProps(__spreadValues({}, parentState), {
1110
+ if (isSameAsParent) return !shouldRerender && lastState && lastState.name === parentState.name ? [false, lastState] : [shouldRerender, __spreadProps(__spreadValues({}, parentState), {
1102
1111
  isNew: false
1103
1112
  })];
1104
1113
  if (!name) {
@@ -1164,14 +1173,23 @@ function getNewThemeName() {
1164
1173
  reset
1165
1174
  } = props, componentName = props.unstyled ? void 0 : props.componentName;
1166
1175
  if (name && reset) throw new Error("Cannot reset and set a new name at the same time.");
1176
+ var cacheKey = `${parentName}|${name || ""}|${componentName || ""}|${reset ? 1 : 0}|${forceUpdate ? 1 : 0}`;
1177
+ if (themeNameCacheVer !== cacheVersion) themeNameCache.clear(), themeNameCacheVer = cacheVersion;
1178
+ else {
1179
+ var cached = themeNameCache.get(cacheKey);
1180
+ if (cached !== void 0) return cached;
1181
+ }
1167
1182
  var {
1168
1183
  themes: themes2
1169
1184
  } = getConfig();
1170
1185
  if (reset) {
1171
1186
  var isSchemeOnly = parentName === "light" || parentName === "dark";
1172
- if (isSchemeOnly) return parentName === "light" ? "dark" : "light";
1173
- var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result = themes2[name1] ? name1 : scheme;
1174
- return result;
1187
+ if (isSchemeOnly) {
1188
+ var result = parentName === "light" ? "dark" : "light";
1189
+ return themeNameCache.set(cacheKey, result), result;
1190
+ }
1191
+ var lastPartIndex = parentName.lastIndexOf("_"), name1 = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex), scheme = parentName.slice(0, lastPartIndex), result1 = themes2[name1] ? name1 : scheme;
1192
+ return themeNameCache.set(cacheKey, result1), result1;
1175
1193
  }
1176
1194
  var parentParts = parentName.split("_"), lastName = parentParts[parentParts.length - 1];
1177
1195
  lastName && lastName[0].toLowerCase() !== lastName[0] && parentParts.pop();
@@ -1262,7 +1280,7 @@ function getNewThemeName() {
1262
1280
  }
1263
1281
  return !forceUpdate && found === parentName && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
1264
1282
  // and we want to avoid reparenting
1265
- !validSchemes[found] ? null : found;
1283
+ !validSchemes[found] ? (themeNameCache.set(cacheKey, null), null) : (themeNameCache.set(cacheKey, found), found);
1266
1284
  }
1267
1285
  var getPropsKey = function(param) {
1268
1286
  var {
@@ -1320,29 +1338,39 @@ function getThemeProxied(_props, _state, _keys, _schemeKeys) {
1320
1338
  return cache$2.set(_state.theme, proxied1), proxied1;
1321
1339
  }
1322
1340
  var EMPTY = {}, useTheme = function() {
1341
+ "use no memo";
1323
1342
  var [theme] = useThemeWithState(EMPTY), res = theme;
1324
1343
  return res;
1325
1344
  }, useThemeWithState = function(props) {
1345
+ "use no memo";
1326
1346
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = React.useRef(null), schemeKeys = React.useRef(null), themeState = useThemeState(props, isRoot, keys, schemeKeys);
1327
1347
  var themeProxied = props.passThrough ? {} : getThemeProxied(props, themeState, keys, schemeKeys);
1328
1348
  return [themeProxied, themeState];
1329
1349
  };
1330
- var _withStableStyle = function(Component, styleProvider) {
1331
- return /* @__PURE__ */ React.forwardRef(function(props, ref) {
1350
+ var _withStableStyle = function(Component, createStyle) {
1351
+ return /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(function(props, ref) {
1332
1352
  var _a = props, {
1333
1353
  _expressions = []
1334
1354
  } = _a, rest = __objRest(_a, [
1335
1355
  "_expressions"
1336
- ]), theme = useTheme(), hasMediaKeys = _expressions.some(function(expr) {
1356
+ ]), parentId = React.useContext(ThemeStateContext);
1357
+ if (!parentId) {
1358
+ var config = getConfigMaybe(), themes2 = config == null ? void 0 : config.themes, fallback = themes2 ? themes2.light || themes2.dark || Object.values(themes2)[0] : {};
1359
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadValues({
1360
+ ref,
1361
+ style: createStyle(fallback, _expressions)
1362
+ }, rest));
1363
+ }
1364
+ var theme = useTheme(), hasMediaKeys = _expressions.some(function(expr) {
1337
1365
  return typeof expr == "string";
1338
1366
  }), media = hasMediaKeys ? useMedia() : null, resolvedExpressions = media ? _expressions.map(function(expr) {
1339
1367
  return typeof expr == "string" ? media[expr] : expr;
1340
1368
  }) : _expressions;
1341
1369
  return /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadValues({
1342
1370
  ref,
1343
- style: styleProvider(theme, resolvedExpressions)
1371
+ style: createStyle(theme, resolvedExpressions)
1344
1372
  }, rest));
1345
- });
1373
+ }));
1346
1374
  };
1347
1375
  function setRef(ref, value) {
1348
1376
  typeof ref == "function" ? ref(value) : ref && (ref.current = value);
@@ -1359,50 +1387,44 @@ function useComposedRefs() {
1359
1387
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
1360
1388
  return React__namespace.useCallback(composeRefs(...refs), refs);
1361
1389
  }
1362
- var defaultComponentState = {
1363
- hover: false,
1364
- press: false,
1365
- pressIn: false,
1366
- focus: false,
1367
- focusVisible: false,
1368
- focusWithin: false,
1369
- unmounted: true,
1370
- disabled: false
1371
- }, defaultComponentStateMounted = __spreadProps(__spreadValues({}, defaultComponentState), {
1372
- unmounted: false
1373
- }), defaultComponentStateShouldEnter = __spreadProps(__spreadValues({}, defaultComponentState), {
1374
- unmounted: "should-enter"
1375
- });
1376
- var GLOBAL_KEY = "__tamagui_native_gesture_state__";
1377
- function getGlobalState() {
1378
- var g = globalThis;
1379
- return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = {
1380
- enabled: false,
1381
- Gesture: null,
1382
- GestureDetector: null,
1383
- ScrollView: null
1384
- }), g[GLOBAL_KEY];
1390
+ function createGlobalState(key, defaultValue2) {
1391
+ var GLOBAL_KEY = `__tamagui_${key}__`;
1392
+ function getGlobalState() {
1393
+ var g = globalThis;
1394
+ return g[GLOBAL_KEY] || (g[GLOBAL_KEY] = defaultValue2), g[GLOBAL_KEY];
1395
+ }
1396
+ function setGlobalState(newState) {
1397
+ globalThis[GLOBAL_KEY] = newState;
1398
+ }
1399
+ return {
1400
+ get: getGlobalState,
1401
+ set: setGlobalState
1402
+ };
1385
1403
  }
1404
+ var state = createGlobalState("gesture", {
1405
+ enabled: false,
1406
+ Gesture: null,
1407
+ GestureDetector: null,
1408
+ ScrollView: null
1409
+ });
1386
1410
  function getGestureHandler() {
1387
1411
  return {
1388
1412
  get isEnabled() {
1389
- return getGlobalState().enabled;
1413
+ return state.get().enabled;
1390
1414
  },
1391
1415
  get state() {
1392
- return getGlobalState();
1416
+ return state.get();
1393
1417
  },
1394
1418
  set(updates) {
1395
- var state = getGlobalState();
1396
- Object.assign(state, updates);
1419
+ Object.assign(state.get(), updates);
1397
1420
  },
1398
1421
  disable() {
1399
- var state = getGlobalState();
1400
- state.enabled = false;
1422
+ state.get().enabled = false;
1401
1423
  },
1402
1424
  createPressGesture(config) {
1403
1425
  var {
1404
1426
  Gesture
1405
- } = getGlobalState();
1427
+ } = state.get();
1406
1428
  if (!Gesture) return null;
1407
1429
  var _config_delayLongPress, longPressDuration = (_config_delayLongPress = config.delayLongPress) !== null && _config_delayLongPress !== void 0 ? _config_delayLongPress : 500, tap = Gesture.Tap().runOnJS(true).maxDuration(1e4).onBegin(function(e) {
1408
1430
  var _config_onPressIn;
@@ -1429,13 +1451,28 @@ function getGestureHandler() {
1429
1451
  }
1430
1452
  };
1431
1453
  }
1454
+ var NativeMenuContext = React.createContext(false);
1455
+ var defaultComponentState = {
1456
+ hover: false,
1457
+ press: false,
1458
+ pressIn: false,
1459
+ focus: false,
1460
+ focusVisible: false,
1461
+ focusWithin: false,
1462
+ unmounted: true,
1463
+ disabled: false
1464
+ }, defaultComponentStateMounted = __spreadProps(__spreadValues({}, defaultComponentState), {
1465
+ unmounted: false
1466
+ }), defaultComponentStateShouldEnter = __spreadProps(__spreadValues({}, defaultComponentState), {
1467
+ unmounted: "should-enter"
1468
+ });
1432
1469
  var dontComposePressabilityKeys = {
1433
1470
  onBlur: true,
1434
1471
  onFocus: true
1435
1472
  }, emptyConfig = {}, usePressability = null;
1436
1473
  function useMainThreadPressEvents(events, viewProps) {
1437
1474
  var enabled = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
1438
- usePressability || (usePressability = require("react-native/Libraries/Pressability/usePressability").default);
1475
+ usePressability = usePressability || require("react-native/Libraries/Pressability/usePressability").default;
1439
1476
  var pressability = usePressability(enabled ? events : emptyConfig);
1440
1477
  if (enabled && pressability) {
1441
1478
  viewProps.hitSlop && events && (events.hitSlop = viewProps.hitSlop);
@@ -1445,64 +1482,89 @@ function useMainThreadPressEvents(events, viewProps) {
1445
1482
  }
1446
1483
  }
1447
1484
  }
1448
- function useEvents(events, viewProps, stateRef, staticConfig, isHOC) {
1449
- if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput && events) {
1450
- var {
1451
- onPressIn,
1452
- onPressOut,
1453
- onPress
1454
- } = events, inputEvents = {
1455
- onPressIn,
1456
- onPressOut: onPressOut || onPress
1457
- };
1458
- return onPressOut && onPress && (inputEvents.onPressOut = composeEventHandlers(onPress, onPressOut)), Object.assign(viewProps, inputEvents), null;
1459
- }
1460
- if (isHOC && events) {
1461
- var {
1462
- onPressIn: onPressIn1,
1463
- onPressOut: onPressOut1,
1464
- onPress: onPress1,
1465
- onLongPress,
1466
- delayLongPress
1467
- } = events;
1468
- return Object.assign(viewProps, {
1469
- onPressIn: onPressIn1,
1470
- onPressOut: onPressOut1,
1471
- onPress: onPress1,
1472
- onLongPress,
1473
- delayLongPress
1474
- }), null;
1475
- }
1485
+ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu) {
1486
+ events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur));
1476
1487
  var hasPressEvents = events == null ? void 0 : events.onPress, gh = getGestureHandler();
1477
1488
  hasPressEvents && (stateRef.current.hasHadEvents = true);
1478
- var everEnabled = !!(hasPressEvents || stateRef.current.hasHadEvents);
1479
- if (gh.isEnabled) {
1480
- var callbacksRef = React.useRef({}), gestureRef = React.useRef(null);
1481
- return everEnabled ? (callbacksRef.current = hasPressEvents ? {
1482
- onPressIn: events.onPressIn,
1483
- onPressOut: events.onPressOut,
1484
- onPress: events.onPress,
1485
- onLongPress: events.onLongPress
1486
- } : {}, gestureRef.current || (gestureRef.current = gh.createPressGesture({
1487
- onPressIn: function(e) {
1488
- var _callbacksRef_current_onPressIn, _callbacksRef_current;
1489
- return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
1490
- },
1491
- onPressOut: function(e) {
1492
- var _callbacksRef_current_onPressOut, _callbacksRef_current;
1493
- return (_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current, e);
1494
- },
1495
- onPress: function(e) {
1496
- var _callbacksRef_current_onPress, _callbacksRef_current;
1497
- return (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e);
1498
- },
1499
- onLongPress: function(e) {
1500
- var _callbacksRef_current_onLongPress, _callbacksRef_current;
1501
- return (_callbacksRef_current_onLongPress = (_callbacksRef_current = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 ? void 0 : _callbacksRef_current_onLongPress.call(_callbacksRef_current, e);
1502
- },
1503
- delayLongPress: events.delayLongPress,
1504
- hitSlop: viewProps.hitSlop
1505
- })), gestureRef.current) : null;
1489
+ var everEnabled = !!(hasPressEvents || stateRef.current.hasHadEvents), isUsingRNGH = gh.isEnabled;
1490
+ if (staticConfig.isInput) {
1491
+ if (events) {
1492
+ var {
1493
+ onPressIn,
1494
+ onPressOut,
1495
+ onPress
1496
+ } = events, inputEvents = {
1497
+ onPressIn,
1498
+ onPressOut: onPressOut || onPress
1499
+ };
1500
+ onPressOut && onPress && (inputEvents.onPressOut = composeEventHandlers(onPress, onPressOut)), Object.assign(viewProps, inputEvents);
1501
+ }
1502
+ return null;
1503
+ }
1504
+ if (isHOC) {
1505
+ if (events) {
1506
+ var {
1507
+ onPressIn: onPressIn1,
1508
+ onPressOut: onPressOut1,
1509
+ onPress: onPress1,
1510
+ onLongPress,
1511
+ delayLongPress
1512
+ } = events;
1513
+ Object.assign(viewProps, {
1514
+ onPressIn: onPressIn1,
1515
+ onPressOut: onPressOut1,
1516
+ onPress: onPress1,
1517
+ onLongPress,
1518
+ delayLongPress
1519
+ });
1520
+ }
1521
+ return null;
1522
+ }
1523
+ if (isUsingRNGH) {
1524
+ var callbacksRef = React.useRef(isUsingRNGH ? {} : null), gestureRef = React.useRef(null);
1525
+ if (everEnabled) {
1526
+ if (callbacksRef.current = hasPressEvents ? {
1527
+ onPressIn: events.onPressIn,
1528
+ onPressOut: events.onPressOut,
1529
+ onPress: events.onPress,
1530
+ onLongPress: events.onLongPress
1531
+ } : {}, !gestureRef.current) if (isInsideNativeMenu) {
1532
+ var {
1533
+ Gesture
1534
+ } = gh.state, manual = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function() {
1535
+ var _callbacksRef_current_onPressIn, _callbacksRef_current;
1536
+ (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 || _callbacksRef_current_onPressIn.call(_callbacksRef_current, {});
1537
+ }).onTouchesUp(function() {
1538
+ var _callbacksRef_current_onPress, _callbacksRef_current, _callbacksRef_current_onPressOut, _callbacksRef_current1;
1539
+ (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, {}), (_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current1, {});
1540
+ }).onTouchesCancelled(function() {
1541
+ var _callbacksRef_current_onPressOut, _callbacksRef_current;
1542
+ (_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current, {});
1543
+ });
1544
+ gestureRef.current = manual;
1545
+ } else gestureRef.current = gh.createPressGesture({
1546
+ onPressIn: function(e) {
1547
+ var _callbacksRef_current_onPressIn, _callbacksRef_current;
1548
+ return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
1549
+ },
1550
+ onPressOut: function(e) {
1551
+ var _callbacksRef_current_onPressOut, _callbacksRef_current;
1552
+ return (_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current, e);
1553
+ },
1554
+ onPress: function(e) {
1555
+ var _callbacksRef_current_onPress, _callbacksRef_current;
1556
+ return (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e);
1557
+ },
1558
+ onLongPress: function(e) {
1559
+ var _callbacksRef_current_onLongPress, _callbacksRef_current;
1560
+ return (_callbacksRef_current_onLongPress = (_callbacksRef_current = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 ? void 0 : _callbacksRef_current_onLongPress.call(_callbacksRef_current, e);
1561
+ },
1562
+ delayLongPress: events == null ? void 0 : events.delayLongPress,
1563
+ hitSlop: viewProps.hitSlop
1564
+ });
1565
+ return gestureRef.current;
1566
+ }
1567
+ return null;
1506
1568
  }
1507
1569
  return useMainThreadPressEvents(events, viewProps, hasPressEvents), null;
1508
1570
  }
@@ -1518,12 +1580,15 @@ function wrapWithGestureDetector(content, gesture, stateRef, isHOC) {
1518
1580
  gesture: gestureToUse
1519
1581
  }, content) : content;
1520
1582
  }
1521
- var getDefaultProps = function(staticConfig, propsComponentName, isSubText) {
1583
+ var getDefaultProps = function(staticConfig, propsComponentName) {
1522
1584
  var _conf_defaultProps, defaultProps = staticConfig == null ? void 0 : staticConfig.defaultProps, conf2 = getConfig(), name = propsComponentName || (staticConfig == null ? void 0 : staticConfig.componentName) || // important: this is how we end up getting the defaultProps we set in createTamagui
1523
1585
  (staticConfig.isText ? "Text" : "View"), userDefaultProps = conf2 == null || (_conf_defaultProps = conf2.defaultProps) === null || _conf_defaultProps === void 0 ? void 0 : _conf_defaultProps[name];
1524
- if (userDefaultProps && (defaultProps = __spreadValues(__spreadValues({}, userDefaultProps), defaultProps)), 0) ;
1525
- return defaultProps;
1586
+ return userDefaultProps && (defaultProps = defaultProps ? __spreadValues(__spreadValues({}, userDefaultProps), defaultProps) : userDefaultProps), defaultProps;
1526
1587
  };
1588
+ function resolveAnimationDriver(driver) {
1589
+ var _driver_default;
1590
+ return driver ? typeof driver.useAnimations == "function" ? driver : "default" in driver && typeof ((_driver_default = driver.default) === null || _driver_default === void 0 ? void 0 : _driver_default.useAnimations) == "function" ? driver.default : null : null;
1591
+ }
1527
1592
  var defaultOffset = {
1528
1593
  height: 0,
1529
1594
  width: 0
@@ -2058,10 +2123,10 @@ function requireNormalizeColor() {
2058
2123
  }
2059
2124
  var normalizeColorExports = requireNormalizeColor();
2060
2125
  const index = /* @__PURE__ */ getDefaultExportFromCjs(normalizeColorExports);
2061
- const normalizeColor$1 = /* @__PURE__ */ _mergeNamespaces({
2126
+ const normalizeColor$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2062
2127
  __proto__: null,
2063
2128
  default: index
2064
- }, [normalizeColorExports]);
2129
+ }, Symbol.toStringTag, { value: "Module" }));
2065
2130
  var norm = index || normalizeColor$1, normalizeCSSColor = norm;
2066
2131
  function rgba(colorInt) {
2067
2132
  var r = Math.round((colorInt & 4278190080) >>> 24), g = Math.round((colorInt & 16711680) >>> 16), b = Math.round((colorInt & 65280) >>> 8), a = ((colorInt & 255) >>> 0) / 255;
@@ -2125,18 +2190,6 @@ var nativeStyle = "borderStyle", borderDefaults = {
2125
2190
  var empty = function() {
2126
2191
  console.warn("no-op native");
2127
2192
  }, getCSSStylesAtomic = empty, getStyleAtomic = empty, styleToCSS = empty;
2128
- function scanAllSheets() {
2129
- if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
2130
- return;
2131
- }
2132
- }
2133
- process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES;
2134
- function setNonce(_2) {
2135
- }
2136
- function insertStyleRules(rulesToInsert) {
2137
- return;
2138
- }
2139
- process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
2140
2193
  function isActivePlatform(key) {
2141
2194
  if (!key.startsWith("$platform")) return true;
2142
2195
  var platform = key.slice(10);
@@ -2178,6 +2231,31 @@ function parseBorderShorthand(value) {
2178
2231
  var result = [];
2179
2232
  return borderWidth !== void 0 && (result.push(["borderTopWidth", borderWidth]), result.push(["borderRightWidth", borderWidth]), result.push(["borderBottomWidth", borderWidth]), result.push(["borderLeftWidth", borderWidth])), borderStyle !== void 0 && result.push(["borderStyle", borderStyle]), borderColor !== void 0 && (result.push(["borderTopColor", borderColor]), result.push(["borderRightColor", borderColor]), result.push(["borderBottomColor", borderColor]), result.push(["borderLeftColor", borderColor])), result.length > 0 ? result : void 0;
2180
2233
  }
2234
+ var outlineStyles = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"]);
2235
+ function parseOutlineShorthand(value) {
2236
+ if (value === "none" || value === "0") return [["outlineWidth", 0], ["outlineStyle", "none"]];
2237
+ var parts = value.trim().split(/\s+/), outlineWidth, outlineStyle, outlineColor, _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2238
+ try {
2239
+ for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2240
+ var part = _step.value;
2241
+ if (outlineStyles.has(part)) outlineStyle = part;
2242
+ else if (/^[\d.]+(?:px|em|rem|%|pt|vw|vh)?$/.test(part)) {
2243
+ var num = parseFloat(part);
2244
+ outlineWidth = part.endsWith("px") || !part.match(/[a-z%]/i) ? num : part;
2245
+ } else outlineColor = part;
2246
+ }
2247
+ } catch (err) {
2248
+ _didIteratorError = true, _iteratorError = err;
2249
+ } finally {
2250
+ try {
2251
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2252
+ } finally {
2253
+ if (_didIteratorError) throw _iteratorError;
2254
+ }
2255
+ }
2256
+ var result = [];
2257
+ return outlineWidth !== void 0 && result.push(["outlineWidth", outlineWidth]), outlineStyle !== void 0 && result.push(["outlineStyle", outlineStyle]), outlineColor !== void 0 && result.push(["outlineColor", outlineColor]), result.length > 0 ? result : void 0;
2258
+ }
2181
2259
  var _loop = function(parent) {
2182
2260
  var _exec, _exec_index, prefix = parent.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent.length);
2183
2261
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
@@ -2204,6 +2282,13 @@ function expandStyle(key, value) {
2204
2282
  }
2205
2283
  return;
2206
2284
  }
2285
+ case "outline": {
2286
+ if (typeof value == "string") {
2287
+ var parsed1 = parseOutlineShorthand(value);
2288
+ if (parsed1) return parsed1;
2289
+ }
2290
+ return;
2291
+ }
2207
2292
  }
2208
2293
  if (key in nativeExpansions) return nativeExpansions[key].map(function(k) {
2209
2294
  return [k, value];
@@ -2318,6 +2403,97 @@ function getFontsForLanguage(fonts, language) {
2318
2403
  })));
2319
2404
  return fontLanguageCache.set(language, next), next;
2320
2405
  }
2406
+ var fontShorthand = {
2407
+ fontSize: "size",
2408
+ fontWeight: "weight"
2409
+ }, colorKeys = tokenCategories.color, _lastFontFamilyToken = null;
2410
+ function getLastFontFamilyToken() {
2411
+ return _lastFontFamilyToken;
2412
+ }
2413
+ function setLastFontFamilyToken(value) {
2414
+ _lastFontFamilyToken = value;
2415
+ }
2416
+ var getTokenForKey = function(key, value, styleProps, styleState) {
2417
+ var _staticConfig_accept, resolveAs = styleProps.resolveValues || "none";
2418
+ if (resolveAs === "none") return value;
2419
+ var opacityModifier;
2420
+ if (key in colorKeys) {
2421
+ var slashIdx = value.indexOf("/");
2422
+ if (slashIdx > 0) {
2423
+ var raw = value.slice(slashIdx + 1);
2424
+ if (raw.length > 0) {
2425
+ var num = Number(raw);
2426
+ Number.isNaN(num) || (opacityModifier = Math.max(0, Math.min(1, num / 100)), value = value.slice(0, slashIdx));
2427
+ }
2428
+ }
2429
+ }
2430
+ var {
2431
+ theme,
2432
+ conf: conf2 = getConfig(),
2433
+ context,
2434
+ fontFamily,
2435
+ staticConfig
2436
+ } = styleState, themeValue = theme ? theme[value] || theme[value.slice(1)] : void 0, tokensParsed = conf2.tokensParsed, valOrVar, hasSet = false, customTokenAccept = staticConfig == null || (_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key];
2437
+ if (customTokenAccept) {
2438
+ var _tokensParsed_customTokenAccept, val = themeValue != null ? themeValue : (_tokensParsed_customTokenAccept = tokensParsed[customTokenAccept]) === null || _tokensParsed_customTokenAccept === void 0 ? void 0 : _tokensParsed_customTokenAccept[value];
2439
+ val != null && (resolveAs = "value", valOrVar = val, hasSet = true);
2440
+ }
2441
+ if (themeValue) {
2442
+ if (resolveAs === "except-theme") return value;
2443
+ valOrVar = themeValue, hasSet = true;
2444
+ } else {
2445
+ if (value in conf2.specificTokens) hasSet = true, valOrVar = conf2.specificTokens[value];
2446
+ else {
2447
+ switch (key) {
2448
+ case "fontFamily": {
2449
+ var _fontsParsed_value, fontsParsed = (context == null ? void 0 : context.language) ? getFontsForLanguage(conf2.fontsParsed, context.language) : conf2.fontsParsed;
2450
+ valOrVar = ((_fontsParsed_value = fontsParsed[value]) === null || _fontsParsed_value === void 0 ? void 0 : _fontsParsed_value.family) || value, setLastFontFamilyToken(value), hasSet = true;
2451
+ break;
2452
+ }
2453
+ case "fontSize":
2454
+ case "lineHeight":
2455
+ case "letterSpacing":
2456
+ case "fontWeight": {
2457
+ var fam = fontFamily || conf2.defaultFontToken;
2458
+ if (fam) {
2459
+ var _font_, fontsParsed1 = (context == null ? void 0 : context.language) ? getFontsForLanguage(conf2.fontsParsed, context.language) : conf2.fontsParsed, font = fontsParsed1[fam] || fontsParsed1[conf2.defaultFontToken];
2460
+ valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[value]) || value, hasSet = true;
2461
+ }
2462
+ break;
2463
+ }
2464
+ }
2465
+ for (var cat in tokenCategories) if (key in tokenCategories[cat]) {
2466
+ var _tokensParsed_cat, res = (_tokensParsed_cat = tokensParsed[cat]) === null || _tokensParsed_cat === void 0 ? void 0 : _tokensParsed_cat[value];
2467
+ res != null ? (valOrVar = res, hasSet = true) : false;
2468
+ }
2469
+ }
2470
+ if (!hasSet) {
2471
+ var spaceVar = tokensParsed.space[value];
2472
+ spaceVar != null && (valOrVar = spaceVar, hasSet = true);
2473
+ }
2474
+ }
2475
+ if (hasSet) {
2476
+ var out = resolveVariableValue(key, valOrVar, resolveAs);
2477
+ if (opacityModifier !== void 0 && opacityModifier < 1) {
2478
+ var _normalizeColor;
2479
+ out = (_normalizeColor = normalizeColor(String(out), opacityModifier)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
2480
+ }
2481
+ return out;
2482
+ }
2483
+ };
2484
+ function resolveVariableValue(key, valOrVar, resolveValues) {
2485
+ if (resolveValues === "none") return valOrVar;
2486
+ if (isVariable(valOrVar)) {
2487
+ if (resolveValues === "value") return valOrVar.val;
2488
+ var get = valOrVar == null ? void 0 : valOrVar.get;
2489
+ if (key !== "shadowColor" && typeof get == "function") {
2490
+ var resolveDynamicFor = resolveValues === "web" ? "web" : void 0;
2491
+ return get(resolveDynamicFor);
2492
+ }
2493
+ return valOrVar.val;
2494
+ }
2495
+ return valOrVar;
2496
+ }
2321
2497
  function _type_of$5(obj) {
2322
2498
  "@swc/helpers - typeof";
2323
2499
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
@@ -2341,6 +2517,152 @@ function normalizeStyle$1(style) {
2341
2517
  }
2342
2518
  return fixStyles(res), res;
2343
2519
  }
2520
+ function parseNativeStyle(key, cssString, tokenMap) {
2521
+ switch (key) {
2522
+ case "backgroundImage":
2523
+ return parseBackgroundImage(cssString, tokenMap);
2524
+ case "boxShadow":
2525
+ return parseBoxShadow(cssString, tokenMap);
2526
+ case "textShadow":
2527
+ return parseTextShadow(cssString, tokenMap);
2528
+ default:
2529
+ return;
2530
+ }
2531
+ }
2532
+ function resolveColor(raw, tokenMap) {
2533
+ return tokenMap && tokenMap.has(raw) ? tokenMap.get(raw) : raw;
2534
+ }
2535
+ function parseBackgroundImage(css, tokenMap) {
2536
+ var match = css.match(RegExp("^linear-gradient\\((.+)\\)$", "s"));
2537
+ if (match) {
2538
+ var inner = match[1], parts = splitOutsideParens(inner);
2539
+ if (!(parts.length < 2)) {
2540
+ var direction, startIdx = 0, firstPart = parts[0].trim();
2541
+ (firstPart.startsWith("to ") || /^\d+(\.\d+)?(deg|rad|turn|grad)$/.test(firstPart)) && (direction = firstPart, startIdx = 1);
2542
+ for (var colorStops = [], i = startIdx; i < parts.length; i++) {
2543
+ var stopParts = parts[i].trim().match(/\S+\([^)]*\)|\S+/g);
2544
+ if (stopParts) {
2545
+ var colorRaw = stopParts[0], color = resolveColor(colorRaw, tokenMap), positions = stopParts.slice(1), stop = {
2546
+ color
2547
+ };
2548
+ positions.length > 0 && (stop.positions = positions), colorStops.push(stop);
2549
+ }
2550
+ }
2551
+ var gradient = {
2552
+ type: "linear-gradient",
2553
+ colorStops
2554
+ };
2555
+ return direction && (gradient.direction = direction), [gradient];
2556
+ }
2557
+ }
2558
+ }
2559
+ function parseBoxShadow(css, tokenMap) {
2560
+ var shadowStrings = splitOutsideParens(css), shadows = [], _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2561
+ try {
2562
+ for (var _iterator = shadowStrings[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2563
+ var raw = _step.value, s = raw.trim();
2564
+ if (s) {
2565
+ var tokens = s.split(/\s+/);
2566
+ if (tokens.length < 2) return;
2567
+ var startIdx = 0, inset = false;
2568
+ tokens[0] === "inset" && (inset = true, startIdx = 1);
2569
+ for (var numericParts = [], colorParts = [], i = startIdx; i < tokens.length; i++) {
2570
+ var n = parseDimension(tokens[i]);
2571
+ if (n !== void 0) numericParts.push(n);
2572
+ else {
2573
+ colorParts = tokens.slice(i);
2574
+ break;
2575
+ }
2576
+ }
2577
+ if (numericParts.length < 2) return;
2578
+ var shadow = {
2579
+ offsetX: numericParts[0],
2580
+ offsetY: numericParts[1]
2581
+ };
2582
+ if (inset && (shadow.inset = true), numericParts.length >= 3 && (shadow.blurRadius = numericParts[2]), numericParts.length >= 4 && (shadow.spreadDistance = numericParts[3]), colorParts.length > 0) {
2583
+ var colorStr = colorParts.join(" ");
2584
+ shadow.color = resolveColor(colorStr, tokenMap);
2585
+ }
2586
+ shadows.push(shadow);
2587
+ }
2588
+ }
2589
+ } catch (err) {
2590
+ _didIteratorError = true, _iteratorError = err;
2591
+ } finally {
2592
+ try {
2593
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2594
+ } finally {
2595
+ if (_didIteratorError) throw _iteratorError;
2596
+ }
2597
+ }
2598
+ return shadows.length > 0 ? shadows : void 0;
2599
+ }
2600
+ function parseTextShadow(css, tokenMap) {
2601
+ var tokens = css.trim().split(/\s+/);
2602
+ if (!(tokens.length < 3)) {
2603
+ var offsetX = parseDimension(tokens[0]), offsetY = parseDimension(tokens[1]), blur = parseDimension(tokens[2]);
2604
+ if (!(offsetX === void 0 || offsetY === void 0 || blur === void 0)) {
2605
+ var result = [["textShadowOffset", {
2606
+ width: offsetX,
2607
+ height: offsetY
2608
+ }], ["textShadowRadius", blur]];
2609
+ if (tokens.length >= 4) {
2610
+ var colorStr = tokens.slice(3).join(" ");
2611
+ result.push(["textShadowColor", resolveColor(colorStr, tokenMap)]);
2612
+ }
2613
+ return result;
2614
+ }
2615
+ }
2616
+ }
2617
+ function parseDimension(s) {
2618
+ var cleaned = s.replace(/px$|dp$/, ""), n = Number(cleaned);
2619
+ return Number.isFinite(n) ? n : void 0;
2620
+ }
2621
+ function splitOutsideParens(s) {
2622
+ for (var parts = [], depth = 0, start = 0, i = 0; i < s.length; i++) {
2623
+ var ch = s.charCodeAt(i);
2624
+ ch === 40 ? depth++ : ch === 41 ? depth-- : ch === 44 && /* , */
2625
+ depth === 0 && (parts.push(s.slice(start, i)), start = i + 1);
2626
+ }
2627
+ return parts.push(s.slice(start)), parts;
2628
+ }
2629
+ var tokenPattern = /(\$[\w.-]+)/g, nativeParseKeys = {
2630
+ backgroundImage: true,
2631
+ boxShadow: true,
2632
+ textShadow: true
2633
+ };
2634
+ function replaceTokens(value, styleProps, styleState) {
2635
+ return value.replace(tokenPattern, function(t) {
2636
+ var r = getTokenForKey("size", t, styleProps, styleState);
2637
+ return r == null && (r = getTokenForKey("color", t, styleProps, styleState)), r != null ? String(r) : t;
2638
+ });
2639
+ }
2640
+ function platformResolveValue(key, value, styleProps, styleState) {
2641
+ if (!nativeParseKeys[key]) return replaceTokens(value, styleProps, styleState);
2642
+ var effectiveStyleProps = key === "backgroundImage" ? __spreadProps(__spreadValues({}, styleProps), {
2643
+ resolveValues: "web"
2644
+ }) : styleProps, tokenMap = /* @__PURE__ */ new Map(), placeholderIdx = 0, withPlaceholders = value.replace(tokenPattern, function(t) {
2645
+ var r = getTokenForKey("size", t, effectiveStyleProps, styleState);
2646
+ if (r == null && (r = getTokenForKey("color", t, effectiveStyleProps, styleState)), r == null) return t;
2647
+ if (typeof r != "string" && typeof r != "number") {
2648
+ var placeholder = `__tk${placeholderIdx++}__`;
2649
+ return tokenMap.set(placeholder, r), placeholder;
2650
+ }
2651
+ return String(r);
2652
+ }), parsed = parseNativeStyle(key, withPlaceholders, tokenMap);
2653
+ return parsed || replaceTokens(value, styleProps, styleState);
2654
+ }
2655
+ var compoundKeys = {
2656
+ boxShadow: true,
2657
+ textShadow: true,
2658
+ filter: true,
2659
+ backgroundImage: true,
2660
+ border: true,
2661
+ outline: true
2662
+ };
2663
+ function resolveCompoundTokens(key, value, styleProps, styleState) {
2664
+ return !value.includes("$") || !compoundKeys[key] ? value : platformResolveValue(key, value, styleProps, styleState);
2665
+ }
2344
2666
  var remRegex = /(-?[\d.]+)rem/g;
2345
2667
  function resolveRem(value) {
2346
2668
  var _config_settings, config = getConfig(), _config_settings_remBaseFontSize, baseFontSize = (_config_settings_remBaseFontSize = config == null || (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.remBaseFontSize) !== null && _config_settings_remBaseFontSize !== void 0 ? _config_settings_remBaseFontSize : 16;
@@ -2406,6 +2728,7 @@ var skipProps = {
2406
2728
  transition: 1,
2407
2729
  space: 1,
2408
2730
  animateOnly: 1,
2731
+ animatedBy: 1,
2409
2732
  disableClassName: 1,
2410
2733
  debug: 1,
2411
2734
  componentName: 1,
@@ -2424,7 +2747,7 @@ function _type_of$4(obj) {
2424
2747
  }
2425
2748
  var propMapper = function(key, value, styleState, disabled, map) {
2426
2749
  if (disabled) return map(key, value);
2427
- if (lastFontFamilyToken = null, !(!isAndroid && key === "elevationAndroid")) {
2750
+ if (setLastFontFamilyToken(null), !(!isAndroid && key === "elevationAndroid")) {
2428
2751
  var {
2429
2752
  conf: conf2,
2430
2753
  styleProps,
@@ -2444,15 +2767,44 @@ var propMapper = function(key, value, styleState, disabled, map) {
2444
2767
  }
2445
2768
  styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
2446
2769
  var originalValue = value;
2447
- if (value != null && (typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (key === "boxShadow" || key === "textShadow" || key === "filter" || key === "backgroundImage" || key === "border") && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t) {
2448
- var r = getTokenForKey("size", t, styleProps, styleState);
2449
- return r == null && (r = getTokenForKey("color", t, styleProps, styleState)), r != null ? String(r) : t;
2450
- }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
2451
- key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
2770
+ if (value != null) if (typeof value == "string") {
2771
+ if (value[0] === "$") value = getTokenForKey(key, value, styleProps, styleState);
2772
+ else {
2773
+ var resolved = resolveCompoundTokens(key, value, styleProps, styleState);
2774
+ value = resolved !== value ? resolved : isRemValue(value) ? resolveRem(value) : value;
2775
+ }
2776
+ } else isVariable(value) ? value = resolveVariableValue(key, value, styleProps.resolveValues) : isRemValue(value) && (value = resolveRem(value));
2777
+ if (value != null && typeof value == "string" && (key === "backgroundImage" || key === "boxShadow" || key === "textShadow")) {
2778
+ var parsed = parseNativeStyle(key, value);
2779
+ if (parsed) {
2780
+ if (key === "textShadow" && Array.isArray(parsed) && Array.isArray(parsed[0])) {
2781
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2782
+ try {
2783
+ for (var _iterator = parsed[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2784
+ var [nkey, nvalue] = _step.value;
2785
+ map(nkey, nvalue, originalValue);
2786
+ }
2787
+ } catch (err) {
2788
+ _didIteratorError = true, _iteratorError = err;
2789
+ } finally {
2790
+ try {
2791
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2792
+ } finally {
2793
+ if (_didIteratorError) throw _iteratorError;
2794
+ }
2795
+ }
2796
+ return;
2797
+ }
2798
+ value = parsed;
2799
+ }
2800
+ }
2801
+ if (value != null) {
2802
+ var fontToken = getLastFontFamilyToken();
2803
+ key === "fontFamily" && fontToken && (styleState.fontFamily = fontToken);
2452
2804
  var expanded = styleProps.noExpand ? null : expandStyle(key, value);
2453
2805
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
2454
- var [nkey, nvalue] = expanded[i];
2455
- map(nkey, nvalue, originalValue);
2806
+ var [nkey1, nvalue1] = expanded[i];
2807
+ map(nkey1, nvalue1, originalValue);
2456
2808
  }
2457
2809
  else map(key, value, originalValue);
2458
2810
  }
@@ -2466,7 +2818,7 @@ var propMapper = function(key, value, styleState, disabled, map) {
2466
2818
  variants
2467
2819
  } = staticConfig;
2468
2820
  if (variants) {
2469
- var variantValue = getVariantDefinition(variants[key], value, conf2);
2821
+ var variantValue = getVariantDefinition(variants[key], value, conf2, styleState);
2470
2822
  if (!variantValue) {
2471
2823
  if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
2472
2824
  var name = staticConfig.componentName || "[UnnamedComponent]";
@@ -2486,7 +2838,7 @@ var propMapper = function(key, value, styleState, disabled, map) {
2486
2838
  if (variantValue) {
2487
2839
  var expanded = normalizeStyle$1(variantValue, !!styleProps.noNormalize);
2488
2840
  var next = Object.entries(expanded);
2489
- return fontFamilyResult && fontFamilyResult[0] === "$" && (lastFontFamilyToken = getVariableValue(fontFamilyResult)), next;
2841
+ return fontFamilyResult && fontFamilyResult[0] === "$" && setLastFontFamilyToken(getVariableValue(fontFamilyResult)), next;
2490
2842
  }
2491
2843
  }
2492
2844
  };
@@ -2521,8 +2873,7 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
2521
2873
  }
2522
2874
  if (styleProps.noExpand) res[subKey] = val;
2523
2875
  else if (variants && subKey in variants) {
2524
- if (parentVariantKey && parentVariantKey === key) res[subKey] = // SYNC WITH *1
2525
- val[0] === "$" ? getTokenForKey(subKey, val, styleProps, styleState) : val;
2876
+ if (parentVariantKey && parentVariantKey === key) res[subKey] = val[0] === "$" ? getTokenForKey(subKey, val, styleProps, styleState) : val;
2526
2877
  else {
2527
2878
  var variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
2528
2879
  if (variantOut) {
@@ -2553,8 +2904,8 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
2553
2904
  continue;
2554
2905
  }
2555
2906
  if (typeof val == "string") {
2556
- var fVal = val[0] === "$" ? getTokenForKey(subKey, val, styleProps, styleState) : isRemValue(val) ? resolveRem(val) : val;
2557
- res[subKey] = fVal;
2907
+ var fVal = val[0] === "$" ? getTokenForKey(subKey, val, styleProps, styleState) : resolveCompoundTokens(subKey, val, styleProps, styleState);
2908
+ res[subKey] = fVal === val && isRemValue(val) ? resolveRem(val) : fVal;
2558
2909
  continue;
2559
2910
  }
2560
2911
  if (isObj(val)) {
@@ -2571,7 +2922,10 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
2571
2922
  spreadName: `...${name}`
2572
2923
  };
2573
2924
  });
2574
- function getVariantDefinition(variant, value, conf2) {
2925
+ function getVariantDefinition(variant, value, conf2, param) {
2926
+ var {
2927
+ theme
2928
+ } = param;
2575
2929
  if (variant) {
2576
2930
  if (typeof variant == "function") return variant;
2577
2931
  var exact = variant[value];
@@ -2586,7 +2940,13 @@ function getVariantDefinition(variant, value, conf2) {
2586
2940
  name,
2587
2941
  spreadName
2588
2942
  } = _step.value;
2589
- if (spreadName in variant && name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
2943
+ if (spreadName in variant) {
2944
+ if (name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
2945
+ if (name === "color" && theme && typeof value == "string" && value[0] === "$") {
2946
+ var themeKey = value.slice(1);
2947
+ if (themeKey in theme) return variant[spreadName];
2948
+ }
2949
+ }
2590
2950
  }
2591
2951
  } catch (err) {
2592
2952
  _didIteratorError = true, _iteratorError = err;
@@ -2603,75 +2963,6 @@ function getVariantDefinition(variant, value, conf2) {
2603
2963
  return variant[`:${typeof value > "u" ? "undefined" : _type_of$4(value)}`] || variant["..."];
2604
2964
  }
2605
2965
  }
2606
- var fontShorthand = {
2607
- fontSize: "size",
2608
- fontWeight: "weight"
2609
- }, lastFontFamilyToken = null, getTokenForKey = function(key, value, styleProps, styleState) {
2610
- var _staticConfig_accept, resolveAs = styleProps.resolveValues || "none";
2611
- if (resolveAs === "none") return value;
2612
- var {
2613
- theme,
2614
- conf: conf2 = getConfig(),
2615
- context,
2616
- fontFamily,
2617
- staticConfig
2618
- } = styleState, themeValue = theme ? theme[value] || theme[value.slice(1)] : void 0, tokensParsed = conf2.tokensParsed, valOrVar, hasSet = false, customTokenAccept = staticConfig == null || (_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key];
2619
- if (customTokenAccept) {
2620
- var val = themeValue != null ? themeValue : tokensParsed[customTokenAccept][value];
2621
- val != null && (resolveAs = "value", valOrVar = val, hasSet = true);
2622
- }
2623
- if (themeValue) {
2624
- if (resolveAs === "except-theme") return value;
2625
- valOrVar = themeValue, hasSet = true;
2626
- } else {
2627
- if (value in conf2.specificTokens) hasSet = true, valOrVar = conf2.specificTokens[value];
2628
- else {
2629
- switch (key) {
2630
- case "fontFamily": {
2631
- var _fontsParsed_value, fontsParsed = (context == null ? void 0 : context.language) ? getFontsForLanguage(conf2.fontsParsed, context.language) : conf2.fontsParsed;
2632
- valOrVar = ((_fontsParsed_value = fontsParsed[value]) === null || _fontsParsed_value === void 0 ? void 0 : _fontsParsed_value.family) || value, lastFontFamilyToken = value, hasSet = true;
2633
- break;
2634
- }
2635
- case "fontSize":
2636
- case "lineHeight":
2637
- case "letterSpacing":
2638
- case "fontWeight": {
2639
- var fam = fontFamily || conf2.defaultFontToken;
2640
- if (fam) {
2641
- var _font_, fontsParsed1 = (context == null ? void 0 : context.language) ? getFontsForLanguage(conf2.fontsParsed, context.language) : conf2.fontsParsed, font = fontsParsed1[fam] || fontsParsed1[conf2.defaultFontToken];
2642
- valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[value]) || value, hasSet = true;
2643
- }
2644
- break;
2645
- }
2646
- }
2647
- for (var cat in tokenCategories) if (key in tokenCategories[cat]) {
2648
- var _tokensParsed_cat, res = (_tokensParsed_cat = tokensParsed[cat]) === null || _tokensParsed_cat === void 0 ? void 0 : _tokensParsed_cat[value];
2649
- res != null ? (valOrVar = res, hasSet = true) : false;
2650
- }
2651
- }
2652
- if (!hasSet) {
2653
- var spaceVar = tokensParsed.space[value];
2654
- spaceVar != null && (valOrVar = spaceVar, hasSet = true);
2655
- }
2656
- }
2657
- if (hasSet) {
2658
- var out = resolveVariableValue(key, valOrVar, resolveAs);
2659
- return out;
2660
- }
2661
- };
2662
- function resolveVariableValue(key, valOrVar, resolveValues) {
2663
- if (resolveValues === "none") return valOrVar;
2664
- if (isVariable(valOrVar)) {
2665
- if (resolveValues === "value") return valOrVar.val;
2666
- var get = valOrVar == null ? void 0 : valOrVar.get;
2667
- if (key !== "shadowColor" && typeof get == "function") {
2668
- var resolveDynamicFor = resolveValues === "web" ? "web" : void 0;
2669
- return get(resolveDynamicFor);
2670
- }
2671
- return valOrVar.val;
2672
- }
2673
- return valOrVar;
2674
- }
2675
2966
  var sortString = function(a, b) {
2676
2967
  return a < b ? -1 : a > b ? 1 : 0;
2677
2968
  };
@@ -2699,14 +2990,14 @@ function normalizeGroupKey(key, groupContext) {
2699
2990
  plen === 2 || plen === 3 && pseudoPriorities[parts[parts.length - 1]]
2700
2991
  ) {
2701
2992
  var name = parts[1];
2702
- if (groupContext && !groupContext[name]) return key.replace("$group-", "$group-true-");
2993
+ if (name !== "true" && groupContext && !groupContext[name]) return key.replace("$group-", "$group-true-");
2703
2994
  }
2704
2995
  return key;
2705
2996
  }
2706
2997
  function isValidStyleKey(key, validStyles2, accept) {
2707
2998
  return key in validStyles2 ? true : accept && key in accept;
2708
2999
  }
2709
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug) {
3000
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
2710
3001
  var _loop2 = function(keyOg2) {
2711
3002
  var keyInit = keyOg2, valInit = props[keyInit];
2712
3003
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -2742,45 +3033,47 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2742
3033
  if (!noSkip && keyInit in skipProps) return "continue";
2743
3034
  (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
2744
3035
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
2745
- if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2, originalVal) {
2746
- var _parentStaticConfig_variants, isStyledContextProp = styledContext && key4 in styledContext;
3036
+ if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key5, val2, originalVal) {
3037
+ var _parentStaticConfig_variants, isStyledContextProp = styledContext && key5 in styledContext;
2747
3038
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
2748
- viewProps[key4] = val2;
3039
+ viewProps[key5] = val2;
2749
3040
  return;
2750
3041
  }
2751
- if (val2 != null) {
2752
- if (key4 === "pointerEvents") {
2753
- viewProps[key4] = val2;
3042
+ if (false, val2 != null) {
3043
+ if (key5 === "pointerEvents") {
3044
+ viewProps[key5] = val2;
2754
3045
  return;
2755
3046
  }
2756
- if (!isHOC && isValidStyleKey(key4, validStyles$1, accept) || isAndroid && key4 === "elevation") {
2757
- mergeStyle(styleState, key4, val2, 1, false, originalVal);
3047
+ if (!isHOC && isValidStyleKey(key5, validStyles$1, accept) || isAndroid && key5 === "elevation") {
3048
+ mergeStyle(styleState, key5, val2, 1, false, originalVal);
2758
3049
  return;
2759
3050
  }
2760
- if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, isMedia === "group" && (key4 = normalizeGroupKey(key4, groupContext)), (inlineProps == null ? void 0 : inlineProps.has(key4)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key4))) {
3051
+ if (isPseudo = key5 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key5), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key5 in variants, isMedia === "group" && (key5 = normalizeGroupKey(key5, groupContext)), (inlineProps == null ? void 0 : inlineProps.has(key5)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key5))) {
2761
3052
  var _props_key;
2762
- viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
3053
+ viewProps[key5] = (_props_key = props[key5]) !== null && _props_key !== void 0 ? _props_key : val2;
2763
3054
  }
2764
3055
  var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
2765
3056
  if (shouldPassThrough2) {
2766
- passDownProp(viewProps, key4, val2, isMediaOrPseudo);
3057
+ passDownProp(viewProps, key5, val2, isMediaOrPseudo), false;
2767
3058
  return;
2768
3059
  }
2769
3060
  if (isPseudo) {
2770
3061
  if (!val2) return;
2771
- var pseudoStyleObject = getSubStyle(styleState, key4, val2, styleProps.noClass && process.env.IS_STATIC !== "is_static");
2772
- {
3062
+ var pseudoStyleObject = getSubStyle(styleState, key5, val2, styleProps.noClass && process.env.IS_STATIC !== "is_static");
3063
+ if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
2773
3064
  var _pseudos, _key;
2774
- if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key4] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static") {
2775
- Object.assign(pseudos[key4], pseudoStyleObject);
3065
+ if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key5] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static") {
3066
+ Object.assign(pseudos[key5], pseudoStyleObject);
2776
3067
  return;
2777
3068
  }
2778
3069
  }
2779
- var descriptor = pseudoDescriptors[key4], isEnter = key4 === "enterStyle", isExit = key4 === "exitStyle";
3070
+ var descriptor = pseudoDescriptors[key5], isEnter = key5 === "enterStyle", isExit = key5 === "exitStyle";
2780
3071
  if (!descriptor) return;
2781
- {
3072
+ var pseudoStyles, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, psuedoStyle, fullKey;
3073
+ if (shouldDoClasses && !isExit) ;
3074
+ if (!shouldDoClasses || isExit || isEnter) {
2782
3075
  var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled2 = componentState[descriptorKey] === false;
2783
- isExit && (isDisabled2 = !styleProps.isExiting), isEnter && componentState.unmounted === false && (isDisabled2 = true);
3076
+ isExit && (isDisabled2 = !styleProps.isExiting), isEnter && componentState.unmounted === false && (isDisabled2 = true), false;
2784
3077
  var importance = descriptor.priority, pseudoOriginalValues = styleOriginalValues.get(pseudoStyleObject);
2785
3078
  for (var pkey in pseudoStyleObject) {
2786
3079
  var _$val = pseudoStyleObject[pkey];
@@ -2790,7 +3083,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2790
3083
  if (shouldMerge) {
2791
3084
  if (process.env.IS_STATIC === "is_static") {
2792
3085
  var _pseudos1, _key1;
2793
- pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
3086
+ pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key5] || (_pseudos1[_key1] = {}), pseudos[key5][pkey] = _$val;
2794
3087
  }
2795
3088
  mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues == null ? void 0 : pseudoOriginalValues[pkey]);
2796
3089
  }
@@ -2805,48 +3098,27 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2805
3098
  }
2806
3099
  if (isMedia) {
2807
3100
  if (!val2) return;
2808
- var mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
3101
+ var mediaKeyShort = key5.slice(isMedia == "theme" ? 7 : 1);
2809
3102
  hasMedia || (hasMedia = true);
2810
- val2.space;
2811
- if ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */ new Set()), hasMedia.add(mediaKeyShort), isMedia === "platform" && !isActivePlatform(key4)) return;
3103
+ var hasSpace = val2.space;
3104
+ if ((hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */ new Set()), hasMedia.add(mediaKeyShort)), isMedia === "platform" && !isActivePlatform(key5)) return;
2812
3105
  var priority = mediaStylesSeen;
2813
- mediaStylesSeen += 1;
2814
- var shouldDoClassesForThisMedia = isWeb;
2815
- if (shouldDoClassesForThisMedia) {
2816
- getSubStyle(styleState, key4, val2, false);
2817
- var mediaStyles = getCSSStylesAtomic(), _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
2818
- try {
2819
- for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
2820
- var style3 = _step12.value, property = style3[StyleObjectProperty], isSubStyle = property[0] === "$";
2821
- if (!(isSubStyle && !isActivePlatform(property))) {
2822
- var out = createMediaStyle(style3, mediaKeyShort, mediaQueryConfig, isMedia, false, priority);
2823
- var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[StyleObjectPseudo] || ""}`;
2824
- addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[StyleObjectIdentifier];
2825
- }
2826
- }
2827
- } catch (err) {
2828
- _didIteratorError12 = true, _iteratorError12 = err;
2829
- } finally {
2830
- try {
2831
- !_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
2832
- } finally {
2833
- if (_didIteratorError12) throw _iteratorError12;
2834
- }
2835
- }
2836
- } else {
2837
- let mergeMediaStyle2 = function(key5, val3, originalVal2) {
3106
+ var mediaStyle, mediaStyles, _iteratorNormalCompletion12, _didIteratorError12, _iteratorError12, _iterator12, _step12, style3, property, isSubStyle, out, subKey, fullKey1;
3107
+ if (mediaStylesSeen += 1, shouldDoClasses) ;
3108
+ else {
3109
+ let mergeMediaStyle2 = function(key6, val3, originalVal2) {
2838
3110
  var _styleState4;
2839
3111
  (_styleState4 = styleState).style || (_styleState4.style = {});
2840
- var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState[mediaKeyShort], importanceBump, debug, originalVal2);
2841
- didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
3112
+ var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key6, val3, mediaState[mediaKeyShort], importanceBump, debug, originalVal2);
3113
+ didMerge && key6 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
2842
3114
  };
2843
- var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
3115
+ var mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
2844
3116
  if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
2845
3117
  if (!mediaState[mediaKeyShort]) {
2846
3118
  return;
2847
3119
  }
2848
3120
  }
2849
- var mediaStyle1 = getSubStyle(styleState, key4, val2, true), importanceBump = 0;
3121
+ var mediaStyle1 = getSubStyle(styleState, key5, val2, true), importanceBump = 0;
2850
3122
  if (isThemeMedia) {
2851
3123
  if (isIos && getSetting("fastSchemeChange")) {
2852
3124
  var _styleState3;
@@ -2872,14 +3144,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2872
3144
  } else if (isGroupMedia) {
2873
3145
  var _groupContext_groupName, _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupState = groupContext == null || (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state, groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media;
2874
3146
  if (!groupState) {
2875
- pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set());
3147
+ false, pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set());
2876
3148
  return;
2877
3149
  }
2878
3150
  var componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
2879
3151
  if (groupMediaKey) {
2880
3152
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
2881
3153
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
2882
- if (!mediaState1 && groupState.layout && (isActive = mediaKeyMatch(groupMediaKey, groupState.layout)), !isActive) {
3154
+ if (!mediaState1 && groupState.layout && (isActive = mediaKeyMatch(groupMediaKey, groupState.layout)), false, !isActive) {
2883
3155
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
2884
3156
  return;
2885
3157
  }
@@ -2889,7 +3161,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2889
3161
  var _this;
2890
3162
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
2891
3163
  var componentGroupPseudoState = (_this = componentGroupState || (groupContext == null ? void 0 : groupContext[groupName].state)) === null || _this === void 0 ? void 0 : _this.pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = pseudoPriorities[groupPseudoKey];
2892
- if (!isActive1) {
3164
+ if (false, !isActive1) {
2893
3165
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
2894
3166
  return;
2895
3167
  }
@@ -2897,6 +3169,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2897
3169
  }
2898
3170
  }
2899
3171
  var mediaOriginalValues = styleOriginalValues.get(mediaStyle1);
3172
+ if (isGroupMedia && mediaStyle1.transition) {
3173
+ var _styleState12;
3174
+ (_styleState12 = styleState).pseudoTransitions || (_styleState12.pseudoTransitions = {}), styleState.pseudoTransitions[`$${mediaKeyShort}`] = mediaStyle1.transition;
3175
+ }
2900
3176
  for (var subKey2 in mediaStyle1) if (subKey2 !== "space") if (subKey2[0] === "$") {
2901
3177
  if (!isActivePlatform(subKey2) || !isActiveTheme(subKey2, themeName)) continue;
2902
3178
  var subOriginalValues = styleOriginalValues.get(mediaStyle1[subKey2]);
@@ -2907,13 +3183,13 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2907
3183
  }
2908
3184
  if (!isVariant) {
2909
3185
  if (isStyledContextProp) return;
2910
- viewProps[key4] = val2;
3186
+ viewProps[key5] = val2;
2911
3187
  }
2912
3188
  }
2913
3189
  }), false) ;
2914
3190
  };
2915
3191
  conf = conf || getConfig();
2916
- (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
3192
+ var driver = animationDriver || (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
2917
3193
  if (props.passThrough) return null;
2918
3194
  var {
2919
3195
  shorthands
@@ -2927,7 +3203,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2927
3203
  inlineWhenUnflattened,
2928
3204
  parentStaticConfig,
2929
3205
  acceptsClassName
2930
- } = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || exports.mediaState, rulesToInsert = void 0, classNames = {};
3206
+ } = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {};
2931
3207
  props.space;
2932
3208
  var pseudos = null, hasMedia = false, dynamicThemeAccess, pseudoGroups, mediaGroups;
2933
3209
  props.className || "";
@@ -2944,15 +3220,17 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2944
3220
  usedKeys: {},
2945
3221
  viewProps,
2946
3222
  context: componentContext,
2947
- debug
3223
+ debug,
3224
+ // resolved animation driver (respects animatedBy prop)
3225
+ animationDriver: driver
2948
3226
  };
2949
3227
  if (process.env.IS_STATIC === "is_static") {
2950
3228
  var {
2951
3229
  fallbackProps
2952
3230
  } = styleProps;
2953
3231
  fallbackProps && (styleState.props = new Proxy(props, {
2954
- get(_2, key4, val2) {
2955
- return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
3232
+ get(_2, key5, val2) {
3233
+ return Reflect.has(props, key5) ? Reflect.get(props, key5) : Reflect.get(fallbackProps, key5);
2956
3234
  }
2957
3235
  }));
2958
3236
  }
@@ -3015,7 +3293,8 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
3015
3293
  dynamicThemeAccess,
3016
3294
  pseudoGroups,
3017
3295
  mediaGroups,
3018
- overriddenContextProps: styleState.overriddenContextProps
3296
+ overriddenContextProps: styleState.overriddenContextProps,
3297
+ pseudoTransitions: styleState.pseudoTransitions
3019
3298
  }, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
3020
3299
  if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
3021
3300
  var style2 = styleState.style;
@@ -3068,11 +3347,23 @@ function mergeStyle(styleState, key, val, importance) {
3068
3347
  var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3069
3348
  var _loop2 = function(key1) {
3070
3349
  var val = styleIn[key1];
3071
- key1 = conf2.shorthands[key1] || key1;
3350
+ if (key1 = conf2.shorthands[key1] || key1, key1 === "transition") {
3351
+ var _styleState;
3352
+ (_styleState = styleState).pseudoTransitions || (_styleState.pseudoTransitions = {}), styleState.pseudoTransitions[subKey] = val;
3353
+ var driver = styleState.animationDriver;
3354
+ if ((driver == null ? void 0 : driver.outputStyle) === "css") {
3355
+ var _driver_animations, animationConfig = (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[val];
3356
+ if (animationConfig) {
3357
+ var important = subKey[0] === "$" ? " !important" : "";
3358
+ styleOut.transition = `all ${animationConfig}${important}`;
3359
+ }
3360
+ }
3361
+ return key = key1, "continue";
3362
+ }
3072
3363
  var shouldSkip = !staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip;
3073
3364
  if (shouldSkip) return key = key1, "continue";
3074
3365
  propMapper(key1, val, styleState, false, function(skey, sval, originalVal) {
3075
- originalVal !== void 0 && (originalValues || (originalValues = {}), originalValues[skey] = originalVal), skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval);
3366
+ originalVal !== void 0 && (originalValues || (originalValues = {}), originalValues[skey] = originalVal), skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval, key1);
3076
3367
  }), key = key1;
3077
3368
  }, {
3078
3369
  staticConfig,
@@ -3110,8 +3401,9 @@ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3110
3401
  } else flatTransforms && mergeFlatTransforms(styleOut, flatTransforms);
3111
3402
  }
3112
3403
  return styleProps.noNormalize || fixStyles(styleOut), originalValues && styleOriginalValues.set(styleOut, originalValues), styleOut;
3113
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l) {
3114
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l);
3404
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
3405
+ "use no memo";
3406
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);
3115
3407
  return res;
3116
3408
  };
3117
3409
  function addStyleToInsertRules(rulesToInsert, styleObject) {
@@ -3173,6 +3465,18 @@ function applyDefaultStyle(pkey, styleState) {
3173
3465
  var defaultValues = animatableDefaults[pkey];
3174
3466
  defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
3175
3467
  }
3468
+ var isEventHandler = /^on[A-Z]/;
3469
+ function mergeSlotStyleProps(base, overlay) {
3470
+ for (var key in overlay) {
3471
+ var baseVal = base[key], overlayVal = overlay[key];
3472
+ overlayVal !== void 0 && (key === "style" ? base.style = baseVal && overlayVal ? __spreadValues(__spreadValues({}, baseVal), overlayVal) : overlayVal || baseVal : key === "className" ? base.className = baseVal && overlayVal ? `${baseVal} ${overlayVal}` : overlayVal || baseVal : key === "ref" ? base.ref = baseVal && overlayVal ? composeRefs(baseVal, overlayVal) : overlayVal || baseVal : isEventHandler.test(key) && typeof baseVal == "function" && typeof overlayVal == "function" ? base[key] = composeEventHandlers(baseVal, overlayVal) : base[key] = overlayVal);
3473
+ }
3474
+ return base;
3475
+ }
3476
+ function mergeRenderElementProps(elementProps, viewProps, children) {
3477
+ var merged = mergeSlotStyleProps(__spreadValues({}, elementProps), viewProps);
3478
+ return merged.children = children, merged;
3479
+ }
3176
3480
  function usePointerEvents(props, viewProps) {
3177
3481
  var {
3178
3482
  onPointerDown,
@@ -3251,17 +3555,41 @@ function usePointerEvents(props, viewProps) {
3251
3555
  }));
3252
3556
  }
3253
3557
  }
3254
- var isEventHandler = /^on[A-Z]/;
3255
- function mergeSlotStyleProps(base, overlay) {
3256
- for (var key in overlay) {
3257
- var baseVal = base[key], overlayVal = overlay[key];
3258
- overlayVal !== void 0 && (key === "style" ? base.style = baseVal && overlayVal ? __spreadValues(__spreadValues({}, baseVal), overlayVal) : overlayVal || baseVal : key === "className" ? base.className = baseVal && overlayVal ? `${baseVal} ${overlayVal}` : overlayVal || baseVal : key === "ref" ? base.ref = baseVal && overlayVal ? composeRefs(baseVal, overlayVal) : overlayVal || baseVal : isEventHandler.test(key) && typeof baseVal == "function" && typeof overlayVal == "function" ? base[key] = composeEventHandlers(baseVal, overlayVal) : base[key] = overlayVal);
3558
+ function resolveEffectivePseudoTransition(prev, next, pseudoTransitions, baseTransition) {
3559
+ if (!pseudoTransitions) return baseTransition;
3560
+ var prevState = prev || {
3561
+ hover: false,
3562
+ press: false,
3563
+ focus: false,
3564
+ groups: {}
3565
+ };
3566
+ if (next.press && !prevState.press && pseudoTransitions.pressStyle) return pseudoTransitions.pressStyle;
3567
+ if (next.hover && !prevState.hover && pseudoTransitions.hoverStyle) return pseudoTransitions.hoverStyle;
3568
+ if (next.focus && !prevState.focus && pseudoTransitions.focusStyle) return pseudoTransitions.focusStyle;
3569
+ for (var key in pseudoTransitions) if (key.startsWith("$group-")) {
3570
+ var _next_group_groupName, _next_group, _prevState_groups, match = key.match(/^\$group-(.+)-(hover|press|focus)$/);
3571
+ if (!match) continue;
3572
+ var groupName = match[1], pseudoType = match[2], nextGroupPseudo = (_next_group = next.group) === null || _next_group === void 0 || (_next_group_groupName = _next_group[groupName]) === null || _next_group_groupName === void 0 ? void 0 : _next_group_groupName.pseudo, prevGroupPseudo = (_prevState_groups = prevState.groups) === null || _prevState_groups === void 0 ? void 0 : _prevState_groups[groupName];
3573
+ if ((nextGroupPseudo == null ? void 0 : nextGroupPseudo[pseudoType]) && !(prevGroupPseudo == null ? void 0 : prevGroupPseudo[pseudoType])) return pseudoTransitions[key];
3259
3574
  }
3260
- return base;
3261
- }
3262
- function mergeRenderElementProps(elementProps, viewProps, children) {
3263
- var merged = mergeSlotStyleProps(__spreadValues({}, elementProps), viewProps);
3264
- return merged.children = children, merged;
3575
+ return baseTransition;
3576
+ }
3577
+ function extractPseudoState(state2) {
3578
+ var groups = {};
3579
+ if (state2.group) for (var groupName in state2.group) {
3580
+ var _state_group_groupName, pseudo = (_state_group_groupName = state2.group[groupName]) === null || _state_group_groupName === void 0 ? void 0 : _state_group_groupName.pseudo;
3581
+ pseudo && (groups[groupName] = {
3582
+ hover: pseudo.hover,
3583
+ press: pseudo.press,
3584
+ focus: pseudo.focus
3585
+ });
3586
+ }
3587
+ return {
3588
+ hover: state2.hover,
3589
+ press: state2.press,
3590
+ focus: state2.focus,
3591
+ groups
3592
+ };
3265
3593
  }
3266
3594
  function setElementProps(element) {
3267
3595
  element && !element.getBoundingClientRect && (element.getBoundingClientRect = function() {
@@ -3360,6 +3688,7 @@ var subscribeToContextGroup = function(props) {
3360
3688
  };
3361
3689
  };
3362
3690
  var Theme = /* @__PURE__ */ React.forwardRef(function(props, ref) {
3691
+ "use no memo";
3363
3692
  if (props.disable) return props.children;
3364
3693
  var {
3365
3694
  passThrough
@@ -3384,7 +3713,7 @@ function getThemedChildren(themeState, children, props) {
3384
3713
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, {
3385
3714
  shallow,
3386
3715
  forceClassName
3387
- } = props, state = stateRef.current, hasEverThemed = state.hasEverThemed, shouldRenderChildrenWithTheme = hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);
3716
+ } = props, state2 = stateRef.current, hasEverThemed = state2.hasEverThemed, shouldRenderChildrenWithTheme = hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);
3388
3717
  if (!shouldRenderChildrenWithTheme) return children;
3389
3718
  children = /* @__PURE__ */ jsxRuntime.jsx(ThemeStateContext.Provider, {
3390
3719
  value: themeState.id,
@@ -3394,9 +3723,9 @@ function getThemedChildren(themeState, children, props) {
3394
3723
  isInverse,
3395
3724
  name
3396
3725
  } = themeState, requiresExtraWrapper = isInverse || forceClassName;
3397
- if (state.hasEverThemed || (state.hasEverThemed = true), (requiresExtraWrapper || // if the theme is exactly dark or light, its likely to change between dark/light
3726
+ if (state2.hasEverThemed || (state2.hasEverThemed = true), (requiresExtraWrapper || // if the theme is exactly dark or light, its likely to change between dark/light
3398
3727
  // and that would require wrapping which would re-parent, so to avoid re-parenting do this
3399
- themeState.name === "dark" || themeState.name === "light") && (state.hasEverThemed = "wrapped"), shallow && themeState.parentId) {
3728
+ themeState.name === "dark" || themeState.name === "light") && (state2.hasEverThemed = "wrapped"), shallow && themeState.parentId) {
3400
3729
  var parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
3401
3730
  if (!parentState) throw new Error("‼️010");
3402
3731
  children = React.Children.toArray(children).map(function(child) {
@@ -3411,6 +3740,7 @@ function getThemedChildren(themeState, children, props) {
3411
3740
  }
3412
3741
  function themeable(Component, staticConfig) {
3413
3742
  var optimize = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, withThemeComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {
3743
+ "use no memo";
3414
3744
  var userDefaults = getDefaultProps(staticConfig, props.componentName), defaultTheme = userDefaults == null ? void 0 : userDefaults.theme, defaultResetTheme = userDefaults == null ? void 0 : userDefaults.themeReset, _a = props, {
3415
3745
  theme,
3416
3746
  componentName,
@@ -3422,7 +3752,7 @@ function themeable(Component, staticConfig) {
3422
3752
  ]), overriddenContextProps, context = staticConfig == null ? void 0 : staticConfig.context;
3423
3753
  if (context) for (var key in context.props) {
3424
3754
  var val = props[key];
3425
- val !== void 0 && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = val);
3755
+ val !== void 0 && (overriddenContextProps = overriddenContextProps || {}, overriddenContextProps[key] = val);
3426
3756
  }
3427
3757
  var element = (
3428
3758
  // @ts-expect-error its ok
@@ -3432,7 +3762,7 @@ function themeable(Component, staticConfig) {
3432
3762
  "data-disable-theme": true
3433
3763
  }))
3434
3764
  ), filteredProps = null, compName = componentName || (staticConfig == null ? void 0 : staticConfig.componentName);
3435
- if (compName && (filteredProps || (filteredProps = {}), filteredProps.componentName = compName), "debug" in props && (filteredProps || (filteredProps = {}), filteredProps.debug = props.debug), ("theme" in props || defaultTheme) && (filteredProps || (filteredProps = {}), filteredProps.name = "theme" in props ? props.theme : defaultTheme), ("themeReset" in props || defaultResetTheme) && (filteredProps || (filteredProps = {}), filteredProps.reset = "themeReset" in props ? themeReset : defaultResetTheme), optimize && !filteredProps) return element;
3765
+ if (compName && (filteredProps = filteredProps || {}, filteredProps.componentName = compName), "debug" in props && (filteredProps = filteredProps || {}, filteredProps.debug = props.debug), ("theme" in props || defaultTheme) && (filteredProps = filteredProps || {}, filteredProps.name = "theme" in props ? props.theme : defaultTheme), ("themeReset" in props || defaultResetTheme) && (filteredProps = filteredProps || {}, filteredProps.reset = "themeReset" in props ? themeReset : defaultResetTheme), optimize && !filteredProps) return element;
3436
3766
  var contents = /* @__PURE__ */ jsxRuntime.jsx(Theme, __spreadProps(__spreadValues({
3437
3767
  "disable-child-theme": true
3438
3768
  }, filteredProps), {
@@ -3448,8 +3778,6 @@ function themeable(Component, staticConfig) {
3448
3778
  }), withTheme = withThemeComponent;
3449
3779
  return withTheme.displayName = `Themed(${(Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "Anonymous"})`, withTheme;
3450
3780
  }
3451
- function getStyleTags(styles) {
3452
- }
3453
3781
  var ClientOnlyContext = /* @__PURE__ */ React.createContext(false), ClientOnly = function(param) {
3454
3782
  var {
3455
3783
  children,
@@ -3476,6 +3804,7 @@ function _type_of$2(obj) {
3476
3804
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
3477
3805
  }
3478
3806
  var useComponentState = function(props, animationDriver, staticConfig, config) {
3807
+ "use no memo";
3479
3808
  var _animationDriver_usePresence, isHydrated = useDidFinishSSR(), needsHydration = !useIsClientOnly(), useAnimations = (animationDriver == null ? void 0 : animationDriver.isStub) ? void 0 : animationDriver == null ? void 0 : animationDriver.useAnimations, {
3480
3809
  isHOC
3481
3810
  } = staticConfig, stateRef = React.useRef(
@@ -3485,7 +3814,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
3485
3814
  stateRef.current || (stateRef.current = {
3486
3815
  startedUnhydrated: needsHydration && !isHydrated
3487
3816
  });
3488
- var hasAnimationProp = !!(!isHOC && "transition" in props || props.style && hasAnimatedStyleValue(props.style)), _animationDriver_inputStyle, inputStyle = (_animationDriver_inputStyle = animationDriver == null ? void 0 : animationDriver.inputStyle) !== null && _animationDriver_inputStyle !== void 0 ? _animationDriver_inputStyle : (animationDriver == null ? void 0 : animationDriver.supportsCSS) ? "css" : "inline", supportsCSS = inputStyle === "css", curStateRef = stateRef.current;
3817
+ var hasAnimationProp = !!(!isHOC && "transition" in props || props.style && hasAnimatedStyleValue(props.style)), _animationDriver_inputStyle, inputStyle = (_animationDriver_inputStyle = animationDriver == null ? void 0 : animationDriver.inputStyle) !== null && _animationDriver_inputStyle !== void 0 ? _animationDriver_inputStyle : "css", _animationDriver_outputStyle, outputStyle = (_animationDriver_outputStyle = animationDriver == null ? void 0 : animationDriver.outputStyle) !== null && _animationDriver_outputStyle !== void 0 ? _animationDriver_outputStyle : "css", curStateRef = stateRef.current;
3489
3818
  !needsHydration && hasAnimationProp && (curStateRef.hasAnimated = true);
3490
3819
  var willBeAnimatedClient = (function() {
3491
3820
  var next = !!(hasAnimationProp && !isHOC && useAnimations);
@@ -3505,11 +3834,11 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
3505
3834
  canImmediatelyEnter ? defaultComponentStateShouldEnter : defaultComponentState
3506
3835
  ) : defaultComponentStateMounted, disabled = isDisabled(props);
3507
3836
  disabled != null && (initialState.disabled = disabled);
3508
- var states2 = React.useState(initialState), state = props.forceStyle ? __spreadProps(__spreadValues({}, states2[0]), {
3837
+ var states2 = React.useState(initialState), state2 = props.forceStyle ? __spreadProps(__spreadValues({}, states2[0]), {
3509
3838
  [props.forceStyle]: true
3510
3839
  }) : states2[0], setState = states2[1], isAnimated = willBeAnimated;
3511
- disabled !== state.disabled && (disabled && Object.assign(state, defaultComponentStateMounted), state.disabled = disabled, setState(function(_2) {
3512
- return __spreadValues({}, state);
3840
+ disabled !== state2.disabled && (disabled && Object.assign(state2, defaultComponentStateMounted), state2.disabled = disabled, setState(function(_2) {
3841
+ return __spreadValues({}, state2);
3513
3842
  }));
3514
3843
  var groupName = props.group, setStateShallow = useCreateShallowSetState(setState, props.debug);
3515
3844
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
@@ -3521,7 +3850,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
3521
3850
  } = presenceState;
3522
3851
  isObj(custom) && Object.assign(props, custom);
3523
3852
  var exv = exitVariant != null ? exitVariant : enterExitVariant, env = enterVariant != null ? enterVariant : enterExitVariant;
3524
- state.unmounted && env && staticConfig.variants[env] ? props[env] = true : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
3853
+ state2.unmounted && env && staticConfig.variants[env] ? props[env] = true : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
3525
3854
  }
3526
3855
  var noClass = !isWeb;
3527
3856
  return {
@@ -3539,9 +3868,10 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
3539
3868
  setState,
3540
3869
  setStateShallow,
3541
3870
  noClass,
3542
- state,
3871
+ state: state2,
3543
3872
  stateRef,
3544
- supportsCSS,
3873
+ inputStyle,
3874
+ outputStyle,
3545
3875
  willBeAnimated,
3546
3876
  willBeAnimatedClient
3547
3877
  };
@@ -3604,8 +3934,9 @@ function createComponent(staticConfig) {
3604
3934
  isText,
3605
3935
  isHOC
3606
3936
  } = staticConfig, component = /* @__PURE__ */ React.forwardRef(function(propsIn, forwardedRef) {
3937
+ "use no memo";
3607
3938
  var _hooks_usePropsTransform;
3608
- config || (config = getConfig());
3939
+ config = config || getConfig();
3609
3940
  if (!hasSetupBaseViews) {
3610
3941
  var _hooks_getBaseViews;
3611
3942
  hasSetupBaseViews = true;
@@ -3613,25 +3944,25 @@ function createComponent(staticConfig) {
3613
3944
  baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
3614
3945
  }
3615
3946
  if (propsIn["data-test-renders"]) {
3616
- var _propsIn_datatestrenders, _current, _2;
3617
- (_2 = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _2 !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
3947
+ var _propsIn_datatestrenders_current;
3948
+ propsIn["data-test-renders"].current = (_propsIn_datatestrenders_current = propsIn["data-test-renders"].current) !== null && _propsIn_datatestrenders_current !== void 0 ? _propsIn_datatestrenders_current : 0, propsIn["data-test-renders"].current += 1;
3618
3949
  }
3619
3950
  var {
3620
3951
  context,
3621
3952
  isReactNative
3622
- } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext);
3953
+ } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext), isInsideNativeMenu = React.useContext(NativeMenuContext);
3623
3954
  var props = propsIn, componentName = props.componentName || staticConfig.componentName, defaultProps = getDefaultProps(staticConfig, props.componentName), [nextProps, overrides] = mergeComponentProps(defaultProps, styledContextValue, propsIn);
3624
3955
  props = nextProps, overriddenContextProps = overrides;
3625
3956
  var groupContextParent = React.useContext(GroupContext), animationDriver = (function() {
3626
- if (props.animatedBy && (config == null ? void 0 : config.animations)) {
3627
- var animations2 = config.animations;
3628
- if ("default" in animations2) {
3629
- var _animations_props_animatedBy;
3630
- return (_animations_props_animatedBy = animations2[props.animatedBy]) !== null && _animations_props_animatedBy !== void 0 ? _animations_props_animatedBy : animations2.default;
3957
+ if (props.animatedBy && config) {
3958
+ if (config.animationDrivers) {
3959
+ var _config_animationDrivers_props_animatedBy;
3960
+ return (_config_animationDrivers_props_animatedBy = config.animationDrivers[props.animatedBy]) !== null && _config_animationDrivers_props_animatedBy !== void 0 ? _config_animationDrivers_props_animatedBy : config.animations;
3631
3961
  }
3632
- return props.animatedBy === "default" ? animations2 : null;
3962
+ return props.animatedBy === "default" ? config.animations : null;
3633
3963
  }
3634
- return componentContext.animationDriver;
3964
+ var _resolveAnimationDriver, _ref;
3965
+ return (_ref = (_resolveAnimationDriver = resolveAnimationDriver(componentContext.animationDriver)) !== null && _resolveAnimationDriver !== void 0 ? _resolveAnimationDriver : resolveAnimationDriver(config == null ? void 0 : config.animations)) !== null && _ref !== void 0 ? _ref : null;
3635
3966
  })(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
3636
3967
  disabled,
3637
3968
  groupName,
@@ -3644,9 +3975,10 @@ function createComponent(staticConfig) {
3644
3975
  presenceState,
3645
3976
  setState,
3646
3977
  noClass,
3647
- state,
3978
+ state: state2,
3648
3979
  stateRef,
3649
- supportsCSS,
3980
+ inputStyle,
3981
+ outputStyle,
3650
3982
  willBeAnimated,
3651
3983
  willBeAnimatedClient,
3652
3984
  startedUnhydrated
@@ -3661,9 +3993,9 @@ function createComponent(staticConfig) {
3661
3993
  var listeners2 = /* @__PURE__ */ new Set();
3662
3994
  return (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || (_stateRef_current_group_listeners = _stateRef_current_group.listeners) === null || _stateRef_current_group_listeners === void 0 || _stateRef_current_group_listeners.clear(), stateRef.current.group = {
3663
3995
  listeners: listeners2,
3664
- emit(state2) {
3996
+ emit(state22) {
3665
3997
  listeners2.forEach(function(l) {
3666
- return l(state2);
3998
+ return l(state22);
3667
3999
  });
3668
4000
  },
3669
4001
  subscribe(cb) {
@@ -3689,12 +4021,8 @@ function createComponent(staticConfig) {
3689
4021
  }
3690
4022
  });
3691
4023
  }, [stateRef, groupName, groupContextParent]), setStateShallow = componentState.setStateShallow;
3692
- var isTaggable = !Component || typeof Component == "string", renderProp = props.render, element = Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || "div", elementType = isText ? BaseTextComponent : BaseViewComponent;
3693
- animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
3694
- // "needsWebStyles" basically with motion we just animate a plain div, but
3695
- // we still have animated.View/Text for Sheet which wants to control
3696
- // things declaratively
3697
- !animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
4024
+ var renderProp = props.render, element = Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || "div", BaseComponent = isText ? BaseTextComponent : BaseViewComponent, elementType = BaseComponent, isAnimatedCustomComponent = animationDriver && isAnimated && animationDriver.needsCustomComponent;
4025
+ isAnimatedCustomComponent && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
3698
4026
  var disableTheme = isHOC;
3699
4027
  var themeStateProps = {
3700
4028
  componentName,
@@ -3712,7 +4040,7 @@ function createComponent(staticConfig) {
3712
4040
  setDidGetVariableValue(false);
3713
4041
  var resolveValues = (
3714
4042
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
3715
- isAnimated && !supportsCSS || isHOC && state.unmounted == false && hasAnimationProp ? "value" : "auto"
4043
+ isAnimated && inputStyle !== "css" || isHOC && state2.unmounted == false && hasAnimationProp ? "value" : "auto"
3716
4044
  ), styleProps = {
3717
4045
  mediaState,
3718
4046
  noClass,
@@ -3722,11 +4050,11 @@ function createComponent(staticConfig) {
3722
4050
  willBeAnimated,
3723
4051
  styledContext: styledContextValue
3724
4052
  }, themeName = (themeState == null ? void 0 : themeState.name) || "";
3725
- var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles, contextForOverride = staticConfig.context;
4053
+ var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state2, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp, animationDriver), isPassthrough = !splitStyles, contextForOverride = staticConfig.context;
3726
4054
  if (splitStyles == null ? void 0 : splitStyles.overriddenContextProps) {
3727
4055
  var _staticConfig_parentStaticConfig, contextForProps = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
3728
4056
  if (contextForProps) {
3729
- for (var key in splitStyles.overriddenContextProps) overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = splitStyles.overriddenContextProps[key];
4057
+ for (var key in splitStyles.overriddenContextProps) overriddenContextProps = overriddenContextProps || {}, overriddenContextProps[key] = splitStyles.overriddenContextProps[key];
3730
4058
  staticConfig.context || (contextForOverride = contextForProps);
3731
4059
  }
3732
4060
  }
@@ -3742,7 +4070,8 @@ function createComponent(staticConfig) {
3742
4070
  });
3743
4071
  }
3744
4072
  }
3745
- if (!isPassthrough && (hasAnimationProp || groupName) && (animationDriver == null ? void 0 : animationDriver.avoidReRenders)) {
4073
+ var hasEnterExitTransition = props.transition && _type_of$1(props.transition) === "object" && !Array.isArray(props.transition) && ("enter" in props.transition || "exit" in props.transition);
4074
+ if (!isPassthrough && (hasAnimationProp || groupName) && (animationDriver == null ? void 0 : animationDriver.avoidReRenders) && !hasEnterExitTransition) {
3746
4075
  let updateGroupListeners2 = function() {
3747
4076
  var updatedState = stateRef.current.nextState;
3748
4077
  if (groupContext) {
@@ -3760,7 +4089,7 @@ function createComponent(staticConfig) {
3760
4089
  notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
3761
4090
  }
3762
4091
  };
3763
- var _componentContext, _componentContext1, ogSetStateShallow = setStateShallow;
4092
+ var ogSetStateShallow = setStateShallow;
3764
4093
  if (stateRef.current.updateStyleListener = function() {
3765
4094
  var useStyleListener = stateRef.current.useStyleListener;
3766
4095
  if (!useStyleListener) {
@@ -3768,11 +4097,11 @@ function createComponent(staticConfig) {
3768
4097
  pendingState && (stateRef.current.nextState = void 0, ogSetStateShallow(pendingState));
3769
4098
  return;
3770
4099
  }
3771
- var updatedState = stateRef.current.nextState || state, mediaState2 = stateRef.current.nextMedia, nextStyles = getSplitStyles(props, staticConfig, theme, themeName, updatedState, mediaState2 ? __spreadProps(__spreadValues({}, styleProps), {
4100
+ var updatedState = stateRef.current.nextState || state2, mediaState2 = stateRef.current.nextMedia, nextStyles = getSplitStyles(props, staticConfig, theme, themeName, updatedState, mediaState2 ? __spreadProps(__spreadValues({}, styleProps), {
3772
4101
  mediaState: mediaState2
3773
- }) : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
3774
- useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
3775
- }, (_componentContext = componentContext).mediaEmitListeners || (_componentContext.mediaEmitListeners = /* @__PURE__ */ new Set()), !stateRef.current.mediaEmitCleanup) {
4102
+ }) : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp, animationDriver), effectiveTransition2 = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, updatedState, nextStyles == null ? void 0 : nextStyles.pseudoTransitions, props.transition);
4103
+ stateRef.current.prevPseudoState = extractPseudoState(updatedState), useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {}, effectiveTransition2);
4104
+ }, componentContext.mediaEmitListeners = componentContext.mediaEmitListeners || /* @__PURE__ */ new Set(), !stateRef.current.mediaEmitCleanup) {
3776
4105
  var updateListener = function(next) {
3777
4106
  var _stateRef_current_updateStyleListener, _stateRef_current;
3778
4107
  stateRef.current.nextMedia = next, (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
@@ -3782,7 +4111,7 @@ function createComponent(staticConfig) {
3782
4111
  (_componentContext_mediaEmitListeners = componentContext.mediaEmitListeners) === null || _componentContext_mediaEmitListeners === void 0 || _componentContext_mediaEmitListeners.delete(updateListener);
3783
4112
  };
3784
4113
  }
3785
- (_componentContext1 = componentContext).mediaEmit || (_componentContext1.mediaEmit = function(next) {
4114
+ componentContext.mediaEmit = componentContext.mediaEmit || function(next) {
3786
4115
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
3787
4116
  try {
3788
4117
  for (var _iterator = componentContext.mediaEmitListeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
@@ -3798,8 +4127,8 @@ function createComponent(staticConfig) {
3798
4127
  if (_didIteratorError) throw _iteratorError;
3799
4128
  }
3800
4129
  }
3801
- }), stateRef.current.setStateShallow = function(nextOrGetNext) {
3802
- var prev = stateRef.current.nextState || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
4130
+ }, stateRef.current.setStateShallow = function(nextOrGetNext) {
4131
+ var prev = stateRef.current.nextState || state2, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
3803
4132
  if (!(next === prev || isEqualShallow(prev, next))) {
3804
4133
  var canAvoidReRender = Object.keys(next).every(function(key3) {
3805
4134
  return avoidReRenderKeys.has(key3);
@@ -3809,18 +4138,12 @@ function createComponent(staticConfig) {
3809
4138
  updateGroupListeners2(), (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
3810
4139
  } else ogSetStateShallow(next);
3811
4140
  }
3812
- }, setStateShallow = function(state2) {
4141
+ }, setStateShallow = function(state22) {
3813
4142
  var _stateRef_current_setStateShallow, _stateRef_current;
3814
- (_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
4143
+ (_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state22);
3815
4144
  };
3816
4145
  }
3817
- if (splitStyles) {
3818
- if (props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured) {
3819
- var _splitStyles;
3820
- (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
3821
- }
3822
- splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
3823
- }
4146
+ splitStyles && (props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style = splitStyles.style || {}, splitStyles.style.opacity = 0), splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess));
3824
4147
  var hasRuntimeMediaKeys = (splitStyles == null ? void 0 : splitStyles.hasMedia) && splitStyles.hasMedia !== true, shouldListenForMedia = didGetVariableValue() || hasRuntimeMediaKeys || noClass && (splitStyles == null ? void 0 : splitStyles.hasMedia) === true, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
3825
4148
  setMediaShouldUpdate(componentContext, shouldListenForMedia, mediaListeningKeys);
3826
4149
  var {
@@ -3877,23 +4200,26 @@ function createComponent(staticConfig) {
3877
4200
  "onClick",
3878
4201
  "theme"
3879
4202
  ]), viewProps = nonTamaguiProps;
3880
- !isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)), renderProp && elementType.acceptTagProp && (viewProps.render = renderProp);
4203
+ props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough));
3881
4204
  var animationStyles, shouldUseAnimation = (
3882
4205
  // if it supports css vars we run it on server too to get matching initial style
3883
- (supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
4206
+ (inputStyle === "css" ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
3884
4207
  ), animatedRef;
3885
4208
  if (shouldUseAnimation) {
3886
4209
  var useStyleEmitter = (animationDriver == null ? void 0 : animationDriver.avoidReRenders) ? function(listener) {
3887
4210
  stateRef.current.useStyleListener = listener;
3888
- } : void 0, animations = useAnimations({
4211
+ } : void 0, effectiveTransition = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, state2, splitStyles == null ? void 0 : splitStyles.pseudoTransitions, props.transition);
4212
+ splitStyles && (splitStyles.effectiveTransition = effectiveTransition), stateRef.current.prevPseudoState = extractPseudoState(state2);
4213
+ var animations = useAnimations({
3889
4214
  props: propsWithAnimation,
3890
- // if hydrating, send empty style
3891
- style: splitStylesStyle || {},
4215
+ // clone style to prevent animation driver mutations from leaking to viewProps
4216
+ // during SSR/pre-hydration (CSS driver mutates style.transition in place)
4217
+ style: isHydrated ? splitStylesStyle || {} : __spreadValues({}, splitStylesStyle),
3892
4218
  // @ts-ignore
3893
4219
  styleState: splitStyles,
3894
4220
  useStyleEmitter,
3895
4221
  presence,
3896
- componentState: state,
4222
+ componentState: state2,
3897
4223
  styleProps,
3898
4224
  theme,
3899
4225
  themeName,
@@ -3901,7 +4227,7 @@ function createComponent(staticConfig) {
3901
4227
  staticConfig,
3902
4228
  stateRef
3903
4229
  });
3904
- animations && (animations.ref && (animatedRef = animations.ref), isHydrated && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`)));
4230
+ animations && (animations.ref && (animatedRef = animations.ref), isHydrated && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state2.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`)));
3905
4231
  }
3906
4232
  !isPassthrough && groupContext && // avoids onLayout if we don't need it
3907
4233
  props.containerType !== "normal" && (nonTamaguiProps.onLayout = composeEventHandlers(nonTamaguiProps.onLayout, function(e) {
@@ -3921,14 +4247,14 @@ function createComponent(staticConfig) {
3921
4247
  });
3922
4248
  };
3923
4249
  useIsomorphicLayoutEffect(function() {
3924
- if (state.unmounted === true && hasEnterStyle) {
4250
+ if (state2.unmounted === true && hasEnterStyle) {
3925
4251
  setStateShallow({
3926
4252
  unmounted: "should-enter"
3927
4253
  });
3928
4254
  return;
3929
4255
  }
3930
- if (state.unmounted) {
3931
- if (supportsCSS) {
4256
+ if (state2.unmounted) {
4257
+ if (inputStyle === "css") {
3932
4258
  var cancelled = false;
3933
4259
  return requestAnimationFrame(function() {
3934
4260
  cancelled || requestAnimationFrame(function() {
@@ -3948,7 +4274,7 @@ function createComponent(staticConfig) {
3948
4274
  var _stateRef_current_mediaEmitCleanup, _stateRef_current;
3949
4275
  componentSetStates.delete(setState), (_stateRef_current_mediaEmitCleanup = (_stateRef_current = stateRef.current).mediaEmitCleanup) === null || _stateRef_current_mediaEmitCleanup === void 0 || _stateRef_current_mediaEmitCleanup.call(_stateRef_current);
3950
4276
  };
3951
- }, [state.unmounted, supportsCSS]), useIsomorphicLayoutEffect(function() {
4277
+ }, [state2.unmounted, inputStyle]), useIsomorphicLayoutEffect(function() {
3952
4278
  if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return subscribeToContextGroup({
3953
4279
  groupContext: allGroupContexts,
3954
4280
  setStateShallow,
@@ -3958,9 +4284,9 @@ function createComponent(staticConfig) {
3958
4284
  }, [allGroupContexts, disabled, pseudoGroups ? objectIdentityKey(pseudoGroups) : 0, mediaGroups ? objectIdentityKey(mediaGroups) : 0]);
3959
4285
  var groupEmitter = stateRef.current.group;
3960
4286
  useIsomorphicLayoutEffect(function() {
3961
- !groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
3962
- }, [groupContext, groupEmitter, state]);
3963
- 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 || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || (pseudos == null ? void 0 : pseudos.focusVisibleStyle)), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = isWeb, shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle);
4287
+ !groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state2);
4288
+ }, [groupContext, groupEmitter, state2]);
4289
+ 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 || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state2.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || (pseudos == null ? void 0 : pseudos.focusVisibleStyle)), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = isWeb, shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle);
3964
4290
  var events = shouldAttach ? __spreadValues(__spreadValues(__spreadProps(__spreadValues({
3965
4291
  onPressOut: attachPress ? function(e) {
3966
4292
  unPress(), onPressOut == null ? void 0 : onPressOut(e), onMouseUp == null ? void 0 : onMouseUp(e);
@@ -3968,7 +4294,7 @@ function createComponent(staticConfig) {
3968
4294
  }, attachPress && {
3969
4295
  onMouseEnter: function(e) {
3970
4296
  var next = {};
3971
- needsHoverState && true && (next.hover = true), needsPressState && state.pressIn && (next.press = true), setStateShallow(next), onHoverIn == null ? void 0 : onHoverIn(e), onMouseEnter == null ? void 0 : onMouseEnter(e);
4297
+ needsHoverState && true && (next.hover = true), needsPressState && state2.pressIn && (next.press = true), setStateShallow(next), onHoverIn == null ? void 0 : onHoverIn(e), onMouseEnter == null ? void 0 : onMouseEnter(e);
3972
4298
  },
3973
4299
  onMouseLeave: function(e) {
3974
4300
  var next = {};
@@ -3991,7 +4317,9 @@ function createComponent(staticConfig) {
3991
4317
  }), attachFocus && {
3992
4318
  onFocus: function(e) {
3993
4319
  var next = {};
3994
- componentContext.setParentFocusState && (next.focusWithin = true), (pseudos == null ? void 0 : pseudos.focusVisibleStyle) && lastInteractionWasKeyboard.value ? next.focusVisible = true : next.focus = true, setStateShallow(next), onFocus == null ? void 0 : onFocus(e);
4320
+ componentContext.setParentFocusState && (componentContext.setParentFocusState({
4321
+ focusWithin: true
4322
+ }), next.focusWithin = true), (pseudos == null ? void 0 : pseudos.focusVisibleStyle) && lastInteractionWasKeyboard.value ? next.focusVisible = true : next.focus = true, setStateShallow(next), onFocus == null ? void 0 : onFocus(e);
3995
4323
  },
3996
4324
  onBlur: function(e) {
3997
4325
  componentContext.setParentFocusState && componentContext.setParentFocusState({
@@ -4016,29 +4344,27 @@ function createComponent(staticConfig) {
4016
4344
  minPressDuration: 0
4017
4345
  });
4018
4346
  }
4019
- var pressGesture = useEvents(events, viewProps, stateRef, staticConfig, isHOC);
4020
- var content = children;
4347
+ var pressGesture = useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu);
4021
4348
  if (asChild) if (elementType = Slot, 0) ;
4022
4349
  else Object.assign(viewProps, {
4023
4350
  onPress,
4024
4351
  onLongPress
4025
4352
  });
4026
- isPassthrough && (content = propsIn.children, elementType = BaseViewComponent, viewProps = {
4353
+ var content;
4354
+ if (isPassthrough) content = /* @__PURE__ */ React.createElement(BaseComponent, {
4027
4355
  style: {
4028
4356
  display: "contents"
4029
4357
  }
4030
- });
4031
- var useChildrenResult;
4032
- if (hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps)), useChildrenResult) content = useChildrenResult;
4033
- else if (typeof renderProp == "function") {
4034
- var renderProps = __spreadProps(__spreadValues({}, viewProps), {
4035
- children: content
4036
- });
4037
- content = renderProp(renderProps, state);
4038
- } else if (renderProp && (typeof renderProp > "u" ? "undefined" : _type_of$1(renderProp)) === "object" && /* @__PURE__ */ React.isValidElement(renderProp)) {
4039
- var elementProps = renderProp.props || {}, mergedProps = mergeRenderElementProps(elementProps, viewProps, content);
4040
- content = /* @__PURE__ */ React.cloneElement(renderProp, mergedProps);
4041
- } else content = /* @__PURE__ */ React.createElement(elementType, viewProps, content);
4358
+ }, propsIn.children);
4359
+ else {
4360
+ hooks.useChildren && (content = hooks.useChildren(elementType, content || children, viewProps));
4361
+ var isRenderPropString = typeof renderProp == "string";
4362
+ if (renderProp && !isRenderPropString) {
4363
+ var out = getCustomRender(renderProp, content || children, viewProps, componentState);
4364
+ out && (viewProps = out.viewProps, elementType = out.elementType);
4365
+ }
4366
+ content || (isRenderPropString && viewProps.render, content = /* @__PURE__ */ React.createElement(elementType, viewProps, content || children));
4367
+ }
4042
4368
  content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC);
4043
4369
  var ResetPresence = animationDriver == null ? void 0 : animationDriver.ResetPresence, needsReset = !!// not when passing down to child
4044
4370
  (!asChild && // not when passThrough
@@ -4049,7 +4375,7 @@ function createComponent(staticConfig) {
4049
4375
  if (renderReset && ResetPresence && (content = /* @__PURE__ */ jsxRuntime.jsx(ResetPresence, {
4050
4376
  disabled: !needsReset,
4051
4377
  children: content
4052
- })), "focusWithinStyle" in propsIn && (content = /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, __spreadProps(__spreadValues({}, componentContext), {
4378
+ })), ("focusWithinStyle" in propsIn || (pseudos == null ? void 0 : pseudos.focusWithinStyle)) && (content = /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, __spreadProps(__spreadValues({}, componentContext), {
4053
4379
  setParentFocusState: setStateShallow,
4054
4380
  children: content
4055
4381
  }))), "group" in props && (content = /* @__PURE__ */ jsxRuntime.jsx(GroupContext.Provider, {
@@ -4092,7 +4418,28 @@ function createComponent(staticConfig) {
4092
4418
  }
4093
4419
  var fromPx = function(val) {
4094
4420
  return typeof val == "number" ? val : typeof val == "string" ? +val.replace("px", "") : 0;
4421
+ }, getCustomRender = function(renderProp, content, viewProps, state2) {
4422
+ if (typeof renderProp == "function") {
4423
+ var out = renderProp(viewProps, state2);
4424
+ renderProp = getRenderElementForPlatform(out);
4425
+ }
4426
+ if (renderProp && (typeof renderProp > "u" ? "undefined" : _type_of$1(renderProp)) === "object" && /* @__PURE__ */ React.isValidElement(renderProp)) {
4427
+ var renderElement = getRenderElementForPlatform(renderProp);
4428
+ if (renderElement) {
4429
+ var elementProps = renderProp.props, mergedProps = elementProps ? mergeRenderElementProps(elementProps, viewProps, content) : viewProps;
4430
+ return {
4431
+ elementType: renderProp.type,
4432
+ viewProps: mergedProps
4433
+ };
4434
+ }
4435
+ }
4095
4436
  };
4437
+ function getRenderElementForPlatform(potential) {
4438
+ if (!isHTMLElement(potential)) return potential;
4439
+ }
4440
+ function isHTMLElement(el) {
4441
+ return typeof el.type == "string" && el.type[0] === el.type[0].toLowerCase();
4442
+ }
4096
4443
  function getExpandedShorthands(props) {
4097
4444
  var shorthands = getConfig().shorthands;
4098
4445
  if (!shorthands) return props;
@@ -4118,6 +4465,18 @@ var registerCSSVariable = function(v) {
4118
4465
  var unitless = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
4119
4466
  return process.env.TAMAGUI_DID_OUTPUT_CSS ? "" : `--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${createCSSVariable(v.name, false)}:${!unitless && typeof v.val == "number" ? `${v.val}px` : v.val}`;
4120
4467
  }, tokensValueToVariable = /* @__PURE__ */ new Map(), autoVariables = [], mutatedAutoVariables = [];
4468
+ function scanAllSheets() {
4469
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
4470
+ return;
4471
+ }
4472
+ }
4473
+ process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES;
4474
+ function setNonce(_2) {
4475
+ }
4476
+ function insertStyleRules(rulesToInsert) {
4477
+ return;
4478
+ }
4479
+ process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
4121
4480
  function isTamaguiComponent(comp, name) {
4122
4481
  var config = comp == null ? void 0 : comp.staticConfig;
4123
4482
  return !!(config && (!name || name === config.componentName));
@@ -4236,6 +4595,8 @@ function ensureThemeVariable(theme, key) {
4236
4595
  val
4237
4596
  });
4238
4597
  }
4598
+ function getStyleTags(styles) {
4599
+ }
4239
4600
  var fontWeights = ["100", "200", "300", "400", "500", "600", "700", "800", "900"], processSection = function(section, keys, defaultValue2) {
4240
4601
  if (typeof section == "string") return section;
4241
4602
  var sectionKeys = Object.keys(section), fillValue = section[sectionKeys[0]];
@@ -4297,10 +4658,8 @@ var noAnimationDriver = function(method) {
4297
4658
  }, createEmptyAnimationDriver = function() {
4298
4659
  return {
4299
4660
  isReactNative: false,
4300
- supportsCSS: true,
4301
4661
  inputStyle: "css",
4302
4662
  outputStyle: "css",
4303
- classNameAnimation: true,
4304
4663
  isStub: true,
4305
4664
  animations: {},
4306
4665
  useAnimations: function() {
@@ -4323,6 +4682,19 @@ var noAnimationDriver = function(method) {
4323
4682
  }
4324
4683
  };
4325
4684
  }, defaultAnimationDriver = createEmptyAnimationDriver();
4685
+ function getFontPropertyDeclarations(fontParsed) {
4686
+ var tokenKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "$true", props = ["font-family: var(--f-family)"], getVarRef = function(obj) {
4687
+ var val = obj == null ? void 0 : obj[tokenKey];
4688
+ if (isVariable(val)) return getVariableVariable(val);
4689
+ }, letterSpacing = getVarRef(fontParsed.letterSpacing);
4690
+ letterSpacing && props.push(`letter-spacing: ${letterSpacing}`);
4691
+ var lineHeight = getVarRef(fontParsed.lineHeight);
4692
+ lineHeight && props.push(`line-height: ${lineHeight}`);
4693
+ var fontStyle = getVarRef(fontParsed.style);
4694
+ fontStyle && props.push(`font-style: ${fontStyle}`);
4695
+ var fontWeight = getVarRef(fontParsed.weight);
4696
+ return fontWeight && props.push(`font-weight: ${fontWeight}`), props;
4697
+ }
4326
4698
  function createTokenCSS(tokens, shouldTokenCategoryHaveUnits2) {
4327
4699
  if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
4328
4700
  var declarations = [], sortedTokenKeys = Object.keys(tokens).sort(), _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
@@ -4369,7 +4741,8 @@ function createFontCSS(fontsParsed, registerFontVariables2) {
4369
4741
  fontDeclarations[key] = {
4370
4742
  name: name.slice(1),
4371
4743
  declarations: fontVars,
4372
- language
4744
+ language,
4745
+ fontParsed
4373
4746
  };
4374
4747
  }
4375
4748
  } catch (err) {
@@ -4386,6 +4759,7 @@ function createFontCSS(fontsParsed, registerFontVariables2) {
4386
4759
  return {};
4387
4760
  }
4388
4761
  function buildCSSRuleSets(declarations, fontDeclarations) {
4762
+ var defaultFontToken = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "$true";
4389
4763
  if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
4390
4764
  let declarationsToRuleSet2 = function(decs) {
4391
4765
  var selector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
@@ -4394,14 +4768,16 @@ function buildCSSRuleSets(declarations, fontDeclarations) {
4394
4768
  };
4395
4769
  var cssRuleSets = [], sep = " ";
4396
4770
  declarations.length && cssRuleSets.push(declarationsToRuleSet2(declarations));
4397
- var sortedFontDeclarationKeys = Object.keys(fontDeclarations).sort(), _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
4771
+ var fontSelectors = [], sortedFontDeclarationKeys = Object.keys(fontDeclarations).sort(), _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
4398
4772
  try {
4399
4773
  for (var _iterator = sortedFontDeclarationKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4400
4774
  var key = _step.value, {
4401
4775
  name,
4402
4776
  declarations: _$declarations,
4403
4777
  language = "default"
4404
- } = fontDeclarations[key], fontSelector = `.font_${name}`, langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`, selectors2 = language === "default" ? ` ${fontSelector}, ${langSelector}` : langSelector, specificRuleSet = declarationsToRuleSet2(_$declarations, selectors2);
4778
+ } = fontDeclarations[key], fontSelector = `.font_${name}`;
4779
+ fontSelectors.push(fontSelector);
4780
+ var langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`, selectors2 = language === "default" ? ` ${fontSelector}, ${langSelector}` : langSelector, specificRuleSet = declarationsToRuleSet2(_$declarations, selectors2);
4405
4781
  cssRuleSets.push(specificRuleSet);
4406
4782
  }
4407
4783
  } catch (err) {
@@ -4413,6 +4789,13 @@ function buildCSSRuleSets(declarations, fontDeclarations) {
4413
4789
  if (_didIteratorError) throw _iteratorError;
4414
4790
  }
4415
4791
  }
4792
+ if (fontSelectors.length) {
4793
+ var firstFont = fontDeclarations[sortedFontDeclarationKeys[0]];
4794
+ if (firstFont == null ? void 0 : firstFont.fontParsed) {
4795
+ var fontProps = getFontPropertyDeclarations(firstFont.fontParsed, defaultFontToken), sharedSelectors = [...fontSelectors, ".is_View"].join(", ");
4796
+ cssRuleSets.push(`${sharedSelectors} {${fontProps.join("; ")}}`);
4797
+ }
4798
+ }
4416
4799
  return cssRuleSets;
4417
4800
  }
4418
4801
  return [];
@@ -4557,17 +4940,15 @@ function createTamagui$1(configIn) {
4557
4940
  return (val2 == null ? void 0 : val2[0]) === "$" && (val2 = val2.slice(1)), val2;
4558
4941
  })();
4559
4942
  ((_configIn_settings1 = configIn.settings) === null || _configIn_settings1 === void 0 ? void 0 : _configIn_settings1.defaultPosition) || "static";
4560
- var defaultProps = configIn.defaultProps || {}, defaultFontToken = defaultFont ? `$${defaultFont}` : "";
4561
- defaultFont && (defaultProps.Text = __spreadProps(__spreadValues({}, defaultProps.Text), {
4562
- fontFamily: defaultFontToken
4563
- }));
4564
- var config = __spreadProps(__spreadValues({
4943
+ var defaultProps = configIn.defaultProps || {}, defaultFontToken = defaultFont ? `$${defaultFont}` : "", inputAnimations = configIn.animations, resolvedDriver = resolveAnimationDriver(inputAnimations), isMultiDriver = resolvedDriver !== null && resolvedDriver !== inputAnimations, resolvedAnimations = resolvedDriver != null ? resolvedDriver : inputAnimations, animationDrivers = isMultiDriver ? inputAnimations : void 0, config = __spreadProps(__spreadValues({
4565
4944
  fonts: {},
4566
4945
  onlyAllowShorthands: false,
4567
4946
  fontLanguages: [],
4568
- animations: defaultAnimationDriver,
4569
4947
  media: {}
4570
4948
  }, configIn), {
4949
+ // normalized animations (resolved from multi-driver format if needed)
4950
+ animations: resolvedAnimations != null ? resolvedAnimations : defaultAnimationDriver,
4951
+ animationDrivers,
4571
4952
  defaultProps,
4572
4953
  settings: __spreadValues({
4573
4954
  webContainerType: "inline-size"
@@ -4791,7 +5172,6 @@ var useIsTouchDevice = function() {
4791
5172
  };
4792
5173
  var View$1 = createComponent({
4793
5174
  acceptsClassName: true,
4794
- defaultProps: viewDefaultStyles,
4795
5175
  validStyles
4796
5176
  });
4797
5177
  function useProps(props, opts) {
@@ -4813,13 +5193,13 @@ function usePropsAndStyle(props, opts) {
4813
5193
  return true;
4814
5194
  }
4815
5195
  }), componentContext = React.useContext(ComponentContext), groupContext = React.useContext(GroupContext), {
4816
- state,
5196
+ state: state2,
4817
5197
  disabled,
4818
5198
  setStateShallow
4819
5199
  } = useComponentState(props, componentContext.animationDriver, staticConfig, getConfig()), mediaStateNow = (opts == null ? void 0 : opts.noMedia) ? (
4820
5200
  // not safe to use mediaState but really marginal to hit this
4821
5201
  exports.mediaState
4822
- ) : useMedia(), splitStyles = useSplitStyles(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, __spreadValues({
5202
+ ) : useMedia(), splitStyles = useSplitStyles(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state2, __spreadValues({
4823
5203
  isAnimated: false,
4824
5204
  mediaState: mediaStateNow,
4825
5205
  noSkip: true,
@@ -4832,7 +5212,7 @@ function usePropsAndStyle(props, opts) {
4832
5212
  } = splitStyles || {};
4833
5213
  return useIsomorphicLayoutEffect(function() {
4834
5214
  if (!disabled) {
4835
- if (state.unmounted) {
5215
+ if (state2.unmounted) {
4836
5216
  setStateShallow({
4837
5217
  unmounted: false
4838
5218
  });
@@ -4867,6 +5247,9 @@ var Configuration = function(props) {
4867
5247
  children: /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, __spreadValues(__spreadValues({}, current), props))
4868
5248
  });
4869
5249
  };
5250
+ function TamaguiRoot(props) {
5251
+ return props.children;
5252
+ }
4870
5253
  function FontLanguage(param) {
4871
5254
  var _a = param, {
4872
5255
  children
@@ -4881,6 +5264,7 @@ function FontLanguage(param) {
4881
5264
  }));
4882
5265
  }
4883
5266
  var ThemeProvider = function(props) {
5267
+ "use no memo";
4884
5268
  var addThemeClassName = getSetting("addThemeClassName"), forceClassName = addThemeClassName === void 0;
4885
5269
  return /* @__PURE__ */ jsxRuntime.jsx(Theme, {
4886
5270
  className: props.className,
@@ -4891,37 +5275,42 @@ var ThemeProvider = function(props) {
4891
5275
  children: props.children
4892
5276
  });
4893
5277
  };
5278
+ var _cachedFirstKey, _cachedConfig;
5279
+ function firstThemeKey(config) {
5280
+ return config !== _cachedConfig && (_cachedConfig = config, _cachedFirstKey = (config == null ? void 0 : config.themes) ? Object.keys(config.themes)[0] : void 0), _cachedFirstKey;
5281
+ }
4894
5282
  function TamaguiProvider$1(param) {
4895
5283
  var {
4896
5284
  children,
4897
5285
  disableInjectCSS,
4898
5286
  config,
4899
5287
  className,
4900
- defaultTheme,
5288
+ defaultTheme: defaultThemeProp,
4901
5289
  reset,
4902
5290
  insets
4903
- } = param;
5291
+ } = param, defaultTheme = defaultThemeProp || firstThemeKey(config) || "light";
4904
5292
  useIsomorphicLayoutEffect(function() {
4905
5293
  updateMediaListeners();
4906
5294
  }, []);
4907
5295
  var memoizedInsets = React.useMemo(function() {
4908
5296
  return insets;
4909
5297
  }, [insets == null ? void 0 : insets.top, insets == null ? void 0 : insets.right, insets == null ? void 0 : insets.bottom, insets == null ? void 0 : insets.left]), defaultAnimationDriver2 = React.useMemo(function() {
4910
- var animations = config == null ? void 0 : config.animations;
4911
- return animations ? "default" in animations ? animations.default : animations : null;
5298
+ return resolveAnimationDriver(config == null ? void 0 : config.animations);
4912
5299
  }, [config == null ? void 0 : config.animations]);
4913
5300
  React.useEffect(function() {
4914
5301
  var _defaultAnimationDriver_onMount;
4915
5302
  defaultAnimationDriver2 == null || (_defaultAnimationDriver_onMount = defaultAnimationDriver2.onMount) === null || _defaultAnimationDriver_onMount === void 0 || _defaultAnimationDriver_onMount.call(defaultAnimationDriver2);
4916
5303
  }, []);
4917
- var contents = /* @__PURE__ */ jsxRuntime.jsx(UnmountedClassName, {
4918
- children: /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, {
4919
- animationDriver: defaultAnimationDriver2,
4920
- insets: memoizedInsets,
4921
- children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, {
4922
- defaultTheme,
4923
- reset,
4924
- className,
5304
+ var contents = /* @__PURE__ */ jsxRuntime.jsx(ComponentContext.Provider, {
5305
+ animationDriver: defaultAnimationDriver2,
5306
+ insets: memoizedInsets,
5307
+ children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, {
5308
+ defaultTheme,
5309
+ reset,
5310
+ className,
5311
+ children: /* @__PURE__ */ jsxRuntime.jsx(TamaguiRoot, {
5312
+ theme: defaultTheme,
5313
+ isRootRoot: true,
4925
5314
  children
4926
5315
  })
4927
5316
  })
@@ -4933,13 +5322,6 @@ function TamaguiProvider$1(param) {
4933
5322
  children: [contents, false]
4934
5323
  });
4935
5324
  }
4936
- function UnmountedClassName(props) {
4937
- var [mounted, setMounted] = React.useState(false);
4938
- if (React.useEffect(function() {
4939
- setMounted(true);
4940
- }, []), !isWeb) return props.children;
4941
- }
4942
- TamaguiProvider$1.displayName = "TamaguiProvider";
4943
5325
  var ellipsisStyle = {
4944
5326
  numberOfLines: 1,
4945
5327
  lineBreakMode: "clip"
@@ -4958,10 +5340,10 @@ var ellipsisStyle = {
4958
5340
  },
4959
5341
  validStyles: __spreadValues(__spreadValues({}, validStyles), stylePropsTextOnly)
4960
5342
  });
4961
- Text$1.displayName = "Text";
5343
+ var isServer = typeof window > "u", useIsomorphicInsertionEffect = isServer ? React__namespace.useEffect : React__namespace.useInsertionEffect || React__namespace.useLayoutEffect;
4962
5344
  function useGet(currentValue, initialValue, forwardToFunction) {
4963
5345
  var curRef = React__namespace.useRef(initialValue != null ? initialValue : currentValue);
4964
- return useIsomorphicLayoutEffect(function() {
5346
+ return useIsomorphicInsertionEffect(function() {
4965
5347
  curRef.current = currentValue;
4966
5348
  }), React__namespace.useCallback(forwardToFunction ? function() {
4967
5349
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
@@ -5167,6 +5549,7 @@ var matchMedia = function(query) {
5167
5549
  function createMedia(media) {
5168
5550
  return setupMatchMedia(matchMedia), media;
5169
5551
  }
5552
+ var LayoutHandlers = /* @__PURE__ */ new WeakMap(), LayoutDisableKey = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), IntersectionState = /* @__PURE__ */ new WeakMap();
5170
5553
  var DisableLayoutContextKey = /* @__PURE__ */ React.createContext(""), LayoutMeasurementController = function(param) {
5171
5554
  var {
5172
5555
  disable,
@@ -5178,14 +5561,22 @@ var DisableLayoutContextKey = /* @__PURE__ */ React.createContext(""), LayoutMea
5178
5561
  children
5179
5562
  });
5180
5563
  };
5181
- function setOnLayoutStrategy(state) {
5564
+ function setOnLayoutStrategy(state2) {
5182
5565
  }
5183
- var avoidUpdates = true, queuedUpdates = /* @__PURE__ */ new Map();
5566
+ var NodeRectCache = /* @__PURE__ */ new WeakMap(), avoidUpdates = true, queuedUpdates = /* @__PURE__ */ new Map();
5184
5567
  function enable() {
5185
5568
  avoidUpdates && (avoidUpdates = false, queuedUpdates && (queuedUpdates.forEach(function(cb) {
5186
5569
  return cb();
5187
5570
  }), queuedUpdates.clear()));
5188
5571
  }
5572
+ function registerLayoutNode(node, onChange, disableKey) {
5573
+ return Nodes.add(node), LayoutHandlers.set(node, onChange), disableKey && LayoutDisableKey.set(node, disableKey), function() {
5574
+ return cleanupNode(node);
5575
+ };
5576
+ }
5577
+ function cleanupNode(node) {
5578
+ Nodes.delete(node), LayoutHandlers.delete(node), LayoutDisableKey.delete(node), NodeRectCache.delete(node), IntersectionState.delete(node);
5579
+ }
5189
5580
  function getBaseViews() {
5190
5581
  var _a, _b, _c, _d;
5191
5582
  const native = require("react-native");
@@ -5249,6 +5640,7 @@ exports.THEME_CLASSNAME_PREFIX = THEME_CLASSNAME_PREFIX;
5249
5640
  exports.THEME_NAME_SEPARATOR = THEME_NAME_SEPARATOR;
5250
5641
  exports.Tamagui = Tamagui;
5251
5642
  exports.TamaguiProvider = TamaguiProvider;
5643
+ exports.TamaguiRoot = TamaguiRoot;
5252
5644
  exports.Text = Text;
5253
5645
  exports.Theme = Theme;
5254
5646
  exports.ThemeProvider = ThemeProvider;
@@ -5271,10 +5663,12 @@ exports.createTamagui = createTamagui;
5271
5663
  exports.createTokens = createTokens;
5272
5664
  exports.createVariable = createVariable;
5273
5665
  exports.createVariables = createVariables;
5666
+ exports.cssShorthandLonghands = cssShorthandLonghands;
5274
5667
  exports.currentPlatform = currentPlatform;
5275
5668
  exports.defaultMediaImportance = defaultMediaImportance;
5276
5669
  exports.didGetVariableValue = didGetVariableValue;
5277
5670
  exports.ensureThemeVariable = ensureThemeVariable;
5671
+ exports.extractPseudoState = extractPseudoState;
5278
5672
  exports.fixStyles = fixStyles;
5279
5673
  exports.forceUpdateThemes = forceUpdateThemes;
5280
5674
  exports.getCSSStylesAtomic = getCSSStylesAtomic;
@@ -5315,7 +5709,7 @@ exports.isChrome = isChrome;
5315
5709
  exports.isClient = isClient;
5316
5710
  exports.isEqualShallow = isEqualShallow;
5317
5711
  exports.isIos = isIos;
5318
- exports.isServer = isServer;
5712
+ exports.isServer = isServer$1;
5319
5713
  exports.isTamaguiComponent = isTamaguiComponent;
5320
5714
  exports.isTamaguiElement = isTamaguiElement;
5321
5715
  exports.isTouchable = isTouchable;
@@ -5333,6 +5727,9 @@ exports.mergeIfNotShallowEqual = mergeIfNotShallowEqual;
5333
5727
  exports.mergeProps = mergeProps;
5334
5728
  exports.mergeSlotStyleProps = mergeSlotStyleProps;
5335
5729
  exports.mutatedAutoVariables = mutatedAutoVariables;
5730
+ exports.nonAnimatableStyleProps = nonAnimatableStyleProps;
5731
+ exports.nonAnimatableWebTextProps = nonAnimatableWebTextProps;
5732
+ exports.nonAnimatableWebViewProps = nonAnimatableWebViewProps;
5336
5733
  exports.normalizeColor = normalizeColor;
5337
5734
  exports.normalizeStyle = normalizeStyle$1;
5338
5735
  exports.normalizeValueWithProperty = normalizeValueWithProperty;
@@ -5346,7 +5743,9 @@ exports.pseudoDescriptorsBase = pseudoDescriptorsBase;
5346
5743
  exports.pseudoPriorities = pseudoPriorities;
5347
5744
  exports.px = px;
5348
5745
  exports.registerFontVariables = registerFontVariables;
5746
+ exports.registerLayoutNode = registerLayoutNode;
5349
5747
  exports.resetMediaStyleCache = resetMediaStyleCache;
5748
+ exports.resolveEffectivePseudoTransition = resolveEffectivePseudoTransition;
5350
5749
  exports.rgba = rgba;
5351
5750
  exports.setConfig = setConfig;
5352
5751
  exports.setDidGetVariableValue = setDidGetVariableValue;
@@ -5395,8 +5794,6 @@ exports.useThemeWithState = useThemeWithState;
5395
5794
  exports.validPseudoKeys = validPseudoKeys;
5396
5795
  exports.validStyles = validStyles;
5397
5796
  exports.variableToString = variableToString;
5398
- exports.viewDefaultStyles = viewDefaultStyles;
5399
5797
  exports.webOnlyStylePropsText = webOnlyStylePropsText;
5400
5798
  exports.webOnlyStylePropsView = webOnlyStylePropsView;
5401
- exports.webViewFlexCompatStyles = webViewFlexCompatStyles;
5402
5799
  exports.withStaticProperties = withStaticProperties;