tamagui 1.74.16 → 1.74.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/setup.js CHANGED
@@ -1,46 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var setup_exports = {};
24
- __export(setup_exports, {
25
- idFn: () => idFn
26
- });
27
- module.exports = __toCommonJS(setup_exports);
28
- var import_polyfill_dev = require("@tamagui/polyfill-dev"), React = __toESM(require("react"));
29
- globalThis.React = React;
1
+ var import_polyfill_dev = require("@tamagui/polyfill-dev");
30
2
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
31
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
32
- typeof globalThis > "u" ? console.warn(
33
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
34
- ) : globalThis.cancelAnimationFrame = (x) => {
35
- try {
36
- cancelAnimationFrame(x);
37
- } catch {
38
- }
39
- };
40
- const idFn = () => {
41
- };
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
44
- idFn
45
- });
46
3
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO,kCAEP,QAAuB;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": "AAAA,0BAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
@@ -1,47 +1,4 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var setup_exports = {};
25
- __export(setup_exports, {
26
- idFn: () => idFn
27
- });
28
- module.exports = __toCommonJS(setup_exports);
29
- var import_polyfill_dev = require("@tamagui/polyfill-dev"), React = __toESM(require("react"));
30
- globalThis.React = React;
2
+ var import_polyfill_dev = require("@tamagui/polyfill-dev");
31
3
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
32
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
33
- typeof globalThis > "u" ? console.warn(
34
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
35
- ) : globalThis.cancelAnimationFrame = (x) => {
36
- try {
37
- cancelAnimationFrame(x);
38
- } catch {
39
- }
40
- };
41
- const idFn = () => {
42
- };
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
45
- idFn
46
- });
47
4
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO,kCAEP,QAAuB;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": ";AAAA,0BAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
package/dist/esm/setup.js CHANGED
@@ -1,19 +1,3 @@
1
1
  import "@tamagui/polyfill-dev";
2
- import * as React from "react";
3
- globalThis.React = React;
4
2
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
5
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
6
- typeof globalThis > "u" ? console.warn(
7
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
8
- ) : globalThis.cancelAnimationFrame = (x) => {
9
- try {
10
- cancelAnimationFrame(x);
11
- } catch {
12
- }
13
- };
14
- const idFn = () => {
15
- };
16
- export {
17
- idFn
18
- };
19
3
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": "AAAA,OAAO;AAEP,YAAY,WAAW;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": "AAAA,OAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
@@ -1,19 +1,3 @@
1
1
  import "@tamagui/polyfill-dev";
2
- import * as React from "react";
3
- globalThis.React = React;
4
2
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
5
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
6
- typeof globalThis > "u" ? console.warn(
7
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
8
- ) : globalThis.cancelAnimationFrame = (x) => {
9
- try {
10
- cancelAnimationFrame(x);
11
- } catch {
12
- }
13
- };
14
- const idFn = () => {
15
- };
16
- export {
17
- idFn
18
- };
19
3
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": "AAAA,OAAO;AAEP,YAAY,WAAW;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": "AAAA,OAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
package/dist/jsx/setup.js CHANGED
@@ -1,19 +1,3 @@
1
1
  import "@tamagui/polyfill-dev";
2
- import * as React from "react";
3
- globalThis.React = React;
4
2
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
5
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
6
- typeof globalThis > "u" ? console.warn(
7
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
8
- ) : globalThis.cancelAnimationFrame = (x) => {
9
- try {
10
- cancelAnimationFrame(x);
11
- } catch {
12
- }
13
- };
14
- const idFn = () => {
15
- };
16
- export {
17
- idFn
18
- };
19
3
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": "AAAA,OAAO;AAEP,YAAY,WAAW;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": "AAAA,OAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
@@ -1,19 +1,3 @@
1
1
  import "@tamagui/polyfill-dev";
2
- import * as React from "react";
3
- globalThis.React = React;
4
2
  typeof requestAnimationFrame > "u" && (globalThis.requestAnimationFrame = setImmediate);
5
- const cancelAnimationFrame = globalThis.cancelAnimationFrame;
6
- typeof globalThis > "u" ? console.warn(
7
- "Warning: globalThis is undefined, are you overwriting it in your bundler?"
8
- ) : globalThis.cancelAnimationFrame = (x) => {
9
- try {
10
- cancelAnimationFrame(x);
11
- } catch {
12
- }
13
- };
14
- const idFn = () => {
15
- };
16
- export {
17
- idFn
18
- };
19
3
  //# sourceMappingURL=setup.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/setup.ts"],
