tamagui 1.79.9 → 1.79.11
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 +94 -76
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +68 -47
- package/dist/test.native.js.map +3 -3
- package/package.json +53 -53
package/dist/native.js
CHANGED
|
@@ -4175,7 +4175,8 @@ var require_createComponent_native = __commonJS({
|
|
|
4175
4175
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
4176
4176
|
});
|
|
4177
4177
|
let component = (0, import_react2.forwardRef)((propsIn, forwardedRef) => {
|
|
4178
|
-
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m;
|
|
4178
|
+
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m, _n;
|
|
4179
|
+
let internalID = process.env.NODE_ENV === "development" ? (0, import_react2.useId)() : "";
|
|
4179
4180
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
4180
4181
|
hasSetupBaseViews = !0;
|
|
4181
4182
|
let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
|
|
@@ -4266,32 +4267,29 @@ var require_createComponent_native = __commonJS({
|
|
|
4266
4267
|
};
|
|
4267
4268
|
typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
|
|
4268
4269
|
let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
|
|
4269
|
-
if (process.env.NODE_ENV === "development") {
|
|
4270
|
-
let
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
propsOrder: Object.keys(props)
|
|
4293
|
-
}), console.groupEnd());
|
|
4294
|
-
}
|
|
4270
|
+
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
4271
|
+
let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${internalID}`;
|
|
4272
|
+
console.group(
|
|
4273
|
+
`%c ${banner} (unmounted: ${state.unmounted})${presence ? ` (presence: ${presence[0]})` : ""} ${isHydrated ? "\u{1F4A6}" : "\u{1F3DC}\uFE0F"}`,
|
|
4274
|
+
"background: green; color: white;"
|
|
4275
|
+
), import_constants.isServer || (console.groupCollapsed(
|
|
4276
|
+
`Info (collapsed): ${state.press || state.pressIn ? "PRESSED " : ""}${state.hover ? "HOVERED " : ""}${state.focus ? "FOCUSED" : " "}`
|
|
4277
|
+
), (0, import_log.log)({
|
|
4278
|
+
propsIn,
|
|
4279
|
+
props,
|
|
4280
|
+
state,
|
|
4281
|
+
staticConfig,
|
|
4282
|
+
elementType,
|
|
4283
|
+
themeStateProps,
|
|
4284
|
+
styledContext: { contextProps: styledContextProps, overriddenContextProps },
|
|
4285
|
+
presence,
|
|
4286
|
+
isAnimated,
|
|
4287
|
+
isHOC,
|
|
4288
|
+
hasAnimationProp,
|
|
4289
|
+
useAnimations,
|
|
4290
|
+
propsInOrder: Object.keys(propsIn),
|
|
4291
|
+
propsOrder: Object.keys(props)
|
|
4292
|
+
}), console.groupEnd());
|
|
4295
4293
|
}
|
|
4296
4294
|
process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
|
|
4297
4295
|
let [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
@@ -4517,8 +4515,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4517
4515
|
direction,
|
|
4518
4516
|
isZStack,
|
|
4519
4517
|
debug: debugProp
|
|
4520
|
-
});
|
|
4521
|
-
asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
4518
|
+
}), ResetPresence = (_l = config == null ? void 0 : config.animations) == null ? void 0 : _l.ResetPresence;
|
|
4519
|
+
willBeAnimated && presence && ResetPresence && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content })), asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
4522
4520
|
let useChildrenResult;
|
|
4523
4521
|
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
|
|
4524
4522
|
elementType,
|
|
@@ -4556,7 +4554,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4556
4554
|
content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
|
|
4557
4555
|
}
|
|
4558
4556
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
4559
|
-
console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> with props`);
|
|
4557
|
+
console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> (${internalID}) with props`);
|
|
4560
4558
|
try {
|
|
4561
4559
|
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("viewPropsOrder", Object.keys(viewProps));
|
|
4562
4560
|
for (let key in viewProps)
|
|
@@ -4574,8 +4572,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4574
4572
|
handlesPressEvents,
|
|
4575
4573
|
willBeAnimated,
|
|
4576
4574
|
isStringElement,
|
|
4577
|
-
classNamesIn: (
|
|
4578
|
-
classNamesOut: (
|
|
4575
|
+
classNamesIn: (_m = props.className) == null ? void 0 : _m.split(" "),
|
|
4576
|
+
classNamesOut: (_n = viewProps.className) == null ? void 0 : _n.split(" "),
|
|
4579
4577
|
events,
|
|
4580
4578
|
shouldAttach,
|
|
4581
4579
|
pseudos,
|
|
@@ -6189,10 +6187,11 @@ var require_PresenceContext_native = __commonJS({
|
|
|
6189
6187
|
return to;
|
|
6190
6188
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), PresenceContext_exports = {};
|
|
6191
6189
|
__export2(PresenceContext_exports, {
|
|
6192
|
-
PresenceContext: () => PresenceContext
|
|
6190
|
+
PresenceContext: () => PresenceContext,
|
|
6191
|
+
ResetPresence: () => ResetPresence
|
|
6193
6192
|
});
|
|
6194
6193
|
module2.exports = __toCommonJS2(PresenceContext_exports);
|
|
6195
|
-
var import_react2 = require("react"), PresenceContext = (0, import_react2.createContext)(null);
|
|
6194
|
+
var import_react2 = require("react"), import_jsx_runtime6 = require("react/jsx-runtime"), PresenceContext = (0, import_react2.createContext)(null), ResetPresence = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PresenceContext.Provider, { value: null, children: props.children });
|
|
6196
6195
|
}
|
|
6197
6196
|
});
|
|
6198
6197
|
|
|
@@ -8415,6 +8414,27 @@ var require_ThemeableStack_native = __commonJS({
|
|
|
8415
8414
|
}
|
|
8416
8415
|
});
|
|
8417
8416
|
|
|
8417
|
+
// ../stacks/dist/cjs/NestingContext.native.js
|
|
8418
|
+
var require_NestingContext_native = __commonJS({
|
|
8419
|
+
"../stacks/dist/cjs/NestingContext.native.js"(exports, module2) {
|
|
8420
|
+
"use strict";
|
|
8421
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
8422
|
+
for (var name in all)
|
|
8423
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
8424
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
8425
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
8426
|
+
for (let key of __getOwnPropNames2(from))
|
|
8427
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
8428
|
+
return to;
|
|
8429
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), NestingContext_exports = {};
|
|
8430
|
+
__export2(NestingContext_exports, {
|
|
8431
|
+
ButtonNestingContext: () => ButtonNestingContext
|
|
8432
|
+
});
|
|
8433
|
+
module2.exports = __toCommonJS2(NestingContext_exports);
|
|
8434
|
+
var import_react2 = require("react"), ButtonNestingContext = (0, import_react2.createContext)(!1);
|
|
8435
|
+
}
|
|
8436
|
+
});
|
|
8437
|
+
|
|
8418
8438
|
// ../stacks/dist/cjs/index.native.js
|
|
8419
8439
|
var require_index_native19 = __commonJS({
|
|
8420
8440
|
"../stacks/dist/cjs/index.native.js"(exports, module2) {
|
|
@@ -8429,6 +8449,7 @@ var require_index_native19 = __commonJS({
|
|
|
8429
8449
|
__reExport2(src_exports2, require_Stacks_native(), module2.exports);
|
|
8430
8450
|
__reExport2(src_exports2, require_SizableStack_native(), module2.exports);
|
|
8431
8451
|
__reExport2(src_exports2, require_ThemeableStack_native(), module2.exports);
|
|
8452
|
+
__reExport2(src_exports2, require_NestingContext_native(), module2.exports);
|
|
8432
8453
|
}
|
|
8433
8454
|
});
|
|
8434
8455
|
|
|
@@ -10883,11 +10904,11 @@ var require_Dialog_native = __commonJS({
|
|
|
10883
10904
|
name: TRIGGER_NAME
|
|
10884
10905
|
}), DialogTrigger = DialogTriggerFrame.styleable(
|
|
10885
10906
|
(props, forwardedRef) => {
|
|
10886
|
-
let { __scopeDialog, ...triggerProps } = props, context = useDialogContext(TRIGGER_NAME, __scopeDialog), composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
10887
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
10907
|
+
let { __scopeDialog, ...triggerProps } = props, isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext), context = useDialogContext(TRIGGER_NAME, __scopeDialog), composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
10908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
10888
10909
|
DialogTriggerFrame,
|
|
10889
10910
|
{
|
|
10890
|
-
tag: "button",
|
|
10911
|
+
tag: isInsideButton ? "span" : "button",
|
|
10891
10912
|
"aria-haspopup": "dialog",
|
|
10892
10913
|
"aria-expanded": context.open,
|
|
10893
10914
|
"aria-controls": context.contentId,
|
|
@@ -10896,7 +10917,7 @@ var require_Dialog_native = __commonJS({
|
|
|
10896
10917
|
ref: composedTriggerRef,
|
|
10897
10918
|
onPress: (0, import_core13.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
10898
10919
|
}
|
|
10899
|
-
);
|
|
10920
|
+
) });
|
|
10900
10921
|
}
|
|
10901
10922
|
);
|
|
10902
10923
|
DialogTrigger.displayName = TRIGGER_NAME;
|
|
@@ -11173,27 +11194,18 @@ var require_Dialog_native = __commonJS({
|
|
|
11173
11194
|
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
11174
11195
|
var CLOSE_NAME = "DialogClose", DialogCloseFrame = (0, import_core13.styled)(import_core13.View, {
|
|
11175
11196
|
name: CLOSE_NAME,
|
|
11176
|
-
tag: "button"
|
|
11177
|
-
variants: {
|
|
11178
|
-
unstyled: {
|
|
11179
|
-
false: {
|
|
11180
|
-
zIndex: 100
|
|
11181
|
-
}
|
|
11182
|
-
}
|
|
11183
|
-
},
|
|
11184
|
-
defaultVariants: {
|
|
11185
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
11186
|
-
}
|
|
11197
|
+
tag: "button"
|
|
11187
11198
|
}), DialogClose = DialogCloseFrame.styleable(
|
|
11188
11199
|
(props, forwardedRef) => {
|
|
11189
11200
|
let { __scopeDialog, displayWhenAdapted, ...closeProps } = props, context = useDialogContext(CLOSE_NAME, __scopeDialog, {
|
|
11190
11201
|
warn: !1,
|
|
11191
11202
|
fallback: {}
|
|
11192
|
-
});
|
|
11193
|
-
return
|
|
11203
|
+
}), isSheet = useShowDialogSheet(context), isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
|
|
11204
|
+
return isSheet && !displayWhenAdapted ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
11194
11205
|
DialogCloseFrame,
|
|
11195
11206
|
{
|
|
11196
11207
|
accessibilityLabel: "Dialog Close",
|
|
11208
|
+
tag: isInsideButton ? "span" : "button",
|
|
11197
11209
|
...closeProps,
|
|
11198
11210
|
ref: forwardedRef,
|
|
11199
11211
|
onPress: (0, import_core13.composeEventHandlers)(
|
|
@@ -12033,7 +12045,6 @@ var require_Button_native = __commonJS({
|
|
|
12033
12045
|
ButtonContext: () => ButtonContext,
|
|
12034
12046
|
ButtonFrame: () => ButtonFrame,
|
|
12035
12047
|
ButtonIcon: () => ButtonIcon,
|
|
12036
|
-
ButtonNestingContext: () => ButtonNestingContext,
|
|
12037
12048
|
ButtonText: () => ButtonText,
|
|
12038
12049
|
buttonStaticConfig: () => buttonStaticConfig,
|
|
12039
12050
|
useButton: () => useButton
|
|
@@ -12151,9 +12162,9 @@ var require_Button_native = __commonJS({
|
|
|
12151
12162
|
}, Button2 = (0, import_web.withStaticProperties)(ButtonComponent, {
|
|
12152
12163
|
Text: ButtonText,
|
|
12153
12164
|
Icon: ButtonIcon
|
|
12154
|
-
})
|
|
12165
|
+
});
|
|
12155
12166
|
function useButton({ textProps, ...propsIn }, { Text: Text3 = Button2.Text } = { Text: Button2.Text }) {
|
|
12156
|
-
let isNested = (0, import_react2.useContext)(ButtonNestingContext), didFinishSSR = (0, import_web.useDidFinishSSR)(), propsActive = (0, import_web.useProps)(propsIn), {
|
|
12167
|
+
let isNested = (0, import_react2.useContext)(import_stacks3.ButtonNestingContext), didFinishSSR = (0, import_web.useDidFinishSSR)(), propsActive = (0, import_web.useProps)(propsIn), {
|
|
12157
12168
|
icon,
|
|
12158
12169
|
iconAfter,
|
|
12159
12170
|
space,
|
|
@@ -12163,7 +12174,8 @@ var require_Button_native = __commonJS({
|
|
|
12163
12174
|
separator,
|
|
12164
12175
|
noTextWrap,
|
|
12165
12176
|
fontFamily,
|
|
12166
|
-
fontSize
|
|
12177
|
+
fontSize,
|
|
12178
|
+
...restProps
|
|
12167
12179
|
} = propsActive, size2 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2)) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
12168
12180
|
size: iconSize,
|
|
12169
12181
|
color
|
|
@@ -12185,7 +12197,7 @@ var require_Button_native = __commonJS({
|
|
|
12185
12197
|
// defaults to <a /> when accessibilityRole = link
|
|
12186
12198
|
// see https://github.com/tamagui/tamagui/issues/505
|
|
12187
12199
|
propsActive.accessibilityRole === "link" ? "a" : void 0
|
|
12188
|
-
),
|
|
12200
|
+
), props = {
|
|
12189
12201
|
size: size2,
|
|
12190
12202
|
...propsIn.disabled && {
|
|
12191
12203
|
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
@@ -12199,7 +12211,7 @@ var require_Button_native = __commonJS({
|
|
|
12199
12211
|
tag
|
|
12200
12212
|
},
|
|
12201
12213
|
...restProps,
|
|
12202
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonNestingContext.Provider, { value: !0, children: inner }),
|
|
12214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: inner }),
|
|
12203
12215
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
12204
12216
|
disableClassName: didFinishSSR
|
|
12205
12217
|
};
|
|
@@ -12808,7 +12820,7 @@ var require_Checkbox_native = __commonJS({
|
|
|
12808
12820
|
native,
|
|
12809
12821
|
scaleIcon,
|
|
12810
12822
|
...checkboxProps
|
|
12811
|
-
} = props, [button, setButton] = React2.useState(null), composedRefs = (0, import_core13.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React2.useRef(!1), propsActive = (0, import_core13.useProps)(props), isFormControl = import_core13.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
12823
|
+
} = props, isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext), [button, setButton] = React2.useState(null), composedRefs = (0, import_core13.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React2.useRef(!1), propsActive = (0, import_core13.useProps)(props), isFormControl = import_core13.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
|
|
12812
12824
|
prop: checkedProp,
|
|
12813
12825
|
defaultProp: defaultChecked,
|
|
12814
12826
|
onChange: onCheckedChange
|
|
@@ -12844,7 +12856,7 @@ var require_Checkbox_native = __commonJS({
|
|
|
12844
12856
|
{
|
|
12845
12857
|
width: size2,
|
|
12846
12858
|
height: size2,
|
|
12847
|
-
tag: "button",
|
|
12859
|
+
tag: isInsideButton ? "span" : "button",
|
|
12848
12860
|
role: "checkbox",
|
|
12849
12861
|
"aria-labelledby": labelledBy,
|
|
12850
12862
|
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
@@ -16930,7 +16942,9 @@ var require_Select_native = __commonJS({
|
|
|
16930
16942
|
});
|
|
16931
16943
|
React2.useEffect(() => {
|
|
16932
16944
|
open && emitValue(value);
|
|
16933
|
-
}, [open])
|
|
16945
|
+
}, [open]), React2.useEffect(() => {
|
|
16946
|
+
emitValue(value);
|
|
16947
|
+
}, [value]);
|
|
16934
16948
|
let [activeIndex, setActiveIndex] = React2.useState(0), [emitValue, valueSubscribe] = useEmitter(), [emitActiveIndex, activeIndexSubscribe] = useEmitter(), selectedIndexRef = React2.useRef(null), activeIndexRef = React2.useRef(null), listContentRef = React2.useRef([]), [selectedIndex, setSelectedIndex] = React2.useState(0), [valueNode, setValueNode] = React2.useState(null);
|
|
16935
16949
|
(0, import_core13.useIsomorphicLayoutEffect)(() => {
|
|
16936
16950
|
selectedIndexRef.current = selectedIndex, activeIndexRef.current = activeIndex;
|
|
@@ -17124,8 +17138,8 @@ var require_helpers_native2 = __commonJS({
|
|
|
17124
17138
|
return distances.indexOf(closestDistance);
|
|
17125
17139
|
}
|
|
17126
17140
|
function getThumbInBoundsOffset(width, left, direction) {
|
|
17127
|
-
let
|
|
17128
|
-
return (
|
|
17141
|
+
let quarterWidth = width / 4, offset2 = linearScale([0, 50], [0, quarterWidth]);
|
|
17142
|
+
return (quarterWidth - offset2(left) * direction) * direction;
|
|
17129
17143
|
}
|
|
17130
17144
|
function getStepsBetweenValues(values) {
|
|
17131
17145
|
return values.slice(0, -1).map((value, index) => values[index + 1] - value);
|
|
@@ -17917,25 +17931,29 @@ var require_createSwitch_native = __commonJS({
|
|
|
17917
17931
|
onChange: onCheckedChange,
|
|
17918
17932
|
transition: !0
|
|
17919
17933
|
});
|
|
17920
|
-
|
|
17921
|
-
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17934
|
+
if (shouldRenderMobileNative)
|
|
17935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17936
|
+
import_react_native4.Switch,
|
|
17937
|
+
{
|
|
17938
|
+
value: checkedProp,
|
|
17939
|
+
onValueChange: onCheckedChange,
|
|
17940
|
+
...nativeProps
|
|
17941
|
+
}
|
|
17942
|
+
);
|
|
17943
|
+
import_core13.isWeb || React2.useEffect(() => {
|
|
17928
17944
|
if (props.id)
|
|
17929
17945
|
return (0, import_focusable2.registerFocusable)(props.id, {
|
|
17930
17946
|
focus: () => {
|
|
17931
17947
|
setChecked((x) => !x);
|
|
17932
17948
|
}
|
|
17933
17949
|
});
|
|
17934
|
-
}, [props.id, setChecked])
|
|
17935
|
-
|
|
17950
|
+
}, [props.id, setChecked]);
|
|
17951
|
+
let isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
|
|
17952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
17953
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17936
17954
|
Frame,
|
|
17937
17955
|
{
|
|
17938
|
-
tag: "button",
|
|
17956
|
+
tag: isInsideButton ? "span" : "button",
|
|
17939
17957
|
unstyled,
|
|
17940
17958
|
size: size2,
|
|
17941
17959
|
checked,
|
|
@@ -17971,7 +17989,7 @@ var require_createSwitch_native = __commonJS({
|
|
|
17971
17989
|
}
|
|
17972
17990
|
)
|
|
17973
17991
|
}
|
|
17974
|
-
),
|
|
17992
|
+
) }),
|
|
17975
17993
|
import_core13.isWeb && isFormControl && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17976
17994
|
BubbleInput,
|
|
17977
17995
|
{
|
|
@@ -17985,7 +18003,7 @@ var require_createSwitch_native = __commonJS({
|
|
|
17985
18003
|
style: { transform: "translateX(-100%)" }
|
|
17986
18004
|
}
|
|
17987
18005
|
)
|
|
17988
|
-
] })
|
|
18006
|
+
] });
|
|
17989
18007
|
}), BubbleInput = (props) => {
|
|
17990
18008
|
let { control, checked, bubbles = !0, ...inputProps } = props, ref = React2.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
|
|
17991
18009
|
return React2.useEffect(() => {
|
|
@@ -19078,7 +19096,7 @@ var require_index_native67 = __commonJS({
|
|
|
19078
19096
|
}, debounced;
|
|
19079
19097
|
}
|
|
19080
19098
|
var defaultOpts = { leading: !1 };
|
|
19081
|
-
function useDebounce(fn, wait, options = defaultOpts, mountArgs = []) {
|
|
19099
|
+
function useDebounce(fn, wait, options = defaultOpts, mountArgs = [fn]) {
|
|
19082
19100
|
let dbEffect = (0, import_react2.useRef)(null);
|
|
19083
19101
|
return (0, import_react2.useEffect)(() => () => {
|
|
19084
19102
|
var _a;
|