@tamagui/web 3.0.0-beta.1216.1 → 3.0.0-beta.1309.1

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 (94) hide show
  1. package/dist/cjs/createComponent.cjs +4 -6
  2. package/dist/cjs/createComponent.native.cjs +3 -5
  3. package/dist/cjs/createComponent.native.js +3 -5
  4. package/dist/cjs/createComponent.native.js.map +1 -1
  5. package/dist/cjs/helpers/createDesignSystem.cjs +9 -7
  6. package/dist/cjs/helpers/createDesignSystem.native.cjs +4 -4
  7. package/dist/cjs/helpers/createDesignSystem.native.js +4 -4
  8. package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
  9. package/dist/cjs/helpers/expandStyle.native.cjs +0 -1
  10. package/dist/cjs/helpers/expandStyle.native.js +0 -1
  11. package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
  12. package/dist/cjs/helpers/expandStyles.cjs +8 -2
  13. package/dist/cjs/helpers/expandStyles.native.cjs +7 -7
  14. package/dist/cjs/helpers/expandStyles.native.js +7 -7
  15. package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
  16. package/dist/cjs/helpers/getSplitStyles.cjs +7 -2
  17. package/dist/cjs/helpers/getSplitStyles.native.cjs +21 -6
  18. package/dist/cjs/helpers/getSplitStyles.native.js +21 -6
  19. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  20. package/dist/cjs/helpers/getThemeCSSRules.cjs +6 -6
  21. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  22. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  23. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  24. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  25. package/dist/cjs/views/Theme.cjs +3 -2
  26. package/dist/cjs/views/Theme.native.cjs +3 -2
  27. package/dist/cjs/views/Theme.native.js +3 -2
  28. package/dist/cjs/views/Theme.native.js.map +1 -1
  29. package/dist/esm/createComponent.mjs +4 -15
  30. package/dist/esm/createComponent.mjs.map +1 -1
  31. package/dist/esm/createComponent.native.js +3 -14
  32. package/dist/esm/createComponent.native.js.map +1 -1
  33. package/dist/esm/helpers/createDesignSystem.mjs +9 -7
  34. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  35. package/dist/esm/helpers/createDesignSystem.native.js +4 -4
  36. package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
  37. package/dist/esm/helpers/expandStyle.native.js +1 -2
  38. package/dist/esm/helpers/expandStyle.native.js.map +1 -1
  39. package/dist/esm/helpers/expandStyles.mjs +8 -2
  40. package/dist/esm/helpers/expandStyles.mjs.map +1 -1
  41. package/dist/esm/helpers/expandStyles.native.js +7 -7
  42. package/dist/esm/helpers/expandStyles.native.js.map +1 -1
  43. package/dist/esm/helpers/getSplitStyles.mjs +7 -2
  44. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  45. package/dist/esm/helpers/getSplitStyles.native.js +21 -6
  46. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  47. package/dist/esm/helpers/getThemeCSSRules.mjs +6 -6
  48. package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
  49. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  50. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  51. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  52. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  53. package/dist/esm/views/Theme.mjs +3 -2
  54. package/dist/esm/views/Theme.mjs.map +1 -1
  55. package/dist/esm/views/Theme.native.js +3 -2
  56. package/dist/esm/views/Theme.native.js.map +1 -1
  57. package/package.json +17 -18
  58. package/src/createComponent.tsx +18 -12
  59. package/src/dom/styleTypes.ts +1 -1
  60. package/src/helpers/createDesignSystem.ts +19 -5
  61. package/src/helpers/expandStyle.ts +0 -4
  62. package/src/helpers/expandStyles.ts +0 -9
  63. package/src/helpers/getSplitStyles.tsx +82 -15
  64. package/src/helpers/getThemeCSSRules.ts +8 -5
  65. package/src/helpers/nativeOnlyProps.ts +0 -1
  66. package/src/interfaces/RNExclusiveTypes.ts +0 -2
  67. package/src/types.tsx +9 -0
  68. package/src/views/Theme.tsx +7 -4
  69. package/types/createComponent.d.ts.map +1 -1
  70. package/types/dom/styleTypes.d.ts +1 -1
  71. package/types/dom/styleTypes.d.ts.map +1 -1
  72. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  73. package/types/helpers/expandStyle.d.ts.map +1 -1
  74. package/types/helpers/expandStyles.d.ts.map +1 -1
  75. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  76. package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
  77. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  78. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  79. package/types/interfaces/RNExclusiveTypes.d.ts +1 -2
  80. package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
  81. package/types/types.d.ts +3 -0
  82. package/types/types.d.ts.map +1 -1
  83. package/types/views/Theme.d.ts.map +1 -1
  84. package/dist/cjs/helpers/timer.cjs +0 -28
  85. package/dist/cjs/helpers/timer.native.cjs +0 -30
  86. package/dist/cjs/helpers/timer.native.js +0 -32
  87. package/dist/cjs/helpers/timer.native.js.map +0 -1
  88. package/dist/esm/helpers/timer.mjs +0 -13
  89. package/dist/esm/helpers/timer.mjs.map +0 -1
  90. package/dist/esm/helpers/timer.native.js +0 -13
  91. package/dist/esm/helpers/timer.native.js.map +0 -1
  92. package/src/helpers/timer.ts +0 -9
  93. package/types/helpers/timer.d.ts +0 -2
  94. package/types/helpers/timer.d.ts.map +0 -1