4
- "mappings": "AAAA,OAAO;AAEP,YAAY,WAAW;AAEvB,WAAW,QAAQ;AAGf,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;AAGxC,MAAM,uBAAuB,WAAW;AAGpC,OAAO,aAAe,MACxB,QAAQ;AAAA,EACN;AACF,IAEA,WAAW,uBAAuB,CAAC,MAAc;AAC/C,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAQ;AAAA,EAER;AACF;AAIK,MAAM,OAAO,MAAM;AAAC;",
4
+ "mappings": "AAAA,OAAO;AAGH,OAAO,wBAA0B,QACnC,WAAW,wBAA2B;",
5
5
  "names": []
6
6
  }
package/dist/native.js CHANGED
@@ -264,7 +264,12 @@ var require_validStyleProps_native = __commonJS({
264
264
  borderTopLeftRadius: !0,
265
265
  borderTopRightRadius: !0,
266
266
  borderBottomLeftRadius: !0,
267
- borderBottomRightRadius: !0
267
+ borderBottomRightRadius: !0,
268
+ // logical
269
+ borderStartStartRadius: !0,
270
+ borderStartEndRadius: !0,
271
+ borderEndStartRadius: !0,
272
+ borderEndEndRadius: !0
268
273
  },
269
274
  size: {
270
275
  width: !0,
@@ -280,6 +285,9 @@ var require_validStyleProps_native = __commonJS({
280
285
  color: {
281
286
  backgroundColor: !0,
282
287
  borderColor: !0,
288
+ borderBlockStartColor: !0,
289
+ borderBlockEndColor: !0,
290
+ borderBlockColor: !0,
283
291
  borderBottomColor: !0,
284
292
  borderTopColor: !0,
285
293
  borderLeftColor: !0,
@@ -369,6 +377,11 @@ var require_validStyleProps_native = __commonJS({
369
377
  justifyContent: !0,
370
378
  left: !0,
371
379
  margin: !0,
380
+ marginBlockEnd: !0,
381
+ marginBlockStart: !0,
382
+ marginInlineEnd: !0,
383
+ marginInline: !0,
384
+ marginInlineStart: !0,
372
385
  marginBottom: !0,
373
386
  marginEnd: !0,
374
387
  marginHorizontal: !0,
@@ -380,6 +393,11 @@ var require_validStyleProps_native = __commonJS({
380
393
  overflow: !0,
381
394
  padding: !0,
382
395
  paddingBottom: !0,
396
+ paddingInline: !0,
397
+ paddingBlock: !0,
398
+ paddingBlockStart: !0,
399
+ paddingInlineEnd: !0,
400
+ paddingInlineStart: !0,
383
401
  paddingEnd: !0,
384
402
  paddingHorizontal: !0,
385
403
  paddingLeft: !0,
@@ -1510,6 +1528,7 @@ var require_createShallowSetState_native = __commonJS({
1510
1528
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createShallowSetState_exports = {};
1511
1529
  __export2(createShallowSetState_exports, {
1512
1530
  createShallowSetState: () => createShallowSetState,
1531
+ isEqualShallow: () => isEqualShallow,
1513
1532
  mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
1514
1533
  });
1515
1534
  module2.exports = __toCommonJS2(createShallowSetState_exports);
@@ -1517,10 +1536,13 @@ var require_createShallowSetState_native = __commonJS({
1517
1536
  return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next));
1518
1537
  }
1519
1538
  function mergeIfNotShallowEqual(prev, next) {
1539
+ return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
1540
+ }
1541
+ function isEqualShallow(prev, next) {
1520
1542
  for (let key in next)
1521
1543
  if (prev[key] !== next[key])
1522
- return { ...prev, ...next };
1523
- return prev;
1544
+ return !1;
1545
+ return !0;
1524
1546
  }
1525
1547
  }
1526
1548
  });
@@ -3415,7 +3437,7 @@ var require_ThemeManager_native = __commonJS({
3415
3437
  return this.updateState(nextState, shouldNotify), nextState;
3416
3438
  }
3417
3439
  updateState(nextState, shouldNotify = !0) {
3418
- this.state = nextState, this._allKeys = null, process.env.NODE_ENV === "development" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
3440
+ this.state = nextState, this._allKeys = null, process.env.NODE_ENV !== "production" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
3419
3441
  this.notify();
3420
3442
  });
3421
3443
  }
@@ -3443,25 +3465,28 @@ var require_ThemeManager_native = __commonJS({
3443
3465
  this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
3444
3466
  }
3445
3467
  onChangeTheme(cb, debugId) {
3446
- return process.env.NODE_ENV === "development" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
3468
+ return process.env.NODE_ENV !== "production" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
3447
3469
  this.themeListeners.delete(cb);
3448
3470
  };
3449
3471
  }
3450
3472
  };
3451
3473
  function getState(props, manager) {
3474
+ var _a;
3452
3475
  if (props.name && props.reset)
3453
3476
  throw new Error(
3454
3477
  process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time."
3455
3478
  );
3456
3479
  if (!getHasThemeUpdatingProps(props))
3457
3480
  return null;
3458
- let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = allManagers.findIndex((x) => !(x != null && x.state.isComponent)) + (props.reset && !isDirectParentAComponentTheme ? 1 : 0), baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
3481
+ let themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
3459
3482
  if (!baseManager && props.reset)
3460
3483
  return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
3461
- let result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "", nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
3462
- props.reset && isDirectParentAComponentTheme && allComponentThemes.shift();
3484
+ let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
3485
+ baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][a-z]+/, ""));
3486
+ let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
3487
+ isDirectParentAComponentTheme && allComponentThemes.shift();
3463
3488
  let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
3464
- process.env.NODE_ENV === "development" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }));
3489
+ process.env.NODE_ENV !== "production" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }));
3465
3490
  for (let i = max2; i >= min2; i--) {
3466
3491
  let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
3467
3492
  props.inverse && (prefix = inverseThemeName(prefix));
@@ -3470,39 +3495,38 @@ var require_ThemeManager_native = __commonJS({
3470
3495
  let lastSegment = potentials.findIndex((x) => !x.includes("_"));
3471
3496
  lastSegment > 0 && potentials.splice(lastSegment, 0, nextName);
3472
3497
  }
3473
- if (props.componentName) {
3498
+ if (componentName && !props.reset) {
3474
3499
  let componentPotentials = [];
3475
3500
  if (nextName) {
3476
3501
  let beforeSeparator = prefix.slice(0, prefix.indexOf(import_constants2.THEME_NAME_SEPARATOR));
3477
- componentPotentials.push(`${beforeSeparator}_${nextName}_${props.componentName}`);
3502
+ componentPotentials.push(`${beforeSeparator}_${nextName}_${componentName}`);
3478
3503
  }
3479
- if (componentPotentials.push(`${prefix}_${props.componentName}`), nextName) {
3504
+ if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
3480
3505
  let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
3481
3506
  if (prefixLessOne) {
3482
- let lessSpecific = `${prefixLessOne}_${nextName}_${props.componentName}`;
3507
+ let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
3483
3508
  componentPotentials.unshift(lessSpecific);
3484
3509
  }
3485
- let moreSpecific = `${prefix}_${nextName}_${props.componentName}`;
3510
+ let moreSpecific = `${prefix}_${nextName}_${componentName}`;
3486
3511
  componentPotentials.unshift(moreSpecific);
3487
3512
  }
3488
3513
  potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
3489
3514
  }
3490
3515
  let found = potentials.find((t) => t in themes);
3491
- if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && console.info(" - ", { found, potentials, baseManager }), found) {
3492
- let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = baseManager == null ? void 0 : baseManager.state, parentScheme = parentState == null ? void 0 : parentState.scheme, parentName = parentState == null ? void 0 : parentState.name, inverse = parentScheme && scheme !== parentScheme;
3516
+ if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && console.info(" - ", { found, potentials, baseManager, nextName, baseName, prefix }), found) {
3517
+ let names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
3493
3518
  result = {
3494
3519
  name: found,
3495
3520
  parentName,
3496
3521
  theme: themes[found],
3497
3522
  className,
3498
- inverse,
3499
3523
  isComponent,
3500
3524
  scheme
3501
3525
  };
3502
3526
  break;
3503
3527
  }
3504
3528
  }
3505
- return process.env.NODE_ENV === "development" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", { result }), console.trace(), console.groupEnd()), result;
3529
+ return process.env.NODE_ENV !== "production" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", { result }), console.trace(), console.groupEnd()), result;
3506
3530
  }
