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.
package/dist/native.js CHANGED
@@ -4611,12 +4611,12 @@ var require_createStyledContext_native = __commonJS({
4611
4611
  }
4612
4612
  });
4613
4613
  module2.exports = __toCommonJS2(createStyledContext_exports);
4614
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_objectIdentityKey = require_objectIdentityKey_native();
4614
+ 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"];
4615
4615
  function createStyledContext2(defaultValues) {
4616
- var OGContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
4616
+ var OGContext = createReactContext(defaultValues), OGProvider2 = OGContext.Provider, Context = OGContext, scopedContexts = /* @__PURE__ */ new Map();
4617
4617
  function getOrCreateScopedContext(scope) {
4618
4618
  var ScopedContext = scopedContexts.get(scope);
4619
- return ScopedContext || (ScopedContext = /* @__PURE__ */ import_react3.default.createContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4619
+ return ScopedContext || (ScopedContext = createReactContext(defaultValues), scopedContexts.set(scope, ScopedContext)), ScopedContext;
4620
4620
  }
4621
4621
  var Provider = function(param) {
4622
4622
  var { children, scope, ...values } = param, next = import_react3.default.useMemo(function() {
@@ -6936,29 +6936,31 @@ var require_propMapper_native = __commonJS({
6936
6936
  };
6937
6937
  });
6938
6938
  function getVariantDefinition(variant, value, conf) {
6939
- if (typeof variant == "function") return variant;
6940
- var exact = variant[value];
6941
- if (exact) return exact;
6942
- if (value != null) {
6943
- var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6944
- try {
6945
- for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6946
- var { name, spreadName } = _step.value;
6947
- if (spreadName in variant && value in tokensParsed[name]) return variant[spreadName];
6948
- }
6949
- } catch (err) {
6950
- _didIteratorError = !0, _iteratorError = err;
6951
- } finally {
6939
+ if (variant) {
6940
+ if (typeof variant == "function") return variant;
6941
+ var exact = variant[value];
6942
+ if (exact) return exact;
6943
+ if (value != null) {
6944
+ var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6952
6945
  try {
6953
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6946
+ for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
6947
+ var { name, spreadName } = _step.value;
6948
+ if (spreadName in variant && value in tokensParsed[name]) return variant[spreadName];
6949
+ }
6950
+ } catch (err) {
6951
+ _didIteratorError = !0, _iteratorError = err;
6954
6952
  } finally {
6955
- if (_didIteratorError) throw _iteratorError;
6953
+ try {
6954
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6955
+ } finally {
6956
+ if (_didIteratorError) throw _iteratorError;
6957
+ }
6956
6958
  }
6959
+ var fontSizeVariant = variant["...fontSize"];
6960
+ if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
6957
6961
  }
6958
- var fontSizeVariant = variant["...fontSize"];
6959
- if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
6962
+ return variant[`:${typeof value}`] || variant["..."];
6960
6963
  }
6961
- return variant[`:${typeof value}`] || variant["..."];
6962
6964
  }
6963
6965
  var fontShorthand = {
6964
6966
  fontSize: "size",
@@ -15785,7 +15787,7 @@ var require_Accordion_native = __commonJS({
15785
15787
  }
15786
15788
  });
15787
15789
  module2.exports = __toCommonJS2(Accordion_exports);
15788
- 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 = [
15790
+ 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 = [
15789
15791
  "Home",
15790
15792
  "End",
15791
15793
  "ArrowDown",
@@ -15815,7 +15817,7 @@ var require_Accordion_native = __commonJS({
15815
15817
  ].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;
15816
15818
  }
15817
15819
  };
15818
- var { Provider: AccordionValueProvider, useStyledContext: useAccordionValueContext } = (0, import_web2.createStyledContext)(), { Provider: AccordionCollapsibleProvider, useStyledContext: useAccordionCollapsibleContext } = (0, import_web2.createStyledContext)(), AccordionImplSingle = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15820
+ var { Provider: AccordionValueProvider, useStyledContext: useAccordionValueContext } = (0, import_web.createStyledContext)(), { Provider: AccordionCollapsibleProvider, useStyledContext: useAccordionCollapsibleContext } = (0, import_web.createStyledContext)(), AccordionImplSingle = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15819
15821
  var { value: valueProp, defaultValue, control, onValueChange = function() {
15820
15822
  }, collapsible = !1, ...accordionSingleProps } = props, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
15821
15823
  prop: valueProp,
@@ -15883,7 +15885,7 @@ var require_Accordion_native = __commonJS({
15883
15885
  })
15884
15886
  })
15885
15887
  });
15886
- }), { Provider: AccordionImplProvider, useStyledContext: useAccordionContext } = (0, import_web2.createStyledContext)(), AccordionImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15888
+ }), { Provider: AccordionImplProvider, useStyledContext: useAccordionContext } = (0, import_web.createStyledContext)(), AccordionImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15887
15889
  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) {
15888
15890
  var _triggerCollection_clampedIndex_ref_current;
15889
15891
  if (ACCORDION_KEYS.includes(event.key)) {
@@ -15942,7 +15944,7 @@ var require_Accordion_native = __commonJS({
15942
15944
  })
15943
15945
  })
