@tamagui/web 3.0.0-beta.1598.1 → 3.0.0-beta.1648.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 (66) hide show
  1. package/dist/cjs/createTamagui.cjs +10 -8
  2. package/dist/cjs/createTamagui.native.cjs +10 -8
  3. package/dist/cjs/createTamagui.native.js +10 -8
  4. package/dist/cjs/createTamagui.native.js.map +1 -1
  5. package/dist/cjs/helpers/getSplitStyles.cjs +5 -7
  6. package/dist/cjs/helpers/getSplitStyles.native.cjs +6 -8
  7. package/dist/cjs/helpers/getSplitStyles.native.js +6 -8
  8. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  9. package/dist/cjs/helpers/proxyThemeToParents.cjs +2 -1
  10. package/dist/cjs/helpers/proxyThemeToParents.native.cjs +2 -1
  11. package/dist/cjs/helpers/proxyThemeToParents.native.js +2 -1
  12. package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
  13. package/dist/cjs/helpers/themes.cjs +19 -11
  14. package/dist/cjs/helpers/themes.native.cjs +19 -11
  15. package/dist/cjs/helpers/themes.native.js +19 -11
  16. package/dist/cjs/helpers/themes.native.js.map +1 -1
  17. package/dist/cjs/hooks/useThemeState.cjs +9 -19
  18. package/dist/cjs/hooks/useThemeState.native.cjs +16 -22
  19. package/dist/cjs/hooks/useThemeState.native.js +16 -22
  20. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  21. package/dist/cjs/internal-runtime.cjs +2 -0
  22. package/dist/cjs/internal-runtime.native.cjs +2 -0
  23. package/dist/cjs/internal-runtime.native.js +2 -0
  24. package/dist/cjs/internal-runtime.native.js.map +1 -1
  25. package/dist/esm/createTamagui.mjs +11 -9
  26. package/dist/esm/createTamagui.mjs.map +1 -1
  27. package/dist/esm/createTamagui.native.js +11 -9
  28. package/dist/esm/createTamagui.native.js.map +1 -1
  29. package/dist/esm/helpers/getSplitStyles.mjs +5 -7
  30. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  31. package/dist/esm/helpers/getSplitStyles.native.js +6 -8
  32. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  33. package/dist/esm/helpers/proxyThemeToParents.mjs +3 -1
  34. package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
  35. package/dist/esm/helpers/proxyThemeToParents.native.js +3 -1
  36. package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
  37. package/dist/esm/helpers/themes.mjs +15 -11
  38. package/dist/esm/helpers/themes.mjs.map +1 -1
  39. package/dist/esm/helpers/themes.native.js +15 -11
  40. package/dist/esm/helpers/themes.native.js.map +1 -1
  41. package/dist/esm/hooks/useThemeState.mjs +8 -20
  42. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  43. package/dist/esm/hooks/useThemeState.native.js +16 -22
  44. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  45. package/dist/esm/internal-runtime.mjs +3 -2
  46. package/dist/esm/internal-runtime.mjs.map +1 -1
  47. package/dist/esm/internal-runtime.native.js +3 -2
  48. package/dist/esm/internal-runtime.native.js.map +1 -1
  49. package/package.json +17 -17
  50. package/src/createTamagui.ts +17 -21
  51. package/src/helpers/getSplitStyles.tsx +13 -8
  52. package/src/helpers/proxyThemeToParents.ts +2 -1
  53. package/src/helpers/themes.ts +17 -11
  54. package/src/hooks/useThemeState.ts +15 -35
  55. package/src/internal-runtime.ts +6 -1
  56. package/src/types.tsx +1 -15
  57. package/types/createTamagui.d.ts.map +1 -1
  58. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  59. package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
  60. package/types/helpers/themes.d.ts +2 -0
  61. package/types/helpers/themes.d.ts.map +1 -1
  62. package/types/hooks/useThemeState.d.ts.map +1 -1
  63. package/types/internal-runtime.d.ts +1 -0
  64. package/types/internal-runtime.d.ts.map +1 -1
  65. package/types/types.d.ts +1 -3
  66. package/types/types.d.ts.map +1 -1
@@ -293,7 +293,6 @@ function contributeProp(pass, keyOg, valOg) {
293
293
  var shouldCheckSkipProps = !noSkip;
294
294
  var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
295
295
  var isTextOrInput = isText || isInput;
296
- var hocParentVariants = isHOC ? parentVariants : void 0;
297
296
  var keyInit = keyOg;
298
297
  var valInit = valOg;
299
298
  if (keyInit === "children") {
@@ -515,9 +514,8 @@ function contributeProp(pass, keyOg, valOg) {
515
514
  var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
516
515
  var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
517
516
  if (isStyleProp && asChildExceptStyleLike) return;
518
- var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
519
- var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
520
- var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
517
+ var shouldPassProp = !isStyleProp && isHOC || parentVariants && keyInit in parentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
518
+ var isHOCShouldPassThrough = isHOC && keyInit in skipProps;
521
519
  var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
522
520
  if (process.env.NODE_ENV === "development" && debug === "verbose") {
523
521
  console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
@@ -605,7 +603,7 @@ function contributeProp(pass, keyOg, valOg) {
605
603
  }
606
604
  }
607
605
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
608
- var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
606
+ var _staticConfig_Component_staticConfig, _staticConfig_Component, _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
609
607
  var conf = getConfig();
610
608
  styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
611
609
  var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
@@ -681,7 +679,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
681
679
  var frontendContainer;
682
680
  var frontendContainerType;
683
681
  var processedProps = props;
684
- var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
682
+ var parentVariants = isHOC ? (_staticConfig_Component = staticConfig.Component) === null || _staticConfig_Component === void 0 ? void 0 : (_staticConfig_Component_staticConfig = _staticConfig_Component.staticConfig) === null || _staticConfig_Component_staticConfig === void 0 ? void 0 : _staticConfig_Component_staticConfig.variants : void 0;
685
683
  var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
686
684
  var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
687
685
  var containerValue;
@@ -703,7 +701,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
703
701
  styledContextKeys,
704
702
  (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
705
703
  debug,
706
- parentStaticConfig,
704
+ process.env.NODE_ENV === "development" ? parentStaticConfig : void 0,
707
705
  defaultProps,
708
706
  driverAnimations,
709
707
  driverOutputStyle,
@@ -1760,7 +1758,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1760
1758
  }
1761
1759
  if (typeof raw === "string" && property === "background") {
1762
1760
  var parts = splitComponents(raw);
1763
- if (parts.length === 1 && !startsValueFunction(parts[0])) {
1761
+ if (parts.length === 1 && (!startsValueFunction(parts[0]) || classifyBorderComponents(parts[0]).color)) {
1764
1762
  emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
1765
1763
  return;
1766
1764
  }