3507
3531
  var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
3508
3532
  function getManagers(themeManager) {
@@ -3557,7 +3581,7 @@ var require_useTheme_native = __commonJS({
3557
3581
  useThemeWithState: () => useThemeWithState
3558
3582
  });
3559
3583
  module2.exports = __toCommonJS2(useTheme_exports);
3560
- var import_constants = require_index_native2(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
3584
+ var import_constants = require_index_native2(), import_react2 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
3561
3585
  function getDefaultThemeProxied() {
3562
3586
  if (cached)
3563
3587
  return cached;
@@ -3651,8 +3675,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3651
3675
  {
3652
3676
  let cur = manager;
3653
3677
  for (; cur; ) {
3654
- if (cur.state.inverse)
3678
+ if (!cur.parentManager)
3655
3679
  return !0;
3680
+ if (cur.parentManager.state.scheme !== cur.state.scheme)
3681
+ return !1;
3656
3682
  cur = cur.parentManager;
3657
3683
  }
3658
3684
  }
@@ -3666,7 +3692,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3666
3692
  state: parentManager == null ? void 0 : parentManager.state,
3667
3693
  themeManager: parentManager
3668
3694
  };
3669
- let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
3695
+ let [themeState, setThemeState] = (0, import_react2.useState)(createState), { state, mounted, isNewTheme, themeManager, inversed } = themeState, isInversingOnMount = !!(!themeState.mounted && props.inverse);
3670
3696
  function getShouldUpdateTheme(manager = themeManager, nextState, prevState = state, forceShouldChange = !1) {
3671
3697
  let forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
3672
3698
  if (!manager || !forceShouldChange && forceUpdate === !1)
@@ -3679,7 +3705,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3679
3705
  if (!themeManager)
3680
3706
  return;
3681
3707
  if (props.inverse && !mounted) {
3682
- setThemeState({ ...themeState, mounted: !0 });
3708
+ setThemeState((prev) => createState({
3709
+ ...prev,
3710
+ mounted: !0
3711
+ }));
3683
3712
  return;
3684
3713
  }
3685
3714
  isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
@@ -3713,6 +3742,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3713
3742
  }), [themeManager])), isInversingOnMount)
