tamagui 1.84.2 → 1.85.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
@@ -556,7 +556,7 @@ var require_composeEventHandlers_native = __commonJS({
556
556
  });
557
557
  module2.exports = __toCommonJS2(composeEventHandlers_exports);
558
558
  function composeEventHandlers(og, next, { checkDefaultPrevented = !0 } = {}) {
559
- return !og || !next ? next || og || void 0 : function(event) {
559
+ return !og || !next ? next || og || void 0 : (event) => {
560
560
  if (og == null || og(event), !event || !(checkDefaultPrevented && "defaultPrevented" in event) || // @ts-ignore
561
561
  "defaultPrevented" in event && !event.defaultPrevented)
562
562
  return next == null ? void 0 : next(event);
@@ -892,7 +892,7 @@ var require_withStaticProperties_native = __commonJS({
892
892
  withStaticProperties: () => withStaticProperties2
893
893
  });
894
894
  module2.exports = __toCommonJS2(withStaticProperties_exports);
895
- var import_react2 = require("react"), Decorated = Symbol(), withStaticProperties2 = function(component, staticProps) {
895
+ var import_react2 = require("react"), Decorated = Symbol(), withStaticProperties2 = (component, staticProps) => {
896
896
  let next = (() => {
897
897
  if (component[Decorated]) {
898
898
  let _ = (0, import_react2.forwardRef)(
@@ -2038,14 +2038,14 @@ var require_accessibilityDirectMap_native = __commonJS({
2038
2038
  return to;
2039
2039
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
2040
2040
  __export2(accessibilityDirectMap_native_exports, {
2041
- accessibilityDirectMap: () => accessibilityDirectMap2,
2041
+ accessibilityDirectMap: () => accessibilityDirectMap,
2042
2042
  accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
2043
2043
  nativeAccessibilityState: () => nativeAccessibilityState,
2044
2044
  nativeAccessibilityValue: () => nativeAccessibilityValue,
2045
2045
  webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
2046
2046
  });
2047
2047
  module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2048
- var accessibilityDirectMap2 = {}, webToNativeAccessibilityDirectMap = {
2048
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2049
2049
  "aria-label": "accessibilityLabel",
2050
2050
  "aria-labelledby": "accessibilityLabelledBy",
2051
2051
  "aria-live": "accessibilityLiveRegion",
@@ -2789,7 +2789,7 @@ var require_normalizeValueWithProperty_native = __commonJS({
2789
2789
  return;
2790
2790
  }
2791
2791
  let cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim(), res;
2792
- return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && isNaN(res) && console.info("Tamagui invalid parsed value, NaN:", {
2792
+ return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && Number.isNaN(res) && console.info("Tamagui invalid parsed value, NaN:", {
2793
2793
  res,
2794
2794
  cssVal,
2795
2795
  cssRule,
@@ -3142,9 +3142,9 @@ var require_propMapper_native = __commonJS({
3142
3142
  }
3143
3143
  }) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
3144
3144
  if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
3145
- `Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
3146
- ", "
3147
- )}`
3145
+ `Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(
3146
+ conf.fontsParsed
3147
+ ).join(", ")}`
3148
3148
  ), !styleProps.noExpand && variants && key in variants) {
3149
3149
  styleState.curProps[key] = value;
3150
3150
  let variantValue = resolveVariants(key, value, styleProps, styleState, "");
@@ -3424,7 +3424,8 @@ var require_getSplitStyles_native = __commonJS({
3424
3424
  let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
3425
3425
  keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
3426
3426
  continue;
3427
- } else if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
3427
+ }
3428
+ if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
3428
3429
  let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
3429
3430
  viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
3430
3431
  [field]: valInit
@@ -3447,7 +3448,7 @@ var require_getSplitStyles_native = __commonJS({
3447
3448
  mergeStylePropIntoStyle(styleState, valInit);
3448
3449
  continue;
3449
3450
  }
3450
- if (0 && !(keyInit in accessibilityDirectMap))
3451
+ if (0)
3451
3452
  switch (keyInit) {
3452
3453
  case "accessibilityRole":
3453
3454
  case "accessibilityLabelledBy":
@@ -3520,10 +3521,7 @@ current`, {
3520
3521
  val,
3521
3522
  styleProps.noClassNames
3522
3523
  ), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
3523
- if (process.env.NODE_ENV === "development" && !styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
3524
- `No animation prop given to component ${staticConfig.componentName || ""} ${props["data-at"] || ""} with enterStyle / exitStyle, these styles will be ignored`,
3525
- { props }
3526
- ), !descriptor || isExit && !styleProps.isExiting)
3524
+ if (!descriptor || isExit && !styleProps.isExiting)
3527
3525
  continue;
3528
3526
  if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
3529
3527
  Object.assign(pseudos[key], pseudoStyleObject);
@@ -3569,7 +3567,8 @@ current`, {
3569
3567
  }
3570
3568
  }
3571
3569
  continue;
3572
- } else if (isMedia) {
3570
+ }
3571
+ if (isMedia) {
3573
3572
  if (!val)
3574
3573
  continue;
3575
3574
  if (isMedia === "platform") {
@@ -4256,7 +4255,14 @@ If this is intended and you are using Tamagui without any themes, you can disabl
4256
4255
  }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
4257
4256
  (name, manager, forced) => {
4258
4257
  let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
4259
- process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", themeManager.id, { force, shouldTryUpdate, props, name, manager, keys }), shouldTryUpdate && setThemeState((prev) => createState(prev, force));
4258
+ process.env.NODE_ENV === "development" && props.debug === "verbose" && console.info(" \u{1F538} onChange", themeManager.id, {
4259
+ force,
4260
+ shouldTryUpdate,
4261
+ props,
4262
+ name,
4263
+ manager,
4264
+ keys
4265
+ }), shouldTryUpdate && setThemeState((prev) => createState(prev, force));
4260
4266
  },
4261
4267
  themeManager.id
4262
4268
  );
@@ -4414,7 +4420,9 @@ var require_Theme_native = __commonJS({
4414
4420
  function getThemedChildren(themeState, children, props, isRoot = !1) {
4415
4421
  let { themeManager, isNewTheme } = themeState;
4416
4422
  if (!themeManager)
4417
- throw new Error(process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C");
4423
+ throw new Error(
4424
+ process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C"
4425
+ );
4418
4426
  let { shallow, forceClassName } = props, hasEverThemed = (0, import_react2.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
4419
4427
  if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
4420
4428
  return children;
@@ -4711,7 +4719,7 @@ var require_createComponent_native = __commonJS({
4711
4719
  {}
4712
4720
  );
4713
4721
  process.env.NODE_ENV === "development" && time && time`stateref`;
4714
- let hostRef = (0, import_react2.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
4722
+ let hostRef = (0, import_react2.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
4715
4723
  if (import_constants4.isServer && !supportsCSSVars)
4716
4724
  return !1;
4717
4725
  let curState = stateRef.current;
@@ -5769,7 +5777,7 @@ ${runtimeStyles}`;
5769
5777
  function getThemesDeduped(themes) {
5770
5778
  let dedupedThemes = [], existing = /* @__PURE__ */ new Map();
5771
5779
  for (let themeName in themes) {
5772
- let darkOrLightSpecificPrefix = themeName.startsWith("dark") ? "dark" : themeName.startsWith("light") ? "light" : "", rawTheme = themes[themeName], key = darkOrLightSpecificPrefix + JSON.stringify(rawTheme);
5780
+ let darkOrLightSpecificPrefix = themeName.startsWith("dark") ? "dark" : themeName.startsWith("light") ? "light" : "", rawTheme = themes[themeName], key = darkOrLightSpecificPrefix + JSON.stringify(Object.entries(rawTheme).sort((a, b) => a[0] > b[0] ? -1 : 1));
5773
5781
  if (existing.has(key)) {
5774
5782
  existing.get(key).names.push(themeName);
5775
5783
  continue;
@@ -5869,7 +5877,7 @@ var require_setupReactNative_native = __commonJS({
5869
5877
  });
5870
5878
  module2.exports = __toCommonJS2(setupReactNative_exports);
5871
5879
  function getReactNativeConfig(Component) {
5872
- var _a, _b, _c;
5880
+ var _a, _b, _c, _d;
5873
5881
  if (Component)
5874
5882
  return (_a = Component.propTypes) != null && _a.onTextInput || (_b = Component.propTypes) != null && _b.onChangeText ? RNConfigs.TextInput : Component.getSizeWithHeaders ? RNConfigs.Image : (_c = Component.propTypes) != null && _c.textBreakStrategy ? RNConfigs.Text : RNConfigs.default;
5875
5883
  }
@@ -6724,8 +6732,8 @@ var require_utils_native = __commonJS({
6724
6732
  if (domEvent.type === "selectionchange") {
6725
6733
  let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
6726
6734
  return composedPathFallback(target);
6727
- } else
6728
- return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
6735
+ }
6736
+ return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
6729
6737
  }
6730
6738
  function composedPathFallback(target) {
6731
6739
  let path = [];
@@ -7215,7 +7223,7 @@ var require_ResponderSystem_native = __commonJS({
7215
7223
  function findWantsResponder(eventPaths, domEvent, responderEvent) {
7216
7224
  let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
7217
7225
  if (shouldSetCallbacks != null) {
7218
- let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
7226
+ let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = (id, node, callbackName) => {
7219
7227
  let shouldSetCallback = getResponderConfig(id)[callbackName];
7220
7228
  if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
7221
7229
  let prunedIdPath = idPath.slice(idPath.indexOf(id));
@@ -7867,7 +7875,7 @@ var require_index_native15 = __commonJS({
7867
7875
  var import_react_native_use_responder_events = require_index_native14(), import_web = require_index_native12(), import_react2 = require("react"), import_createOptimizedView = require_createOptimizedView_native(), import_getBaseViews = require_getBaseViews_native(), import_useElementLayout = require_useElementLayout_native(), import_usePlatformMethods = require_usePlatformMethods_native(), import_Pressability = require_Pressability_native();
7868
7876
  __reExport2(src_exports2, require_index_native12(), module2.exports);
7869
7877
  __reExport2(src_exports2, require_reactNativeTypes_native(), module2.exports);
7870
- var View2 = import_web.View, Stack3 = import_web.Stack, Text3 = import_web.Text, baseViews = (0, import_getBaseViews.getBaseViews)();
7878
+ var baseViews = (0, import_getBaseViews.getBaseViews)();
7871
7879
  (0, import_web.setupHooks)({
7872
7880
  getBaseViews: import_getBaseViews.getBaseViews,
7873
7881
  usePropsTransform(elementType, propsIn, hostRef) {
@@ -7956,7 +7964,7 @@ var require_index_native15 = __commonJS({
7956
7964
  });
7957
7965
  var dontComposePressabilityKeys = {
7958
7966
  onClick: !0
7959
- };
7967
+ }, View2 = import_web.View, Stack3 = import_web.Stack, Text3 = import_web.Text;
7960
7968
  }
7961
7969
  });
7962
7970
 
@@ -11827,7 +11835,7 @@ var require_Avatar_native = __commonJS({
11827
11835
  import_image.Image,
11828
11836
  {
11829
11837
  fullscreen: !0,
11830
- ...typeof shapeSize == "number" && !isNaN(shapeSize) && {
11838
+ ...typeof shapeSize == "number" && !Number.isNaN(shapeSize) && {
11831
11839
  width: shapeSize,
11832
11840
  height: shapeSize
11833
11841
  },
@@ -12173,10 +12181,12 @@ var require_Button_native = __commonJS({
12173
12181
  }), ButtonIcon = (props) => {
12174
12182
  let { children, scaleIcon = 1 } = props, { size: size2, color } = (0, import_react2.useContext)(ButtonContext), iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2)) * scaleIcon;
12175
12183
  return (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color })(children);
12176
- }, ButtonComponent = ButtonFrame.styleable(function(props, ref) {
12177
- let { props: buttonProps } = useButton(props);
12178
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonFrame, { ...buttonProps, ref });
12179
- }), buttonStaticConfig = {
12184
+ }, ButtonComponent = ButtonFrame.styleable(
12185
+ function(props, ref) {
12186
+ let { props: buttonProps } = useButton(props);
12187
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonFrame, { ...buttonProps, ref });
12188
+ }
12189
+ ), buttonStaticConfig = {
12180
12190
  inlineProps: /* @__PURE__ */ new Set([
12181
12191
  // text props go here (can't really optimize them, but we never fully extract button anyway)
12182
12192
  // may be able to remove this entirely, as the compiler / runtime have gotten better
@@ -13949,10 +13959,12 @@ var require_ListItem_native = __commonJS({
13949
13959
  ] })
13950
13960
  }
13951
13961
  };
13952
- }, ListItemComponent = ListItemFrame.styleable(function(props, ref) {
13953
- let { props: listItemProps } = useListItem(props);
13954
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemFrame, { ref, ...listItemProps });
13955
- }), ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
13962
+ }, ListItemComponent = ListItemFrame.styleable(
13963
+ function(props, ref) {
13964
+ let { props: listItemProps } = useListItem(props);
13965
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemFrame, { ref, ...listItemProps });
13966
+ }
13967
+ ), ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
13956
13968
  Text: ListItemText,
13957
13969
  Subtitle: ListItemSubtitle
13958
13970
  });
@@ -15870,10 +15882,10 @@ var require_Progress_native = __commonJS({
15870
15882
  return typeof value == "number";
15871
15883
  }
15872
15884
  function isValidMaxNumber(max2) {
15873
- return isNumber(max2) && !isNaN(max2) && max2 > 0;
15885
+ return isNumber(max2) && !Number.isNaN(max2) && max2 > 0;
15874
15886
  }
15875
15887
  function isValidValueNumber(value, max2) {
15876
- return isNumber(value) && !isNaN(value) && value <= max2 && value >= 0;
15888
+ return isNumber(value) && !Number.isNaN(value) && value <= max2 && value >= 0;
15877
15889
  }
15878
15890
  var DEFAULT_MAX = 100, ProgressFrame = (0, import_core13.styled)(import_stacks3.ThemeableStack, {
15879
15891
  name: "Progress",
@@ -17013,35 +17025,33 @@ var require_Select_native = __commonJS({
17013
17025
  }
17014
17026
  }), SelectGroup = React2.forwardRef(
17015
17027
  (props, forwardedRef) => {
17016
- let { __scopeSelect, ...groupProps } = props, groupId = React2.useId(), context = (0, import_context.useSelectContext)(GROUP_NAME, __scopeSelect), itemParentContext = (0, import_context.useSelectItemParentContext)(GROUP_NAME, __scopeSelect), size2 = itemParentContext.size ?? "$true", nativeSelectRef = React2.useRef(null), content = function() {
17017
- return itemParentContext.shouldRenderWebNative ? (
17018
- // @ts-expect-error until we support typing based on tag
17019
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(NativeSelectFrame, { asChild: !0, size: size2, value: context.value, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17020
- NativeSelectTextFrame,
17021
- {
17022
- onChange: (event) => {
17023
- itemParentContext.onChange(event.currentTarget.value);
17024
- },
17025
- size: size2,
17026
- ref: nativeSelectRef,
17027
- style: {
17028
- color: "var(--color)",
17029
- // @ts-ignore
17030
- appearance: "none"
17031
- },
17032
- children: props.children
17033
- }
17034
- ) })
17035
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17036
- SelectGroupFrame,
17028
+ let { __scopeSelect, ...groupProps } = props, groupId = React2.useId(), context = (0, import_context.useSelectContext)(GROUP_NAME, __scopeSelect), itemParentContext = (0, import_context.useSelectItemParentContext)(GROUP_NAME, __scopeSelect), size2 = itemParentContext.size ?? "$true", nativeSelectRef = React2.useRef(null), content = itemParentContext.shouldRenderWebNative ? (
17029
+ // @ts-expect-error until we support typing based on tag
17030
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(NativeSelectFrame, { asChild: !0, size: size2, value: context.value, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17031
+ NativeSelectTextFrame,
17037
17032
  {
17038
- role: "group",
17039
- "aria-labelledby": groupId,
17040
- ...groupProps,
17041
- ref: forwardedRef
17033
+ onChange: (event) => {
17034
+ itemParentContext.onChange(event.currentTarget.value);
17035
+ },
17036
+ size: size2,
17037
+ ref: nativeSelectRef,
17038
+ style: {
17039
+ color: "var(--color)",
17040
+ // @ts-ignore
17041
+ appearance: "none"
17042
+ },
17043
+ children: props.children
17042
17044
  }
17043
- );
17044
- }();
17045
+ ) })
17046
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17047
+ SelectGroupFrame,
17048
+ {
17049
+ role: "group",
17050
+ "aria-labelledby": groupId,
17051
+ ...groupProps,
17052
+ ref: forwardedRef
17053
+ }
17054
+ );
17045
17055
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId || "", children: content });
17046
17056
  }
17047
17057
  );
@@ -17299,7 +17309,10 @@ var require_helpers_native2 = __commonJS({
17299
17309
  return 100 / (max2 - min2) * (value - min2);
17300
17310
  }
17301
17311
  function getLabel(index, totalValues) {
17302
- return totalValues > 2 ? `Value ${index + 1} of ${totalValues}` : totalValues === 2 ? ["Minimum", "Maximum"][index] : void 0;
17312
+ if (totalValues > 2)
17313
+ return `Value ${index + 1} of ${totalValues}`;
17314
+ if (totalValues === 2)
17315
+ return ["Minimum", "Maximum"][index];
17303
17316
  }
17304
17317
  function getClosestValueIndex(values, nextValue) {
17305
17318
  if (values.length === 1)
@@ -18821,36 +18834,38 @@ var require_Toggle_native = __commonJS({
18821
18834
  defaultVariants: {
18822
18835
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
18823
18836
  }
18824
- }), Toggle = React2.forwardRef(function(props, forwardedRef) {
18825
- let {
18826
- pressed: pressedProp,
18827
- defaultPressed = !1,
18828
- onPressedChange,
18829
- ...buttonProps
18830
- } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18831
- prop: pressedProp,
18832
- onChange: onPressedChange,
18833
- defaultProp: defaultPressed
18834
- });
18835
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18836
- ToggleFrame,
18837
- {
18838
- ...!props.unstyled && {
18839
- theme: pressed ? "active" : null,
18840
- themeShallow: !0
18841
- },
18842
- active: props.unstyled ? void 0 : pressed,
18843
- "aria-pressed": pressed,
18844
- "data-state": pressed ? "on" : "off",
18845
- "data-disabled": props.disabled ? "" : void 0,
18846
- ...buttonProps,
18847
- ref: forwardedRef,
18848
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress ?? void 0, () => {
18849
- props.disabled || setPressed(!pressed);
18850
- })
18851
- }
18852
- );
18853
- });
18837
+ }), Toggle = React2.forwardRef(
18838
+ function(props, forwardedRef) {
18839
+ let {
18840
+ pressed: pressedProp,
18841
+ defaultPressed = !1,
18842
+ onPressedChange,
18843
+ ...buttonProps
18844
+ } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18845
+ prop: pressedProp,
18846
+ onChange: onPressedChange,
18847
+ defaultProp: defaultPressed
18848
+ });
18849
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18850
+ ToggleFrame,
18851
+ {
18852
+ ...!props.unstyled && {
18853
+ theme: pressed ? "active" : null,
18854
+ themeShallow: !0
18855
+ },
18856
+ active: props.unstyled ? void 0 : pressed,
18857
+ "aria-pressed": pressed,
18858
+ "data-state": pressed ? "on" : "off",
18859
+ "data-disabled": props.disabled ? "" : void 0,
18860
+ ...buttonProps,
18861
+ ref: forwardedRef,
18862
+ onPress: (0, import_helpers.composeEventHandlers)(props.onPress ?? void 0, () => {
18863
+ props.disabled || setPressed(!pressed);
18864
+ })
18865
+ }
18866
+ );
18867
+ }
18868
+ );
18854
18869
  }
18855
18870
  });
18856
18871
 
@@ -19206,9 +19221,9 @@ var require_index_native67 = __commonJS({
19206
19221
  let timeout, isCancelled = !1;
19207
19222
  function debounced() {
19208
19223
  isCancelled = !1;
19209
- let context = this, args = arguments;
19210
- leading && !timeout && func.apply(context, args), clearTimeout(timeout), timeout = setTimeout(function() {
19211
- timeout = null, leading || isCancelled || func.apply(context, args), isCancelled = !1;
19224
+ let args = arguments;
19225
+ leading && !timeout && func.apply(this, args), clearTimeout(timeout), timeout = setTimeout(() => {
19226
+ timeout = null, leading || isCancelled || func.apply(this, args), isCancelled = !1;
19212
19227
  }, wait);
19213
19228
  }
19214
19229
  return debounced.cancel = () => {