tamagui 1.123.4 → 1.123.5

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.
@@ -4283,12 +4283,12 @@ var require_createStyledContext_native = __commonJS({
4283
4283
  }
4284
4284
  });
4285
4285
  module2.exports = __toCommonJS2(createStyledContext_exports);
4286
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native();
4286
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native(), createReactContext = import_react3.default[Math.random(), "createContext"];
4287
4287
  function createStyledContext2(defaultValues) {
4288
- var OGContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
4288
+ var OGContext = createReactContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
4289
4289
  function getOrCreateScopedContext(scope) {
4290
4290
  var ScopedContext = scopedContexts.get(scope);
4291
- return ScopedContext || (ScopedContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4291
+ return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4292
4292
  }
4293
4293
  var Provider = function(param) {
4294
4294
  var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
@@ -6586,29 +6586,31 @@ var require_propMapper_native = __commonJS({
6586
6586
  };
6587
6587
  });
6588
6588
  function getVariantDefinition(variant, value, conf) {
6589
- if (typeof variant == "function") return variant;
6590
- var exact = variant[value];
6591
- if (exact) return exact;
6592
- if (value != null) {
6593
- var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6594
- try {
6595
- for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6596
- var { name, spreadName } = _step.value;
6597
- if (spreadName in variant && value in tokensParsed[name]) return variant[spreadName];
6598
- }
6599
- } catch (err) {
6600
- _didIteratorError = !0, _iteratorError = err;
6601
- } finally {
6589
+ if (variant) {
6590
+ if (typeof variant == "function") return variant;
6591
+ var exact = variant[value];
6592
+ if (exact) return exact;
6593
+ if (value != null) {
6594
+ var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6602
6595
  try {
6603
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6596
+ for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6597
+ var { name, spreadName } = _step.value;
6598
+ if (spreadName in variant && value in tokensParsed[name]) return variant[spreadName];
6599
+ }
6600
+ } catch (err) {
6601
+ _didIteratorError = !0, _iteratorError = err;
6604
6602
  } finally {
6605
- if (_didIteratorError) throw _iteratorError;
6603
+ try {
6604
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6605
+ } finally {
6606
+ if (_didIteratorError) throw _iteratorError;
6607
+ }
6606
6608
  }
6609
+ var fontSizeVariant = variant["...fontSize"];
6610
+ if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
6607
6611
  }
6608
- var fontSizeVariant = variant["...fontSize"];
6609
- if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
6612
+ return variant[`:${typeof value}`] || variant["..."];
6610
6613
  }
6611
- return variant[`:${typeof value}`] || variant["..."];
6612
6614
  }
6613
6615
  var fontShorthand = {
6614
6616
  fontSize: "size",
@@ -15159,7 +15161,7 @@ var require_Accordion_native = __commonJS({
15159
15161
  }
15160
15162
  });
15161
15163
  module2.exports = __toCommonJS2(Accordion_exports);
15162
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_collapsible = require_index_native15(), import_collection = require_index_native19(), import_compose_refs = require_index_native12(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_stacks3 = require_index_native22(), import_text2 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_use_direction = require_index_native25(), import_web = require_index_native14(), import_web2 = require_index_native14(), React4 = __toESM2(require("react")), ACCORDION_NAME = "Accordion", ACCORDION_KEYS = [
15164
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_collapsible = require_index_native15(), import_collection = require_index_native19(), import_compose_refs = require_index_native12(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_stacks3 = require_index_native22(), import_text2 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_use_direction = require_index_native25(), import_web = require_index_native14(), React4 = __toESM2(require("react")), ACCORDION_NAME = "Accordion", ACCORDION_KEYS = [
15163
15165
  "Home",
15164
15166
  "End",
15165
15167
  "ArrowDown",
@@ -15189,7 +15191,7 @@ var require_Accordion_native = __commonJS({
15189
15191
  ].includes(props.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : props.type === "multiple" && typeof value == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : props.type === "single" && Array.isArray(value) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null;
15190
15192
  }
15191
15193
  };
15192
- var { Provider: AccordionValueProvider, useStyledContext: useAccordionValueContext } = (0, import_web2.createStyledContext)(), { Provider: AccordionCollapsibleProvider, useStyledContext: useAccordionCollapsibleContext } = (0, import_web2.createStyledContext)(), AccordionImplSingle = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15194
+ var { Provider: AccordionValueProvider, useStyledContext: useAccordionValueContext } = (0, import_web.createStyledContext)(), { Provider: AccordionCollapsibleProvider, useStyledContext: useAccordionCollapsibleContext } = (0, import_web.createStyledContext)(), AccordionImplSingle = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15193
15195
  var { value: valueProp, defaultValue, control, onValueChange = function() {
15194
15196
  }, collapsible = !1, ...accordionSingleProps } = props, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
15195
15197
  prop: valueProp,
@@ -15257,7 +15259,7 @@ var require_Accordion_native = __commonJS({
15257
15259
  })
15258
15260
  })
15259
15261
  });
15260
- }), { Provider: AccordionImplProvider, useStyledContext: useAccordionContext } = (0, import_web2.createStyledContext)(), AccordionImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15262
+ }), { Provider: AccordionImplProvider, useStyledContext: useAccordionContext } = (0, import_web.createStyledContext)(), AccordionImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15261
15263
  var { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props, accordionRef = React4.useRef(null), composedRef = (0, import_compose_refs.useComposedRefs)(accordionRef, forwardedRef), getItems = useCollection(__scopeAccordion || ACCORDION_CONTEXT), direction = (0, import_use_direction.useDirection)(dir), isDirectionLTR = direction === "ltr", handleKeyDown = (0, import_helpers.composeEventHandlers)(props.onKeyDown, function(event) {
15262
15264
  var _triggerCollection_clampedIndex_ref_current;
15263
15265
  if (ACCORDION_KEYS.includes(event.key)) {
@@ -15316,7 +15318,7 @@ var require_Accordion_native = __commonJS({
15316
15318
  })
15317
15319
  })
15318
15320
  });