3714
3743
  return {
3715
3744
  isNewTheme: !1,
3745
+ inversed: !1,
3716
3746
  themeManager: parentManager,
3717
3747
  state: {
3718
3748
  name: "",
@@ -3723,10 +3753,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3723
3753
  return {
3724
3754
  state,
3725
3755
  isNewTheme,
3756
+ inversed,
3726
3757
  themeManager
3727
3758
  };
3728
3759
  function createState(prev, force = !1) {
3729
- var _a;
3730
3760
  if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
3731
3761
  return prev;
3732
3762
  let themeManager2 = parentManager, state2;
@@ -3745,15 +3775,18 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3745
3775
  themeManager2 = getNewThemeManager(), state2 = { ...themeManager2.state };
3746
3776
  }
3747
3777
  let isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse), mounted2 = props.inverse ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
3748
- if (state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager)), !force && (state2 == null ? void 0 : state2.name) === ((_a = prev == null ? void 0 : prev.state) == null ? void 0 : _a.name))
3749
- return prev;
3750
- let response = {
3751
- state: state2,
3778
+ state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
3779
+ let wasInversed = prev == null ? void 0 : prev.inversed, inversed2 = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme) ? !0 : wasInversed ? !1 : null, response = {
3752
3780
  themeManager: themeManager2,
3753
3781
  isNewTheme: isNewTheme2,
3754
- mounted: mounted2
3755
- };
3756
- if (process.env.NODE_ENV === "development" && props.debug && import_constants.isClient) {
3782
+ mounted: mounted2,
3783
+ inversed: inversed2
3784
+ }, shouldReturnPrev = !force && prev && // isEqualShallow uses the second arg as the keys so this should compare without state first...
3785
+ (0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
3786
+ (0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
3787
+ if (prev && shouldReturnPrev)
3788
+ return prev;
3789
+ if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants.isClient) {
3757
3790
  console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
3758
3791
  let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
3759
3792
  console.info({
@@ -3821,9 +3854,7 @@ var require_Theme_native = __commonJS({
3821
3854
  )), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), Theme_exports = {};
3822
3855
  __export2(Theme_exports, {
3823
3856
  Theme: () => Theme2,
3824
- getThemeCNStyle: () => getThemeCNStyle,
3825
- useThemedChildren: () => useThemedChildren,
3826
- wrapThemeElements: () => wrapThemeElements
3857
+ useThemedChildren: () => useThemedChildren
3827
3858
  });
3828
3859
  module2.exports = __toCommonJS2(Theme_exports);
3829
3860
  var import_constants = require_index_native2(), import_react2 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime6 = require("react/jsx-runtime"), Theme2 = (0, import_react2.forwardRef)(function(props, ref) {
@@ -3862,40 +3893,32 @@ var require_Theme_native = __commonJS({
3862
3893
  isRoot
3863
3894
  }) : elementsWithContext;
3864
3895
  }
3865
- function getThemeCNStyle(themeState, isRoot = !1) {
3866
- var _a, _b;
3867
- if (!themeState.isNewTheme)
3868
- return;
3869
- let themeColor = (_a = themeState.state) != null && _a.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
3870
- color: themeColor
3871
- } : void 0, className = ((_b = themeState.state) == null ? void 0 : _b.className) || "";
3872
- return isRoot && (className = className.replace("t_sub_theme", "")), { style, className };
3873
- }
3874
3896
  function wrapThemeElements({
3875
3897
  children,
3876
3898
  themeState,
3877
3899
  forceClassName,
3878
3900
  isRoot
3879
3901
  }) {
3880
- var _a, _b;
3902
+ var _a;
3881
3903
  if (isRoot && forceClassName === !1)
3882
3904
  return children;
3883
- let inverse = (_a = themeState.state) == null ? void 0 : _a.inverse;
3884
- if (!themeState.isNewTheme && !inverse && !forceClassName)
3905
+ let inverse = themeState.inversed, requiresExtraWrapper = inverse != null || forceClassName;
3906
+ if (!themeState.isNewTheme && !requiresExtraWrapper)
3885
3907
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "_dsp_contents is_Theme", children });
3886
- let { className, style } = getThemeCNStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
3887
- if (inverse != null || forceClassName) {
3888
- let name = ((_b = themeState.state) == null ? void 0 : _b.name) || "";
3889
- themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3890
- "span",
3891
- {
3892
- className: `${name.startsWith("light") ? "t_light" : name.startsWith("dark") ? "t_dark" : ""} _dsp_contents ${inverse ? "is_inversed" : ""}`,
3893
- children: themedChildren
3894
- }
3895
- );
3908
+ let { className, style } = getThemeClassNameAndStyle(themeState, isRoot), themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${className} _dsp_contents is_Theme`, style, children });
3909
+ if (requiresExtraWrapper) {
3910
+ let name = ((_a = themeState.state) == null ? void 0 : _a.name) || "", inverseClassName = name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "";
3911
+ themedChildren = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${inverse ? inverseClassName : ""} _dsp_contents`, children: themedChildren });
3896
3912
  }
