tamagui 1.125.18 → 1.125.20

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
@@ -19412,22 +19412,26 @@ var require_Dialog_native = __commonJS({
19412
19412
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
19413
19413
  }
19414
19414
  }), DialogPortalItem = function(props) {
19415
- var { __scopeDialog, children, space, spaceDirection, separator } = props, themeName = (0, import_core12.useThemeName)(), context = useDialogContext(PORTAL_NAME, props.__scopeDialog), childrenSpaced = children;
19416
- return (space || separator) && (childrenSpaced = (0, import_core12.spacedChildren)({
19415
+ var { __scopeDialog, children, space, spaceDirection, separator } = props, themeName = (0, import_core12.useThemeName)(), context = useDialogContext(PORTAL_NAME, props.__scopeDialog), isAdapted = (0, import_adapt.useAdaptIsActive)(), childrenSpaced = children;
19416
+ (space || separator) && (childrenSpaced = (0, import_core12.spacedChildren)({
19417
19417
  children,
19418
19418
  separator,
19419
19419
  space,
19420
19420
  direction: spaceDirection
19421
- })), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
19422
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogProvider, {
19423
- scope: __scopeDialog,
19424
- ...context,
19425
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
19426
- name: themeName,
19427
- children: childrenSpaced
19428
- })
19421
+ }));
19422
+ var content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogProvider, {
19423
+ scope: __scopeDialog,
19424
+ ...context,
19425
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
19426
+ name: themeName,
19427
+ children: childrenSpaced
19429
19428
  })
19430
19429
  });
19430
+ return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
19431
+ children: content
19432
+ }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
19433
+ children: content
19434
+ });
19431
19435
  }, DialogPortal = function(props) {
19432
19436
  var { __scopeDialog, forceMount, children, ...frameProps } = props, context = useDialogContext(PORTAL_NAME, __scopeDialog), isShowing = forceMount || context.open, [isFullyHidden, setIsFullyHidden] = React4.useState(!isShowing), isAdapted = (0, import_adapt.useAdaptIsActive)();
19433
19437
  isShowing && isFullyHidden && setIsFullyHidden(!1);
@@ -19460,7 +19464,10 @@ var require_Dialog_native = __commonJS({
19460
19464
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PassthroughTheme, {
19461
19465
  children: framedContents
19462
19466
  })
19463
- }) : framedContents;
19467
+ }) : isAdapted ? framedContents : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalItem, {
19468
+ __scopeDialog,
19469
+ children: framedContents
19470
+ });
19464
19471
  }
19465
19472
  return children;