15319
- }), ITEM_NAME = "AccordionItem", { Provider: AccordionItemProvider, useStyledContext: useAccordionItemContext } = (0, import_web2.createStyledContext)(), AccordionItem = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15321
+ }), ITEM_NAME = "AccordionItem", { Provider: AccordionItemProvider, useStyledContext: useAccordionItemContext } = (0, import_web.createStyledContext)(), AccordionItem = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15320
15322
  var { __scopeAccordion, value, ...accordionItemProps } = props, accordionContext = useAccordionContext(__scopeAccordion), valueContext = useAccordionValueContext(__scopeAccordion), triggerId = React4.useId(), open = value && valueContext.value.includes(value) || !1, disabled = accordionContext.disabled || props.disabled;
15321
15323
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionItemProvider, {
15322
15324
  scope: __scopeAccordion,
@@ -15349,7 +15351,7 @@ var require_Accordion_native = __commonJS({
15349
15351
  });
15350
15352
  });
15351
15353
  AccordionHeader.displayName = HEADER_NAME;
15352
- var AccordionTriggerFrame = (0, import_web2.styled)(import_collapsible.Collapsible.Trigger, {
15354
+ var AccordionTriggerFrame = (0, import_web.styled)(import_collapsible.Collapsible.Trigger, {
15353
15355
  variants: {
15354
15356
  unstyled: {
15355
15357
  false: {
@@ -15387,7 +15389,7 @@ var require_Accordion_native = __commonJS({
15387
15389
  ref: forwardedRef
15388
15390
  })
15389
15391
  });
15390
- }), AccordionContentFrame = (0, import_web2.styled)(import_collapsible.Collapsible.Content, {
15392
+ }), AccordionContentFrame = (0, import_web.styled)(import_collapsible.Collapsible.Content, {
15391
15393
  variants: {
15392
15394
  unstyled: {
15393
15395
  false: {
@@ -20966,7 +20968,7 @@ var require_Checkbox_native = __commonJS({
20966
20968
  },
20967
20969
  pressStyle: {
20968
20970
  borderColor: "$borderColor",
20969
- backgroundColor: "$backgroundColor"
20971
+ backgroundColor: "$background"
20970
20972
  },
20971
20973
  focusStyle: {
20972
20974
  outlineWidth: 0
@@ -21728,9 +21730,9 @@ var require_useCheckbox_native = __commonJS({
21728
21730
  "data-state": (0, import_utils3.getState)(checked),
21729
21731
  "data-disabled": disabled ? "" : void 0,
21730
21732
  disabled,
21731
- onKeyDown: handleKeyDown
21733
+ onKeyDown: disabled ? void 0 : handleKeyDown
21732
21734
  },
21733
- onPress: handlePress
21735
+ onPress: disabled ? void 0 : handlePress
21734
21736
  }
21735
21737
  };
21736
21738
  }
@@ -21892,12 +21894,17 @@ var require_createCheckbox_native = __commonJS({
21892
21894
  ...checkboxProps.style
21893
21895
  }
21894
21896
  });
21895
- var _propsActive_size1, _ref1, _ref2;
21896
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckboxContext.Provider, {
21897
- value: {
21897
+ var memoizedContext = (0, import_react3.useMemo)(function() {
21898
+ return {
21898
21899
  checked,
21899
21900
  disabled: checkboxProps.disabled
21900
- },
21901
+ };
21902
+ }, [
21903
+ checked,
21904
+ checkboxProps.disabled
21905
+ ]), _propsActive_size1, _ref1, _ref2;
21906
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckboxContext.Provider, {
21907
+ value: memoizedContext,
21901
21908
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {
21902
21909
  size: (_ref1 = (_propsActive_size1 = propsActive.size) !== null && _propsActive_size1 !== void 0 ? _propsActive_size1 : styledContext == null ? void 0 : styledContext.size) !== null && _ref1 !== void 0 ? _ref1 : "$true",
21903
21910
  scaleIcon: (_ref2 = scaleIcon ?? (styledContext == null ? void 0 : styledContext.scaleIcon)) !== null && _ref2 !== void 0 ? _ref2 : 1,
@@ -23769,7 +23776,7 @@ var require_floating_ui_react_native = __commonJS({
23769
23776
  var React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React4), ORIGIN$1 = {
23770
23777
  x: 0,
23771
23778
  y: 0
23772
- };
23779
+ }, isAndroid = reactNative.Platform.OS === "android";
23773
23780
  function isView(reference) {
23774
23781
  return "measure" in reference;
23775
23782
  }
@@ -23788,6 +23795,7 @@ var require_floating_ui_react_native = __commonJS({
23788
23795
  }, method = sameScrollView ? "measure" : "measureInWindow";
23789
23796
  if (isView(reference))
23790
23797
  reference[method](function(x2, y2, width2, height2) {
23798
+ y2 = isAndroid && !sameScrollView && reactNative.StatusBar.currentHeight ? y2 + reactNative.StatusBar.currentHeight : y2;
23791
23799
  var referenceRect2 = {
23792
23800
  width: width2,
23793
23801
  height: height2,
@@ -23817,10 +23825,10 @@ var require_floating_ui_react_native = __commonJS({
23817
23825
  });
23818
23826
  },
23819
23827
  getClippingRect() {
23820
- var { width, height } = reactNative.Dimensions.get("window");
23828
+ var { width: windowWidth, height: windowHeight } = reactNative.Dimensions.get("window"), { height: screenHeight } = reactNative.Dimensions.get("screen"), statusBarHeight = reactNative.StatusBar.currentHeight || 0, navigationBarHeight = isAndroid ? screenHeight - windowHeight - statusBarHeight : 0;
23821
23829
  return Promise.resolve({
23822
- width,
23823
- height,
23830
+ width: windowWidth,
23831
+ height: screenHeight - navigationBarHeight,
23824
23832
  ...sameScrollView ? scrollOffsets : ORIGIN$1
23825
23833
  });
23826
23834
  },
@@ -24508,21 +24516,9 @@ var require_Popper_native = __commonJS({
24508
24516
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
24509
24517
  }
24510
24518
  }), PopperContent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24511
- var { __scopePopper, enableAnimationForPositionChange, ...rest } = props, { strategy, placement, refs, x, y, getFloatingProps, size: size4 } = usePopperContext(__scopePopper), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), contents = React4.useMemo(function() {
24512
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperContentFrame, {
24513
- "data-placement": placement,
24514
- "data-strategy": strategy,
24515
- contain: "layout",
24516
- size: size4,
24517
- ...rest
24518
- }, "popper-content-frame");
24519
- }, [
24520
- placement,
24521
- strategy,
24522
- props
24523
- ]), [needsMeasure, setNeedsMeasure] = React4.useState(!0);
24524
- React4.useEffect(function() {
24525
- enableAnimationForPositionChange && (x || y) && setNeedsMeasure(!1);
24519
+ var { __scopePopper, enableAnimationForPositionChange, ...rest } = props, { strategy, placement, refs, x, y, getFloatingProps, size: size4 } = usePopperContext(__scopePopper), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), [needsMeasure, setNeedsMeasure] = React4.useState(enableAnimationForPositionChange);
24520
+ (0, import_constants4.useIsomorphicLayoutEffect)(function() {
24521
+ x && y && setNeedsMeasure(!1);
24526
24522
  }, [
24527
24523
  enableAnimationForPositionChange,
24528
24524
  x,
@@ -24539,18 +24535,23 @@ var require_Popper_native = __commonJS({
24539
24535
  ...enableAnimationForPositionChange && {
24540
24536
  // apply animation but disable it on initial render to avoid animating from 0 to the first position
24541
24537
  animation: rest.animation,
24542
- animateOnly: needsMeasure ? [
24543
- "none"
24544
- ] : rest.animateOnly,
24538
+ animateOnly: needsMeasure ? [] : rest.animateOnly,
24545
24539
  animatePresence: !1
24540
+ },
24541
+ ...x === 0 && y === 0 && {
24542
+ opacity: 0,
24543
+ animateOnly: []
24546
24544
  }
24547
24545
  };
24548
24546
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
24549
24547
  ...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
24550
- ...x === 0 && y === 0 ? {
24551
- opacity: 0
24552
- } : {},
24553
- children: contents
24548
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperContentFrame, {
24549
+ "data-placement": placement,
24550
+ "data-strategy": strategy,
24551
+ contain: "layout",
24552
+ size: size4,
24553
+ ...rest
24554
+ }, "popper-content-frame")
24554
24555
  });
24555
24556
  }), PopperArrowFrame = (0, import_core12.styled)(import_stacks3.YStack, {
24556
24557
  name: "PopperArrow",
@@ -25479,7 +25480,7 @@ var require_RadioGroup_native = __commonJS({
25479
25480
  },
25480
25481
  pressStyle: {
25481
25482
  borderColor: "$borderColor",
25482
- backgroundColor: "$backgroundColor"
25483
+ backgroundColor: "$background"
25483
25484
  },
25484
25485
  focusVisibleStyle: {
25485
25486
  outlineWidth: 0