tamagui 1.80.4 → 1.81.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.
- package/dist/native.js +51 -41
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +51 -41
- package/dist/test.native.js.map +1 -1
- package/package.json +52 -52
package/dist/native.js
CHANGED
|
@@ -1568,7 +1568,7 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
1568
1568
|
for (let key in obj) {
|
|
1569
1569
|
k += key;
|
|
1570
1570
|
let arg = obj[key], type = typeof arg;
|
|
1571
|
-
if (!arg || type !== "object")
|
|
1571
|
+
if (!arg || type !== "object" && type !== "function")
|
|
1572
1572
|
k += type + arg;
|
|
1573
1573
|
else if (cache.has(arg))
|
|
1574
1574
|
k += cache.get(arg);
|
|
@@ -1607,7 +1607,7 @@ var require_createStyledContext_native = __commonJS({
|
|
|
1607
1607
|
scope,
|
|
1608
1608
|
...values
|
|
1609
1609
|
}) => {
|
|
1610
|
-
let
|
|
1610
|
+
let next = (0, import_react2.useMemo)(() => ({
|
|
1611
1611
|
// this ! is a workaround for ts error
|
|
1612
1612
|
...defaultValues,
|
|
1613
1613
|
...values
|
|
@@ -1616,7 +1616,7 @@ var require_createStyledContext_native = __commonJS({
|
|
|
1616
1616
|
let ScopedContext = scopedContexts.get(scope);
|
|
1617
1617
|
ScopedContext || (ScopedContext = (0, import_react2.createContext)(defaultValues), scopedContexts.set(scope, ScopedContext)), Provider2 = ScopedContext.Provider;
|
|
1618
1618
|
}
|
|
1619
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value, children });
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider2, { value: next, children });
|
|
1620
1620
|
}, useStyledContext = (scope) => {
|
|
1621
1621
|
let context = scope ? scopedContexts.get(scope) : OGContext;
|
|
1622
1622
|
return (0, import_react2.useContext)(context);
|
|
@@ -3318,37 +3318,43 @@ var require_propMapper_native = __commonJS({
|
|
|
3318
3318
|
fontSize: "size",
|
|
3319
3319
|
fontWeight: "weight"
|
|
3320
3320
|
}, lastFontFamilyToken = null, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
|
|
3321
|
-
var _a, _b, _c;
|
|
3321
|
+
var _a, _b, _c, _d;
|
|
3322
3322
|
if (resolveAs === "none")
|
|
3323
3323
|
return value;
|
|
3324
|
-
let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
|
|
3324
|
+
let { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
|
|
3325
3325
|
if (theme && value in theme)
|
|
3326
3326
|
valOrVar = theme[value], process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(` - resolving ${key} to theme value ${value}: ${(_a = valOrVar == null ? void 0 : valOrVar.get) == null ? void 0 : _a.call(valOrVar)}`), hasSet = !0;
|
|
3327
3327
|
else if (value in conf.specificTokens)
|
|
3328
3328
|
hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
3329
3329
|
else {
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3330
|
+
let customTokenAccept = (_b = staticConfig == null ? void 0 : staticConfig.acceptTokens) == null ? void 0 : _b[key];
|
|
3331
|
+
if (customTokenAccept) {
|
|
3332
|
+
let val = tokensParsed[customTokenAccept][value];
|
|
3333
|
+
val && (valOrVar = val, hasSet = !0);
|
|
3334
|
+
} else {
|
|
3335
|
+
switch (key) {
|
|
3336
|
+
case "fontFamily": {
|
|
3337
|
+
valOrVar = ((_c = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _c.family) || value, lastFontFamilyToken = value, hasSet = !0;
|
|
3338
|
+
break;
|
|
3339
|
+
}
|
|
3340
|
+
case "fontSize":
|
|
3341
|
+
case "lineHeight":
|
|
3342
|
+
case "letterSpacing":
|
|
3343
|
+
case "fontWeight": {
|
|
3344
|
+
let defaultFont = conf.defaultFont || "$body", fam = fontFamily || defaultFont;
|
|
3345
|
+
if (fam) {
|
|
3346
|
+
let fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed[fam] || fontsParsed[defaultFont];
|
|
3347
|
+
valOrVar = ((_d = font == null ? void 0 : font[fontShorthand[key] || key]) == null ? void 0 : _d[value]) || value, hasSet = !0;
|
|
3348
|
+
}
|
|
3349
|
+
break;
|
|
3343
3350
|
}
|
|
3344
|
-
break;
|
|
3345
3351
|
}
|
|
3352
|
+
for (let cat in import_helpers.tokenCategories)
|
|
3353
|
+
if (key in import_helpers.tokenCategories[cat]) {
|
|
3354
|
+
let res = tokensParsed[cat][value];
|
|
3355
|
+
res != null && (valOrVar = res, hasSet = !0);
|
|
3356
|
+
}
|
|
3346
3357
|
}
|
|
3347
|
-
for (let cat in import_helpers.tokenCategories)
|
|
3348
|
-
if (key in import_helpers.tokenCategories[cat]) {
|
|
3349
|
-
let res = tokensParsed[cat][value];
|
|
3350
|
-
res != null && (valOrVar = res, hasSet = !0);
|
|
3351
|
-
}
|
|
3352
3358
|
if (!hasSet) {
|
|
3353
3359
|
let spaceVar = tokensParsed.space[value];
|
|
3354
3360
|
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
@@ -3394,7 +3400,12 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3394
3400
|
useSplitStyles: () => useSplitStyles
|
|
3395
3401
|
});
|
|
3396
3402
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3397
|
-
var import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_react2 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-"
|
|
3403
|
+
var import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_react2 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3404
|
+
function isValidStyleKey(key, staticConfig) {
|
|
3405
|
+
let validStyleProps = staticConfig.validStyles ?? (staticConfig.isText ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
3406
|
+
return key in validStyleProps || staticConfig.acceptTokens && key in staticConfig.acceptTokens;
|
|
3407
|
+
}
|
|
3408
|
+
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3398
3409
|
var _a, _b, _c, _e, _f, _g;
|
|
3399
3410
|
conf = conf || (0, import_config.getConfig)(), import_constants4.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3400
3411
|
let { shorthands } = conf, {
|
|
@@ -3406,7 +3417,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3406
3417
|
inlineWhenUnflattened,
|
|
3407
3418
|
parentStaticConfig,
|
|
3408
3419
|
acceptsClassName
|
|
3409
|
-
} = staticConfig,
|
|
3420
|
+
} = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = "", mediaStylesSeen = 0, styleState = {
|
|
3410
3421
|
curProps: { ...props },
|
|
3411
3422
|
classNames,
|
|
3412
3423
|
conf,
|
|
@@ -3434,7 +3445,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3434
3445
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
3435
3446
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !isHOC)
|
|
3436
3447
|
continue;
|
|
3437
|
-
let valInitType = typeof valInit;
|
|
3448
|
+
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3438
3449
|
if (styleState.curProps[keyInit] = valInit, !import_constants4.isAndroid && keyInit === "elevationAndroid")
|
|
3439
3450
|
continue;
|
|
3440
3451
|
if (keyInit === "userSelect")
|
|
@@ -3483,7 +3494,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3483
3494
|
case "accessibilityRequired":
|
|
3484
3495
|
default:
|
|
3485
3496
|
}
|
|
3486
|
-
let
|
|
3497
|
+
let isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo), isStyleProp = isMediaOrPseudo || isVariant && !styleProps.noExpand || isValidStyleKeyInit || isShorthand;
|
|
3487
3498
|
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
|
|
3488
3499
|
continue;
|
|
3489
3500
|
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
@@ -3704,7 +3715,7 @@ current`, {
|
|
|
3704
3715
|
if (
|
|
3705
3716
|
// is HOC we can just pass through the styles as props
|
|
3706
3717
|
// this fixes issues where style prop got merged with wrong priority
|
|
3707
|
-
!isHOC && (key
|
|
3718
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants4.isAndroid && key === "elevation")
|
|
3708
3719
|
) {
|
|
3709
3720
|
mergeStyle(styleState, key, val);
|
|
3710
3721
|
continue;
|
|
@@ -5081,7 +5092,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5081
5092
|
subscribe: groupState.subscribe
|
|
5082
5093
|
};
|
|
5083
5094
|
}, [groupName]);
|
|
5084
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
5095
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
5085
5096
|
let contextProps = staticConfig.context.props;
|
|
5086
5097
|
for (let key in contextProps)
|
|
5087
5098
|
(key in style || key in viewProps) && (overriddenContextProps ||= {}, overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
@@ -6365,7 +6376,6 @@ var require_Text_native = __commonJS({
|
|
|
6365
6376
|
}
|
|
6366
6377
|
}
|
|
6367
6378
|
},
|
|
6368
|
-
deoptProps: /* @__PURE__ */ new Set(["ellipse"]),
|
|
6369
6379
|
validStyles: {
|
|
6370
6380
|
...import_helpers.validStyles,
|
|
6371
6381
|
...import_helpers.stylePropsTextOnly
|
|
@@ -12216,7 +12226,7 @@ var require_Button_native = __commonJS({
|
|
|
12216
12226
|
Icon: ButtonIcon
|
|
12217
12227
|
});
|
|
12218
12228
|
function useButton({ textProps, ...propsIn }, { Text: Text3 = Button2.Text } = { Text: Button2.Text }) {
|
|
12219
|
-
let isNested = (0, import_react2.useContext)(import_stacks3.ButtonNestingContext),
|
|
12229
|
+
let isNested = (0, import_react2.useContext)(import_stacks3.ButtonNestingContext), propsActive = (0, import_web.useProps)(propsIn), {
|
|
12220
12230
|
icon,
|
|
12221
12231
|
iconAfter,
|
|
12222
12232
|
space,
|
|
@@ -12227,6 +12237,7 @@ var require_Button_native = __commonJS({
|
|
|
12227
12237
|
noTextWrap,
|
|
12228
12238
|
fontFamily,
|
|
12229
12239
|
fontSize,
|
|
12240
|
+
tag,
|
|
12230
12241
|
...restProps
|
|
12231
12242
|
} = propsActive, size2 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2)) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
12232
12243
|
size: iconSize,
|
|
@@ -12245,11 +12256,7 @@ var require_Button_native = __commonJS({
|
|
|
12245
12256
|
separator,
|
|
12246
12257
|
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
12247
12258
|
children: [themedIcon, ...contents, themedIconAfter]
|
|
12248
|
-
}),
|
|
12249
|
-
// defaults to <a /> when accessibilityRole = link
|
|
12250
|
-
// see https://github.com/tamagui/tamagui/issues/505
|
|
12251
|
-
propsActive.accessibilityRole === "link" ? "a" : void 0
|
|
12252
|
-
), props = {
|
|
12259
|
+
}), props = {
|
|
12253
12260
|
size: size2,
|
|
12254
12261
|
...propsIn.disabled && {
|
|
12255
12262
|
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
@@ -12259,13 +12266,16 @@ var require_Button_native = __commonJS({
|
|
|
12259
12266
|
borderColor: "$background"
|
|
12260
12267
|
}
|
|
12261
12268
|
},
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12269
|
+
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
12270
|
+
tag: tag ?? (isNested ? "span" : (
|
|
12271
|
+
// defaults to <a /> when accessibilityRole = link
|
|
12272
|
+
// see https://github.com/tamagui/tamagui/issues/505
|
|
12273
|
+
propsActive.accessibilityRole === "link" ? "a" : "button"
|
|
12274
|
+
)),
|
|
12265
12275
|
...restProps,
|
|
12266
12276
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: inner }),
|
|
12267
12277
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
12268
|
-
disableClassName:
|
|
12278
|
+
disableClassName: !0
|
|
12269
12279
|
};
|
|
12270
12280
|
return {
|
|
12271
12281
|
spaceSize,
|