19466
19473
  }, PassthroughTheme = function(param) {
@@ -21823,31 +21830,42 @@ var require_focusableInputHOC_native = __commonJS({
21823
21830
  module2.exports = __toCommonJS2(focusableInputHOC_exports);
21824
21831
  var import_compose_refs = require_index_native11(), import_web = require_index_native14(), import_react3 = __toESM2(require("react")), import_registerFocusable = require_registerFocusable_native();
21825
21832
  function useFocusable2(param) {
21826
- var { isInput, props, ref } = param, { id, onChangeText, value, defaultValue } = props, inputValue = import_react3.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react3.default.useRef(), inputRef = import_react3.default.useCallback(function(input) {
21833
+ var { isInput, props, ref } = param, { id, onChangeText, value, defaultValue } = props, inputValue = import_react3.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react3.default.useRef(), focusAndSelect = import_react3.default.useCallback(function(input) {
21834
+ input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
21835
+ }, []), registerFocusableHandler = import_react3.default.useCallback(function(input) {
21827
21836
  var _unregisterFocusable_current;
21828
- id && input && ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
21837
+ !id || !input || ((_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable), unregisterFocusable.current = (0, import_registerFocusable.registerFocusable)(id, {
21829
21838
  focus: input.focus,
21830
21839
  ...isInput && {
21831
- // react-native doesn't support programmatic .select()
21832
- focusAndSelect() {
21833
- input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
21840
+ focusAndSelect: function() {
21841
+ return focusAndSelect(input);
21834
21842
  }
21835
21843
  }
21836
21844
  }));
21837
21845
  }, [
21846
+ id,
21838
21847
  isInput,
21839
- id
21840
- ]), combinedRefs = (0, import_compose_refs.composeRefs)(ref, inputRef);
21848
+ focusAndSelect
21849
+ ]), inputRef = import_react3.default.useCallback(function(input) {
21850
+ input && registerFocusableHandler(input);
21851
+ }, [
21852
+ registerFocusableHandler
21853
+ ]), handleChangeText = (0, import_web.useEvent)(function(value2) {
21854
+ inputValue.current = value2, onChangeText == null || onChangeText(value2);
21855
+ });
21841
21856
  return import_react3.default.useEffect(function() {
21842
21857
  return function() {
21843
21858
  var _unregisterFocusable_current;
21844
21859
  (_unregisterFocusable_current = unregisterFocusable.current) === null || _unregisterFocusable_current === void 0 || _unregisterFocusable_current.call(unregisterFocusable);
21845
21860
  };
21846
21861
  }, []), {
21847
- ref: combinedRefs,
21848
- onChangeText: (0, import_web.useEvent)(function(value2) {
21849
- inputValue.current = value2, onChangeText == null || onChangeText(value2);
21850
- })
21862
+ ref: import_react3.default.useMemo(function() {
21863
+ return (0, import_compose_refs.composeRefs)(ref, inputRef);
21864
+ }, [
21865
+ ref,
21866
+ inputRef
21867
+ ]),
21868
+ onChangeText: handleChangeText
21851
21869
  };
21852
21870
  }
21853
21871
  }
@@ -29032,7 +29050,8 @@ var require_Slider_native = __commonJS({
29032
29050
  var RANGE_NAME = "SliderTrackActive", SliderTrackActiveFrame = (0, import_core12.styled)(import_SliderImpl.SliderFrame, {
29033
29051
  name: "SliderTrackActive",
29034
29052
  backgroundColor: "$background",
29035
- position: "absolute"
29053
+ position: "absolute",
29054
+ pointerEvents: "box-none"
29036
29055
  }), SliderTrackActive = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
29037
29056
  var { __scopeSlider, ...rangeProps } = props, context = (0, import_constants22.useSliderContext)(RANGE_NAME, __scopeSlider), orientation = (0, import_constants22.useSliderOrientationContext)(RANGE_NAME, __scopeSlider), ref = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref), valuesCount = context.values.length, percentages = context.values.map(function(value) {
29038
29057
  return (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max);
@@ -31688,19 +31707,32 @@ var defaultStyles = {
31688
31707
  });
31689
31708
  });
31690
31709
  function useInputProps(props, ref) {
31691
- var _theme_placeholderColorProp, _theme_placeholderColor, theme = (0, import_core7.useTheme)(), { onChangeText, ref: combinedRef } = (0, import_focusable.useFocusable)({
31692
- // @ts-ignore
31710
+ var theme = (0, import_core7.useTheme)(), focusableProps = (0, import_focusable.useFocusable)({
31693
31711
  props,
31694
31712
  ref,
31695
31713
  isInput: !0
31696
- }), placeholderColorProp = props.placeholderTextColor, _theme_placeholderColorProp_get, _ref, placeholderTextColor = (_ref = (_theme_placeholderColorProp_get = (_theme_placeholderColorProp = theme[placeholderColorProp]) === null || _theme_placeholderColorProp === void 0 ? void 0 : _theme_placeholderColorProp.get()) !== null && _theme_placeholderColorProp_get !== void 0 ? _theme_placeholderColorProp_get : placeholderColorProp) !== null && _ref !== void 0 ? _ref : (_theme_placeholderColor = theme.placeholderColor) === null || _theme_placeholderColor === void 0 ? void 0 : _theme_placeholderColor.get();
31697
- return {
31698
- ref: combinedRef,
31699
- readOnly: props.disabled,
31700
- ...props,
31701
- placeholderTextColor,
31702
- onChangeText
31703
- };
31714
+ }), placeholderTextColor = import_react.default.useMemo(function() {
31715
+ var _theme_placeholderColorProp, _theme_placeholderColor, placeholderColorProp = props.placeholderTextColor, _theme_placeholderColorProp_get, _ref;
31716
+ return (_ref = (_theme_placeholderColorProp_get = (_theme_placeholderColorProp = theme[placeholderColorProp]) === null || _theme_placeholderColorProp === void 0 ? void 0 : _theme_placeholderColorProp.get()) !== null && _theme_placeholderColorProp_get !== void 0 ? _theme_placeholderColorProp_get : placeholderColorProp) !== null && _ref !== void 0 ? _ref : (_theme_placeholderColor = theme.placeholderColor) === null || _theme_placeholderColor === void 0 ? void 0 : _theme_placeholderColor.get();
31717
+ }, [
31718
+ props.placeholderTextColor,
31719
+ theme
31720
+ ]);
31721
+ return import_react.default.useMemo(function() {
31722
+ return {
31723
+ ref: focusableProps.ref,
31724
+ readOnly: props.disabled,
31725
+ ...props,
31726
+ placeholderTextColor,
31727
+ onChangeText: focusableProps.onChangeText
31728
+ };
31729
+ }, [
31730
+ focusableProps.ref,
31731
+ focusableProps.onChangeText,
31732
+ props.disabled,
31733
+ props,
31734
+ placeholderTextColor
31735
+ ]);
31704
31736
  }
31705
31737
 
31706
31738
  // src/views/Spinner.tsx