tamagui 1.101.4 → 1.101.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
@@ -2753,45 +2753,34 @@ var require_insertStyleRule_native = __commonJS({
2753
2753
  }
2754
2754
  function insertStyleRules(rulesToInsert) {
2755
2755
  if (!process.env.TAMAGUI_REACT_19) {
2756
- if (!rulesToInsert.length || !sheet) return;
2757
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2758
- try {
2759
- for (var _iterator = rulesToInsert[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2760
- var styleObject = _step.value, identifier = styleObject[import_helpers.StyleObjectIdentifier];
2761
- if (shouldInsertStyleRules(identifier)) {
2762
- var rules = styleObject[import_helpers.StyleObjectRules];
2763
- allSelectors[identifier] = rules.join(`
2756
+ if (!sheet) return;
2757
+ for (var key in rulesToInsert) {
2758
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
2759
+ if (shouldInsertStyleRules(identifier)) {
2760
+ var rules = styleObject[import_helpers.StyleObjectRules];
2761
+ allSelectors[identifier] = rules.join(`
2764
2762
  `), track(identifier), updateRules(identifier, rules);
2765
- var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
2766
- try {
2767
- for (var _iterator1 = rules[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
2768
- var rule = _step1.value;
2769
- if (process.env.NODE_ENV === "production") try {
2770
- sheet.insertRule(rule, sheet.cssRules.length);
2771
- } catch (err) {
2772
- console.error("Error inserting CSS", err);
2773
- }
2774
- else sheet.insertRule(rule, sheet.cssRules.length);
2763
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2764
+ try {
2765
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2766
+ var rule = _step.value;
2767
+ if (process.env.NODE_ENV === "production") try {
2768
+ sheet.insertRule(rule, sheet.cssRules.length);
2769
+ } catch (err) {
2770
+ console.error("Error inserting CSS", err);
2775
2771
  }
2776
- } catch (err) {
2777
- _didIteratorError1 = !0, _iteratorError1 = err;
2772
+ else sheet.insertRule(rule, sheet.cssRules.length);
2773
+ }
2774
+ } catch (err) {
2775
+ _didIteratorError = !0, _iteratorError = err;
2776
+ } finally {
2777
+ try {
2778
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2778
2779
  } finally {
2779
- try {
2780
- !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
2781
- } finally {
2782
- if (_didIteratorError1) throw _iteratorError1;
2783
- }
2780
+ if (_didIteratorError) throw _iteratorError;
2784
2781
  }
2785
2782
  }
2786
2783
  }
2787
- } catch (err) {
2788
- _didIteratorError = !0, _iteratorError = err;
2789
- } finally {
2790
- try {
2791
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2792
- } finally {
2793
- if (_didIteratorError) throw _iteratorError;
2794
- }
2795
2784
  }
2796
2785
  }
2797
2786
  }
@@ -7793,7 +7782,7 @@ current`, _object_spread9({}, styleState.style)));
7793
7782
  try {
7794
7783
  for (var _iterator = pseudoStyles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
7795
7784
  var psuedoStyle = _step.value, fullKey = "".concat(psuedoStyle[import_helpers.StyleObjectProperty]).concat(PROP_SPLIT).concat(descriptor.name);
7796
- fullKey in usedKeys || mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0);
7785
+ fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0));
7797
7786
  }
7798
7787
  } catch (err) {
7799
7788
  _didIteratorError = !0, _iteratorError = err;
@@ -7875,7 +7864,7 @@ current`, _object_spread9({}, styleState.style)));
7875
7864
  var style = _step1.value, out = (0, import_createMediaStyle.createMediaStyle)(style, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
7876
7865
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
7877
7866
  var fullKey1 = "".concat(style[import_helpers.StyleObjectProperty]).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style[import_helpers.StyleObjectPseudo] || "");
7878
- fullKey1 in usedKeys || mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0);
7867
+ fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
7879
7868
  }
7880
7869
  } catch (err) {
7881
7870
  _didIteratorError1 = !0, _iteratorError1 = err;
@@ -8120,7 +8109,11 @@ current`, _object_spread9({}, styleState.style)));
8120
8109
  conf = conf || (0, import_config.getConfig)();
8121
8110
  var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
8122
8111
  return res;
8123
- }, defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = _object_spread_props8(_object_spread9({}, Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
8112
+ };
8113
+ function addStyleToInsertRules(rulesToInsert, styleObject) {
8114
+ if (0) var identifier;
8115
+ }
8116
+ var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = _object_spread_props8(_object_spread9({}, Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
8124
8117
  var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
8125
8118
  return [
8126
8119
  k,
@@ -9746,23 +9739,27 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9746
9739
  children: content
9747
9740
  }));
9748
9741
  }
9749
- if (process.env.TAMAGUI_REACT_19 && splitStyles.rulesToInsert.length && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
9750
- children: [
9751
- content,
9752
- /* lets see if we can put a single style tag per rule for optimal de-duping */
9753
- splitStyles.rulesToInsert.map(function(styleObject) {
9754
- var identifier = styleObject[import_helpers.StyleObjectIdentifier];
9755
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", {
9756
- // @ts-ignore
9757
- href: "t_".concat(identifier),
9758
- // @ts-ignore
9759
- precedence: "default",
9760
- children: styleObject[import_helpers.StyleObjectRules].join(`
9742
+ if (process.env.TAMAGUI_REACT_19) {
9743
+ var rulesToInsert = splitStyles.rulesToInsert, keys = Object.keys(splitStyles.rulesToInsert);
9744
+ keys.length && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
9745
+ children: [
9746
+ content,
9747
+ /* lets see if we can put a single style tag per rule for optimal de-duping */
9748
+ keys.map(function(key3) {
9749
+ var styleObject = rulesToInsert[key3], identifier = styleObject[import_helpers.StyleObjectIdentifier];
9750
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", {
9751
+ // @ts-ignore
9752
+ href: "t_".concat(identifier),
9753
+ // @ts-ignore
9754
+ precedence: "default",
9755
+ children: styleObject[import_helpers.StyleObjectRules].join(`
9761
9756
  `)
9762
- }, identifier);
9763
- })
9764
- ]
9765
- })), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9757
+ }, identifier);
9758
+ })
9759
+ ]
9760
+ }));
9761
+ }
9762
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9766
9763
  var element1 = typeof elementType == "string" ? elementType : "Component", title = "render <".concat(element1, " /> (").concat(internalID, ") with props");
9767
9764
  if (import_constants4.isWeb) {
9768
9765
  console.groupCollapsed(title);
@@ -9875,10 +9872,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9875
9872
  }
9876
9873
  });
9877
9874
  function spacedChildren2(props) {
9878
- var _childrenList__type, _childrenList_, isZStack = props.isZStack, children = props.children, space = props.space, direction = props.direction, spaceFlex = props.spaceFlex, separator = props.separator, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
9879
- if (!(hasSpace || hasSeparator || isZStack)) return children;
9880
- var childrenList = import_react4.Children.toArray(children), len = childrenList.length;
9881
- if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace)) return childrenList;
9875
+ var _childrenList__type, _childrenList_, isZStack = props.isZStack, children = props.children, space = props.space, direction = props.direction, spaceFlex = props.spaceFlex, separator = props.separator, ensureKeys = props.ensureKeys, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null, areChildrenArray = Array.isArray(children);
9876
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) return children;
9877
+ var childrenList = areChildrenArray ? children : import_react4.Children.toArray(children), len = childrenList.length;
9878
+ if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace)) return children;
9882
9879
  var final = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
9883
9880
  try {
9884
9881
  for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
@@ -9892,22 +9889,22 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9892
9889
  children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AbsoluteFill, {
9893
9890
  children: child
9894
9891
  }) : child
9895
- }, index)), !(isUnspaced(child) && index === 0) && !isZStack) {
9892
+ }, "".concat(index, "0t"))), !(isUnspaced(child) && index === 0) && !isZStack) {
9896
9893
  var next = childrenList[index + 1];
9897
- next && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9898
- key: "_".concat(index, "_00tmgui"),
9894
+ next && !isEmpty && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9895
+ key: "_".concat(index, "_00t"),
9899
9896
  direction,
9900
9897
  space,
9901
9898
  spaceFlex
9902
- })), final.push(/* @__PURE__ */ import_react4.default.isValidElement(separator) ? /* @__PURE__ */ import_react4.default.cloneElement(separator, {
9903
- key: "sep_".concat(index)
9904
- }) : separator), hasSpace && final.push(createSpacer({
9905
- key: "_".concat(index, "01tmgui"),
9899
+ })), final.push(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react4.Fragment, {
9900
+ children: separator
9901
+ }, "".concat(index, "03t"))), hasSpace && final.push(createSpacer({
9902
+ key: "_".concat(index, "01t"),
9906
9903
  direction,
9907
9904
  space,
9908
9905
  spaceFlex
9909
9906
  }))) : final.push(createSpacer({
9910
- key: "_".concat(index, "02tmgui"),
9907
+ key: "_".concat(index, "02t"),
9911
9908
  direction,
9912
9909
  space,
9913
9910
  spaceFlex
@@ -23570,8 +23567,11 @@ var require_Button_native = __commonJS({
23570
23567
  // a bit arbitrary but scaling to font size is necessary so long as button does
23571
23568
  space: spaceSize,
23572
23569
  spaceFlex,
23570
+ ensureKeys: !0,
23573
23571
  separator,
23574
23572
  direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
23573
+ // for keys to stay the same we keep indices as similar a possible
23574
+ // so even if icons are undefined we still pass them
23575
23575
  children: [
23576
23576
  themedIcon
23577
23577
  ].concat(_to_consumable_array2(contents), [
@@ -29992,11 +29992,11 @@ var require_Popper_native = __commonJS({
29992
29992
  "virtualRef",
29993
29993
  "__scopePopper"
29994
29994
  ]), _usePopperContext = usePopperContext(__scopePopper), getReferenceProps = _usePopperContext.getReferenceProps, refs = _usePopperContext.refs, ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, refs.setReference);
29995
- if (React2.useEffect(function() {
29995
+ React2.useEffect(function() {
29996
29996
  virtualRef && refs.setReference(virtualRef.current);
29997
29997
  }, [
29998
29998
  virtualRef
29999
- ]), virtualRef) return null;
29999
+ ]);
30000
30000
  var stackProps = _object_spread9({
30001
30001
  ref: composedRefs
30002
30002
  }, anchorProps);
@@ -30457,6 +30457,18 @@ var require_Popover_native = __commonJS({
30457
30457
  var __scopePopover = props.__scopePopover, rest = _object_without_properties5(props, [
30458
30458
  "__scopePopover"
30459
30459
  ]), context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
30460
+ if (!props.children) return null;
30461
+ var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, _object_spread_props8(_object_spread9({
30462
+ "aria-haspopup": "dialog",
30463
+ "aria-expanded": context.open,
30464
+ // TODO not matching
30465
+ // aria-controls={context.contentId}
30466
+ "data-state": getState(context.open)
30467
+ }, rest), {
30468
+ // @ts-ignore
30469
+ ref: composedTriggerRef,
30470
+ onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
30471
+ }));
30460
30472
  if (anchorTo) {
30461
30473
  var virtualRef = {
30462
30474
  current: _object_spread9({
@@ -30474,21 +30486,10 @@ var require_Popover_native = __commonJS({
30474
30486
  };
30475
30487
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperAnchor, {
30476
30488
  virtualRef,
30477
- __scopePopper: __scopePopover || POPOVER_SCOPE
30489
+ __scopePopper: __scopePopover || POPOVER_SCOPE,
30490
+ children: trigger
30478
30491
  });
30479
30492
  }
30480
- if (!props.children) return null;
30481
- var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, _object_spread_props8(_object_spread9({
30482
- "aria-haspopup": "dialog",
30483
- "aria-expanded": context.open,
30484
- // TODO not matching
30485
- // aria-controls={context.contentId}
30486
- "data-state": getState(context.open)
30487
- }, rest), {
30488
- // @ts-ignore
30489
- ref: composedTriggerRef,
30490
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
30491
- }));
30492
30493
  return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperAnchor, {
30493
30494
  __scopePopper: __scopePopover || POPOVER_SCOPE,
30494
30495
  asChild: !0,