@@ -378,6 +378,7 @@ function contributeProp(pass, keyOg, valOg) {
378
378
  if (hocSlots) {
379
379
  var _direct1;
380
380
  var slots = (_direct1 = direct).flatSlots || (_direct1.flatSlots = /* @__PURE__ */ new Map());
381
+ var markerLayer = pass[passSourceLayer];
381
382
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
382
383
  try {
383
384
  for (var _iterator = hocSlots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
@@ -386,6 +387,7 @@ function contributeProp(pass, keyOg, valOg) {
386
387
  try {
387
388
  for (var _iterator1 = entries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
388
389
  var entry = _step1.value;
390
+ pass[passSourceLayer] = Math.max(entry[7] >> 5, sourceLayerResolver);
389
391
  if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
390
392
  if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in nonAnimatableStyleProps)) {
391
393
  var _styleState_animationDriver;
@@ -415,6 +417,7 @@ function contributeProp(pass, keyOg, valOg) {
415
417
  if (_didIteratorError) throw _iteratorError;
416
418
  }
417
419
  }
420
+ pass[passSourceLayer] = markerLayer;
418
421
  }
419
422
  }
420
423
  return;
@@ -486,9 +489,6 @@ function contributeProp(pass, keyOg, valOg) {
486
489
  }
487
490
  }
488
491
  if (!isValidStyleKeyInit) {
489
- if (!isAndroid) {
490
- if (keyInit === "elevationAndroid") return;
491
- }
492
492
  if (keyInit === "userSelect") {
493
493
  keyInit = "selectable";
494
494
  valInit = valInit !== "none";
@@ -641,6 +641,12 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
641
641
  animationDriver: resolvedDriver
642
642
  };
643
643
  styleState.flatStyleStaticConfig = styleStaticConfig;
644
+ var prev = styleProps.prevStyle;
645
+ if (prev) {
646
+ styleState.flatPrevStyle = prev;
647
+ styleState.flatStyleChanged = false;
648
+ styleState.flatStyleKeyCount = 0;
649
+ }
644
650
  if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
645
651
  if (process.env.NODE_ENV === "development" && debug === "verbose" && isClient) {
646
652
  if (isDevTools) {
@@ -859,6 +865,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
859
865
  }
860
866
  if (hasProvenance) setStyleTokenProvenance(styleState.style, provenance);
861
867
  }
868
+ var direct = styleState;
869
+ var prevStyle = direct.flatPrevStyle;
870
+ if (prevStyle && styleState.style && !direct.flatStyleChanged && Object.keys(prevStyle).length === Object.keys(styleState.style).length) styleState.style = prevStyle;
862
871
  var result = {
863
872
  hasMedia,
864
873
  fontFamily: styleState.fontFamily,
@@ -1000,6 +1009,11 @@ function mergeStyle(styleState, key, val) {
1000
1009
  if (staticConfig.isInput && key in nativeTextInputColorProps) viewProps[nativeTextInputColorProps[key]] = out;
1001
1010
  else {
1002
1011
  var _styleState4;
1012
+ var direct = styleState;
1013
+ if (direct.flatPrevStyle) {
1014
+ direct.flatStyleKeyCount = (direct.flatStyleKeyCount || 0) + 1;
1015
+ if (!direct.flatStyleChanged && direct.flatPrevStyle[key] !== out) direct.flatStyleChanged = true;
1016
+ }
1003
1017
  (_styleState4 = styleState).style || (_styleState4.style = {});
1004
1018
  styleState.style[key] = out;
1005
1019
  if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
@@ -1863,10 +1877,11 @@ function walkConditionalValue(state, property, value, parent, sink) {
1863
1877
  }
1864
1878
  }
1865
1879
  if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && getConfigRevisionState(state.conf).propertyKind(property) !== 8 && property !== "boxShadow" && property !== "textShadow" && property !== "fontFamily" && property !== "gap" && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
1866
- if (warnMode === 1 && (!canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
1867
- var _state_flatPropertyLayers;
1880
+ if (warnMode === 1 && conditions & 12 && !hasBase) {
1868
1881
  var resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
1869
- if (resting !== null && !((_state_flatPropertyLayers = state.flatPropertyLayers) === null || _state_flatPropertyLayers === void 0 ? void 0 : _state_flatPropertyLayers.has(property))) emitConditionalValue(state, property, resting, parentCondition, resting, sink, warnMode, contextOnly);
1882
+ var layers = state.flatPropertyLayers;
1883
+ var owned = !canGenerateCSS || !state.flatShouldDoClasses ? layers === null || layers === void 0 ? void 0 : layers.has(property) : property === "scale" ? (layers === null || layers === void 0 ? void 0 : layers.has("--t-scale-x")) || (layers === null || layers === void 0 ? void 0 : layers.has("--t-scale-y")) : layers === null || layers === void 0 ? void 0 : layers.has(property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : property);
1884
+ if (resting !== null && !owned) emitConditionalValue(state, property, resting, parentCondition, resting, sink, warnMode, contextOnly);
1870
1885
  }
1871
1886
  return true;
1872
1887
  }