@tamagui/core 1.75.6 → 1.75.7

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 CHANGED
@@ -2378,65 +2378,6 @@ var require_createMediaStyle_native = __commonJS({
2378
2378
  }
2379
2379
  });
2380
2380
 
2381
- // ../web/dist/cjs/helpers/expandStyle.native.js
2382
- var require_expandStyle_native = __commonJS({
2383
- "../web/dist/cjs/helpers/expandStyle.native.js"(exports, module2) {
2384
- "use strict";
2385
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all2) => {
2386
- for (var name in all2)
2387
- __defProp2(target, name, { get: all2[name], enumerable: !0 });
2388
- }, __copyProps2 = (to, from, except, desc) => {
2389
- if (from && typeof from == "object" || typeof from == "function")
2390
- for (let key of __getOwnPropNames2(from))
2391
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
2392
- return to;
2393
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyle_exports = {};
2394
- __export2(expandStyle_exports, {
2395
- expandStyle: () => expandStyle
2396
- });
2397
- module2.exports = __toCommonJS2(expandStyle_exports);
2398
- var import_constants2 = require_index_native2();
2399
- function expandStyle(key, value) {
2400
- if (!1)
2401
- switch (key) {
2402
- case "textAlignVertical":
2403
- case "writingDirection":
2404
- }
2405
- if (import_constants2.isAndroid && key === "elevationAndroid")
2406
- return [["elevation", value]];
2407
- if (key in EXPANSIONS)
2408
- return EXPANSIONS[key].map((key2) => [key2, value]);
2409
- }
2410
- var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = {
2411
- borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
2412
- borderRadius: [
2413
- "TopLeftRadius",
2414
- "TopRightRadius",
2415
- "BottomRightRadius",
2416
- "BottomLeftRadius"
2417
- ],
2418
- borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
2419
- margin: all,
2420
- marginHorizontal: horiz,
2421
- marginVertical: vert,
2422
- overscrollBehavior: xy,
2423
- padding: all,
2424
- paddingHorizontal: horiz,
2425
- paddingVertical: vert,
2426
- ...import_constants2.isWeb && {
2427
- // react-native only supports borderStyle
2428
- borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
2429
- // react-native doesn't support X / Y
2430
- overflow: xy
2431
- }
2432
- }, _a;
2433
- for (let parent in EXPANSIONS) {
2434
- let prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
2435
- EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
2436
- }
2437
- }
2438
- });
2439
-
2440
2381
  // ../../node_modules/@react-native/normalize-color/index.js