15944
15946
  });
15945
- }), ITEM_NAME = "AccordionItem", { Provider: AccordionItemProvider, useStyledContext: useAccordionItemContext } = (0, import_web2.createStyledContext)(), AccordionItem = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15947
+ }), ITEM_NAME = "AccordionItem", { Provider: AccordionItemProvider, useStyledContext: useAccordionItemContext } = (0, import_web.createStyledContext)(), AccordionItem = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
15946
15948
  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;
15947
15949
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionItemProvider, {
15948
15950
  scope: __scopeAccordion,
@@ -15975,7 +15977,7 @@ var require_Accordion_native = __commonJS({
15975
15977
  });
15976
15978
  });
15977
15979
  AccordionHeader.displayName = HEADER_NAME;
15978
- var AccordionTriggerFrame = (0, import_web2.styled)(import_collapsible.Collapsible.Trigger, {
15980
+ var AccordionTriggerFrame = (0, import_web.styled)(import_collapsible.Collapsible.Trigger, {
15979
15981
  variants: {
15980
15982
  unstyled: {
15981
15983
  false: {
@@ -16013,7 +16015,7 @@ var require_Accordion_native = __commonJS({
16013
16015
  ref: forwardedRef
16014
16016
  })
16015
16017
  });
16016
- }), AccordionContentFrame = (0, import_web2.styled)(import_collapsible.Collapsible.Content, {
16018
+ }), AccordionContentFrame = (0, import_web.styled)(import_collapsible.Collapsible.Content, {
16017
16019
  variants: {
16018
16020
  unstyled: {
16019
16021
  false: {
@@ -21691,7 +21693,7 @@ var require_Checkbox_native = __commonJS({
21691
21693
  },
21692
21694
  pressStyle: {
21693
21695
  borderColor: "$borderColor",
21694
- backgroundColor: "$backgroundColor"
21696
+ backgroundColor: "$background"
21695
21697
  },
21696
21698
  focusStyle: {
21697
21699
  outlineWidth: 0
@@ -22457,9 +22459,9 @@ var require_useCheckbox_native = __commonJS({
22457
22459
  "data-state": (0, import_utils3.getState)(checked),
22458
22460
  "data-disabled": disabled ? "" : void 0,
22459
22461
  disabled,
22460
- onKeyDown: handleKeyDown
22462
+ onKeyDown: disabled ? void 0 : handleKeyDown
22461
22463
  },
22462
- onPress: handlePress
22464
+ onPress: disabled ? void 0 : handlePress
22463
22465
  }
22464
22466
  };
22465
22467
  }
@@ -22621,12 +22623,17 @@ var require_createCheckbox_native = __commonJS({
22621
22623
  ...checkboxProps.style
22622
22624
  }
22623
22625
  });
22624
- var _propsActive_size1, _ref1, _ref2;
22625
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckboxContext.Provider, {
22626
- value: {
22626
+ var memoizedContext = (0, import_react3.useMemo)(function() {
22627
+ return {
22627
22628
  checked,
22628
22629
  disabled: checkboxProps.disabled
22629
- },
22630
+ };
22631
+ }, [
22632
+ checked,
22633
+ checkboxProps.disabled
22634
+ ]), _propsActive_size1, _ref1, _ref2;
22635
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckboxContext.Provider, {
22636
+ value: memoizedContext,
22630
22637
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_CheckboxStyledContext.CheckboxStyledContext.Provider, {
22631
22638
  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",
22632
22639
  scaleIcon: (_ref2 = scaleIcon ?? (styledContext == null ? void 0 : styledContext.scaleIcon)) !== null && _ref2 !== void 0 ? _ref2 : 1,
@@ -24498,7 +24505,7 @@ var require_floating_ui_react_native = __commonJS({
24498
24505
  var React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React4), ORIGIN$1 = {
24499
24506
  x: 0,
24500
24507
  y: 0
24501
- };
24508
+ }, isAndroid = reactNative.Platform.OS === "android";
24502
24509
  function isView(reference) {
24503
24510
  return "measure" in reference;
24504
24511
  }
@@ -24517,6 +24524,7 @@ var require_floating_ui_react_native = __commonJS({
24517
24524
  }, method = sameScrollView ? "measure" : "measureInWindow";
24518
24525
  if (isView(reference))
24519
24526
  reference[method](function(x2, y2, width2, height2) {
24527
+ y2 = isAndroid && !sameScrollView && reactNative.StatusBar.currentHeight ? y2 + reactNative.StatusBar.currentHeight : y2;
24520
24528
  var referenceRect2 = {
24521
24529
  width: width2,
24522
24530
  height: height2,
@@ -24546,10 +24554,10 @@ var require_floating_ui_react_native = __commonJS({
24546
24554
  });
24547
24555
  },
24548
24556
  getClippingRect() {
24549
- var { width, height } = reactNative.Dimensions.get("window");
24557
+ 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;
24550
24558
  return Promise.resolve({
24551
- width,
24552
- height,
24559
+ width: windowWidth,
24560
+ height: screenHeight - navigationBarHeight,
24553
24561
  ...sameScrollView ? scrollOffsets : ORIGIN$1
24554
24562
  });
24555
24563
  },
@@ -25237,21 +25245,9 @@ var require_Popper_native = __commonJS({
25237
25245
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
25238
25246
  }
25239
25247
  }), PopperContent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
25240
- 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() {
25241
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperContentFrame, {
25242
- "data-placement": placement,
25243
- "data-strategy": strategy,
25244
- contain: "layout",
25245
- size: size4,
25246
- ...rest
25247
- }, "popper-content-frame");
25248
- }, [
25249
- placement,
25250
- strategy,
25251
- props
25252
- ]), [needsMeasure, setNeedsMeasure] = React4.useState(!0);
25253
- React4.useEffect(function() {
25254
- enableAnimationForPositionChange && (x || y) && setNeedsMeasure(!1);
25248
+ 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);
25249
+ (0, import_constants4.useIsomorphicLayoutEffect)(function() {
25250
+ x && y && setNeedsMeasure(!1);
25255
25251
  }, [
25256
25252
  enableAnimationForPositionChange,
25257
25253
  x,
@@ -25268,18 +25264,23 @@ var require_Popper_native = __commonJS({
25268
25264
  ...enableAnimationForPositionChange && {
25269
25265
  // apply animation but disable it on initial render to avoid animating from 0 to the first position
25270
25266
  animation: rest.animation,
25271
- animateOnly: needsMeasure ? [
25272
- "none"
25273
- ] : rest.animateOnly,
25267
+ animateOnly: needsMeasure ? [] : rest.animateOnly,
25274
25268
  animatePresence: !1
25269
+ },
25270
+ ...x === 0 && y === 0 && {
25271
+ opacity: 0,
25272
+ animateOnly: []
25275
25273
  }
25276
25274
  };
25277
25275
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
25278
25276
  ...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
25279
- ...x === 0 && y === 0 ? {
25280
- opacity: 0
25281
- } : {},
25282
- children: contents
25277
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperContentFrame, {
25278
+ "data-placement": placement,
25279
+ "data-strategy": strategy,
25280
+ contain: "layout",
25281
+ size: size4,
25282
+ ...rest
25283
+ }, "popper-content-frame")
25283
25284
  });
25284
25285
  }), PopperArrowFrame = (0, import_core12.styled)(import_stacks3.YStack, {
25285
25286
  name: "PopperArrow",
@@ -26208,7 +26209,7 @@ var require_RadioGroup_native = __commonJS({
26208
26209
  },
26209
26210
  pressStyle: {
26210
26211
  borderColor: "$borderColor",
26211
- backgroundColor: "$backgroundColor"
26212
+ backgroundColor: "$background"
26212
26213
  },
26213
26214
  focusVisibleStyle: {
26214
26215
  outlineWidth: 0