tamagui 1.79.10 → 1.79.12

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
@@ -5611,6 +5611,30 @@ var require_withStaticProperties_native = __commonJS({
5611
5611
  }
5612
5612
  });
5613
5613
 
5614
+ // ../web/dist/cjs/internalWithTheme.native.js
5615
+ var require_internalWithTheme_native = __commonJS({
5616
+ "../web/dist/cjs/internalWithTheme.native.js"(exports, module2) {
5617
+ "use strict";
5618
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
5619
+ for (var name in all)
5620
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
5621
+ }, __copyProps2 = (to, from, except, desc) => {
5622
+ if (from && typeof from == "object" || typeof from == "function")
5623
+ for (let key of __getOwnPropNames2(from))
5624
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
5625
+ return to;
5626
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), internalWithTheme_exports = {};
5627
+ __export2(internalWithTheme_exports, {
5628
+ internalWithTheme: () => internalWithTheme
5629
+ });
5630
+ module2.exports = __toCommonJS2(internalWithTheme_exports);
5631
+ var import_useTheme = require_useTheme_native(), import_jsx_runtime6 = require("react/jsx-runtime"), internalWithTheme = (Component, styleProvider) => (props) => {
5632
+ let { expressions, ...rest } = props, theme = (0, import_useTheme.useTheme)();
5633
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { style: styleProvider(theme, props.expressions), ...rest });
5634
+ };
5635
+ }
5636
+ });
5637
+
5614
5638
  // ../web/dist/cjs/hooks/useThemeName.native.js