2441
2382
  var require_normalize_color = __commonJS({
2442
2383
  "../../node_modules/@react-native/normalize-color/index.js"(exports, module2) {
@@ -3078,26 +3019,10 @@ var require_expandStyles_native = __commonJS({
3078
3019
  return to;
3079
3020
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyles_exports = {};
3080
3021
  __export2(expandStyles_exports, {
3081
- expandStylesAndRemoveNullishValues: () => expandStylesAndRemoveNullishValues,
3082
3022
  fixStyles: () => fixStyles
3083
3023
  });
3084
3024
  module2.exports = __toCommonJS2(expandStyles_exports);
3085
- var import_constants2 = require_index_native2(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
3086
- function expandStylesAndRemoveNullishValues(style) {
3087
- let res = {};
3088
- for (let key in style) {
3089
- let valIn = style[key];
3090
- if (valIn == null)
3091
- continue;
3092
- if (key in import_pseudoDescriptors.pseudoDescriptors) {
3093
- res[key] = expandStylesAndRemoveNullishValues(valIn);
3094
- continue;
3095
- }
3096
- let val = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(valIn, key), out = (0, import_expandStyle.expandStyle)(key, val);
3097
- out ? Object.assign(res, Object.fromEntries(out)) : res[key] = val;
3098
- }
3099
- return fixStyles(res), res;
3100
- }
3025
+ var import_constants2 = require_index_native2(), import_normalizeShadow = require_normalizeShadow_native();
3101
3026
  function fixStyles(style) {
3102
3027
  "elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
3103
3028
  for (let key in borderDefaults)
@@ -3139,6 +3064,101 @@ var require_getStylesAtomic_native = __commonJS({
3139
3064
  }
3140
3065
  });
3141
3066
 
3067
+ // ../web/dist/cjs/helpers/expandStyle.native.js
3068
+ var require_expandStyle_native = __commonJS({
3069
+ "../web/dist/cjs/helpers/expandStyle.native.js"(exports, module2) {
3070
+ "use strict";
3071
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all2) => {
3072
+ for (var name in all2)
3073
+ __defProp2(target, name, { get: all2[name], enumerable: !0 });
3074
+ }, __copyProps2 = (to, from, except, desc) => {
3075
+ if (from && typeof from == "object" || typeof from == "function")
3076
+ for (let key of __getOwnPropNames2(from))
3077
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3078
+ return to;
3079
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStyle_exports = {};
3080
+ __export2(expandStyle_exports, {
3081
+ expandStyle: () => expandStyle
3082
+ });
3083
+ module2.exports = __toCommonJS2(expandStyle_exports);
3084
+ var import_constants2 = require_index_native2();
3085
+ function expandStyle(key, value) {
3086
+ if (!1)
3087
+ switch (key) {
3088
+ case "textAlignVertical":
3089
+ case "writingDirection":
3090
+ }
3091
+ if (import_constants2.isAndroid && key === "elevationAndroid")
3092
+ return [["elevation", value]];
3093
+ if (key in EXPANSIONS)
3094
+ return EXPANSIONS[key].map((key2) => [key2, value]);
3095
+ }
3096
+ var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = {
3097
+ borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
3098
+ borderRadius: [
3099
+ "TopLeftRadius",
3100
+ "TopRightRadius",
3101
+ "BottomRightRadius",
3102
+ "BottomLeftRadius"
3103
+ ],
3104
+ borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
3105
+ margin: all,
3106
+ marginHorizontal: horiz,
3107
+ marginVertical: vert,
3108
+ overscrollBehavior: xy,
3109
+ padding: all,
3110
+ paddingHorizontal: horiz,
3111
+ paddingVertical: vert,
3112
+ ...import_constants2.isWeb && {
3113
+ // react-native only supports borderStyle
3114
+ borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
3115
+ // react-native doesn't support X / Y
3116
+ overflow: xy
3117
+ }
3118
+ }, _a;
3119
+ for (let parent in EXPANSIONS) {
3120
+ let prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
3121
+ EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
3122
+ }
3123
+ }
3124
+ });
3125
+
3126
+ // ../web/dist/cjs/helpers/expandStylesAndRemoveNullishValues.native.js
3127
+ var require_expandStylesAndRemoveNullishValues_native = __commonJS({
3128
+ "../web/dist/cjs/helpers/expandStylesAndRemoveNullishValues.native.js"(exports, module2) {
3129
+ "use strict";
3130
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
3131
+ for (var name in all)
3132
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
3133
+ }, __copyProps2 = (to, from, except, desc) => {
3134
+ if (from && typeof from == "object" || typeof from == "function")
3135
+ for (let key of __getOwnPropNames2(from))
3136
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
3137
+ return to;
3138
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), expandStylesAndRemoveNullishValues_exports = {};
3139
+ __export2(expandStylesAndRemoveNullishValues_exports, {
3140
+ expandStylesAndRemoveNullishValues: () => expandStylesAndRemoveNullishValues
3141
+ });
3142
+ module2.exports = __toCommonJS2(expandStylesAndRemoveNullishValues_exports);
3143
+ var import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
3144
+ function expandStylesAndRemoveNullishValues(style, disableNormalize = !1) {
3145
+ let res = {};
3146
+ for (let key in style) {
3147
+ let prop = style[key];
3148
+ if (prop == null)
3149
+ continue;
3150
+ if (key in import_pseudoDescriptors.pseudoDescriptors) {
3151
+ res[key] = expandStylesAndRemoveNullishValues(prop, disableNormalize);
3152
+ continue;
3153
+ }
3154
+ let value = disableNormalize ? prop : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(prop, key), out = (0, import_expandStyle.expandStyle)(key, value);
3155
+ out ? Object.assign(res, Object.fromEntries(out)) : res[key] = value;
3156
+ }
3157
+ return (0, import_expandStyles.fixStyles)(res), res;
3158
+ }
3159
+ }
3160
+ });
3161
+
3142
3162
  // ../web/dist/cjs/helpers/getVariantExtras.native.js
3143
3163
  var require_getVariantExtras_native = __commonJS({
3144
3164
  "../web/dist/cjs/helpers/getVariantExtras.native.js"(exports, module2) {
@@ -3245,7 +3265,7 @@ var require_propMapper_native = __commonJS({
3245
3265
  propMapper: () => propMapper
3246
3266
  });
3247
3267
  module2.exports = __toCommonJS2(propMapper_exports);
3248
- var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
3268
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
3249
3269
  if (!import_constants2.isAndroid && key === "elevationAndroid")
3250
3270
  return;
3251
3271
  let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
@@ -3302,7 +3322,10 @@ var require_propMapper_native = __commonJS({
3302
3322
  );
3303
3323
  }
3304
3324
  if (variantValue) {
3305
- let expanded = (0, import_expandStyles.expandStylesAndRemoveNullishValues)(variantValue), next = Object.entries(expanded);
3325
+ let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
3326
+ variantValue,
3327
+ !!styleProps.noNormalize
3328
+ ), next = Object.entries(expanded);
3306
3329
  return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
3307
3330
  }
3308
3331
  };
@@ -3467,7 +3490,7 @@ var require_getSplitStyles_native = __commonJS({
3467
3490
  module2.exports = __toCommonJS2(getSplitStyles_exports);
3468
3491
  var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), 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_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3469
3492
  var _a, _b, _c, _e, _f, _g;
3470
- conf = conf || (0, import_config.getConfig)();
3493
+ conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
3471
3494
  let { shorthands } = conf, {
3472
3495
  isHOC,
3473
3496
  isText,
@@ -3538,7 +3561,7 @@ var require_getSplitStyles_native = __commonJS({
3538
3561
  continue;
3539
3562
  }
3540
3563
  if (keyInit[0] === "_" && keyInit.startsWith("_style")) {
3541
- mergeStyleProp(styleState, valInit);
3564
+ mergeStylePropIntoStyle(styleState, valInit);
3542
3565
  continue;
3543
3566
  }
3544
3567
  if (!1 && !(keyInit in accessibilityDirectMap))
@@ -3792,7 +3815,7 @@ current`, {
3792
3815
  }
3793
3816
  }
3794
3817
  }
3795
- if (props.style && mergeStyleProp(styleState, props.style), !styleProps.noNormalize && ((0, import_expandStyles.fixStyles)(style), import_constants2.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
3818
+ if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants2.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
3796
3819
  mergeTransform(style, key, val, !0);
3797
3820
  }), parentSplitStyles && !shouldDoClasses))
3798
3821
  for (let key in parentSplitStyles.style)
@@ -3840,14 +3863,14 @@ current`, {
3840
3863
  }
3841
3864
  return result;
3842
3865
  };
3843
- function mergeStyle(styleState, key, val) {
3866
+ function mergeStyle(styleState, key, val, disableNormalize = !1) {
3844
3867
  let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
3845
3868
  if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_")
3846
3869
  classNames[key] = val, usedKeys[key] ||= 1;
3847
3870
  else if (key in import_helpers.stylePropsTransform)
3848
3871
  styleState.transforms ||= {}, styleState.transforms[key] = val;
3849
3872
  else {
3850
- let out = import_constants2.isWeb && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
3873
+ let out = import_constants2.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
3851
3874
  key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
3852
3875
  }
3853
3876
  }
@@ -3863,17 +3886,13 @@ current`, {
3863
3886
  }
3864
3887
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
3865
3888
  };
3866
- function mergeStyleProp(styleState, val) {
3867
- if (!val)
3868
- return;
3869
- let styles = [].concat(val).flat();
3870
- for (let cur of styles)
3871
- if (cur)
3872
- if (cur.$$css)
3873
- Object.assign(styleState.classNames, cur);
3874
- else
3875
- for (let key in cur)
3876
- key in styleState.usedKeys || mergeStyle(styleState, key, cur[key]);
3889
+ function mergeStylePropIntoStyle(styleState, cur) {
3890
+ if (cur)
3891
+ if (cur.$$css)
3892
+ Object.assign(styleState.classNames, cur);
3893
+ else
3894
+ for (let key in cur)
3895
+ key in styleState.usedKeys || mergeStyle(styleState, key, cur[key]);
3877
3896
  }
3878
3897
  var useInsertEffectCompat = import_constants2.isWeb ? import_react3.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : () => {
3879
3898
  }, useSplitStyles = (...args) => {
@@ -5197,11 +5216,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
5197
5216
  }
5198
5217
  function styleable(Component2, options) {
5199
5218
  var _a2;
5200
- let ComponentForwardedRef = ((_a2 = Component2.render) == null ? void 0 : _a2.length) === 2 ? Component2 : (
5201
- // memo because theme changes otherwise would always re-render
5202
- (0, import_react3.memo)((0, import_react3.forwardRef)(Component2))
5203
- ), extendedConfig = extendStyledConfig(options == null ? void 0 : options.staticConfig), out = options != null && options.disableTheme ? ComponentForwardedRef : (0, import_themeable.themeable)(ComponentForwardedRef, extendedConfig);
5204
- return out.staticConfig = extendedConfig, out.styleable = styleable, out;
5219
+ let out = ((_a2 = Component2.render) == null ? void 0 : _a2.length) === 2 ? Component2 : (0, import_react3.forwardRef)(Component2), extendedConfig = extendStyledConfig(options == null ? void 0 : options.staticConfig);
5220
+ return out = options != null && options.disableTheme ? out : (0, import_themeable.themeable)(out, extendedConfig), process.env.TAMAGUI_MEMOIZE_STYLEABLE && (out = (0, import_react3.memo)(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
5205
5221
  }
5206
5222
  return res.extractable = extractable, res.styleable = styleable, res;
5207
5223
  }
@@ -6687,6 +6703,7 @@ var require_index_native9 = __commonJS({
6687
6703
  __reExport2(src_exports2, require_ComponentContext_native(), module2.exports);
6688
6704
  __reExport2(src_exports2, require_createStyledContext_native(), module2.exports);
6689
6705
  __reExport2(src_exports2, require_expandStyles_native(), module2.exports);
6706
+ __reExport2(src_exports2, require_expandStylesAndRemoveNullishValues_native(), module2.exports);
6690
6707
  __reExport2(src_exports2, require_propMapper_native(), module2.exports);
6691
6708
  __reExport2(src_exports2, require_getExpandedShorthands_native(), module2.exports);
6692
6709
  __reExport2(src_exports2, require_getSplitStyles_native(), module2.exports);