@tamagui/core 1.105.5 → 1.105.6

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
@@ -5327,18 +5327,22 @@ var require_createMediaStyle_native = __commonJS({
5327
5327
  }
5328
5328
  var MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
5329
5329
  press: "active"
5330
- }, createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
5331
- var _styleObject = _sliced_to_array(styleObject, 5), property = _styleObject[0], _value = _styleObject[1], identifier = _styleObject[2], _pseudo = _styleObject[3], rules = _styleObject[4], conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = "".concat(ogPrefix).concat(MEDIA_SEP).concat(mediaKeyIn.replace("-", "")).concat(negKey).concat(MEDIA_SEP), styleRule = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
5330
+ }, specifities = new Array(5).fill(0).map(function(_, i) {
5331
+ return new Array(i).fill(":root").join("");
5332
+ }), createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
5333
+ var _styleObject = _sliced_to_array(styleObject, 5), property = _styleObject[0], _value = _styleObject[1], identifier = _styleObject[2], _pseudo = _styleObject[3], rules = _styleObject[4], conf = (0, import_config.getConfig)(), enableMediaPropOrder = conf.settings.mediaPropOrder, isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = "".concat(ogPrefix).concat(MEDIA_SEP).concat(mediaKeyIn.replace("-", "")).concat(negKey).concat(MEDIA_SEP), styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
5332
5334
  return rule.replace(identifier, nextIdentifier);
5333
- }).join(";");
5335
+ }).join(";"), isHover = !1;
5334
5336
  if (isNonWindowMedia) {
5335
- var precedenceImportancePrefix = new Array((priority || 0) + (isGroup ? 1 : 0)).fill(":root").join("");
5337
+ var specificity = (priority || 0) + (isGroup ? 1 : 0);
5336
5338
  if (isTheme || isGroup) {
5337
- var groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), mediaName = groupInfo == null ? void 0 : groupInfo.name;
5338
- groupMediaKey = groupInfo == null ? void 0 : groupInfo.media, isGroup && (containerName = mediaName);
5339
- var name = (isGroup ? "group_" : "") + mediaName, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupInfo.pseudo ? groupPseudoToPseudoCSSMap[groupInfo.pseudo] || groupInfo.pseudo : void 0, pseudoSelector = pseudoSelectorName ? ":".concat(pseudoSelectorName) : "", presedencePrefix = ":root".concat(precedenceImportancePrefix).concat(precedenceSpace), mediaSelector = ".t_".concat(name).concat(pseudoSelector), nextSelector = "".concat(presedencePrefix).concat(mediaSelector, " ").concat(selector.replace(":root", ""));
5339
+ var _getGroupPropParts = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyIn), name = _getGroupPropParts.name, media = _getGroupPropParts.media, pseudo = _getGroupPropParts.pseudo;
5340
+ groupMediaKey = media, isGroup && (containerName = name);
5341
+ var groupClassName = (isGroup ? "group_" : "") + name, selectorStart = styleInner.indexOf(":root"), selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = pseudo ? groupPseudoToPseudoCSSMap[pseudo] || pseudo : void 0;
5342
+ pseudo === "press" && (specificity += 2), pseudo === "hover" && (isHover = !0);
5343
+ var pseudoSelector = pseudoSelectorName ? ":".concat(pseudoSelectorName) : "", presedencePrefix = ":root".concat(specifities[specificity]).concat(precedenceSpace), mediaSelector = ".t_".concat(groupClassName).concat(pseudoSelector), nextSelector = "".concat(presedencePrefix).concat(mediaSelector, " ").concat(selector.replace(":root", ""));
5340
5344
  styleRule = styleInner.replace(selector, nextSelector);
5341
- } else styleRule = "".concat(precedenceImportancePrefix).concat(styleInner);
5345
+ } else styleRule = "".concat(specifities[specificity]).concat(styleInner);
5342
5346
  }