3897
3913
  return themedChildren;
3898
3914
  }
3915
+ function getThemeClassNameAndStyle(themeState, isRoot = !1) {
3916
+ var _a, _b;
3917
+ let themeColor = (_a = themeState.state) != null && _a.theme && themeState.isNewTheme ? (0, import_createVariable.variableToString)(themeState.state.theme.color) : "", style = themeColor ? {
3918
+ color: themeColor
3919
+ } : void 0, className = ((_b = themeState.state) == null ? void 0 : _b.className) || "";
3920
+ return isRoot && (className = className.replace("t_sub_theme", "")), { style, className };
3921
+ }
3899
3922
  }
3900
3923
  });
3901
3924
 
@@ -3924,7 +3947,7 @@ var require_themeable_native = __commonJS({
3924
3947
  import_Theme.Theme,
3925
3948
  {
3926
3949
  componentName: componentName || (staticConfig == null ? void 0 : staticConfig.componentName),
3927
- name: theme || null,
3950
+ name: theme,
3928
3951
  "disable-child-theme": !0,
3929
3952
  debug: props.debug,
3930
3953
  inverse: themeInverse,
@@ -11801,7 +11824,6 @@ var require_Button_native = __commonJS({
11801
11824
  }
11802
11825
  }), ButtonText = (0, import_web.styled)(import_text2.SizableText, {
11803
11826
  name: "Button",
11804
- // same name as the frame so they can share a single theme
11805
11827
  context: ButtonContext,
11806
11828
  variants: {
11807
11829
  unstyled: {