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.
@@ -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)(
@@ -1991,14 +1991,14 @@ var require_accessibilityDirectMap_native = __commonJS({
1991
1991
  return to;
1992
1992
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), accessibilityDirectMap_native_exports = {};
1993
1993
  __export2(accessibilityDirectMap_native_exports, {
1994
- accessibilityDirectMap: () => accessibilityDirectMap2,
1994
+ accessibilityDirectMap: () => accessibilityDirectMap,
1995
1995
  accessibilityWebRoleToNativeRole: () => accessibilityWebRoleToNativeRole,
1996
1996
  nativeAccessibilityState: () => nativeAccessibilityState,
1997
1997
  nativeAccessibilityValue: () => nativeAccessibilityValue,
1998
1998
  webToNativeAccessibilityDirectMap: () => webToNativeAccessibilityDirectMap
1999
1999
  });
2000
2000
  module2.exports = __toCommonJS2(accessibilityDirectMap_native_exports);
2001
- var accessibilityDirectMap2 = {}, webToNativeAccessibilityDirectMap = {
2001
+ var accessibilityDirectMap = {}, webToNativeAccessibilityDirectMap = {
2002
2002
  "aria-label": "accessibilityLabel",
2003
2003
  "aria-labelledby": "accessibilityLabelledBy",
2004
2004
  "aria-live": "accessibilityLiveRegion",
@@ -3334,7 +3334,8 @@ var require_getSplitStyles_native = __commonJS({
3334
3334
  let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
3335
3335
  keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
3336
3336
  continue;
3337
- } else if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
3337
+ }
3338
+ if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
3338
3339
  let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
3339
3340
  viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
3340
3341
  [field]: valInit
@@ -3357,7 +3358,7 @@ var require_getSplitStyles_native = __commonJS({
3357
3358
  mergeStylePropIntoStyle(styleState, valInit);
3358
3359
  continue;
3359
3360
  }
3360
- if (0 && !(keyInit in accessibilityDirectMap))
3361
+ if (0)
3361
3362
  switch (keyInit) {
3362
3363
  case "accessibilityRole":
3363
3364
  case "accessibilityLabelledBy":
@@ -3435,7 +3436,8 @@ var require_getSplitStyles_native = __commonJS({
3435
3436
  }
3436
3437
  }
3437
3438
  continue;
3438
- } else if (isMedia) {
3439
+ }
3440
+ if (isMedia) {
3439
3441
  if (!val)
3440
3442
  continue;
3441
3443
  if (isMedia === "platform") {
@@ -4211,7 +4213,9 @@ var require_Theme_native = __commonJS({
4211
4213
  function getThemedChildren(themeState, children, props, isRoot = !1) {
4212
4214
  let { themeManager, isNewTheme } = themeState;
4213
4215
  if (!themeManager)
4214
- throw new Error("\u274C");
4216
+ throw new Error(
4217
+ "\u274C"
4218
+ );
4215
4219
  let { shallow, forceClassName } = props, hasEverThemed = (0, import_react2.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
4216
4220
  if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
4217
4221
  return children;
@@ -4462,7 +4466,7 @@ var require_createComponent_native = __commonJS({
4462
4466
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
4463
4467
  let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName, isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), stateRef = (0, import_react2.useRef)(
4464
4468
  {}
4465
- ), 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 = (() => {
4469
+ ), 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 = (() => {
4466
4470
  if (import_constants4.isServer && !supportsCSSVars)
4467
4471
  return !1;
4468
4472
  let curState = stateRef.current;
@@ -5424,7 +5428,7 @@ ${runtimeStyles}`;
5424
5428
  function getThemesDeduped(themes) {
5425
5429
  let dedupedThemes = [], existing = /* @__PURE__ */ new Map();
5426
5430
  for (let themeName in themes) {
5427
- let darkOrLightSpecificPrefix = themeName.startsWith("dark") ? "dark" : themeName.startsWith("light") ? "light" : "", rawTheme = themes[themeName], key = darkOrLightSpecificPrefix + JSON.stringify(rawTheme);
5431
+ 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));
5428
5432
  if (existing.has(key)) {
5429
5433
  existing.get(key).names.push(themeName);
5430
5434
  continue;
@@ -5524,7 +5528,7 @@ var require_setupReactNative_native = __commonJS({
5524
5528
  });
5525
5529
  module2.exports = __toCommonJS2(setupReactNative_exports);
5526
5530
  function getReactNativeConfig(Component) {
5527
- var _a, _b, _c;
5531
+ var _a, _b, _c, _d;
5528
5532
  if (Component)
5529
5533
  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;
5530
5534
  }
@@ -6379,8 +6383,8 @@ var require_utils_native = __commonJS({
6379
6383
  if (domEvent.type === "selectionchange") {
6380
6384
  let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
6381
6385
  return composedPathFallback(target);
6382
- } else
6383
- return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
6386
+ }
6387
+ return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
6384
6388
  }
6385
6389
  function composedPathFallback(target) {
6386
6390
  let path = [];
@@ -6862,7 +6866,7 @@ var require_ResponderSystem_native = __commonJS({
6862
6866
  function findWantsResponder(eventPaths, domEvent, responderEvent) {
6863
6867
  let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
6864
6868
  if (shouldSetCallbacks != null) {
6865
- let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
6869
+ let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = (id, node, callbackName) => {
6866
6870
  let shouldSetCallback = getResponderConfig(id)[callbackName];
6867
6871
  if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
6868
6872
  let prunedIdPath = idPath.slice(idPath.indexOf(id));
@@ -7512,7 +7516,7 @@ var require_index_native15 = __commonJS({
7512
7516
  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();
7513
7517
  __reExport2(src_exports2, require_index_native12(), module2.exports);
7514
7518
  __reExport2(src_exports2, require_reactNativeTypes_native(), module2.exports);
7515
- var View2 = import_web.View, Stack3 = import_web.Stack, Text3 = import_web.Text, baseViews = (0, import_getBaseViews.getBaseViews)();
7519
+ var baseViews = (0, import_getBaseViews.getBaseViews)();
7516
7520
  (0, import_web.setupHooks)({
7517
7521
  getBaseViews: import_getBaseViews.getBaseViews,
7518
7522
  usePropsTransform(elementType, propsIn, hostRef) {
@@ -7591,7 +7595,7 @@ var require_index_native15 = __commonJS({
7591
7595
  });
7592
7596
  var dontComposePressabilityKeys = {
7593
7597
  onClick: !0
7594
- };
7598
+ }, View2 = import_web.View, Stack3 = import_web.Stack, Text3 = import_web.Text;
7595
7599
  }
7596
7600
  });
7597
7601
 
@@ -11379,7 +11383,7 @@ var require_Avatar_native = __commonJS({
11379
11383
  import_image.Image,
11380
11384
  {
11381
11385
  fullscreen: !0,
11382
- ...typeof shapeSize == "number" && !isNaN(shapeSize) && {
11386
+ ...typeof shapeSize == "number" && !Number.isNaN(shapeSize) && {
11383
11387
  width: shapeSize,
11384
11388
  height: shapeSize
11385
11389
  },
@@ -11725,10 +11729,12 @@ var require_Button_native = __commonJS({
11725
11729
  }), ButtonIcon = (props) => {
11726
11730
  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;
11727
11731
  return (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color })(children);
11728
- }, ButtonComponent = ButtonFrame.styleable(function(props, ref) {
11729
- let { props: buttonProps } = useButton(props);
11730
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonFrame, { ...buttonProps, ref });
11731
- }), buttonStaticConfig = {
11732
+ }, ButtonComponent = ButtonFrame.styleable(
11733
+ function(props, ref) {
11734
+ let { props: buttonProps } = useButton(props);
11735
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonFrame, { ...buttonProps, ref });
11736
+ }
11737
+ ), buttonStaticConfig = {
11732
11738
  inlineProps: /* @__PURE__ */ new Set([
11733
11739
  // text props go here (can't really optimize them, but we never fully extract button anyway)
11734
11740
  // may be able to remove this entirely, as the compiler / runtime have gotten better
@@ -13414,10 +13420,12 @@ var require_ListItem_native = __commonJS({
13414
13420
  ] })
13415
13421
  }
13416
13422
  };
13417
- }, ListItemComponent = ListItemFrame.styleable(function(props, ref) {
13418
- let { props: listItemProps } = useListItem(props);
13419
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemFrame, { ref, ...listItemProps });
13420
- }), ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
13423
+ }, ListItemComponent = ListItemFrame.styleable(
13424
+ function(props, ref) {
13425
+ let { props: listItemProps } = useListItem(props);
13426
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemFrame, { ref, ...listItemProps });
13427
+ }
13428
+ ), ListItem2 = (0, import_helpers.withStaticProperties)(ListItemComponent, {
13421
13429
  Text: ListItemText,
13422
13430
  Subtitle: ListItemSubtitle
13423
13431
  });
@@ -15335,10 +15343,10 @@ var require_Progress_native = __commonJS({
15335
15343
  return typeof value == "number";
15336
15344
  }
15337
15345
  function isValidMaxNumber(max2) {
15338
- return isNumber(max2) && !isNaN(max2) && max2 > 0;
15346
+ return isNumber(max2) && !Number.isNaN(max2) && max2 > 0;
15339
15347
  }
15340
15348
  function isValidValueNumber(value, max2) {
15341
- return isNumber(value) && !isNaN(value) && value <= max2 && value >= 0;
15349
+ return isNumber(value) && !Number.isNaN(value) && value <= max2 && value >= 0;
15342
15350
  }
15343
15351
  var DEFAULT_MAX = 100, ProgressFrame = (0, import_core13.styled)(import_stacks3.ThemeableStack, {
15344
15352
  name: "Progress",
@@ -16478,35 +16486,33 @@ var require_Select_native = __commonJS({
16478
16486
  }
16479
16487
  }), SelectGroup = React2.forwardRef(
16480
16488
  (props, forwardedRef) => {
16481
- 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() {
16482
- return itemParentContext.shouldRenderWebNative ? (
16483
- // @ts-expect-error until we support typing based on tag
16484
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(NativeSelectFrame, { asChild: !0, size: size2, value: context.value, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
16485
- NativeSelectTextFrame,
16486
- {
16487
- onChange: (event) => {
16488
- itemParentContext.onChange(event.currentTarget.value);
16489
- },
16490
- size: size2,
16491
- ref: nativeSelectRef,
16492
- style: {
16493
- color: "var(--color)",
16494
- // @ts-ignore
16495
- appearance: "none"
16496
- },
16497
- children: props.children
16498
- }
16499
- ) })
16500
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
16501
- SelectGroupFrame,
16489
+ 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 ? (
16490
+ // @ts-expect-error until we support typing based on tag
16491
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(NativeSelectFrame, { asChild: !0, size: size2, value: context.value, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
16492
+ NativeSelectTextFrame,
16502
16493
  {
16503
- role: "group",
16504
- "aria-labelledby": groupId,
16505
- ...groupProps,
16506
- ref: forwardedRef
16494
+ onChange: (event) => {
16495
+ itemParentContext.onChange(event.currentTarget.value);
16496
+ },
16497
+ size: size2,
16498
+ ref: nativeSelectRef,
16499
+ style: {
16500
+ color: "var(--color)",
16501
+ // @ts-ignore
16502
+ appearance: "none"
16503
+ },
16504
+ children: props.children
16507
16505
  }
16508
- );
16509
- }();
16506
+ ) })
16507
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
16508
+ SelectGroupFrame,
16509
+ {
16510
+ role: "group",
16511
+ "aria-labelledby": groupId,
16512
+ ...groupProps,
16513
+ ref: forwardedRef
16514
+ }
16515
+ );
16510
16516
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId || "", children: content });
16511
16517
  }
16512
16518
  );
@@ -16764,7 +16770,10 @@ var require_helpers_native2 = __commonJS({
16764
16770
  return 100 / (max2 - min2) * (value - min2);
16765
16771
  }
16766
16772
  function getLabel(index, totalValues) {
16767
- return totalValues > 2 ? `Value ${index + 1} of ${totalValues}` : totalValues === 2 ? ["Minimum", "Maximum"][index] : void 0;
16773
+ if (totalValues > 2)
16774
+ return `Value ${index + 1} of ${totalValues}`;
16775
+ if (totalValues === 2)
16776
+ return ["Minimum", "Maximum"][index];
16768
16777
  }
16769
16778
  function getClosestValueIndex(values, nextValue) {
16770
16779
  if (values.length === 1)
@@ -18270,36 +18279,38 @@ var require_Toggle_native = __commonJS({
18270
18279
  defaultVariants: {
18271
18280
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
18272
18281
  }
18273
- }), Toggle = React2.forwardRef(function(props, forwardedRef) {
18274
- let {
18275
- pressed: pressedProp,
18276
- defaultPressed = !1,
18277
- onPressedChange,
18278
- ...buttonProps
18279
- } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18280
- prop: pressedProp,
18281
- onChange: onPressedChange,
18282
- defaultProp: defaultPressed
18283
- });
18284
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18285
- ToggleFrame,
18286
- {
18287
- ...!props.unstyled && {
18288
- theme: pressed ? "active" : null,
18289
- themeShallow: !0
18290
- },
18291
- active: props.unstyled ? void 0 : pressed,
18292
- "aria-pressed": pressed,
18293
- "data-state": pressed ? "on" : "off",
18294
- "data-disabled": props.disabled ? "" : void 0,
18295
- ...buttonProps,
18296
- ref: forwardedRef,
18297
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress ?? void 0, () => {
18298
- props.disabled || setPressed(!pressed);
18299
- })
18300
- }
18301
- );
18302
- });
18282
+ }), Toggle = React2.forwardRef(
18283
+ function(props, forwardedRef) {
18284
+ let {
18285
+ pressed: pressedProp,
18286
+ defaultPressed = !1,
18287
+ onPressedChange,
18288
+ ...buttonProps
18289
+ } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18290
+ prop: pressedProp,
18291
+ onChange: onPressedChange,
18292
+ defaultProp: defaultPressed
18293
+ });
18294
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18295
+ ToggleFrame,
18296
+ {
18297
+ ...!props.unstyled && {
18298
+ theme: pressed ? "active" : null,
18299
+ themeShallow: !0
18300
+ },
18301
+ active: props.unstyled ? void 0 : pressed,
18302
+ "aria-pressed": pressed,
18303
+ "data-state": pressed ? "on" : "off",
18304
+ "data-disabled": props.disabled ? "" : void 0,
18305
+ ...buttonProps,
18306
+ ref: forwardedRef,
18307
+ onPress: (0, import_helpers.composeEventHandlers)(props.onPress ?? void 0, () => {
18308
+ props.disabled || setPressed(!pressed);
18309
+ })
18310
+ }
18311
+ );
18312
+ }
18313
+ );
18303
18314
  }
18304
18315
  });
18305
18316
 
@@ -18655,9 +18666,9 @@ var require_index_native67 = __commonJS({
18655
18666
  let timeout, isCancelled = !1;
18656
18667
  function debounced() {
18657
18668
  isCancelled = !1;
18658
- let context = this, args = arguments;
18659
- leading && !timeout && func.apply(context, args), clearTimeout(timeout), timeout = setTimeout(function() {
18660
- timeout = null, leading || isCancelled || func.apply(context, args), isCancelled = !1;
18669
+ let args = arguments;
18670
+ leading && !timeout && func.apply(this, args), clearTimeout(timeout), timeout = setTimeout(() => {
18671
+ timeout = null, leading || isCancelled || func.apply(this, args), isCancelled = !1;
18661
18672
  }, wait);
18662
18673
  }
18663
18674
  return debounced.cancel = () => {