5343
5347
  if (!isNonWindowMedia || groupMediaKey) {
5344
5348
  if (!selectors) {
@@ -5355,16 +5359,16 @@ var require_createMediaStyle_native = __commonJS({
5355
5359
  ];
5356
5360
  })));
5357
5361
  }
5358
- var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector1 = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = "".concat(screenStr).concat(mediaSelector1), precedenceImportancePrefix1 = groupMediaKey ? "" : enableMediaPropOrder ? (
5362
+ var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector1 = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = "".concat(screenStr).concat(mediaSelector1), precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
5359
5363
  // this new array should be cached
5360
- new Array(priority).fill(":root").join("")
5364
+ specifities[priority]
5361
5365
  ) : (
5362
5366
  // @ts-ignore
5363
5367
  prefixes[mediaKey]
5364
5368
  ), prefix = groupMediaKey ? "@container ".concat(containerName) : "@media";
5365
- groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", " and ".concat(mediaQuery, " {")).replace("and screen and", "and") : styleRule = "".concat(prefix, " ").concat(mediaQuery, "{").concat(precedenceImportancePrefix1).concat(styleInner, "}"), groupMediaKey && (styleRule = "@supports (contain: ".concat(conf.settings.webContainerType || "inline-size", ") {").concat(styleRule, "}"));
5369
+ groupMediaKey && (styleInner = styleRule), styleInner.includes(prefix) ? styleRule = styleInner.replace("{", " and ".concat(mediaQuery, " {")).replace("and screen and", "and") : styleRule = "".concat(prefix, " ").concat(mediaQuery, "{").concat(precedenceImportancePrefix).concat(styleInner, "}"), groupMediaKey && (styleRule = "@supports (contain: ".concat(conf.settings.webContainerType || "inline-size", ") {").concat(styleRule, "}"));
5366
5370
  }
5367
- return [
5371
+ return isHover && (styleRule = "@media (hover:hover){".concat(styleRule, "}")), [
5368
5372
  property,
5369
5373
  void 0,
5370
5374
  nextIdentifier,
@@ -9533,7 +9537,11 @@ var require_createComponent_native = __commonJS({
9533
9537
  var shouldAvoidClasses = !import_constants.isWeb;
9534
9538
  if (import_constants.isWeb) {
9535
9539
  var disableClassName = props.disableClassName, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
9536
- (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0);
9540
+ (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
9541
+ isAnimatedAndHydrated,
9542
+ isDisabledManually,
9543
+ isClassNameDisabled
9544
+ }));
9537
9545
  }
9538
9546
  var groupName = props.group;
9539
9547
  if (groupName && !curStateRef.group) {
@@ -11567,7 +11575,7 @@ var require_styled_native = __commonJS({
11567
11575
  }
11568
11576
  }
11569
11577
  (parentDefaultProps || defaultVariants || parentDefaultVariants) && (defaultProps = _object_spread2({}, parentDefaultProps, parentDefaultVariants, defaultProps, defaultVariants)), parentStaticConfig != null && parentStaticConfig.isHOC && name && (defaultProps.componentName = name);
11570
- var isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName)), conf = _object_spread_props(_object_spread2(_object_spread_props(_object_spread2({}, parentStaticConfig, staticExtractionOptions, !isPlainStyledComponent && {
11578
+ var isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), _staticExtractionOptions_acceptsClassName, _ref, acceptsClassName = (_ref = (_staticExtractionOptions_acceptsClassName = staticExtractionOptions == null ? void 0 : staticExtractionOptions.acceptsClassName) !== null && _staticExtractionOptions_acceptsClassName !== void 0 ? _staticExtractionOptions_acceptsClassName : acceptsClassNameProp) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName), conf = _object_spread_props(_object_spread2(_object_spread_props(_object_spread2({}, parentStaticConfig, staticExtractionOptions, !isPlainStyledComponent && {
11571
11579
  Component
11572
11580
  }), {
11573
11581
  // @ts-expect-error