tamagui 1.138.1 → 1.138.3
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/native.cjs +79 -27
- package/dist/test.cjs +79 -27
- package/package.json +55 -55
package/dist/native.cjs
CHANGED
|
@@ -3117,6 +3117,10 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
|
|
|
3117
3117
|
if (!(!styleProps2.noSkip && subKey in skipProps)) {
|
|
3118
3118
|
if (styleProps2.noExpand) res[subKey] = val;
|
|
3119
3119
|
else if (variants2 && subKey in variants2) {
|
|
3120
|
+
if (staticConfig) {
|
|
3121
|
+
var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
|
|
3122
|
+
contextProps && subKey in contextProps && (styleState.resolvedContextVariants || (styleState.resolvedContextVariants = {}), styleState.resolvedContextVariants[subKey] = val);
|
|
3123
|
+
}
|
|
3120
3124
|
if (parentVariantKey && parentVariantKey === key) res[subKey] = // SYNC WITH *1
|
|
3121
3125
|
val[0] === "$" ? getTokenForKey(subKey, val, styleProps2, styleState) : val;
|
|
3122
3126
|
else {
|
|
@@ -3279,6 +3283,17 @@ function _type_of$5(obj) {
|
|
|
3279
3283
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3280
3284
|
}
|
|
3281
3285
|
var conf;
|
|
3286
|
+
function normalizeGroupKey(key, groupContext) {
|
|
3287
|
+
var parts = key.split("-"), plen = parts.length;
|
|
3288
|
+
if (
|
|
3289
|
+
// check if its actually a simple group selector to avoid breaking selectors
|
|
3290
|
+
plen === 2 || plen === 3 && pseudoPriorities[parts[parts.length - 1]]
|
|
3291
|
+
) {
|
|
3292
|
+
var name = parts[1];
|
|
3293
|
+
if (groupContext && !groupContext[name]) return key.replace("$group-", "$group-true-");
|
|
3294
|
+
}
|
|
3295
|
+
return key;
|
|
3296
|
+
}
|
|
3282
3297
|
function isValidStyleKey(key, validStyles2, accept) {
|
|
3283
3298
|
return key in validStyles2 ? true : accept && key in accept;
|
|
3284
3299
|
}
|
|
@@ -3305,16 +3320,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3305
3320
|
return "continue";
|
|
3306
3321
|
}
|
|
3307
3322
|
var isVariant = !isValidStyleKeyInit && variants2 && keyInit in variants2, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo ? getMediaKey(keyInit) : false, isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
3308
|
-
|
|
3309
|
-
var parts = keyInit.split("-"), plen = parts.length;
|
|
3310
|
-
if (
|
|
3311
|
-
// check if its actually a simple group selector to avoid breaking selectors
|
|
3312
|
-
plen === 2 || plen === 3 && pseudoPriorities[parts[parts.length - 1]]
|
|
3313
|
-
) {
|
|
3314
|
-
var name2 = parts[1];
|
|
3315
|
-
groupContext && !(groupContext == null ? void 0 : groupContext[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
3316
|
-
}
|
|
3317
|
-
}
|
|
3323
|
+
isMediaOrPseudo && isMedia === "group" && (keyInit = normalizeGroupKey(keyInit, groupContext));
|
|
3318
3324
|
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
|
|
3319
3325
|
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web")) return "continue";
|
|
3320
3326
|
var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
|
|
@@ -3338,7 +3344,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3338
3344
|
mergeStyle(styleState, key4, val2, 1);
|
|
3339
3345
|
return;
|
|
3340
3346
|
}
|
|
3341
|
-
if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants2 && key4 in variants2, (inlineProps == null ? void 0 : inlineProps.has(key4)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key4))) {
|
|
3347
|
+
if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants2 && key4 in variants2, 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))) {
|
|
3342
3348
|
var _props_key;
|
|
3343
3349
|
viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
3344
3350
|
}
|
|
@@ -3557,7 +3563,8 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3557
3563
|
rulesToInsert,
|
|
3558
3564
|
dynamicThemeAccess,
|
|
3559
3565
|
pseudoGroups,
|
|
3560
|
-
mediaGroups
|
|
3566
|
+
mediaGroups,
|
|
3567
|
+
resolvedContextVariants: styleState.resolvedContextVariants
|
|
3561
3568
|
}, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
3562
3569
|
if (!styleProps2.noMergeStyle && !asChildExceptStyleLike) {
|
|
3563
3570
|
var style2 = styleState.style;
|
|
@@ -3865,9 +3872,16 @@ function _type_of$4(obj) {
|
|
|
3865
3872
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3866
3873
|
}
|
|
3867
3874
|
var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
3868
|
-
var _animationDriver_usePresence, isHydrated = useDidFinishSSR(), needsHydration = !useIsClientOnly(),
|
|
3875
|
+
var _animationDriver_usePresence, isHydrated = useDidFinishSSR(), needsHydration = !useIsClientOnly(), useAnimations = (animationDriver == null ? void 0 : animationDriver.isStub) ? void 0 : animationDriver == null ? void 0 : animationDriver.useAnimations, {
|
|
3869
3876
|
isHOC
|
|
3870
|
-
} = staticConfig, stateRef = React.useRef(
|
|
3877
|
+
} = staticConfig, stateRef = React.useRef(
|
|
3878
|
+
// performance: avoid creating object every render
|
|
3879
|
+
void 0
|
|
3880
|
+
);
|
|
3881
|
+
stateRef.current || (stateRef.current = {
|
|
3882
|
+
startedUnhydrated: needsHydration && !isHydrated
|
|
3883
|
+
});
|
|
3884
|
+
var hasAnimationProp = !!(!isHOC && "animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
|
|
3871
3885
|
!needsHydration && hasAnimationProp && (curStateRef.hasAnimated = true);
|
|
3872
3886
|
var willBeAnimatedClient = (function() {
|
|
3873
3887
|
var next = !!(hasAnimationProp && !isHOC && useAnimations);
|
|
@@ -3907,7 +3921,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
3907
3921
|
}
|
|
3908
3922
|
var noClass = !isWeb;
|
|
3909
3923
|
return {
|
|
3910
|
-
startedUnhydrated,
|
|
3924
|
+
startedUnhydrated: curStateRef.startedUnhydrated,
|
|
3911
3925
|
curStateRef,
|
|
3912
3926
|
disabled,
|
|
3913
3927
|
groupName,
|
|
@@ -4015,7 +4029,7 @@ function createComponent(staticConfig) {
|
|
|
4015
4029
|
nextProps && (props = nextProps), overriddenContextProps = overrides;
|
|
4016
4030
|
}
|
|
4017
4031
|
var componentName2 = props.componentName || staticConfig.componentName;
|
|
4018
|
-
var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, animationDriver, staticConfig), {
|
|
4032
|
+
var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
|
|
4019
4033
|
disabled,
|
|
4020
4034
|
groupName,
|
|
4021
4035
|
hasAnimationProp,
|
|
@@ -4105,7 +4119,15 @@ function createComponent(staticConfig) {
|
|
|
4105
4119
|
willBeAnimated,
|
|
4106
4120
|
styledContext: styledContextValue
|
|
4107
4121
|
}, themeName = (themeState == null ? void 0 : themeState.name) || "";
|
|
4108
|
-
var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state, styleProps2, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles,
|
|
4122
|
+
var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state, styleProps2, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles, contextForOverride = staticConfig.context;
|
|
4123
|
+
if (splitStyles == null ? void 0 : splitStyles.resolvedContextVariants) {
|
|
4124
|
+
var _staticConfig_parentStaticConfig, contextForVariants = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
|
|
4125
|
+
if (contextForVariants) {
|
|
4126
|
+
for (var key in splitStyles.resolvedContextVariants) overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = splitStyles.resolvedContextVariants[key];
|
|
4127
|
+
staticConfig.context || (contextForOverride = contextForVariants);
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
var groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
|
|
4109
4131
|
if (!isPassthrough && groupContext && // avoids onLayout if we don't need it
|
|
4110
4132
|
props.containerType !== "normal") {
|
|
4111
4133
|
var groupState = groupContext == null ? void 0 : groupContext.state;
|
|
@@ -4147,8 +4169,8 @@ function createComponent(staticConfig) {
|
|
|
4147
4169
|
}), stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
4148
4170
|
var prev = stateRef.current.nextState || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
4149
4171
|
if (!(next === prev || isEqualShallow(prev, next))) {
|
|
4150
|
-
var canAvoidReRender = Object.keys(next).every(function(
|
|
4151
|
-
return avoidReRenderKeys.has(
|
|
4172
|
+
var canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
4173
|
+
return avoidReRenderKeys.has(key3);
|
|
4152
4174
|
}), updatedState = __spreadValues(__spreadValues({}, prev), next);
|
|
4153
4175
|
if (stateRef.current.nextState = updatedState, canAvoidReRender) {
|
|
4154
4176
|
var _stateRef_current_updateStyleListener, _stateRef_current;
|
|
@@ -4394,9 +4416,9 @@ function createComponent(staticConfig) {
|
|
|
4394
4416
|
}))), "group" in props && (content = /* @__PURE__ */ jsxRuntimeExports.jsx(GroupContext.Provider, {
|
|
4395
4417
|
value: allGroupContexts,
|
|
4396
4418
|
children: content
|
|
4397
|
-
})), content = disableTheme || !splitStyles ? content : getThemedChildren(themeState, content, themeStateProps, false, stateRef), overriddenContextProps) {
|
|
4398
|
-
var Provider =
|
|
4399
|
-
for (var
|
|
4419
|
+
})), content = disableTheme || !splitStyles ? content : getThemedChildren(themeState, content, themeStateProps, false, stateRef), overriddenContextProps && contextForOverride) {
|
|
4420
|
+
var Provider = contextForOverride.Provider;
|
|
4421
|
+
for (var key1 in styledContextValue) key1 in overriddenContextProps || (overriddenContextProps[key1] = styledContextValue[key1]);
|
|
4400
4422
|
debugProp && console.info("overriddenContextProps", overriddenContextProps), content = /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, __spreadProps(__spreadValues({
|
|
4401
4423
|
__disableMergeDefaultValues: true
|
|
4402
4424
|
}, overriddenContextProps), {
|
|
@@ -4742,6 +4764,35 @@ var cache$1 = /* @__PURE__ */ new WeakMap(), createVariables = function(tokens)
|
|
|
4742
4764
|
}
|
|
4743
4765
|
return cache$1.set(res, true), res;
|
|
4744
4766
|
};
|
|
4767
|
+
var noAnimationDriver = function(method) {
|
|
4768
|
+
console.warn(`No animation driver configured. To use ${method}, you must pass \`animations\` to createTamagui. See: https://tamagui.dev/docs/core/animations`);
|
|
4769
|
+
}, createEmptyAnimationDriver = function() {
|
|
4770
|
+
return {
|
|
4771
|
+
isReactNative: false,
|
|
4772
|
+
supportsCSS: true,
|
|
4773
|
+
classNameAnimation: true,
|
|
4774
|
+
isStub: true,
|
|
4775
|
+
animations: {},
|
|
4776
|
+
useAnimations: function() {
|
|
4777
|
+
return noAnimationDriver("animations");
|
|
4778
|
+
},
|
|
4779
|
+
usePresence: function() {
|
|
4780
|
+
return noAnimationDriver("usePresence");
|
|
4781
|
+
},
|
|
4782
|
+
ResetPresence: function() {
|
|
4783
|
+
return noAnimationDriver("ResetPresence");
|
|
4784
|
+
},
|
|
4785
|
+
useAnimatedNumber: function() {
|
|
4786
|
+
return noAnimationDriver("useAnimatedNumber");
|
|
4787
|
+
},
|
|
4788
|
+
useAnimatedNumberStyle: function() {
|
|
4789
|
+
return noAnimationDriver("useAnimatedNumberStyle");
|
|
4790
|
+
},
|
|
4791
|
+
useAnimatedNumberReaction: function() {
|
|
4792
|
+
return noAnimationDriver("useAnimatedNumberReaction");
|
|
4793
|
+
}
|
|
4794
|
+
};
|
|
4795
|
+
}, defaultAnimationDriver = createEmptyAnimationDriver();
|
|
4745
4796
|
function insertFont(name, fontIn) {
|
|
4746
4797
|
var font = createFont(fontIn), tokened = createVariables(font, name), parsed = parseFont(tokened);
|
|
4747
4798
|
return setConfigFont(name, tokened, parsed), parsed;
|
|
@@ -4824,7 +4875,7 @@ function createTamagui$2(configIn) {
|
|
|
4824
4875
|
fonts: {},
|
|
4825
4876
|
onlyAllowShorthands: false,
|
|
4826
4877
|
fontLanguages: [],
|
|
4827
|
-
animations:
|
|
4878
|
+
animations: defaultAnimationDriver,
|
|
4828
4879
|
media: {}
|
|
4829
4880
|
}, configIn), {
|
|
4830
4881
|
unset,
|
|
@@ -4874,8 +4925,7 @@ function getThemesDeduped(themes2, colorTokens) {
|
|
|
4874
4925
|
e2.names.push(themeName);
|
|
4875
4926
|
continue;
|
|
4876
4927
|
}
|
|
4877
|
-
var theme = __spreadValues({}, rawTheme);
|
|
4878
|
-
colorTokens && Object.assign(theme, colorTokens);
|
|
4928
|
+
var theme = __spreadValues(__spreadValues({}, colorTokens), rawTheme);
|
|
4879
4929
|
for (var key1 in theme) ensureThemeVariable(theme, key1);
|
|
4880
4930
|
var deduped = {
|
|
4881
4931
|
names: [themeName],
|
|
@@ -10491,7 +10541,9 @@ var DialogContext = createStyledContext(
|
|
|
10491
10541
|
height: "auto",
|
|
10492
10542
|
// ensure always in frame and right height
|
|
10493
10543
|
maxHeight: "100vh",
|
|
10494
|
-
position: "fixed"
|
|
10544
|
+
position: "fixed",
|
|
10545
|
+
// ensure dialog inherits stacking context from portal wrapper
|
|
10546
|
+
zIndex: 1
|
|
10495
10547
|
}
|
|
10496
10548
|
}
|
|
10497
10549
|
}
|
|
@@ -13931,7 +13983,7 @@ var needsRepropagation = isAndroid || isIos && !USE_NATIVE_PORTAL, PopoverContex
|
|
|
13931
13983
|
virtualRef
|
|
13932
13984
|
}), {
|
|
13933
13985
|
scope,
|
|
13934
|
-
asChild:
|
|
13986
|
+
asChild: true,
|
|
13935
13987
|
children: trigger
|
|
13936
13988
|
}));
|
|
13937
13989
|
}), PopoverContentFrame = styled(PopperContentFrame, {
|
package/dist/test.cjs
CHANGED
|
@@ -3358,6 +3358,10 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
|
|
|
3358
3358
|
if (!(!styleProps2.noSkip && subKey in skipProps)) {
|
|
3359
3359
|
if (styleProps2.noExpand) res[subKey] = val;
|
|
3360
3360
|
else if (variants2 && subKey in variants2) {
|
|
3361
|
+
if (staticConfig) {
|
|
3362
|
+
var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
|
|
3363
|
+
contextProps && subKey in contextProps && (styleState.resolvedContextVariants || (styleState.resolvedContextVariants = {}), styleState.resolvedContextVariants[subKey] = val);
|
|
3364
|
+
}
|
|
3361
3365
|
if (parentVariantKey && parentVariantKey === key) res[subKey] = // SYNC WITH *1
|
|
3362
3366
|
val[0] === "$" ? getTokenForKey(subKey, val, styleProps2, styleState) : val;
|
|
3363
3367
|
else {
|
|
@@ -3520,6 +3524,17 @@ function _type_of$5(obj) {
|
|
|
3520
3524
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3521
3525
|
}
|
|
3522
3526
|
var conf;
|
|
3527
|
+
function normalizeGroupKey(key, groupContext) {
|
|
3528
|
+
var parts = key.split("-"), plen = parts.length;
|
|
3529
|
+
if (
|
|
3530
|
+
// check if its actually a simple group selector to avoid breaking selectors
|
|
3531
|
+
plen === 2 || plen === 3 && pseudoPriorities[parts[parts.length - 1]]
|
|
3532
|
+
) {
|
|
3533
|
+
var name = parts[1];
|
|
3534
|
+
if (groupContext && !groupContext[name]) return key.replace("$group-", "$group-true-");
|
|
3535
|
+
}
|
|
3536
|
+
return key;
|
|
3537
|
+
}
|
|
3523
3538
|
function isValidStyleKey(key, validStyles2, accept) {
|
|
3524
3539
|
return key in validStyles2 ? true : accept && key in accept;
|
|
3525
3540
|
}
|
|
@@ -3547,16 +3562,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3547
3562
|
return "continue";
|
|
3548
3563
|
}
|
|
3549
3564
|
var isVariant = !isValidStyleKeyInit && variants2 && keyInit in variants2, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo ? getMediaKey(keyInit) : false, isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
3550
|
-
|
|
3551
|
-
var parts = keyInit.split("-"), plen = parts.length;
|
|
3552
|
-
if (
|
|
3553
|
-
// check if its actually a simple group selector to avoid breaking selectors
|
|
3554
|
-
plen === 2 || plen === 3 && pseudoPriorities[parts[parts.length - 1]]
|
|
3555
|
-
) {
|
|
3556
|
-
var name2 = parts[1];
|
|
3557
|
-
groupContext && !(groupContext == null ? void 0 : groupContext[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
3558
|
-
}
|
|
3559
|
-
}
|
|
3565
|
+
isMediaOrPseudo && isMedia === "group" && (keyInit = normalizeGroupKey(keyInit, groupContext));
|
|
3560
3566
|
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
|
|
3561
3567
|
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web")) return "continue";
|
|
3562
3568
|
var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
|
|
@@ -3580,7 +3586,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3580
3586
|
mergeStyle(styleState, key4, val2, 1);
|
|
3581
3587
|
return;
|
|
3582
3588
|
}
|
|
3583
|
-
if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants2 && key4 in variants2, (inlineProps == null ? void 0 : inlineProps.has(key4)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key4))) {
|
|
3589
|
+
if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants2 && key4 in variants2, 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))) {
|
|
3584
3590
|
var _props_key;
|
|
3585
3591
|
viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
3586
3592
|
}
|
|
@@ -3799,7 +3805,8 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3799
3805
|
rulesToInsert,
|
|
3800
3806
|
dynamicThemeAccess,
|
|
3801
3807
|
pseudoGroups,
|
|
3802
|
-
mediaGroups
|
|
3808
|
+
mediaGroups,
|
|
3809
|
+
resolvedContextVariants: styleState.resolvedContextVariants
|
|
3803
3810
|
}, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
3804
3811
|
if (!styleProps2.noMergeStyle && !asChildExceptStyleLike) {
|
|
3805
3812
|
var style2 = styleState.style;
|
|
@@ -4107,9 +4114,16 @@ function _type_of$4(obj) {
|
|
|
4107
4114
|
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4108
4115
|
}
|
|
4109
4116
|
var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
4110
|
-
var _animationDriver_usePresence, isHydrated = useDidFinishSSR(), needsHydration = !useIsClientOnly(),
|
|
4117
|
+
var _animationDriver_usePresence, isHydrated = useDidFinishSSR(), needsHydration = !useIsClientOnly(), useAnimations = (animationDriver == null ? void 0 : animationDriver.isStub) ? void 0 : animationDriver == null ? void 0 : animationDriver.useAnimations, {
|
|
4111
4118
|
isHOC
|
|
4112
|
-
} = staticConfig, stateRef = React.useRef(
|
|
4119
|
+
} = staticConfig, stateRef = React.useRef(
|
|
4120
|
+
// performance: avoid creating object every render
|
|
4121
|
+
void 0
|
|
4122
|
+
);
|
|
4123
|
+
stateRef.current || (stateRef.current = {
|
|
4124
|
+
startedUnhydrated: needsHydration && !isHydrated
|
|
4125
|
+
});
|
|
4126
|
+
var hasAnimationProp = !!(!isHOC && "animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
|
|
4113
4127
|
!needsHydration && hasAnimationProp && (curStateRef.hasAnimated = true);
|
|
4114
4128
|
var willBeAnimatedClient = (function() {
|
|
4115
4129
|
var next = !!(hasAnimationProp && !isHOC && useAnimations);
|
|
@@ -4149,7 +4163,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
4149
4163
|
}
|
|
4150
4164
|
var noClass = !isWeb;
|
|
4151
4165
|
return {
|
|
4152
|
-
startedUnhydrated,
|
|
4166
|
+
startedUnhydrated: curStateRef.startedUnhydrated,
|
|
4153
4167
|
curStateRef,
|
|
4154
4168
|
disabled,
|
|
4155
4169
|
groupName,
|
|
@@ -4261,7 +4275,7 @@ function createComponent(staticConfig) {
|
|
|
4261
4275
|
nextProps && (props = nextProps), overriddenContextProps = overrides;
|
|
4262
4276
|
}
|
|
4263
4277
|
var componentName2 = props.componentName || staticConfig.componentName;
|
|
4264
|
-
var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, animationDriver, staticConfig), {
|
|
4278
|
+
var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
|
|
4265
4279
|
disabled,
|
|
4266
4280
|
groupName,
|
|
4267
4281
|
hasAnimationProp,
|
|
@@ -4351,7 +4365,15 @@ function createComponent(staticConfig) {
|
|
|
4351
4365
|
willBeAnimated,
|
|
4352
4366
|
styledContext: styledContextValue
|
|
4353
4367
|
}, themeName = (themeState == null ? void 0 : themeState.name) || "";
|
|
4354
|
-
var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state, styleProps2, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles,
|
|
4368
|
+
var splitStyles = useSplitStyles(props, staticConfig, theme, themeName, state, styleProps2, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles, contextForOverride = staticConfig.context;
|
|
4369
|
+
if (splitStyles == null ? void 0 : splitStyles.resolvedContextVariants) {
|
|
4370
|
+
var _staticConfig_parentStaticConfig, contextForVariants = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
|
|
4371
|
+
if (contextForVariants) {
|
|
4372
|
+
for (var key in splitStyles.resolvedContextVariants) overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = splitStyles.resolvedContextVariants[key];
|
|
4373
|
+
staticConfig.context || (contextForOverride = contextForVariants);
|
|
4374
|
+
}
|
|
4375
|
+
}
|
|
4376
|
+
var groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
|
|
4355
4377
|
if (!isPassthrough && groupContext && // avoids onLayout if we don't need it
|
|
4356
4378
|
props.containerType !== "normal") {
|
|
4357
4379
|
var groupState = groupContext == null ? void 0 : groupContext.state;
|
|
@@ -4393,8 +4415,8 @@ function createComponent(staticConfig) {
|
|
|
4393
4415
|
}), stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
4394
4416
|
var prev = stateRef.current.nextState || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
4395
4417
|
if (!(next === prev || isEqualShallow(prev, next))) {
|
|
4396
|
-
var canAvoidReRender = Object.keys(next).every(function(
|
|
4397
|
-
return avoidReRenderKeys.has(
|
|
4418
|
+
var canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
4419
|
+
return avoidReRenderKeys.has(key3);
|
|
4398
4420
|
}), updatedState = __spreadValues(__spreadValues({}, prev), next);
|
|
4399
4421
|
if (stateRef.current.nextState = updatedState, canAvoidReRender) {
|
|
4400
4422
|
var _stateRef_current_updateStyleListener, _stateRef_current;
|
|
@@ -4640,9 +4662,9 @@ function createComponent(staticConfig) {
|
|
|
4640
4662
|
}))), "group" in props && (content = /* @__PURE__ */ jsxRuntimeExports.jsx(GroupContext.Provider, {
|
|
4641
4663
|
value: allGroupContexts,
|
|
4642
4664
|
children: content
|
|
4643
|
-
})), content = disableTheme || !splitStyles ? content : getThemedChildren(themeState, content, themeStateProps, false, stateRef), overriddenContextProps) {
|
|
4644
|
-
var Provider =
|
|
4645
|
-
for (var
|
|
4665
|
+
})), content = disableTheme || !splitStyles ? content : getThemedChildren(themeState, content, themeStateProps, false, stateRef), overriddenContextProps && contextForOverride) {
|
|
4666
|
+
var Provider = contextForOverride.Provider;
|
|
4667
|
+
for (var key1 in styledContextValue) key1 in overriddenContextProps || (overriddenContextProps[key1] = styledContextValue[key1]);
|
|
4646
4668
|
debugProp && console.info("overriddenContextProps", overriddenContextProps), content = /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, __spreadProps(__spreadValues({
|
|
4647
4669
|
__disableMergeDefaultValues: true
|
|
4648
4670
|
}, overriddenContextProps), {
|
|
@@ -4988,6 +5010,35 @@ var cache$1 = /* @__PURE__ */ new WeakMap(), createVariables = function(tokens)
|
|
|
4988
5010
|
}
|
|
4989
5011
|
return cache$1.set(res, true), res;
|
|
4990
5012
|
};
|
|
5013
|
+
var noAnimationDriver = function(method) {
|
|
5014
|
+
console.warn(`No animation driver configured. To use ${method}, you must pass \`animations\` to createTamagui. See: https://tamagui.dev/docs/core/animations`);
|
|
5015
|
+
}, createEmptyAnimationDriver = function() {
|
|
5016
|
+
return {
|
|
5017
|
+
isReactNative: false,
|
|
5018
|
+
supportsCSS: true,
|
|
5019
|
+
classNameAnimation: true,
|
|
5020
|
+
isStub: true,
|
|
5021
|
+
animations: {},
|
|
5022
|
+
useAnimations: function() {
|
|
5023
|
+
return noAnimationDriver("animations");
|
|
5024
|
+
},
|
|
5025
|
+
usePresence: function() {
|
|
5026
|
+
return noAnimationDriver("usePresence");
|
|
5027
|
+
},
|
|
5028
|
+
ResetPresence: function() {
|
|
5029
|
+
return noAnimationDriver("ResetPresence");
|
|
5030
|
+
},
|
|
5031
|
+
useAnimatedNumber: function() {
|
|
5032
|
+
return noAnimationDriver("useAnimatedNumber");
|
|
5033
|
+
},
|
|
5034
|
+
useAnimatedNumberStyle: function() {
|
|
5035
|
+
return noAnimationDriver("useAnimatedNumberStyle");
|
|
5036
|
+
},
|
|
5037
|
+
useAnimatedNumberReaction: function() {
|
|
5038
|
+
return noAnimationDriver("useAnimatedNumberReaction");
|
|
5039
|
+
}
|
|
5040
|
+
};
|
|
5041
|
+
}, defaultAnimationDriver = createEmptyAnimationDriver();
|
|
4991
5042
|
function insertFont(name, fontIn) {
|
|
4992
5043
|
var font = createFont(fontIn), tokened = createVariables(font, name), parsed = parseFont(tokened);
|
|
4993
5044
|
return setConfigFont(name, tokened, parsed), parsed;
|
|
@@ -5071,7 +5122,7 @@ function createTamagui$2(configIn) {
|
|
|
5071
5122
|
fonts: {},
|
|
5072
5123
|
onlyAllowShorthands: false,
|
|
5073
5124
|
fontLanguages: [],
|
|
5074
|
-
animations:
|
|
5125
|
+
animations: defaultAnimationDriver,
|
|
5075
5126
|
media: {}
|
|
5076
5127
|
}, configIn), {
|
|
5077
5128
|
unset,
|
|
@@ -5121,8 +5172,7 @@ function getThemesDeduped(themes2, colorTokens) {
|
|
|
5121
5172
|
e2.names.push(themeName);
|
|
5122
5173
|
continue;
|
|
5123
5174
|
}
|
|
5124
|
-
var theme = __spreadValues({}, rawTheme);
|
|
5125
|
-
colorTokens && Object.assign(theme, colorTokens);
|
|
5175
|
+
var theme = __spreadValues(__spreadValues({}, colorTokens), rawTheme);
|
|
5126
5176
|
for (var key1 in theme) ensureThemeVariable(theme, key1);
|
|
5127
5177
|
var deduped = {
|
|
5128
5178
|
names: [themeName],
|
|
@@ -10639,7 +10689,9 @@ var DialogContext = createStyledContext(
|
|
|
10639
10689
|
height: "auto",
|
|
10640
10690
|
// ensure always in frame and right height
|
|
10641
10691
|
maxHeight: "100vh",
|
|
10642
|
-
position: "fixed"
|
|
10692
|
+
position: "fixed",
|
|
10693
|
+
// ensure dialog inherits stacking context from portal wrapper
|
|
10694
|
+
zIndex: 1
|
|
10643
10695
|
}
|
|
10644
10696
|
}
|
|
10645
10697
|
}
|
|
@@ -14079,7 +14131,7 @@ var needsRepropagation = isAndroid || isIos && !USE_NATIVE_PORTAL, PopoverContex
|
|
|
14079
14131
|
virtualRef
|
|
14080
14132
|
}), {
|
|
14081
14133
|
scope,
|
|
14082
|
-
asChild:
|
|
14134
|
+
asChild: true,
|
|
14083
14135
|
children: trigger
|
|
14084
14136
|
}));
|
|
14085
14137
|
}), PopoverContentFrame = styled(PopperContentFrame, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "1.138.
|
|
3
|
+
"version": "1.138.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
6
|
"removeSideEffects": true,
|
|
@@ -81,62 +81,62 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@tamagui/accordion": "1.138.
|
|
85
|
-
"@tamagui/adapt": "1.138.
|
|
86
|
-
"@tamagui/alert-dialog": "1.138.
|
|
87
|
-
"@tamagui/animate-presence": "1.138.
|
|
88
|
-
"@tamagui/avatar": "1.138.
|
|
89
|
-
"@tamagui/button": "1.138.
|
|
90
|
-
"@tamagui/card": "1.138.
|
|
91
|
-
"@tamagui/checkbox": "1.138.
|
|
92
|
-
"@tamagui/compose-refs": "1.138.
|
|
93
|
-
"@tamagui/constants": "1.138.
|
|
94
|
-
"@tamagui/core": "1.138.
|
|
95
|
-
"@tamagui/create-context": "1.138.
|
|
96
|
-
"@tamagui/dialog": "1.138.
|
|
97
|
-
"@tamagui/elements": "1.138.
|
|
98
|
-
"@tamagui/fake-react-native": "1.138.
|
|
99
|
-
"@tamagui/focusable": "1.138.
|
|
100
|
-
"@tamagui/font-size": "1.138.
|
|
101
|
-
"@tamagui/form": "1.138.
|
|
102
|
-
"@tamagui/get-button-sized": "1.138.
|
|
103
|
-
"@tamagui/get-font-sized": "1.138.
|
|
104
|
-
"@tamagui/get-token": "1.138.
|
|
105
|
-
"@tamagui/group": "1.138.
|
|
106
|
-
"@tamagui/helpers-tamagui": "1.138.
|
|
107
|
-
"@tamagui/image": "1.138.
|
|
108
|
-
"@tamagui/label": "1.138.
|
|
109
|
-
"@tamagui/linear-gradient": "1.138.
|
|
110
|
-
"@tamagui/list-item": "1.138.
|
|
111
|
-
"@tamagui/polyfill-dev": "1.138.
|
|
112
|
-
"@tamagui/popover": "1.138.
|
|
113
|
-
"@tamagui/popper": "1.138.
|
|
114
|
-
"@tamagui/portal": "1.138.
|
|
115
|
-
"@tamagui/progress": "1.138.
|
|
116
|
-
"@tamagui/radio-group": "1.138.
|
|
117
|
-
"@tamagui/react-native-media-driver": "1.138.
|
|
118
|
-
"@tamagui/scroll-view": "1.138.
|
|
119
|
-
"@tamagui/select": "1.138.
|
|
120
|
-
"@tamagui/separator": "1.138.
|
|
121
|
-
"@tamagui/shapes": "1.138.
|
|
122
|
-
"@tamagui/sheet": "1.138.
|
|
123
|
-
"@tamagui/slider": "1.138.
|
|
124
|
-
"@tamagui/stacks": "1.138.
|
|
125
|
-
"@tamagui/switch": "1.138.
|
|
126
|
-
"@tamagui/tabs": "1.138.
|
|
127
|
-
"@tamagui/text": "1.138.
|
|
128
|
-
"@tamagui/theme": "1.138.
|
|
129
|
-
"@tamagui/toggle-group": "1.138.
|
|
130
|
-
"@tamagui/tooltip": "1.138.
|
|
131
|
-
"@tamagui/use-controllable-state": "1.138.
|
|
132
|
-
"@tamagui/use-debounce": "1.138.
|
|
133
|
-
"@tamagui/use-force-update": "1.138.
|
|
134
|
-
"@tamagui/use-window-dimensions": "1.138.
|
|
135
|
-
"@tamagui/visually-hidden": "1.138.
|
|
136
|
-
"@tamagui/z-index-stack": "1.138.
|
|
84
|
+
"@tamagui/accordion": "1.138.3",
|
|
85
|
+
"@tamagui/adapt": "1.138.3",
|
|
86
|
+
"@tamagui/alert-dialog": "1.138.3",
|
|
87
|
+
"@tamagui/animate-presence": "1.138.3",
|
|
88
|
+
"@tamagui/avatar": "1.138.3",
|
|
89
|
+
"@tamagui/button": "1.138.3",
|
|
90
|
+
"@tamagui/card": "1.138.3",
|
|
91
|
+
"@tamagui/checkbox": "1.138.3",
|
|
92
|
+
"@tamagui/compose-refs": "1.138.3",
|
|
93
|
+
"@tamagui/constants": "1.138.3",
|
|
94
|
+
"@tamagui/core": "1.138.3",
|
|
95
|
+
"@tamagui/create-context": "1.138.3",
|
|
96
|
+
"@tamagui/dialog": "1.138.3",
|
|
97
|
+
"@tamagui/elements": "1.138.3",
|
|
98
|
+
"@tamagui/fake-react-native": "1.138.3",
|
|
99
|
+
"@tamagui/focusable": "1.138.3",
|
|
100
|
+
"@tamagui/font-size": "1.138.3",
|
|
101
|
+
"@tamagui/form": "1.138.3",
|
|
102
|
+
"@tamagui/get-button-sized": "1.138.3",
|
|
103
|
+
"@tamagui/get-font-sized": "1.138.3",
|
|
104
|
+
"@tamagui/get-token": "1.138.3",
|
|
105
|
+
"@tamagui/group": "1.138.3",
|
|
106
|
+
"@tamagui/helpers-tamagui": "1.138.3",
|
|
107
|
+
"@tamagui/image": "1.138.3",
|
|
108
|
+
"@tamagui/label": "1.138.3",
|
|
109
|
+
"@tamagui/linear-gradient": "1.138.3",
|
|
110
|
+
"@tamagui/list-item": "1.138.3",
|
|
111
|
+
"@tamagui/polyfill-dev": "1.138.3",
|
|
112
|
+
"@tamagui/popover": "1.138.3",
|
|
113
|
+
"@tamagui/popper": "1.138.3",
|
|
114
|
+
"@tamagui/portal": "1.138.3",
|
|
115
|
+
"@tamagui/progress": "1.138.3",
|
|
116
|
+
"@tamagui/radio-group": "1.138.3",
|
|
117
|
+
"@tamagui/react-native-media-driver": "1.138.3",
|
|
118
|
+
"@tamagui/scroll-view": "1.138.3",
|
|
119
|
+
"@tamagui/select": "1.138.3",
|
|
120
|
+
"@tamagui/separator": "1.138.3",
|
|
121
|
+
"@tamagui/shapes": "1.138.3",
|
|
122
|
+
"@tamagui/sheet": "1.138.3",
|
|
123
|
+
"@tamagui/slider": "1.138.3",
|
|
124
|
+
"@tamagui/stacks": "1.138.3",
|
|
125
|
+
"@tamagui/switch": "1.138.3",
|
|
126
|
+
"@tamagui/tabs": "1.138.3",
|
|
127
|
+
"@tamagui/text": "1.138.3",
|
|
128
|
+
"@tamagui/theme": "1.138.3",
|
|
129
|
+
"@tamagui/toggle-group": "1.138.3",
|
|
130
|
+
"@tamagui/tooltip": "1.138.3",
|
|
131
|
+
"@tamagui/use-controllable-state": "1.138.3",
|
|
132
|
+
"@tamagui/use-debounce": "1.138.3",
|
|
133
|
+
"@tamagui/use-force-update": "1.138.3",
|
|
134
|
+
"@tamagui/use-window-dimensions": "1.138.3",
|
|
135
|
+
"@tamagui/visually-hidden": "1.138.3",
|
|
136
|
+
"@tamagui/z-index-stack": "1.138.3"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@tamagui/build": "1.138.
|
|
139
|
+
"@tamagui/build": "1.138.3",
|
|
140
140
|
"react": "*",
|
|
141
141
|
"react-native": "0.81.5",
|
|
142
142
|
"react-native-web": "^0.21.0"
|