5615
5639
  var require_useThemeName_native = __commonJS({
5616
5640
  "../web/dist/cjs/hooks/useThemeName.native.js"(exports, module2) {
@@ -6127,6 +6151,7 @@ var require_index_native9 = __commonJS({
6127
6151
  __reExport2(src_exports2, require_themes_native(), module2.exports);
6128
6152
  __reExport2(src_exports2, require_createShallowSetState_native(), module2.exports);
6129
6153
  __reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
6154
+ __reExport2(src_exports2, require_internalWithTheme_native(), module2.exports);
6130
6155
  var import_useMedia = require_useMedia_native();
6131
6156
  __reExport2(src_exports2, require_useTheme_native(), module2.exports);
6132
6157
  __reExport2(src_exports2, require_useThemeName_native(), module2.exports);
@@ -8188,7 +8213,7 @@ var require_index_native18 = __commonJS({
8188
8213
  });
8189
8214
  module2.exports = __toCommonJS2(src_exports2);
8190
8215
  var import_get_token2 = require_index_native17(), getButtonSized2 = (val, { tokens, props }) => {
8191
- if (!val)
8216
+ if (!val || props.circular)
8192
8217
  return;
8193
8218
  if (typeof val == "number")
8194
8219
  return {
@@ -11194,27 +11219,18 @@ var require_Dialog_native = __commonJS({
11194
11219
  DialogDescription.displayName = DESCRIPTION_NAME;
11195
11220
  var CLOSE_NAME = "DialogClose", DialogCloseFrame = (0, import_core13.styled)(import_core13.View, {
11196
11221
  name: CLOSE_NAME,
11197
- tag: "button",
11198
- variants: {
11199
- unstyled: {
11200
- false: {
11201
- zIndex: 100
11202
- }
11203
- }
11204
- },
11205
- defaultVariants: {
11206
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
11207
- }
11222
+ tag: "button"
11208
11223
  }), DialogClose = DialogCloseFrame.styleable(
11209
11224
  (props, forwardedRef) => {
11210
11225
  let { __scopeDialog, displayWhenAdapted, ...closeProps } = props, context = useDialogContext(CLOSE_NAME, __scopeDialog, {
11211
11226
  warn: !1,
11212
11227
  fallback: {}
11213
- });
11214
- return useShowDialogSheet(context) && !displayWhenAdapted ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
11228
+ }), isSheet = useShowDialogSheet(context), isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
11229
+ return isSheet && !displayWhenAdapted ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
11215
11230
  DialogCloseFrame,
11216
11231
  {
11217
11232
  accessibilityLabel: "Dialog Close",
11233
+ tag: isInsideButton ? "span" : "button",
11218
11234
  ...closeProps,
11219
11235
  ref: forwardedRef,
11220
11236
  onPress: (0, import_core13.composeEventHandlers)(
@@ -17147,8 +17163,8 @@ var require_helpers_native2 = __commonJS({
17147
17163
  return distances.indexOf(closestDistance);
17148
17164
  }
17149
17165
  function getThumbInBoundsOffset(width, left, direction) {
17150
- let halfWidth = width / 2, offset2 = linearScale([0, 50], [0, halfWidth]);
17151
- return (halfWidth - offset2(left) * direction) * direction;
17166
+ let quarterWidth = width / 4, offset2 = linearScale([0, 50], [0, quarterWidth]);
17167
+ return (quarterWidth - offset2(left) * direction) * direction;
17152
17168
  }
17153
17169
  function getStepsBetweenValues(values) {
17154
17170
  return values.slice(0, -1).map((value, index) => values[index + 1] - value);
@@ -17537,61 +17553,63 @@ var require_Slider_native = __commonJS({
17537
17553
  defaultVariants: {
17538
17554
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
17539
17555
  }
17540
- }), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
17541
- let { __scopeSlider, index, size: sizeProp, ...thumbProps } = props, context = (0, import_constants.useSliderContext)(THUMB_NAME, __scopeSlider), orientation = (0, import_constants.useSliderOrientationContext)(THUMB_NAME, __scopeSlider), [thumb, setThumb] = React2.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(
17542
- forwardedRef,
17543
- (node) => setThumb(node)
17544
- ), value = context.values[index], percent = value === void 0 ? 0 : (0, import_helpers2.convertValueToPercentage)(value, context.min, context.max), label = (0, import_helpers2.getLabel)(index, context.values.length), sizeIn = sizeProp ?? context.size ?? "$true", [size2, setSize] = React2.useState(() => (0, import_core13.getVariableValue)(getThumbSize(sizeIn).width)), thumbInBoundsOffset = size2 ? (0, import_helpers2.getThumbInBoundsOffset)(size2, percent, orientation.direction) : 0;
17545
- React2.useEffect(() => {
17546
- if (thumb)
17547
- return context.thumbs.set(thumb, index), () => {
17548
- context.thumbs.delete(thumb);
17549
- };
17550
- }, [thumb, context.thumbs, index]);
17551
- let positionalStyles = context.orientation === "horizontal" ? {
17552
- x: thumbInBoundsOffset - size2 / 2,
17553
- y: -size2 / 2,
17554
- top: "50%",
17555
- ...size2 === 0 && {
17556
- top: "auto",
17557
- bottom: "auto"
17558
- }
17559
- } : {
17560
- x: -size2 / 2,
17561
- y: size2 / 2,
17562
- left: "50%",
17563
- ...size2 === 0 && {
17564
- left: "auto",
17565
- right: "auto"
17566
- }
17567
- };
17568
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17569
- SliderThumbFrame,
17570
- {
17571
- ref: composedRefs,
17572
- role: "slider",
17573
- "aria-label": props["aria-label"] || label,
17574
- "aria-valuemin": context.min,
17575
- "aria-valuenow": value,
17576
- "aria-valuemax": context.max,
17577
- "aria-orientation": context.orientation,
17578
- "data-orientation": context.orientation,
17579
- "data-disabled": context.disabled ? "" : void 0,
17580
- tabIndex: context.disabled ? void 0 : 0,
17581
- animateOnly: ["transform", "left", "top", "right", "bottom"],
17582
- ...positionalStyles,
17583
- [orientation.startEdge]: `${percent}%`,
17584
- size: sizeIn,
17585
- ...thumbProps,
17586
- onLayout: (e) => {
17587
- setSize(e.nativeEvent.layout[orientation.sizeProp]);
17588
- },
17589
- onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, () => {
17590
- context.valueIndexToChangeRef.current = index;
17591
- })
17592
- }
17593
- );
17594
- }), SliderComponent = React2.forwardRef(
17556
+ }), SliderThumb = React2.memo(
17557
+ SliderThumbFrame.styleable(function(props, forwardedRef) {
17558
+ let { __scopeSlider, index, size: sizeProp, ...thumbProps } = props, context = (0, import_constants.useSliderContext)(THUMB_NAME, __scopeSlider), orientation = (0, import_constants.useSliderOrientationContext)(THUMB_NAME, __scopeSlider), [thumb, setThumb] = React2.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(
17559
+ forwardedRef,
17560
+ (node) => setThumb(node)
17561
+ ), value = context.values[index], percent = value === void 0 ? 0 : (0, import_helpers2.convertValueToPercentage)(value, context.min, context.max), label = (0, import_helpers2.getLabel)(index, context.values.length), sizeIn = sizeProp ?? context.size ?? "$true", [size2, setSize] = React2.useState(() => (0, import_core13.getVariableValue)(getThumbSize(sizeIn).width)), thumbInBoundsOffset = size2 ? (0, import_helpers2.getThumbInBoundsOffset)(size2, percent, orientation.direction) : 0;
17562
+ React2.useEffect(() => {
17563
+ if (thumb)
17564
+ return context.thumbs.set(thumb, index), () => {
17565
+ context.thumbs.delete(thumb);
17566
+ };
17567
+ }, [thumb, context.thumbs, index]);
17568
+ let positionalStyles = context.orientation === "horizontal" ? {
17569
+ x: thumbInBoundsOffset - size2 / 2,
17570
+ y: -size2 / 2,
17571
+ top: "50%",
17572
+ ...size2 === 0 && {
17573
+ top: "auto",
17574
+ bottom: "auto"
17575
+ }
17576
+ } : {
17577
+ x: -size2 / 2,
17578
+ y: size2 / 2,
17579
+ left: "50%",
17580
+ ...size2 === 0 && {
17581
+ left: "auto",
17582
+ right: "auto"
17583
+ }
17584
+ };
17585
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17586
+ SliderThumbFrame,
17587
+ {
17588
+ ref: composedRefs,
17589
+ role: "slider",
17590
+ "aria-label": props["aria-label"] || label,
17591
+ "aria-valuemin": context.min,
17592
+ "aria-valuenow": value,
17593
+ "aria-valuemax": context.max,
17594
+ "aria-orientation": context.orientation,
17595
+ "data-orientation": context.orientation,
17596
+ "data-disabled": context.disabled ? "" : void 0,
17597
+ tabIndex: context.disabled ? void 0 : 0,
17598
+ animateOnly: ["transform", "left", "top", "right", "bottom"],
17599
+ ...positionalStyles,
17600
+ [orientation.startEdge]: `${percent}%`,
17601
+ size: sizeIn,
17602
+ ...thumbProps,
17603
+ onLayout: (e) => {
17604
+ setSize(e.nativeEvent.layout[orientation.sizeProp]);
17605
+ },
17606
+ onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, () => {
17607
+ context.valueIndexToChangeRef.current = index;
17608
+ })
17609
+ }
17610
+ );
17611
+ })
17612
+ ), SliderComponent = React2.forwardRef(
17595
17613
  (props, forwardedRef) => {
17596
17614
  let {
17597
17615
  name,
@@ -19105,7 +19123,7 @@ var require_index_native67 = __commonJS({
19105
19123
  }, debounced;
19106
19124
  }
19107
19125
  var defaultOpts = { leading: !1 };
19108
- function useDebounce(fn, wait, options = defaultOpts, mountArgs = []) {
19126
+ function useDebounce(fn, wait, options = defaultOpts, mountArgs = [fn]) {
19109
19127
  let dbEffect = (0, import_react2.useRef)(null);
19110
19128
  return (0, import_react2.useEffect)(() => () => {
19111
19129
  var _a;