@tamagui/core 1.93.3 → 1.94.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 CHANGED
@@ -5167,57 +5167,7 @@ var require_accessibilityDirectMap_native = __commonJS({
5167
5167
  }
5168
5168
  });
5169
5169
  module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
5170
- var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
5171
- "aria-label": "accessibilityLabel",
5172
- "aria-labelledby": "accessibilityLabelledBy",
5173
- "aria-live": "accessibilityLiveRegion",
5174
- "aria-modal": "accessibilityViewIsModal",
5175
- "aria-hidden": "accessibilityElementsHidden"
5176
- }, nativeAccessibilityValue = {
5177
- "aria-valuemin": "min",
5178
- "aria-valuemax": "max",
5179
- "aria-valuenow": "now",
5180
- "aria-valuetext": "text"
5181
- }, nativeAccessibilityState = {
5182
- "aria-disabled": "disabled",
5183
- "aria-selected": "selected",
5184
- "aria-checked": "checked",
5185
- "aria-busy": "busy",
5186
- "aria-expanded": "expanded"
5187
- }, accessibilityWebRoleToNativeRole = {
5188
- alert: "alert",
5189
- button: "button",
5190
- checkbox: "checkbox",
5191
- combobox: "combobox",
5192
- grid: "grid",
5193
- group: "none",
5194
- heading: "header",
5195
- imagebutton: "imagebutton",
5196
- img: "image",
5197
- keyboardkey: "keyboardkey",
5198
- link: "link",
5199
- menu: "menu",
5200
- menubar: "menubar",
5201
- menuitem: "menuitem",
5202
- none: "none",
5203
- presentation: "none",
5204
- progressbar: "progressbar",
5205
- radio: "radio",
5206
- radiogroup: "radiogroup",
5207
- region: "summary",
5208
- scrollbar: "scrollbar",
5209
- searchbox: "search",
5210
- slider: "adjustable",
5211
- spinbutton: "spinbutton",
5212
- summary: "summary",
5213
- switch: "switch",
5214
- tab: "tab",
5215
- tablist: "tablist",
5216
- text: "text",
5217
- timer: "timer",
5218
- togglebutton: "togglebutton",
5219
- toolbar: "toolbar"
5220
- };
5170
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {}, nativeAccessibilityValue = {}, nativeAccessibilityState = {}, accessibilityWebRoleToNativeRole = {};
5221
5171
  }
5222
5172
  });
5223
5173
 
@@ -7688,24 +7638,7 @@ var require_getSplitStyles_native = __commonJS({
7688
7638
  continue;
7689
7639
  if (keyInit === "userSelect")
7690
7640
  keyInit = "selectable", valInit = valInit !== "none";
7691
- else if (keyInit === "role") {
7692
- viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
7693
- continue;
7694
- } else if (keyInit.startsWith("aria-")) {
7695
- if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
7696
- var nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
7697
- keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
7698
- continue;
7699
- }
7700
- if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
7701
- var field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
7702
- viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = _define_property2({}, field, valInit);
7703
- } else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
7704
- var field1 = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
7705
- viewProps.accessibilityState ? viewProps.accessibilityState[field1] = valInit : viewProps.accessibilityState = _define_property2({}, field1, valInit);
7706
- }
7707
- continue;
7708
- } else if (keyInit.startsWith("data-"))
7641
+ else if (keyInit.startsWith("data-"))
7709
7642
  continue;
7710
7643
  }
7711
7644
  if (keyInit === "dataSet") {
@@ -7715,7 +7648,12 @@ var require_getSplitStyles_native = __commonJS({
7715
7648
  }
7716
7649
  if (0)
7717
7650
  var didUseKeyInit;
7718
- var 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), isMediaOrPseudo1 = !!(isMedia || isPseudo), isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !styleProps.noExpand || isShorthand;
7651
+ var 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), isMediaOrPseudo1 = !!(isMedia || isPseudo);
7652
+ if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
7653
+ var name = keyInit.split("-")[1];
7654
+ context != null && context.groups.subscribe && !(context != null && context.groups.state[name]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
7655
+ }
7656
+ var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !styleProps.noExpand || isShorthand;
7719
7657
  if (!(isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))) {
7720
7658
  var shouldPassProp = !isStyleProp || // is in parent variants
7721
7659
  isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
@@ -8074,7 +8012,7 @@ current`, _object_spread2({}, styleState.style)));
8074
8012
  var cnStyles, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3;
8075
8013
  try {
8076
8014
  for (var _iterator3, _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0)
8077
- var name;
8015
+ var name1;
8078
8016
  } catch (err) {
8079
8017
  } finally {
8080
8018
  try {
@@ -9279,10 +9217,7 @@ var require_createComponent_native = __commonJS({
9279
9217
  var hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curStateRef.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
9280
9218
  disabled != null && (initialState.disabled = disabled);
9281
9219
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? _object_spread_props(_object_spread2({}, states[0]), _define_property2({}, props.forceStyle, !0)) : states[0], setState = states[1];
9282
- disabled !== state.disabled && setState(_object_spread_props(_object_spread2({}, state, import_defaultComponentState.defaultComponentState), {
9283
- // removes any stale press state etc
9284
- disabled
9285
- }));
9220
+ disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState(_object_spread2({}, state)));
9286
9221
  var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, props.debug);
9287
9222
  if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
9288
9223
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn("has presenceState ".concat(JSON.stringify(presenceState)));
@@ -9580,7 +9515,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9580
9515
  pseudoGroups ? Object.keys(_to_consumable_array(pseudoGroups)).join("") : 0,
9581
9516
  mediaGroups ? Object.keys(_to_consumable_array(mediaGroups)).join("") : 0
9582
9517
  ]);
9583
- var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimeHoverStyle);
9518
+ var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle);
9584
9519
  process.env.NODE_ENV === "development" && time && time(_templateObject14());
9585
9520
  var events = shouldAttach ? _object_spread2(_object_spread_props(_object_spread2({
9586
9521
  onPressOut: attachPress ? function(e) {
@@ -9939,7 +9874,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9939
9874
  group
9940
9875
  });
9941
9876
  };
9942
- if (pseudo && pseudoGroups != null && pseudoGroups.has(name))
9877
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name)))
9943
9878
  Object.assign(current.pseudo, pseudo), persist();
9944
9879
  else if (layout && mediaGroups) {
9945
9880
  var mediaState2 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);