@tallyui/primitives 3.20.1 → 4.0.0
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/index.d.ts +4 -0
- package/dist/index.js +515 -328
- package/package.json +1 -1
- package/src/combobox/combobox.tsx +105 -10
- package/src/combobox/types.ts +4 -1
- package/src/context-menu/context-menu.tsx +3 -6
- package/src/dialog/dialog.tsx +4 -6
- package/src/dropdown-menu/dropdown-menu.tsx +20 -8
- package/src/hooks/measure-trigger.ts +14 -0
- package/src/hooks/use-escape-dismiss.ts +35 -0
- package/src/hooks/use-relative-position.ts +4 -1
- package/src/hover-card/hover-card.tsx +3 -6
- package/src/hover-card/types.ts +2 -0
- package/src/layer-stack.ts +19 -0
- package/src/popover/popover.tsx +92 -13
- package/src/select/select.tsx +18 -8
- package/src/tooltip/tooltip.tsx +3 -6
- package/src/hooks/use-relative-position.web.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -169,7 +169,8 @@ function useAugmentedRef({
|
|
|
169
169
|
// src/hooks/use-relative-position.ts
|
|
170
170
|
import * as React4 from "react";
|
|
171
171
|
import {
|
|
172
|
-
Dimensions
|
|
172
|
+
Dimensions,
|
|
173
|
+
Platform
|
|
173
174
|
} from "react-native";
|
|
174
175
|
var POSITION_ABSOLUTE = {
|
|
175
176
|
position: "absolute"
|
|
@@ -190,7 +191,7 @@ function useRelativePosition({
|
|
|
190
191
|
side,
|
|
191
192
|
disablePositioningStyle
|
|
192
193
|
}) {
|
|
193
|
-
const dimensions = Dimensions.get("screen");
|
|
194
|
+
const dimensions = Dimensions.get(Platform.OS === "web" ? "window" : "screen");
|
|
194
195
|
return React4.useMemo(() => {
|
|
195
196
|
if (disablePositioningStyle) {
|
|
196
197
|
return {};
|
|
@@ -325,6 +326,7 @@ function getContentStyle({
|
|
|
325
326
|
dimensions
|
|
326
327
|
}) {
|
|
327
328
|
return Object.assign(
|
|
329
|
+
{},
|
|
328
330
|
POSITION_ABSOLUTE,
|
|
329
331
|
getSidePosition({
|
|
330
332
|
side,
|
|
@@ -684,9 +686,23 @@ __export(dialog_exports, {
|
|
|
684
686
|
|
|
685
687
|
// src/dialog/dialog.tsx
|
|
686
688
|
import * as React7 from "react";
|
|
687
|
-
import { Platform, Pressable as Pressable2, Text as Text2, View as View2 } from "react-native";
|
|
689
|
+
import { Platform as Platform2, Pressable as Pressable2, Text as Text2, View as View2 } from "react-native";
|
|
690
|
+
|
|
691
|
+
// src/layer-stack.ts
|
|
692
|
+
var layers = [];
|
|
693
|
+
function pushLayer(id) {
|
|
694
|
+
layers.push(id);
|
|
695
|
+
}
|
|
696
|
+
function removeLayer(id) {
|
|
697
|
+
const index = layers.indexOf(id);
|
|
698
|
+
if (index !== -1) layers.splice(index, 1);
|
|
699
|
+
}
|
|
700
|
+
function isTopLayer(id) {
|
|
701
|
+
return layers[layers.length - 1] === id;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// src/dialog/dialog.tsx
|
|
688
705
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
689
|
-
var openContentStack = [];
|
|
690
706
|
var RootContext2 = React7.createContext(null);
|
|
691
707
|
function useRootContext2() {
|
|
692
708
|
const context = React7.useContext(RootContext2);
|
|
@@ -775,18 +791,17 @@ var Content3 = React7.forwardRef(function Content4({ asChild, forceMount, onEsca
|
|
|
775
791
|
onEscapeKeyDownRef.current = onEscapeKeyDown;
|
|
776
792
|
onOpenChangeRef.current = onOpenChange;
|
|
777
793
|
React7.useEffect(() => {
|
|
778
|
-
if (!open && !forceMount ||
|
|
779
|
-
|
|
794
|
+
if (!open && !forceMount || Platform2.OS !== "web" || typeof document === "undefined") return;
|
|
795
|
+
pushLayer(nativeID);
|
|
780
796
|
const onKeyDown = (event) => {
|
|
781
|
-
if (event.key !== "Escape" ||
|
|
797
|
+
if (event.key !== "Escape" || !isTopLayer(nativeID)) return;
|
|
782
798
|
onEscapeKeyDownRef.current?.(event);
|
|
783
799
|
if (!event.defaultPrevented) onOpenChangeRef.current(false);
|
|
784
800
|
};
|
|
785
801
|
document.addEventListener("keydown", onKeyDown);
|
|
786
802
|
return () => {
|
|
787
803
|
document.removeEventListener("keydown", onKeyDown);
|
|
788
|
-
|
|
789
|
-
if (index !== -1) openContentStack.splice(index, 1);
|
|
804
|
+
removeLayer(nativeID);
|
|
790
805
|
};
|
|
791
806
|
}, [open, forceMount, nativeID]);
|
|
792
807
|
if (!forceMount && !open) {
|
|
@@ -857,9 +872,22 @@ __export(popover_exports, {
|
|
|
857
872
|
// src/popover/popover.tsx
|
|
858
873
|
import * as React8 from "react";
|
|
859
874
|
import {
|
|
875
|
+
Platform as Platform4,
|
|
860
876
|
Pressable as Pressable3,
|
|
861
877
|
View as View3
|
|
862
878
|
} from "react-native";
|
|
879
|
+
|
|
880
|
+
// src/hooks/measure-trigger.ts
|
|
881
|
+
import { Platform as Platform3 } from "react-native";
|
|
882
|
+
function measureTrigger(node, onMeasure) {
|
|
883
|
+
if (Platform3.OS === "web") {
|
|
884
|
+
node?.measureInWindow?.((x, y, width, height) => onMeasure({ pageX: x, pageY: y, width, height }));
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
node?.measure?.((_x, _y, width, height, pageX, pageY) => onMeasure({ pageX, pageY, width, height }));
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// src/popover/popover.tsx
|
|
863
891
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
864
892
|
var InternalContext3 = React8.createContext(null);
|
|
865
893
|
function useInternalContext3() {
|
|
@@ -890,7 +918,9 @@ function Root3({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, ch
|
|
|
890
918
|
});
|
|
891
919
|
const [triggerPosition, setTriggerPosition] = React8.useState(null);
|
|
892
920
|
const [contentLayout, setContentLayout] = React8.useState(null);
|
|
893
|
-
|
|
921
|
+
const triggerRef = React8.useRef(null);
|
|
922
|
+
const overlayCount = React8.useRef(0);
|
|
923
|
+
return /* @__PURE__ */ jsx6(InternalContext3.Provider, { value: { nativeID, triggerRef, overlayCount }, children: /* @__PURE__ */ jsx6(
|
|
894
924
|
RootContext3.Provider,
|
|
895
925
|
{
|
|
896
926
|
value: {
|
|
@@ -908,14 +938,13 @@ function Root3({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, ch
|
|
|
908
938
|
Root3.displayName = "PopoverRoot";
|
|
909
939
|
var Trigger5 = React8.forwardRef(function Trigger6({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
|
|
910
940
|
const { open, onOpenChange, setTriggerPosition } = useRootContext3();
|
|
941
|
+
const { triggerRef } = useInternalContext3();
|
|
911
942
|
const augmentedRef = useAugmentedRef({
|
|
912
943
|
ref,
|
|
913
944
|
methods: {
|
|
914
945
|
open: () => {
|
|
915
946
|
onOpenChange(true);
|
|
916
|
-
augmentedRef.current
|
|
917
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
918
|
-
});
|
|
947
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
919
948
|
},
|
|
920
949
|
close: () => {
|
|
921
950
|
setTriggerPosition(null);
|
|
@@ -923,12 +952,13 @@ var Trigger5 = React8.forwardRef(function Trigger6({ asChild, onPress: onPressPr
|
|
|
923
952
|
}
|
|
924
953
|
}
|
|
925
954
|
});
|
|
955
|
+
React8.useLayoutEffect(() => {
|
|
956
|
+
triggerRef.current = augmentedRef.current;
|
|
957
|
+
});
|
|
926
958
|
const onPress = React8.useCallback(
|
|
927
959
|
(ev) => {
|
|
928
960
|
if (disabled) return;
|
|
929
|
-
augmentedRef.current
|
|
930
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
931
|
-
});
|
|
961
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
932
962
|
onOpenChange(!open);
|
|
933
963
|
onPressProp?.(ev);
|
|
934
964
|
},
|
|
@@ -959,6 +989,14 @@ function Portal4({ forceMount, hostName, children }) {
|
|
|
959
989
|
Portal4.displayName = "PopoverPortal";
|
|
960
990
|
var Overlay5 = React8.forwardRef(function Overlay6({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
961
991
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext3();
|
|
992
|
+
const { overlayCount } = useInternalContext3();
|
|
993
|
+
React8.useLayoutEffect(() => {
|
|
994
|
+
if (!forceMount && !open) return;
|
|
995
|
+
overlayCount.current += 1;
|
|
996
|
+
return () => {
|
|
997
|
+
overlayCount.current -= 1;
|
|
998
|
+
};
|
|
999
|
+
}, [open, forceMount, overlayCount]);
|
|
962
1000
|
const onPress = React8.useCallback(
|
|
963
1001
|
(ev) => {
|
|
964
1002
|
if (closeOnPress) {
|
|
@@ -989,10 +1027,60 @@ var Content5 = React8.forwardRef(function Content6({
|
|
|
989
1027
|
style,
|
|
990
1028
|
disablePositioningStyle,
|
|
991
1029
|
onLayout: onLayoutProp,
|
|
1030
|
+
onEscapeKeyDown,
|
|
1031
|
+
onPointerDownOutside,
|
|
1032
|
+
onInteractOutside,
|
|
992
1033
|
...props
|
|
993
1034
|
}, ref) {
|
|
994
|
-
const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext3();
|
|
995
|
-
const { nativeID } = useInternalContext3();
|
|
1035
|
+
const { open, onOpenChange, triggerPosition, setTriggerPosition, contentLayout, setContentLayout } = useRootContext3();
|
|
1036
|
+
const { nativeID, triggerRef, overlayCount } = useInternalContext3();
|
|
1037
|
+
const contentRef = React8.useRef(null);
|
|
1038
|
+
const composedRef = React8.useMemo(() => composeRefs(ref, contentRef), [ref]);
|
|
1039
|
+
const onEscapeKeyDownRef = React8.useRef(onEscapeKeyDown);
|
|
1040
|
+
const onPointerDownOutsideRef = React8.useRef(onPointerDownOutside);
|
|
1041
|
+
const onInteractOutsideRef = React8.useRef(onInteractOutside);
|
|
1042
|
+
const closeRef = React8.useRef(() => {
|
|
1043
|
+
});
|
|
1044
|
+
onEscapeKeyDownRef.current = onEscapeKeyDown;
|
|
1045
|
+
onPointerDownOutsideRef.current = onPointerDownOutside;
|
|
1046
|
+
onInteractOutsideRef.current = onInteractOutside;
|
|
1047
|
+
closeRef.current = () => {
|
|
1048
|
+
setTriggerPosition(null);
|
|
1049
|
+
setContentLayout(null);
|
|
1050
|
+
onOpenChange(false);
|
|
1051
|
+
};
|
|
1052
|
+
React8.useEffect(() => {
|
|
1053
|
+
if (!open || Platform4.OS !== "web" || typeof document === "undefined") return;
|
|
1054
|
+
pushLayer(nativeID);
|
|
1055
|
+
const onKeyDown = (event) => {
|
|
1056
|
+
if (event.key !== "Escape" || !isTopLayer(nativeID)) return;
|
|
1057
|
+
onEscapeKeyDownRef.current?.(event);
|
|
1058
|
+
if (!event.defaultPrevented) closeRef.current();
|
|
1059
|
+
};
|
|
1060
|
+
const onPointerDown = (event) => {
|
|
1061
|
+
if (!isTopLayer(nativeID) || overlayCount.current !== 0) return;
|
|
1062
|
+
const target = event.target;
|
|
1063
|
+
const contentNode = contentRef.current;
|
|
1064
|
+
const triggerNode = triggerRef.current;
|
|
1065
|
+
if (target instanceof Node && (contentNode?.contains(target) || triggerNode?.contains(target))) {
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const outside = new CustomEvent("popover.pointerDownOutside", {
|
|
1069
|
+
cancelable: true,
|
|
1070
|
+
detail: { originalEvent: event }
|
|
1071
|
+
});
|
|
1072
|
+
onPointerDownOutsideRef.current?.(outside);
|
|
1073
|
+
onInteractOutsideRef.current?.(outside);
|
|
1074
|
+
if (!outside.defaultPrevented) closeRef.current();
|
|
1075
|
+
};
|
|
1076
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1077
|
+
document.addEventListener("pointerdown", onPointerDown, { capture: true });
|
|
1078
|
+
return () => {
|
|
1079
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
1080
|
+
document.removeEventListener("pointerdown", onPointerDown, { capture: true });
|
|
1081
|
+
removeLayer(nativeID);
|
|
1082
|
+
};
|
|
1083
|
+
}, [open, nativeID, triggerRef, overlayCount]);
|
|
996
1084
|
const positionStyle = useRelativePosition({
|
|
997
1085
|
align,
|
|
998
1086
|
avoidCollisions,
|
|
@@ -1004,6 +1092,8 @@ var Content5 = React8.forwardRef(function Content6({
|
|
|
1004
1092
|
side,
|
|
1005
1093
|
disablePositioningStyle
|
|
1006
1094
|
});
|
|
1095
|
+
const lastPositionStyle = React8.useRef(void 0);
|
|
1096
|
+
if (open) lastPositionStyle.current = positionStyle;
|
|
1007
1097
|
const onLayout = React8.useCallback(
|
|
1008
1098
|
(event) => {
|
|
1009
1099
|
setContentLayout(event.nativeEvent.layout);
|
|
@@ -1018,13 +1108,13 @@ var Content5 = React8.forwardRef(function Content6({
|
|
|
1018
1108
|
return /* @__PURE__ */ jsx6(
|
|
1019
1109
|
Component,
|
|
1020
1110
|
{
|
|
1021
|
-
ref,
|
|
1111
|
+
ref: composedRef,
|
|
1022
1112
|
role: "dialog",
|
|
1023
1113
|
nativeID,
|
|
1024
1114
|
"aria-labelledby": `${nativeID}_title`,
|
|
1025
1115
|
"aria-describedby": `${nativeID}_description`,
|
|
1026
1116
|
"aria-modal": true,
|
|
1027
|
-
style: [positionStyle, style],
|
|
1117
|
+
style: [!open && forceMount ? lastPositionStyle.current ?? positionStyle : positionStyle, style],
|
|
1028
1118
|
onLayout,
|
|
1029
1119
|
...props
|
|
1030
1120
|
}
|
|
@@ -1078,16 +1168,45 @@ __export(select_exports, {
|
|
|
1078
1168
|
});
|
|
1079
1169
|
|
|
1080
1170
|
// src/select/select.tsx
|
|
1081
|
-
import * as
|
|
1171
|
+
import * as React10 from "react";
|
|
1082
1172
|
import {
|
|
1083
1173
|
Pressable as Pressable4,
|
|
1084
1174
|
Text as Text3,
|
|
1085
1175
|
View as View4
|
|
1086
1176
|
} from "react-native";
|
|
1177
|
+
|
|
1178
|
+
// src/hooks/use-escape-dismiss.ts
|
|
1179
|
+
import * as React9 from "react";
|
|
1180
|
+
import { Platform as Platform5 } from "react-native";
|
|
1181
|
+
function useEscapeDismiss(active, close, onEscapeKeyDown) {
|
|
1182
|
+
const id = React9.useId();
|
|
1183
|
+
const closeRef = React9.useRef(close);
|
|
1184
|
+
const onEscapeKeyDownRef = React9.useRef(onEscapeKeyDown);
|
|
1185
|
+
closeRef.current = close;
|
|
1186
|
+
onEscapeKeyDownRef.current = onEscapeKeyDown;
|
|
1187
|
+
React9.useEffect(() => {
|
|
1188
|
+
if (!active || Platform5.OS !== "web" || typeof document === "undefined") return;
|
|
1189
|
+
pushLayer(id);
|
|
1190
|
+
const onKeyDown = (event) => {
|
|
1191
|
+
if (event.key !== "Escape" || !isTopLayer(id)) return;
|
|
1192
|
+
onEscapeKeyDownRef.current?.(event);
|
|
1193
|
+
if (event.defaultPrevented) return;
|
|
1194
|
+
closeRef.current();
|
|
1195
|
+
event.stopPropagation();
|
|
1196
|
+
};
|
|
1197
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
1198
|
+
return () => {
|
|
1199
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
1200
|
+
removeLayer(id);
|
|
1201
|
+
};
|
|
1202
|
+
}, [active, id]);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
// src/select/select.tsx
|
|
1087
1206
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1088
|
-
var RootContext4 =
|
|
1207
|
+
var RootContext4 = React10.createContext(null);
|
|
1089
1208
|
function useRootContext4() {
|
|
1090
|
-
const context =
|
|
1209
|
+
const context = React10.useContext(RootContext4);
|
|
1091
1210
|
if (!context) {
|
|
1092
1211
|
throw new Error(
|
|
1093
1212
|
"Select compound components cannot be rendered outside the Select.Root component"
|
|
@@ -1095,9 +1214,9 @@ function useRootContext4() {
|
|
|
1095
1214
|
}
|
|
1096
1215
|
return context;
|
|
1097
1216
|
}
|
|
1098
|
-
var ItemContext =
|
|
1217
|
+
var ItemContext = React10.createContext(null);
|
|
1099
1218
|
function useItemContext() {
|
|
1100
|
-
const context =
|
|
1219
|
+
const context = React10.useContext(ItemContext);
|
|
1101
1220
|
if (!context) {
|
|
1102
1221
|
throw new Error(
|
|
1103
1222
|
"Select.Item compound components cannot be rendered outside a Select.Item component"
|
|
@@ -1115,7 +1234,7 @@ function Root4({
|
|
|
1115
1234
|
disabled,
|
|
1116
1235
|
children
|
|
1117
1236
|
}) {
|
|
1118
|
-
const nativeID =
|
|
1237
|
+
const nativeID = React10.useId();
|
|
1119
1238
|
const [value, onValueChange] = useControllableState({
|
|
1120
1239
|
prop: valueProp,
|
|
1121
1240
|
defaultProp: defaultValue,
|
|
@@ -1126,8 +1245,8 @@ function Root4({
|
|
|
1126
1245
|
defaultProp: defaultOpen,
|
|
1127
1246
|
onChange: onOpenChangeProp
|
|
1128
1247
|
});
|
|
1129
|
-
const [triggerPosition, setTriggerPosition] =
|
|
1130
|
-
const [contentLayout, setContentLayout] =
|
|
1248
|
+
const [triggerPosition, setTriggerPosition] = React10.useState(null);
|
|
1249
|
+
const [contentLayout, setContentLayout] = React10.useState(null);
|
|
1131
1250
|
return /* @__PURE__ */ jsx7(
|
|
1132
1251
|
RootContext4.Provider,
|
|
1133
1252
|
{
|
|
@@ -1148,16 +1267,14 @@ function Root4({
|
|
|
1148
1267
|
);
|
|
1149
1268
|
}
|
|
1150
1269
|
Root4.displayName = "SelectRoot";
|
|
1151
|
-
var Trigger7 =
|
|
1270
|
+
var Trigger7 = React10.forwardRef(function Trigger8({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
|
|
1152
1271
|
const { open, onOpenChange, disabled: disabledRoot, setTriggerPosition } = useRootContext4();
|
|
1153
1272
|
const augmentedRef = useAugmentedRef({
|
|
1154
1273
|
ref,
|
|
1155
1274
|
methods: {
|
|
1156
1275
|
open: () => {
|
|
1157
1276
|
onOpenChange(true);
|
|
1158
|
-
augmentedRef.current
|
|
1159
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1160
|
-
});
|
|
1277
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1161
1278
|
},
|
|
1162
1279
|
close: () => {
|
|
1163
1280
|
setTriggerPosition(null);
|
|
@@ -1165,12 +1282,10 @@ var Trigger7 = React9.forwardRef(function Trigger8({ asChild, onPress: onPressPr
|
|
|
1165
1282
|
}
|
|
1166
1283
|
}
|
|
1167
1284
|
});
|
|
1168
|
-
const onPress =
|
|
1285
|
+
const onPress = React10.useCallback(
|
|
1169
1286
|
(ev) => {
|
|
1170
1287
|
if (disabled || disabledRoot) return;
|
|
1171
|
-
augmentedRef.current
|
|
1172
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1173
|
-
});
|
|
1288
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1174
1289
|
onOpenChange(!open);
|
|
1175
1290
|
onPressProp?.(ev);
|
|
1176
1291
|
},
|
|
@@ -1191,7 +1306,7 @@ var Trigger7 = React9.forwardRef(function Trigger8({ asChild, onPress: onPressPr
|
|
|
1191
1306
|
);
|
|
1192
1307
|
});
|
|
1193
1308
|
Trigger7.displayName = "SelectTrigger";
|
|
1194
|
-
var Value =
|
|
1309
|
+
var Value = React10.forwardRef(function Value2({ asChild, placeholder, ...props }, ref) {
|
|
1195
1310
|
const { value } = useRootContext4();
|
|
1196
1311
|
const Component = asChild ? Slot : Text3;
|
|
1197
1312
|
return /* @__PURE__ */ jsx7(Component, { ref, ...props, children: value?.label ?? placeholder });
|
|
@@ -1205,9 +1320,9 @@ function Portal5({ forceMount, hostName, children }) {
|
|
|
1205
1320
|
return /* @__PURE__ */ jsx7(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx7(RootContext4.Provider, { value: rootValue, children }) });
|
|
1206
1321
|
}
|
|
1207
1322
|
Portal5.displayName = "SelectPortal";
|
|
1208
|
-
var Overlay7 =
|
|
1323
|
+
var Overlay7 = React10.forwardRef(function Overlay8({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
1209
1324
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext4();
|
|
1210
|
-
const onPress =
|
|
1325
|
+
const onPress = React10.useCallback(
|
|
1211
1326
|
(ev) => {
|
|
1212
1327
|
if (closeOnPress) {
|
|
1213
1328
|
setTriggerPosition(null);
|
|
@@ -1225,7 +1340,7 @@ var Overlay7 = React9.forwardRef(function Overlay8({ asChild, forceMount, onPres
|
|
|
1225
1340
|
return /* @__PURE__ */ jsx7(Component, { ref, onPress, ...props });
|
|
1226
1341
|
});
|
|
1227
1342
|
Overlay7.displayName = "SelectOverlay";
|
|
1228
|
-
var Content7 =
|
|
1343
|
+
var Content7 = React10.forwardRef(function Content8({
|
|
1229
1344
|
asChild,
|
|
1230
1345
|
forceMount,
|
|
1231
1346
|
align = "start",
|
|
@@ -1237,9 +1352,19 @@ var Content7 = React9.forwardRef(function Content8({
|
|
|
1237
1352
|
style,
|
|
1238
1353
|
disablePositioningStyle,
|
|
1239
1354
|
onLayout: onLayoutProp,
|
|
1355
|
+
onEscapeKeyDown,
|
|
1240
1356
|
...props
|
|
1241
1357
|
}, ref) {
|
|
1242
|
-
const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext4();
|
|
1358
|
+
const { open, onOpenChange, triggerPosition, contentLayout, setTriggerPosition, setContentLayout } = useRootContext4();
|
|
1359
|
+
useEscapeDismiss(
|
|
1360
|
+
open,
|
|
1361
|
+
() => {
|
|
1362
|
+
setTriggerPosition(null);
|
|
1363
|
+
setContentLayout(null);
|
|
1364
|
+
onOpenChange(false);
|
|
1365
|
+
},
|
|
1366
|
+
onEscapeKeyDown
|
|
1367
|
+
);
|
|
1243
1368
|
const positionStyle = useRelativePosition({
|
|
1244
1369
|
align,
|
|
1245
1370
|
avoidCollisions,
|
|
@@ -1251,7 +1376,7 @@ var Content7 = React9.forwardRef(function Content8({
|
|
|
1251
1376
|
side,
|
|
1252
1377
|
disablePositioningStyle
|
|
1253
1378
|
});
|
|
1254
|
-
const onLayout =
|
|
1379
|
+
const onLayout = React10.useCallback(
|
|
1255
1380
|
(event) => {
|
|
1256
1381
|
setContentLayout(event.nativeEvent.layout);
|
|
1257
1382
|
onLayoutProp?.(event);
|
|
@@ -1268,16 +1393,16 @@ var Content7 = React9.forwardRef(function Content8({
|
|
|
1268
1393
|
ref,
|
|
1269
1394
|
role: "list",
|
|
1270
1395
|
"aria-modal": true,
|
|
1271
|
-
style: [positionStyle, style],
|
|
1396
|
+
style: [positionStyle, triggerPosition ? { minWidth: triggerPosition.width } : null, style],
|
|
1272
1397
|
onLayout,
|
|
1273
1398
|
...props
|
|
1274
1399
|
}
|
|
1275
1400
|
);
|
|
1276
1401
|
});
|
|
1277
1402
|
Content7.displayName = "SelectContent";
|
|
1278
|
-
var Item =
|
|
1403
|
+
var Item = React10.forwardRef(function Item2({ asChild, value: itemValue, label, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
|
|
1279
1404
|
const { value, onValueChange, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext4();
|
|
1280
|
-
const onPress =
|
|
1405
|
+
const onPress = React10.useCallback(
|
|
1281
1406
|
(ev) => {
|
|
1282
1407
|
if (disabled) return;
|
|
1283
1408
|
onValueChange({ value: itemValue, label });
|
|
@@ -1305,13 +1430,13 @@ var Item = React9.forwardRef(function Item2({ asChild, value: itemValue, label,
|
|
|
1305
1430
|
) });
|
|
1306
1431
|
});
|
|
1307
1432
|
Item.displayName = "SelectItem";
|
|
1308
|
-
var ItemText =
|
|
1433
|
+
var ItemText = React10.forwardRef(function ItemText2({ asChild, ...props }, ref) {
|
|
1309
1434
|
const { label } = useItemContext();
|
|
1310
1435
|
const Component = asChild ? Slot : Text3;
|
|
1311
1436
|
return /* @__PURE__ */ jsx7(Component, { ref, ...props, children: label });
|
|
1312
1437
|
});
|
|
1313
1438
|
ItemText.displayName = "SelectItemText";
|
|
1314
|
-
var ItemIndicator =
|
|
1439
|
+
var ItemIndicator = React10.forwardRef(function ItemIndicator2({ asChild, forceMount, ...props }, ref) {
|
|
1315
1440
|
const { itemValue } = useItemContext();
|
|
1316
1441
|
const { value } = useRootContext4();
|
|
1317
1442
|
if (!forceMount && value?.value !== itemValue) {
|
|
@@ -1321,17 +1446,17 @@ var ItemIndicator = React9.forwardRef(function ItemIndicator2({ asChild, forceMo
|
|
|
1321
1446
|
return /* @__PURE__ */ jsx7(Component, { ref, role: "presentation", ...props });
|
|
1322
1447
|
});
|
|
1323
1448
|
ItemIndicator.displayName = "SelectItemIndicator";
|
|
1324
|
-
var Group =
|
|
1449
|
+
var Group = React10.forwardRef(function Group2({ asChild, ...props }, ref) {
|
|
1325
1450
|
const Component = asChild ? Slot : View4;
|
|
1326
1451
|
return /* @__PURE__ */ jsx7(Component, { ref, role: "group", ...props });
|
|
1327
1452
|
});
|
|
1328
1453
|
Group.displayName = "SelectGroup";
|
|
1329
|
-
var Label =
|
|
1454
|
+
var Label = React10.forwardRef(function Label2({ asChild, ...props }, ref) {
|
|
1330
1455
|
const Component = asChild ? Slot : Text3;
|
|
1331
1456
|
return /* @__PURE__ */ jsx7(Component, { ref, ...props });
|
|
1332
1457
|
});
|
|
1333
1458
|
Label.displayName = "SelectLabel";
|
|
1334
|
-
var Separator =
|
|
1459
|
+
var Separator = React10.forwardRef(function Separator2({ asChild, decorative, ...props }, ref) {
|
|
1335
1460
|
const Component = asChild ? Slot : View4;
|
|
1336
1461
|
return /* @__PURE__ */ jsx7(
|
|
1337
1462
|
Component,
|
|
@@ -1355,12 +1480,12 @@ __export(tabs_exports, {
|
|
|
1355
1480
|
});
|
|
1356
1481
|
|
|
1357
1482
|
// src/tabs/tabs.tsx
|
|
1358
|
-
import * as
|
|
1483
|
+
import * as React11 from "react";
|
|
1359
1484
|
import { Pressable as Pressable5, View as View5 } from "react-native";
|
|
1360
1485
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1361
|
-
var RootContext5 =
|
|
1486
|
+
var RootContext5 = React11.createContext(null);
|
|
1362
1487
|
function useRootContext5() {
|
|
1363
|
-
const context =
|
|
1488
|
+
const context = React11.useContext(RootContext5);
|
|
1364
1489
|
if (!context) {
|
|
1365
1490
|
throw new Error(
|
|
1366
1491
|
"Tabs compound components cannot be rendered outside the Tabs.Root component"
|
|
@@ -1374,7 +1499,7 @@ function Root5({
|
|
|
1374
1499
|
onValueChange: onValueChangeProp,
|
|
1375
1500
|
children
|
|
1376
1501
|
}) {
|
|
1377
|
-
const nativeID =
|
|
1502
|
+
const nativeID = React11.useId();
|
|
1378
1503
|
const [value = "", onValueChange] = useControllableState({
|
|
1379
1504
|
prop: valueProp,
|
|
1380
1505
|
defaultProp: defaultValue,
|
|
@@ -1383,14 +1508,14 @@ function Root5({
|
|
|
1383
1508
|
return /* @__PURE__ */ jsx8(RootContext5.Provider, { value: { value, onValueChange, nativeID }, children });
|
|
1384
1509
|
}
|
|
1385
1510
|
Root5.displayName = "TabsRoot";
|
|
1386
|
-
var List =
|
|
1511
|
+
var List = React11.forwardRef(function List2({ asChild, ...props }, ref) {
|
|
1387
1512
|
const Component = asChild ? Slot : View5;
|
|
1388
1513
|
return /* @__PURE__ */ jsx8(Component, { ref, role: "tablist", ...props });
|
|
1389
1514
|
});
|
|
1390
1515
|
List.displayName = "TabsList";
|
|
1391
|
-
var Trigger9 =
|
|
1516
|
+
var Trigger9 = React11.forwardRef(function Trigger10({ asChild, onPress: onPressProp, disabled, value: tabValue, ...props }, ref) {
|
|
1392
1517
|
const { onValueChange, value: rootValue, nativeID } = useRootContext5();
|
|
1393
|
-
const onPress =
|
|
1518
|
+
const onPress = React11.useCallback(
|
|
1394
1519
|
(ev) => {
|
|
1395
1520
|
if (disabled) return;
|
|
1396
1521
|
onValueChange(tabValue);
|
|
@@ -1415,7 +1540,7 @@ var Trigger9 = React10.forwardRef(function Trigger10({ asChild, onPress: onPress
|
|
|
1415
1540
|
);
|
|
1416
1541
|
});
|
|
1417
1542
|
Trigger9.displayName = "TabsTrigger";
|
|
1418
|
-
var Content9 =
|
|
1543
|
+
var Content9 = React11.forwardRef(function Content10({ asChild, forceMount, value: tabValue, ...props }, ref) {
|
|
1419
1544
|
const { value: rootValue, nativeID } = useRootContext5();
|
|
1420
1545
|
if (!forceMount && rootValue !== tabValue) {
|
|
1421
1546
|
return null;
|
|
@@ -1458,16 +1583,16 @@ __export(context_menu_exports, {
|
|
|
1458
1583
|
});
|
|
1459
1584
|
|
|
1460
1585
|
// src/context-menu/context-menu.tsx
|
|
1461
|
-
import * as
|
|
1586
|
+
import * as React12 from "react";
|
|
1462
1587
|
import {
|
|
1463
1588
|
Pressable as Pressable6,
|
|
1464
1589
|
Text as Text4,
|
|
1465
1590
|
View as View6
|
|
1466
1591
|
} from "react-native";
|
|
1467
1592
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1468
|
-
var RootContext6 =
|
|
1593
|
+
var RootContext6 = React12.createContext(null);
|
|
1469
1594
|
function useRootContext6() {
|
|
1470
|
-
const context =
|
|
1595
|
+
const context = React12.useContext(RootContext6);
|
|
1471
1596
|
if (!context) {
|
|
1472
1597
|
throw new Error(
|
|
1473
1598
|
"ContextMenu compound components cannot be rendered outside the ContextMenu.Root component"
|
|
@@ -1475,9 +1600,9 @@ function useRootContext6() {
|
|
|
1475
1600
|
}
|
|
1476
1601
|
return context;
|
|
1477
1602
|
}
|
|
1478
|
-
var FormItemContext =
|
|
1603
|
+
var FormItemContext = React12.createContext(null);
|
|
1479
1604
|
function useFormItemContext() {
|
|
1480
|
-
const context =
|
|
1605
|
+
const context = React12.useContext(FormItemContext);
|
|
1481
1606
|
if (!context) {
|
|
1482
1607
|
throw new Error(
|
|
1483
1608
|
"ContextMenu.ItemIndicator must be rendered inside a CheckboxItem or RadioItem"
|
|
@@ -1485,10 +1610,10 @@ function useFormItemContext() {
|
|
|
1485
1610
|
}
|
|
1486
1611
|
return context;
|
|
1487
1612
|
}
|
|
1488
|
-
var RadioItemContext =
|
|
1489
|
-
var SubContext =
|
|
1613
|
+
var RadioItemContext = React12.createContext(null);
|
|
1614
|
+
var SubContext = React12.createContext(null);
|
|
1490
1615
|
function useSubContext() {
|
|
1491
|
-
const context =
|
|
1616
|
+
const context = React12.useContext(SubContext);
|
|
1492
1617
|
if (!context) {
|
|
1493
1618
|
throw new Error(
|
|
1494
1619
|
"ContextMenu.Sub compound components cannot be rendered outside a ContextMenu.Sub component"
|
|
@@ -1497,14 +1622,14 @@ function useSubContext() {
|
|
|
1497
1622
|
return context;
|
|
1498
1623
|
}
|
|
1499
1624
|
function Root6({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
|
|
1500
|
-
const nativeID =
|
|
1625
|
+
const nativeID = React12.useId();
|
|
1501
1626
|
const [open = false, onOpenChange] = useControllableState({
|
|
1502
1627
|
prop: openProp,
|
|
1503
1628
|
defaultProp: defaultOpen,
|
|
1504
1629
|
onChange: onOpenChangeProp
|
|
1505
1630
|
});
|
|
1506
|
-
const [triggerPosition, setTriggerPosition] =
|
|
1507
|
-
const [contentLayout, setContentLayout] =
|
|
1631
|
+
const [triggerPosition, setTriggerPosition] = React12.useState(null);
|
|
1632
|
+
const [contentLayout, setContentLayout] = React12.useState(null);
|
|
1508
1633
|
return /* @__PURE__ */ jsx9(
|
|
1509
1634
|
RootContext6.Provider,
|
|
1510
1635
|
{
|
|
@@ -1522,16 +1647,14 @@ function Root6({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, ch
|
|
|
1522
1647
|
);
|
|
1523
1648
|
}
|
|
1524
1649
|
Root6.displayName = "ContextMenuRoot";
|
|
1525
|
-
var Trigger11 =
|
|
1650
|
+
var Trigger11 = React12.forwardRef(function Trigger12({ asChild, onLongPress: onLongPressProp, disabled, ...props }, ref) {
|
|
1526
1651
|
const { open, onOpenChange, setTriggerPosition } = useRootContext6();
|
|
1527
1652
|
const augmentedRef = useAugmentedRef({
|
|
1528
1653
|
ref,
|
|
1529
1654
|
methods: {
|
|
1530
1655
|
open: () => {
|
|
1531
1656
|
onOpenChange(true);
|
|
1532
|
-
augmentedRef.current
|
|
1533
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1534
|
-
});
|
|
1657
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1535
1658
|
},
|
|
1536
1659
|
close: () => {
|
|
1537
1660
|
setTriggerPosition(null);
|
|
@@ -1539,12 +1662,10 @@ var Trigger11 = React11.forwardRef(function Trigger12({ asChild, onLongPress: on
|
|
|
1539
1662
|
}
|
|
1540
1663
|
}
|
|
1541
1664
|
});
|
|
1542
|
-
const onLongPress =
|
|
1665
|
+
const onLongPress = React12.useCallback(
|
|
1543
1666
|
(ev) => {
|
|
1544
1667
|
if (disabled) return;
|
|
1545
|
-
augmentedRef.current
|
|
1546
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1547
|
-
});
|
|
1668
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1548
1669
|
onOpenChange(!open);
|
|
1549
1670
|
onLongPressProp?.(ev);
|
|
1550
1671
|
},
|
|
@@ -1573,9 +1694,9 @@ function Portal6({ forceMount, hostName, children }) {
|
|
|
1573
1694
|
return /* @__PURE__ */ jsx9(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx9(RootContext6.Provider, { value: rootValue, children }) });
|
|
1574
1695
|
}
|
|
1575
1696
|
Portal6.displayName = "ContextMenuPortal";
|
|
1576
|
-
var Overlay9 =
|
|
1697
|
+
var Overlay9 = React12.forwardRef(function Overlay10({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
1577
1698
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
|
|
1578
|
-
const onPress =
|
|
1699
|
+
const onPress = React12.useCallback(
|
|
1579
1700
|
(ev) => {
|
|
1580
1701
|
if (closeOnPress) {
|
|
1581
1702
|
setTriggerPosition(null);
|
|
@@ -1593,7 +1714,7 @@ var Overlay9 = React11.forwardRef(function Overlay10({ asChild, forceMount, onPr
|
|
|
1593
1714
|
return /* @__PURE__ */ jsx9(Component, { ref, onPress, ...props });
|
|
1594
1715
|
});
|
|
1595
1716
|
Overlay9.displayName = "ContextMenuOverlay";
|
|
1596
|
-
var Content11 =
|
|
1717
|
+
var Content11 = React12.forwardRef(function Content12({
|
|
1597
1718
|
asChild,
|
|
1598
1719
|
forceMount,
|
|
1599
1720
|
align = "start",
|
|
@@ -1619,7 +1740,7 @@ var Content11 = React11.forwardRef(function Content12({
|
|
|
1619
1740
|
side,
|
|
1620
1741
|
disablePositioningStyle
|
|
1621
1742
|
});
|
|
1622
|
-
const onLayout =
|
|
1743
|
+
const onLayout = React12.useCallback(
|
|
1623
1744
|
(event) => {
|
|
1624
1745
|
setContentLayout(event.nativeEvent.layout);
|
|
1625
1746
|
onLayoutProp?.(event);
|
|
@@ -1643,9 +1764,9 @@ var Content11 = React11.forwardRef(function Content12({
|
|
|
1643
1764
|
);
|
|
1644
1765
|
});
|
|
1645
1766
|
Content11.displayName = "ContextMenuContent";
|
|
1646
|
-
var Item3 =
|
|
1767
|
+
var Item3 = React12.forwardRef(function Item4({ asChild, textValue, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
|
|
1647
1768
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
|
|
1648
|
-
const onPress =
|
|
1769
|
+
const onPress = React12.useCallback(
|
|
1649
1770
|
(ev) => {
|
|
1650
1771
|
if (disabled) return;
|
|
1651
1772
|
if (closeOnPress) {
|
|
@@ -1672,17 +1793,17 @@ var Item3 = React11.forwardRef(function Item4({ asChild, textValue, onPress: onP
|
|
|
1672
1793
|
);
|
|
1673
1794
|
});
|
|
1674
1795
|
Item3.displayName = "ContextMenuItem";
|
|
1675
|
-
var Group3 =
|
|
1796
|
+
var Group3 = React12.forwardRef(function Group4({ asChild, ...props }, ref) {
|
|
1676
1797
|
const Component = asChild ? Slot : View6;
|
|
1677
1798
|
return /* @__PURE__ */ jsx9(Component, { ref, role: "group", ...props });
|
|
1678
1799
|
});
|
|
1679
1800
|
Group3.displayName = "ContextMenuGroup";
|
|
1680
|
-
var Label3 =
|
|
1801
|
+
var Label3 = React12.forwardRef(function Label4({ asChild, ...props }, ref) {
|
|
1681
1802
|
const Component = asChild ? Slot : Text4;
|
|
1682
1803
|
return /* @__PURE__ */ jsx9(Component, { ref, ...props });
|
|
1683
1804
|
});
|
|
1684
1805
|
Label3.displayName = "ContextMenuLabel";
|
|
1685
|
-
var CheckboxItem =
|
|
1806
|
+
var CheckboxItem = React12.forwardRef(function CheckboxItem2({
|
|
1686
1807
|
asChild,
|
|
1687
1808
|
checked,
|
|
1688
1809
|
onCheckedChange,
|
|
@@ -1693,7 +1814,7 @@ var CheckboxItem = React11.forwardRef(function CheckboxItem2({
|
|
|
1693
1814
|
...props
|
|
1694
1815
|
}, ref) {
|
|
1695
1816
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
|
|
1696
|
-
const onPress =
|
|
1817
|
+
const onPress = React12.useCallback(
|
|
1697
1818
|
(ev) => {
|
|
1698
1819
|
if (disabled) return;
|
|
1699
1820
|
onCheckedChange(!checked);
|
|
@@ -1722,12 +1843,12 @@ var CheckboxItem = React11.forwardRef(function CheckboxItem2({
|
|
|
1722
1843
|
) });
|
|
1723
1844
|
});
|
|
1724
1845
|
CheckboxItem.displayName = "ContextMenuCheckboxItem";
|
|
1725
|
-
var RadioGroup =
|
|
1846
|
+
var RadioGroup = React12.forwardRef(function RadioGroup2({ asChild, value, onValueChange, ...props }, ref) {
|
|
1726
1847
|
const Component = asChild ? Slot : View6;
|
|
1727
1848
|
return /* @__PURE__ */ jsx9(FormItemContext.Provider, { value: { value, onValueChange }, children: /* @__PURE__ */ jsx9(Component, { ref, role: "radiogroup", ...props }) });
|
|
1728
1849
|
});
|
|
1729
1850
|
RadioGroup.displayName = "ContextMenuRadioGroup";
|
|
1730
|
-
var RadioItem =
|
|
1851
|
+
var RadioItem = React12.forwardRef(function RadioItem2({
|
|
1731
1852
|
asChild,
|
|
1732
1853
|
value: itemValue,
|
|
1733
1854
|
textValue,
|
|
@@ -1738,7 +1859,7 @@ var RadioItem = React11.forwardRef(function RadioItem2({
|
|
|
1738
1859
|
}, ref) {
|
|
1739
1860
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
|
|
1740
1861
|
const formContext = useFormItemContext();
|
|
1741
|
-
const onPress =
|
|
1862
|
+
const onPress = React12.useCallback(
|
|
1742
1863
|
(ev) => {
|
|
1743
1864
|
if (disabled) return;
|
|
1744
1865
|
formContext.onValueChange(itemValue);
|
|
@@ -1767,9 +1888,9 @@ var RadioItem = React11.forwardRef(function RadioItem2({
|
|
|
1767
1888
|
) });
|
|
1768
1889
|
});
|
|
1769
1890
|
RadioItem.displayName = "ContextMenuRadioItem";
|
|
1770
|
-
var ItemIndicator3 =
|
|
1891
|
+
var ItemIndicator3 = React12.forwardRef(function ItemIndicator4({ asChild, forceMount, ...props }, ref) {
|
|
1771
1892
|
const formContext = useFormItemContext();
|
|
1772
|
-
const radioItemContext =
|
|
1893
|
+
const radioItemContext = React12.useContext(RadioItemContext);
|
|
1773
1894
|
if (!forceMount) {
|
|
1774
1895
|
if (radioItemContext) {
|
|
1775
1896
|
const ctx = formContext;
|
|
@@ -1787,7 +1908,7 @@ var ItemIndicator3 = React11.forwardRef(function ItemIndicator4({ asChild, force
|
|
|
1787
1908
|
return /* @__PURE__ */ jsx9(Component, { ref, role: "presentation", ...props });
|
|
1788
1909
|
});
|
|
1789
1910
|
ItemIndicator3.displayName = "ContextMenuItemIndicator";
|
|
1790
|
-
var Separator3 =
|
|
1911
|
+
var Separator3 = React12.forwardRef(function Separator4({ asChild, decorative, ...props }, ref) {
|
|
1791
1912
|
const Component = asChild ? Slot : View6;
|
|
1792
1913
|
return /* @__PURE__ */ jsx9(
|
|
1793
1914
|
Component,
|
|
@@ -1800,7 +1921,7 @@ var Separator3 = React11.forwardRef(function Separator4({ asChild, decorative, .
|
|
|
1800
1921
|
});
|
|
1801
1922
|
Separator3.displayName = "ContextMenuSeparator";
|
|
1802
1923
|
function Sub({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
|
|
1803
|
-
const nativeID =
|
|
1924
|
+
const nativeID = React12.useId();
|
|
1804
1925
|
const [open = false, onOpenChange] = useControllableState({
|
|
1805
1926
|
prop: openProp,
|
|
1806
1927
|
defaultProp: defaultOpen,
|
|
@@ -1809,9 +1930,9 @@ function Sub({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, chil
|
|
|
1809
1930
|
return /* @__PURE__ */ jsx9(SubContext.Provider, { value: { nativeID, open, onOpenChange }, children });
|
|
1810
1931
|
}
|
|
1811
1932
|
Sub.displayName = "ContextMenuSub";
|
|
1812
|
-
var SubTrigger =
|
|
1933
|
+
var SubTrigger = React12.forwardRef(function SubTrigger2({ asChild, textValue, onPress: onPressProp, disabled, ...props }, ref) {
|
|
1813
1934
|
const { open, onOpenChange } = useSubContext();
|
|
1814
|
-
const onPress =
|
|
1935
|
+
const onPress = React12.useCallback(
|
|
1815
1936
|
(ev) => {
|
|
1816
1937
|
if (disabled) return;
|
|
1817
1938
|
onOpenChange(!open);
|
|
@@ -1835,7 +1956,7 @@ var SubTrigger = React11.forwardRef(function SubTrigger2({ asChild, textValue, o
|
|
|
1835
1956
|
);
|
|
1836
1957
|
});
|
|
1837
1958
|
SubTrigger.displayName = "ContextMenuSubTrigger";
|
|
1838
|
-
var SubContent =
|
|
1959
|
+
var SubContent = React12.forwardRef(function SubContent2({ asChild, forceMount, ...props }, ref) {
|
|
1839
1960
|
const { open, nativeID } = useSubContext();
|
|
1840
1961
|
if (!forceMount && !open) {
|
|
1841
1962
|
return null;
|
|
@@ -1869,16 +1990,16 @@ __export(dropdown_menu_exports, {
|
|
|
1869
1990
|
});
|
|
1870
1991
|
|
|
1871
1992
|
// src/dropdown-menu/dropdown-menu.tsx
|
|
1872
|
-
import * as
|
|
1993
|
+
import * as React13 from "react";
|
|
1873
1994
|
import {
|
|
1874
1995
|
Pressable as Pressable7,
|
|
1875
1996
|
Text as Text5,
|
|
1876
1997
|
View as View7
|
|
1877
1998
|
} from "react-native";
|
|
1878
1999
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1879
|
-
var RootContext7 =
|
|
2000
|
+
var RootContext7 = React13.createContext(null);
|
|
1880
2001
|
function useRootContext7() {
|
|
1881
|
-
const context =
|
|
2002
|
+
const context = React13.useContext(RootContext7);
|
|
1882
2003
|
if (!context) {
|
|
1883
2004
|
throw new Error(
|
|
1884
2005
|
"DropdownMenu compound components cannot be rendered outside the DropdownMenu.Root component"
|
|
@@ -1886,9 +2007,9 @@ function useRootContext7() {
|
|
|
1886
2007
|
}
|
|
1887
2008
|
return context;
|
|
1888
2009
|
}
|
|
1889
|
-
var FormItemContext2 =
|
|
2010
|
+
var FormItemContext2 = React13.createContext(null);
|
|
1890
2011
|
function useFormItemContext2() {
|
|
1891
|
-
const context =
|
|
2012
|
+
const context = React13.useContext(FormItemContext2);
|
|
1892
2013
|
if (!context) {
|
|
1893
2014
|
throw new Error(
|
|
1894
2015
|
"DropdownMenu.ItemIndicator must be rendered inside a CheckboxItem or RadioItem"
|
|
@@ -1896,10 +2017,10 @@ function useFormItemContext2() {
|
|
|
1896
2017
|
}
|
|
1897
2018
|
return context;
|
|
1898
2019
|
}
|
|
1899
|
-
var RadioItemContext2 =
|
|
1900
|
-
var SubContext2 =
|
|
2020
|
+
var RadioItemContext2 = React13.createContext(null);
|
|
2021
|
+
var SubContext2 = React13.createContext(null);
|
|
1901
2022
|
function useSubContext2() {
|
|
1902
|
-
const context =
|
|
2023
|
+
const context = React13.useContext(SubContext2);
|
|
1903
2024
|
if (!context) {
|
|
1904
2025
|
throw new Error(
|
|
1905
2026
|
"DropdownMenu.Sub compound components cannot be rendered outside a DropdownMenu.Sub component"
|
|
@@ -1908,14 +2029,14 @@ function useSubContext2() {
|
|
|
1908
2029
|
return context;
|
|
1909
2030
|
}
|
|
1910
2031
|
function Root7({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
|
|
1911
|
-
const nativeID =
|
|
2032
|
+
const nativeID = React13.useId();
|
|
1912
2033
|
const [open = false, onOpenChange] = useControllableState({
|
|
1913
2034
|
prop: openProp,
|
|
1914
2035
|
defaultProp: defaultOpen,
|
|
1915
2036
|
onChange: onOpenChangeProp
|
|
1916
2037
|
});
|
|
1917
|
-
const [triggerPosition, setTriggerPosition] =
|
|
1918
|
-
const [contentLayout, setContentLayout] =
|
|
2038
|
+
const [triggerPosition, setTriggerPosition] = React13.useState(null);
|
|
2039
|
+
const [contentLayout, setContentLayout] = React13.useState(null);
|
|
1919
2040
|
return /* @__PURE__ */ jsx10(
|
|
1920
2041
|
RootContext7.Provider,
|
|
1921
2042
|
{
|
|
@@ -1933,16 +2054,14 @@ function Root7({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, ch
|
|
|
1933
2054
|
);
|
|
1934
2055
|
}
|
|
1935
2056
|
Root7.displayName = "DropdownMenuRoot";
|
|
1936
|
-
var Trigger13 =
|
|
2057
|
+
var Trigger13 = React13.forwardRef(function Trigger14({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
|
|
1937
2058
|
const { open, onOpenChange, setTriggerPosition } = useRootContext7();
|
|
1938
2059
|
const augmentedRef = useAugmentedRef({
|
|
1939
2060
|
ref,
|
|
1940
2061
|
methods: {
|
|
1941
2062
|
open: () => {
|
|
1942
2063
|
onOpenChange(true);
|
|
1943
|
-
augmentedRef.current
|
|
1944
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1945
|
-
});
|
|
2064
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1946
2065
|
},
|
|
1947
2066
|
close: () => {
|
|
1948
2067
|
setTriggerPosition(null);
|
|
@@ -1950,12 +2069,10 @@ var Trigger13 = React12.forwardRef(function Trigger14({ asChild, onPress: onPres
|
|
|
1950
2069
|
}
|
|
1951
2070
|
}
|
|
1952
2071
|
});
|
|
1953
|
-
const onPress =
|
|
2072
|
+
const onPress = React13.useCallback(
|
|
1954
2073
|
(ev) => {
|
|
1955
2074
|
if (disabled) return;
|
|
1956
|
-
augmentedRef.current
|
|
1957
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
1958
|
-
});
|
|
2075
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
1959
2076
|
onOpenChange(!open);
|
|
1960
2077
|
onPressProp?.(ev);
|
|
1961
2078
|
},
|
|
@@ -1984,9 +2101,9 @@ function Portal7({ forceMount, hostName, children }) {
|
|
|
1984
2101
|
return /* @__PURE__ */ jsx10(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx10(RootContext7.Provider, { value: rootValue, children }) });
|
|
1985
2102
|
}
|
|
1986
2103
|
Portal7.displayName = "DropdownMenuPortal";
|
|
1987
|
-
var Overlay11 =
|
|
2104
|
+
var Overlay11 = React13.forwardRef(function Overlay12({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
1988
2105
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
|
|
1989
|
-
const onPress =
|
|
2106
|
+
const onPress = React13.useCallback(
|
|
1990
2107
|
(ev) => {
|
|
1991
2108
|
if (closeOnPress) {
|
|
1992
2109
|
setTriggerPosition(null);
|
|
@@ -2004,7 +2121,7 @@ var Overlay11 = React12.forwardRef(function Overlay12({ asChild, forceMount, onP
|
|
|
2004
2121
|
return /* @__PURE__ */ jsx10(Component, { ref, onPress, ...props });
|
|
2005
2122
|
});
|
|
2006
2123
|
Overlay11.displayName = "DropdownMenuOverlay";
|
|
2007
|
-
var Content13 =
|
|
2124
|
+
var Content13 = React13.forwardRef(function Content14({
|
|
2008
2125
|
asChild,
|
|
2009
2126
|
forceMount,
|
|
2010
2127
|
align = "start",
|
|
@@ -2016,9 +2133,19 @@ var Content13 = React12.forwardRef(function Content14({
|
|
|
2016
2133
|
style,
|
|
2017
2134
|
disablePositioningStyle,
|
|
2018
2135
|
onLayout: onLayoutProp,
|
|
2136
|
+
onEscapeKeyDown,
|
|
2019
2137
|
...props
|
|
2020
2138
|
}, ref) {
|
|
2021
|
-
const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext7();
|
|
2139
|
+
const { open, onOpenChange, triggerPosition, contentLayout, setTriggerPosition, setContentLayout } = useRootContext7();
|
|
2140
|
+
useEscapeDismiss(
|
|
2141
|
+
open,
|
|
2142
|
+
() => {
|
|
2143
|
+
setTriggerPosition(null);
|
|
2144
|
+
setContentLayout(null);
|
|
2145
|
+
onOpenChange(false);
|
|
2146
|
+
},
|
|
2147
|
+
onEscapeKeyDown
|
|
2148
|
+
);
|
|
2022
2149
|
const positionStyle = useRelativePosition({
|
|
2023
2150
|
align,
|
|
2024
2151
|
avoidCollisions,
|
|
@@ -2030,7 +2157,7 @@ var Content13 = React12.forwardRef(function Content14({
|
|
|
2030
2157
|
side,
|
|
2031
2158
|
disablePositioningStyle
|
|
2032
2159
|
});
|
|
2033
|
-
const onLayout =
|
|
2160
|
+
const onLayout = React13.useCallback(
|
|
2034
2161
|
(event) => {
|
|
2035
2162
|
setContentLayout(event.nativeEvent.layout);
|
|
2036
2163
|
onLayoutProp?.(event);
|
|
@@ -2054,9 +2181,9 @@ var Content13 = React12.forwardRef(function Content14({
|
|
|
2054
2181
|
);
|
|
2055
2182
|
});
|
|
2056
2183
|
Content13.displayName = "DropdownMenuContent";
|
|
2057
|
-
var Item5 =
|
|
2184
|
+
var Item5 = React13.forwardRef(function Item6({ asChild, textValue, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
|
|
2058
2185
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
|
|
2059
|
-
const onPress =
|
|
2186
|
+
const onPress = React13.useCallback(
|
|
2060
2187
|
(ev) => {
|
|
2061
2188
|
if (disabled) return;
|
|
2062
2189
|
if (closeOnPress) {
|
|
@@ -2083,17 +2210,17 @@ var Item5 = React12.forwardRef(function Item6({ asChild, textValue, onPress: onP
|
|
|
2083
2210
|
);
|
|
2084
2211
|
});
|
|
2085
2212
|
Item5.displayName = "DropdownMenuItem";
|
|
2086
|
-
var Group5 =
|
|
2213
|
+
var Group5 = React13.forwardRef(function Group6({ asChild, ...props }, ref) {
|
|
2087
2214
|
const Component = asChild ? Slot : View7;
|
|
2088
2215
|
return /* @__PURE__ */ jsx10(Component, { ref, role: "group", ...props });
|
|
2089
2216
|
});
|
|
2090
2217
|
Group5.displayName = "DropdownMenuGroup";
|
|
2091
|
-
var Label5 =
|
|
2218
|
+
var Label5 = React13.forwardRef(function Label6({ asChild, ...props }, ref) {
|
|
2092
2219
|
const Component = asChild ? Slot : Text5;
|
|
2093
2220
|
return /* @__PURE__ */ jsx10(Component, { ref, ...props });
|
|
2094
2221
|
});
|
|
2095
2222
|
Label5.displayName = "DropdownMenuLabel";
|
|
2096
|
-
var CheckboxItem3 =
|
|
2223
|
+
var CheckboxItem3 = React13.forwardRef(function CheckboxItem4({
|
|
2097
2224
|
asChild,
|
|
2098
2225
|
checked,
|
|
2099
2226
|
onCheckedChange,
|
|
@@ -2104,7 +2231,7 @@ var CheckboxItem3 = React12.forwardRef(function CheckboxItem4({
|
|
|
2104
2231
|
...props
|
|
2105
2232
|
}, ref) {
|
|
2106
2233
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
|
|
2107
|
-
const onPress =
|
|
2234
|
+
const onPress = React13.useCallback(
|
|
2108
2235
|
(ev) => {
|
|
2109
2236
|
if (disabled) return;
|
|
2110
2237
|
onCheckedChange(!checked);
|
|
@@ -2133,12 +2260,12 @@ var CheckboxItem3 = React12.forwardRef(function CheckboxItem4({
|
|
|
2133
2260
|
) });
|
|
2134
2261
|
});
|
|
2135
2262
|
CheckboxItem3.displayName = "DropdownMenuCheckboxItem";
|
|
2136
|
-
var RadioGroup3 =
|
|
2263
|
+
var RadioGroup3 = React13.forwardRef(function RadioGroup4({ asChild, value, onValueChange, ...props }, ref) {
|
|
2137
2264
|
const Component = asChild ? Slot : View7;
|
|
2138
2265
|
return /* @__PURE__ */ jsx10(FormItemContext2.Provider, { value: { value, onValueChange }, children: /* @__PURE__ */ jsx10(Component, { ref, role: "radiogroup", ...props }) });
|
|
2139
2266
|
});
|
|
2140
2267
|
RadioGroup3.displayName = "DropdownMenuRadioGroup";
|
|
2141
|
-
var RadioItem3 =
|
|
2268
|
+
var RadioItem3 = React13.forwardRef(function RadioItem4({
|
|
2142
2269
|
asChild,
|
|
2143
2270
|
value: itemValue,
|
|
2144
2271
|
textValue,
|
|
@@ -2149,7 +2276,7 @@ var RadioItem3 = React12.forwardRef(function RadioItem4({
|
|
|
2149
2276
|
}, ref) {
|
|
2150
2277
|
const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
|
|
2151
2278
|
const formContext = useFormItemContext2();
|
|
2152
|
-
const onPress =
|
|
2279
|
+
const onPress = React13.useCallback(
|
|
2153
2280
|
(ev) => {
|
|
2154
2281
|
if (disabled) return;
|
|
2155
2282
|
formContext.onValueChange(itemValue);
|
|
@@ -2178,9 +2305,9 @@ var RadioItem3 = React12.forwardRef(function RadioItem4({
|
|
|
2178
2305
|
) });
|
|
2179
2306
|
});
|
|
2180
2307
|
RadioItem3.displayName = "DropdownMenuRadioItem";
|
|
2181
|
-
var ItemIndicator5 =
|
|
2308
|
+
var ItemIndicator5 = React13.forwardRef(function ItemIndicator6({ asChild, forceMount, ...props }, ref) {
|
|
2182
2309
|
const formContext = useFormItemContext2();
|
|
2183
|
-
const radioItemContext =
|
|
2310
|
+
const radioItemContext = React13.useContext(RadioItemContext2);
|
|
2184
2311
|
if (!forceMount) {
|
|
2185
2312
|
if (radioItemContext) {
|
|
2186
2313
|
const ctx = formContext;
|
|
@@ -2198,7 +2325,7 @@ var ItemIndicator5 = React12.forwardRef(function ItemIndicator6({ asChild, force
|
|
|
2198
2325
|
return /* @__PURE__ */ jsx10(Component, { ref, role: "presentation", ...props });
|
|
2199
2326
|
});
|
|
2200
2327
|
ItemIndicator5.displayName = "DropdownMenuItemIndicator";
|
|
2201
|
-
var Separator5 =
|
|
2328
|
+
var Separator5 = React13.forwardRef(function Separator6({ asChild, decorative, ...props }, ref) {
|
|
2202
2329
|
const Component = asChild ? Slot : View7;
|
|
2203
2330
|
return /* @__PURE__ */ jsx10(
|
|
2204
2331
|
Component,
|
|
@@ -2211,7 +2338,7 @@ var Separator5 = React12.forwardRef(function Separator6({ asChild, decorative, .
|
|
|
2211
2338
|
});
|
|
2212
2339
|
Separator5.displayName = "DropdownMenuSeparator";
|
|
2213
2340
|
function Sub2({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
|
|
2214
|
-
const nativeID =
|
|
2341
|
+
const nativeID = React13.useId();
|
|
2215
2342
|
const [open = false, onOpenChange] = useControllableState({
|
|
2216
2343
|
prop: openProp,
|
|
2217
2344
|
defaultProp: defaultOpen,
|
|
@@ -2220,9 +2347,9 @@ function Sub2({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, chi
|
|
|
2220
2347
|
return /* @__PURE__ */ jsx10(SubContext2.Provider, { value: { nativeID, open, onOpenChange }, children });
|
|
2221
2348
|
}
|
|
2222
2349
|
Sub2.displayName = "DropdownMenuSub";
|
|
2223
|
-
var SubTrigger3 =
|
|
2350
|
+
var SubTrigger3 = React13.forwardRef(function SubTrigger4({ asChild, textValue, onPress: onPressProp, disabled, ...props }, ref) {
|
|
2224
2351
|
const { open, onOpenChange } = useSubContext2();
|
|
2225
|
-
const onPress =
|
|
2352
|
+
const onPress = React13.useCallback(
|
|
2226
2353
|
(ev) => {
|
|
2227
2354
|
if (disabled) return;
|
|
2228
2355
|
onOpenChange(!open);
|
|
@@ -2246,8 +2373,9 @@ var SubTrigger3 = React12.forwardRef(function SubTrigger4({ asChild, textValue,
|
|
|
2246
2373
|
);
|
|
2247
2374
|
});
|
|
2248
2375
|
SubTrigger3.displayName = "DropdownMenuSubTrigger";
|
|
2249
|
-
var SubContent3 =
|
|
2250
|
-
const { open, nativeID } = useSubContext2();
|
|
2376
|
+
var SubContent3 = React13.forwardRef(function SubContent4({ asChild, forceMount, ...props }, ref) {
|
|
2377
|
+
const { open, nativeID, onOpenChange } = useSubContext2();
|
|
2378
|
+
useEscapeDismiss(open, () => onOpenChange(false));
|
|
2251
2379
|
if (!forceMount && !open) {
|
|
2252
2380
|
return null;
|
|
2253
2381
|
}
|
|
@@ -2265,12 +2393,12 @@ __export(list_exports, {
|
|
|
2265
2393
|
});
|
|
2266
2394
|
|
|
2267
2395
|
// src/list/list.tsx
|
|
2268
|
-
import
|
|
2396
|
+
import React14 from "react";
|
|
2269
2397
|
import { FlatList, View as View8 } from "react-native";
|
|
2270
2398
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2271
|
-
var ItemContext2 =
|
|
2399
|
+
var ItemContext2 = React14.createContext(null);
|
|
2272
2400
|
function useItemContext2() {
|
|
2273
|
-
const context =
|
|
2401
|
+
const context = React14.useContext(ItemContext2);
|
|
2274
2402
|
if (!context) {
|
|
2275
2403
|
throw new Error("useItemContext must be used within a List.Item");
|
|
2276
2404
|
}
|
|
@@ -2293,8 +2421,8 @@ function RootInner({ data, renderItem, keyExtractor, estimatedItemSize, ...props
|
|
|
2293
2421
|
}
|
|
2294
2422
|
);
|
|
2295
2423
|
}
|
|
2296
|
-
var Root8 =
|
|
2297
|
-
var Item7 =
|
|
2424
|
+
var Root8 = React14.forwardRef(RootInner);
|
|
2425
|
+
var Item7 = React14.forwardRef(
|
|
2298
2426
|
({ children, ...props }, ref) => /* @__PURE__ */ jsx11(View8, { ref, ...props, children })
|
|
2299
2427
|
);
|
|
2300
2428
|
Item7.displayName = "ListItem";
|
|
@@ -2306,7 +2434,7 @@ __export(image_exports, {
|
|
|
2306
2434
|
});
|
|
2307
2435
|
|
|
2308
2436
|
// src/image/image.tsx
|
|
2309
|
-
import
|
|
2437
|
+
import React15 from "react";
|
|
2310
2438
|
import { Image as RNImage } from "react-native";
|
|
2311
2439
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2312
2440
|
var contentFitToResizeMode = {
|
|
@@ -2316,7 +2444,7 @@ var contentFitToResizeMode = {
|
|
|
2316
2444
|
none: "center",
|
|
2317
2445
|
"scale-down": "contain"
|
|
2318
2446
|
};
|
|
2319
|
-
var Root9 =
|
|
2447
|
+
var Root9 = React15.forwardRef(
|
|
2320
2448
|
({ source, alt, placeholder, contentFit = "cover", style, ...props }, ref) => {
|
|
2321
2449
|
return /* @__PURE__ */ jsx12(
|
|
2322
2450
|
RNImage,
|
|
@@ -2343,12 +2471,12 @@ __export(label_exports, {
|
|
|
2343
2471
|
});
|
|
2344
2472
|
|
|
2345
2473
|
// src/label/label.tsx
|
|
2346
|
-
import * as
|
|
2474
|
+
import * as React16 from "react";
|
|
2347
2475
|
import { Text as Text6 } from "react-native";
|
|
2348
2476
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2349
|
-
var RootContext8 =
|
|
2477
|
+
var RootContext8 = React16.createContext(null);
|
|
2350
2478
|
function useRootContext8() {
|
|
2351
|
-
const context =
|
|
2479
|
+
const context = React16.useContext(RootContext8);
|
|
2352
2480
|
if (!context) {
|
|
2353
2481
|
throw new Error(
|
|
2354
2482
|
"Label compound components cannot be rendered outside the Label.Root component"
|
|
@@ -2356,7 +2484,7 @@ function useRootContext8() {
|
|
|
2356
2484
|
}
|
|
2357
2485
|
return context;
|
|
2358
2486
|
}
|
|
2359
|
-
var Root10 =
|
|
2487
|
+
var Root10 = React16.forwardRef(function Root11({ asChild, nativeID, ...props }, ref) {
|
|
2360
2488
|
const Component = asChild ? Slot : Text6;
|
|
2361
2489
|
return /* @__PURE__ */ jsx13(RootContext8.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx13(Component, { ref, nativeID, ...props }) });
|
|
2362
2490
|
});
|
|
@@ -2369,10 +2497,10 @@ __export(separator_exports, {
|
|
|
2369
2497
|
});
|
|
2370
2498
|
|
|
2371
2499
|
// src/separator/separator.tsx
|
|
2372
|
-
import * as
|
|
2500
|
+
import * as React17 from "react";
|
|
2373
2501
|
import { View as View9 } from "react-native";
|
|
2374
2502
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2375
|
-
var Root12 =
|
|
2503
|
+
var Root12 = React17.forwardRef(function Root13({ asChild, orientation = "horizontal", decorative = false, ...props }, ref) {
|
|
2376
2504
|
const Component = asChild ? Slot : View9;
|
|
2377
2505
|
return /* @__PURE__ */ jsx14(
|
|
2378
2506
|
Component,
|
|
@@ -2401,7 +2529,7 @@ __export(combobox_exports, {
|
|
|
2401
2529
|
});
|
|
2402
2530
|
|
|
2403
2531
|
// src/combobox/combobox.tsx
|
|
2404
|
-
import * as
|
|
2532
|
+
import * as React18 from "react";
|
|
2405
2533
|
import {
|
|
2406
2534
|
Pressable as Pressable8,
|
|
2407
2535
|
Text as Text7,
|
|
@@ -2409,9 +2537,19 @@ import {
|
|
|
2409
2537
|
View as View10
|
|
2410
2538
|
} from "react-native";
|
|
2411
2539
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2412
|
-
var
|
|
2540
|
+
var AnchorContext = React18.createContext(null);
|
|
2541
|
+
var useAnchorContext = () => React18.useContext(AnchorContext);
|
|
2542
|
+
function useAnchorNode(anchorRef, node) {
|
|
2543
|
+
React18.useEffect(() => {
|
|
2544
|
+
anchorRef.current = node.current;
|
|
2545
|
+
return () => {
|
|
2546
|
+
anchorRef.current = null;
|
|
2547
|
+
};
|
|
2548
|
+
}, [anchorRef, node]);
|
|
2549
|
+
}
|
|
2550
|
+
var RootContext9 = React18.createContext(null);
|
|
2413
2551
|
function useRootContext9() {
|
|
2414
|
-
const context =
|
|
2552
|
+
const context = React18.useContext(RootContext9);
|
|
2415
2553
|
if (!context) {
|
|
2416
2554
|
throw new Error(
|
|
2417
2555
|
"Combobox compound components cannot be rendered outside the Combobox.Root component"
|
|
@@ -2419,9 +2557,9 @@ function useRootContext9() {
|
|
|
2419
2557
|
}
|
|
2420
2558
|
return context;
|
|
2421
2559
|
}
|
|
2422
|
-
var ItemContext3 =
|
|
2560
|
+
var ItemContext3 = React18.createContext(null);
|
|
2423
2561
|
function useItemContext3() {
|
|
2424
|
-
const context =
|
|
2562
|
+
const context = React18.useContext(ItemContext3);
|
|
2425
2563
|
if (!context) {
|
|
2426
2564
|
throw new Error(
|
|
2427
2565
|
"Combobox.Item compound components cannot be rendered outside a Combobox.Item component"
|
|
@@ -2440,7 +2578,7 @@ function Root14({
|
|
|
2440
2578
|
onSearchValueChange: onSearchValueChangeProp,
|
|
2441
2579
|
children
|
|
2442
2580
|
}) {
|
|
2443
|
-
const nativeID =
|
|
2581
|
+
const nativeID = React18.useId();
|
|
2444
2582
|
const [value, onValueChange] = useControllableState({
|
|
2445
2583
|
prop: valueProp,
|
|
2446
2584
|
defaultProp: defaultValue,
|
|
@@ -2456,6 +2594,10 @@ function Root14({
|
|
|
2456
2594
|
defaultProp: "",
|
|
2457
2595
|
onChange: onSearchValueChangeProp
|
|
2458
2596
|
});
|
|
2597
|
+
const [triggerPosition, setTriggerPosition] = React18.useState(null);
|
|
2598
|
+
const [contentLayout, setContentLayout] = React18.useState(null);
|
|
2599
|
+
const triggerRef = React18.useRef(null);
|
|
2600
|
+
const inputRef = React18.useRef(null);
|
|
2459
2601
|
return /* @__PURE__ */ jsx15(
|
|
2460
2602
|
RootContext9.Provider,
|
|
2461
2603
|
{
|
|
@@ -2468,14 +2610,23 @@ function Root14({
|
|
|
2468
2610
|
onSearchValueChange,
|
|
2469
2611
|
nativeID
|
|
2470
2612
|
},
|
|
2471
|
-
children
|
|
2613
|
+
children: /* @__PURE__ */ jsx15(
|
|
2614
|
+
AnchorContext.Provider,
|
|
2615
|
+
{
|
|
2616
|
+
value: { triggerPosition, setTriggerPosition, contentLayout, setContentLayout, triggerRef, inputRef },
|
|
2617
|
+
children
|
|
2618
|
+
}
|
|
2619
|
+
)
|
|
2472
2620
|
}
|
|
2473
2621
|
);
|
|
2474
2622
|
}
|
|
2475
2623
|
Root14.displayName = "ComboboxRoot";
|
|
2476
|
-
var Input =
|
|
2624
|
+
var Input = React18.forwardRef(function Input2({ asChild, placeholder, ...props }, ref) {
|
|
2477
2625
|
const { open, onOpenChange, searchValue, onSearchValueChange } = useRootContext9();
|
|
2478
|
-
const
|
|
2626
|
+
const { inputRef } = useAnchorContext();
|
|
2627
|
+
const augmentedRef = useAugmentedRef({ ref });
|
|
2628
|
+
useAnchorNode(inputRef, augmentedRef);
|
|
2629
|
+
const onChange = React18.useCallback(
|
|
2479
2630
|
(ev) => {
|
|
2480
2631
|
onSearchValueChange(ev.nativeEvent.text);
|
|
2481
2632
|
if (!open) {
|
|
@@ -2484,7 +2635,7 @@ var Input = React17.forwardRef(function Input2({ asChild, placeholder, ...props
|
|
|
2484
2635
|
},
|
|
2485
2636
|
[onSearchValueChange, onOpenChange, open]
|
|
2486
2637
|
);
|
|
2487
|
-
const onFocus =
|
|
2638
|
+
const onFocus = React18.useCallback(() => {
|
|
2488
2639
|
if (!open) {
|
|
2489
2640
|
onOpenChange(true);
|
|
2490
2641
|
}
|
|
@@ -2493,7 +2644,7 @@ var Input = React17.forwardRef(function Input2({ asChild, placeholder, ...props
|
|
|
2493
2644
|
return /* @__PURE__ */ jsx15(
|
|
2494
2645
|
Component,
|
|
2495
2646
|
{
|
|
2496
|
-
ref,
|
|
2647
|
+
ref: augmentedRef,
|
|
2497
2648
|
role: "combobox",
|
|
2498
2649
|
"aria-expanded": open,
|
|
2499
2650
|
"aria-autocomplete": "list",
|
|
@@ -2506,20 +2657,28 @@ var Input = React17.forwardRef(function Input2({ asChild, placeholder, ...props
|
|
|
2506
2657
|
);
|
|
2507
2658
|
});
|
|
2508
2659
|
Input.displayName = "ComboboxInput";
|
|
2509
|
-
var Trigger15 =
|
|
2660
|
+
var Trigger15 = React18.forwardRef(function Trigger16({ asChild, onPress: onPressProp, ...props }, ref) {
|
|
2510
2661
|
const { open, onOpenChange } = useRootContext9();
|
|
2511
|
-
const
|
|
2662
|
+
const { triggerRef, inputRef } = useAnchorContext();
|
|
2663
|
+
const augmentedRef = useAugmentedRef({ ref });
|
|
2664
|
+
useAnchorNode(triggerRef, augmentedRef);
|
|
2665
|
+
const onPress = React18.useCallback(
|
|
2512
2666
|
(ev) => {
|
|
2513
|
-
|
|
2667
|
+
const input = inputRef.current;
|
|
2668
|
+
if (typeof input?.contains === "function" && input.contains(ev.target)) {
|
|
2669
|
+
if (!open) onOpenChange(true);
|
|
2670
|
+
} else {
|
|
2671
|
+
onOpenChange(!open);
|
|
2672
|
+
}
|
|
2514
2673
|
onPressProp?.(ev);
|
|
2515
2674
|
},
|
|
2516
|
-
[onOpenChange, onPressProp, open]
|
|
2675
|
+
[inputRef, onOpenChange, onPressProp, open]
|
|
2517
2676
|
);
|
|
2518
2677
|
const Component = asChild ? Slot : Pressable8;
|
|
2519
2678
|
return /* @__PURE__ */ jsx15(
|
|
2520
2679
|
Component,
|
|
2521
2680
|
{
|
|
2522
|
-
ref,
|
|
2681
|
+
ref: augmentedRef,
|
|
2523
2682
|
role: "button",
|
|
2524
2683
|
"aria-expanded": open,
|
|
2525
2684
|
onPress,
|
|
@@ -2530,25 +2689,61 @@ var Trigger15 = React17.forwardRef(function Trigger16({ asChild, onPress: onPres
|
|
|
2530
2689
|
Trigger15.displayName = "ComboboxTrigger";
|
|
2531
2690
|
function Portal8({ forceMount, hostName, children }) {
|
|
2532
2691
|
const rootValue = useRootContext9();
|
|
2692
|
+
const anchorValue = useAnchorContext();
|
|
2533
2693
|
if (!forceMount && !rootValue.open) {
|
|
2534
2694
|
return null;
|
|
2535
2695
|
}
|
|
2536
|
-
return /* @__PURE__ */ jsx15(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx15(RootContext9.Provider, { value: rootValue, children }) });
|
|
2696
|
+
return /* @__PURE__ */ jsx15(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx15(RootContext9.Provider, { value: rootValue, children: /* @__PURE__ */ jsx15(AnchorContext.Provider, { value: anchorValue, children }) }) });
|
|
2537
2697
|
}
|
|
2538
2698
|
Portal8.displayName = "ComboboxPortal";
|
|
2539
|
-
var Content15 =
|
|
2540
|
-
const { open } = useRootContext9();
|
|
2699
|
+
var Content15 = React18.forwardRef(function Content16({ asChild, forceMount, style, onLayout: onLayoutProp, onEscapeKeyDown, ...props }, ref) {
|
|
2700
|
+
const { open, onOpenChange } = useRootContext9();
|
|
2701
|
+
const { triggerPosition, setTriggerPosition, contentLayout, setContentLayout, triggerRef, inputRef } = useAnchorContext();
|
|
2702
|
+
React18.useEffect(() => {
|
|
2703
|
+
if (!open) return;
|
|
2704
|
+
measureTrigger(triggerRef.current ?? inputRef.current, setTriggerPosition);
|
|
2705
|
+
return () => {
|
|
2706
|
+
setTriggerPosition(null);
|
|
2707
|
+
setContentLayout(null);
|
|
2708
|
+
};
|
|
2709
|
+
}, [open, triggerRef, inputRef, setTriggerPosition, setContentLayout]);
|
|
2710
|
+
useEscapeDismiss(open, () => onOpenChange(false), onEscapeKeyDown);
|
|
2711
|
+
const positionStyle = useRelativePosition({
|
|
2712
|
+
align: "start",
|
|
2713
|
+
avoidCollisions: true,
|
|
2714
|
+
triggerPosition,
|
|
2715
|
+
contentLayout,
|
|
2716
|
+
alignOffset: 0,
|
|
2717
|
+
sideOffset: 4,
|
|
2718
|
+
side: "bottom"
|
|
2719
|
+
});
|
|
2720
|
+
const onLayout = React18.useCallback(
|
|
2721
|
+
(event) => {
|
|
2722
|
+
setContentLayout(event.nativeEvent.layout);
|
|
2723
|
+
onLayoutProp?.(event);
|
|
2724
|
+
},
|
|
2725
|
+
[onLayoutProp, setContentLayout]
|
|
2726
|
+
);
|
|
2541
2727
|
if (!forceMount && !open) {
|
|
2542
2728
|
return null;
|
|
2543
2729
|
}
|
|
2544
2730
|
const Component = asChild ? Slot : View10;
|
|
2545
|
-
return /* @__PURE__ */ jsx15(
|
|
2731
|
+
return /* @__PURE__ */ jsx15(
|
|
2732
|
+
Component,
|
|
2733
|
+
{
|
|
2734
|
+
ref,
|
|
2735
|
+
role: "listbox",
|
|
2736
|
+
style: [positionStyle, triggerPosition ? { minWidth: triggerPosition.width } : null, style],
|
|
2737
|
+
onLayout,
|
|
2738
|
+
...props
|
|
2739
|
+
}
|
|
2740
|
+
);
|
|
2546
2741
|
});
|
|
2547
2742
|
Content15.displayName = "ComboboxContent";
|
|
2548
|
-
var Item8 =
|
|
2743
|
+
var Item8 = React18.forwardRef(function Item9({ asChild, value: itemValue, label, onPress: onPressProp, ...props }, ref) {
|
|
2549
2744
|
const { value, onValueChange, onOpenChange, onSearchValueChange } = useRootContext9();
|
|
2550
2745
|
const isSelected = value?.value === itemValue;
|
|
2551
|
-
const onPress =
|
|
2746
|
+
const onPress = React18.useCallback(
|
|
2552
2747
|
(ev) => {
|
|
2553
2748
|
onValueChange({ value: itemValue, label });
|
|
2554
2749
|
onOpenChange(false);
|
|
@@ -2570,13 +2765,13 @@ var Item8 = React17.forwardRef(function Item9({ asChild, value: itemValue, label
|
|
|
2570
2765
|
) });
|
|
2571
2766
|
});
|
|
2572
2767
|
Item8.displayName = "ComboboxItem";
|
|
2573
|
-
var ItemText3 =
|
|
2768
|
+
var ItemText3 = React18.forwardRef(function ItemText4({ asChild, ...props }, ref) {
|
|
2574
2769
|
const { label } = useItemContext3();
|
|
2575
2770
|
const Component = asChild ? Slot : Text7;
|
|
2576
2771
|
return /* @__PURE__ */ jsx15(Component, { ref, ...props, children: label });
|
|
2577
2772
|
});
|
|
2578
2773
|
ItemText3.displayName = "ComboboxItemText";
|
|
2579
|
-
var Empty =
|
|
2774
|
+
var Empty = React18.forwardRef(function Empty2({ asChild, ...props }, ref) {
|
|
2580
2775
|
const Component = asChild ? Slot : View10;
|
|
2581
2776
|
return /* @__PURE__ */ jsx15(Component, { ref, ...props });
|
|
2582
2777
|
});
|
|
@@ -2591,12 +2786,12 @@ __export(checkbox_exports, {
|
|
|
2591
2786
|
});
|
|
2592
2787
|
|
|
2593
2788
|
// src/checkbox/checkbox.tsx
|
|
2594
|
-
import * as
|
|
2789
|
+
import * as React19 from "react";
|
|
2595
2790
|
import { Pressable as Pressable9, View as View11 } from "react-native";
|
|
2596
2791
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2597
|
-
var RootContext10 =
|
|
2792
|
+
var RootContext10 = React19.createContext(null);
|
|
2598
2793
|
function useRootContext10() {
|
|
2599
|
-
const context =
|
|
2794
|
+
const context = React19.useContext(RootContext10);
|
|
2600
2795
|
if (!context) {
|
|
2601
2796
|
throw new Error(
|
|
2602
2797
|
"Checkbox compound components cannot be rendered outside the Checkbox.Root component"
|
|
@@ -2604,7 +2799,7 @@ function useRootContext10() {
|
|
|
2604
2799
|
}
|
|
2605
2800
|
return context;
|
|
2606
2801
|
}
|
|
2607
|
-
var Root15 =
|
|
2802
|
+
var Root15 = React19.forwardRef(function Root16({
|
|
2608
2803
|
asChild,
|
|
2609
2804
|
checked: checkedProp,
|
|
2610
2805
|
defaultChecked,
|
|
@@ -2618,7 +2813,7 @@ var Root15 = React18.forwardRef(function Root16({
|
|
|
2618
2813
|
defaultProp: defaultChecked,
|
|
2619
2814
|
onChange: onCheckedChangeProp
|
|
2620
2815
|
});
|
|
2621
|
-
const onPress =
|
|
2816
|
+
const onPress = React19.useCallback(
|
|
2622
2817
|
(ev) => {
|
|
2623
2818
|
if (disabled) return;
|
|
2624
2819
|
setChecked(!checked);
|
|
@@ -2641,7 +2836,7 @@ var Root15 = React18.forwardRef(function Root16({
|
|
|
2641
2836
|
) });
|
|
2642
2837
|
});
|
|
2643
2838
|
Root15.displayName = "CheckboxRoot";
|
|
2644
|
-
var Indicator =
|
|
2839
|
+
var Indicator = React19.forwardRef(function Indicator2({ asChild, forceMount, ...props }, ref) {
|
|
2645
2840
|
const { checked, disabled } = useRootContext10();
|
|
2646
2841
|
if (!forceMount && !checked) {
|
|
2647
2842
|
return null;
|
|
@@ -2669,12 +2864,12 @@ __export(switch_exports, {
|
|
|
2669
2864
|
});
|
|
2670
2865
|
|
|
2671
2866
|
// src/switch/switch.tsx
|
|
2672
|
-
import * as
|
|
2867
|
+
import * as React20 from "react";
|
|
2673
2868
|
import { Pressable as Pressable10, View as View12 } from "react-native";
|
|
2674
2869
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2675
|
-
var RootContext11 =
|
|
2870
|
+
var RootContext11 = React20.createContext(null);
|
|
2676
2871
|
function useRootContext11() {
|
|
2677
|
-
const context =
|
|
2872
|
+
const context = React20.useContext(RootContext11);
|
|
2678
2873
|
if (!context) {
|
|
2679
2874
|
throw new Error(
|
|
2680
2875
|
"Switch compound components cannot be rendered outside the Switch.Root component"
|
|
@@ -2682,7 +2877,7 @@ function useRootContext11() {
|
|
|
2682
2877
|
}
|
|
2683
2878
|
return context;
|
|
2684
2879
|
}
|
|
2685
|
-
var Root17 =
|
|
2880
|
+
var Root17 = React20.forwardRef(function Root18({
|
|
2686
2881
|
asChild,
|
|
2687
2882
|
checked: checkedProp,
|
|
2688
2883
|
defaultChecked,
|
|
@@ -2696,7 +2891,7 @@ var Root17 = React19.forwardRef(function Root18({
|
|
|
2696
2891
|
defaultProp: defaultChecked,
|
|
2697
2892
|
onChange: onCheckedChangeProp
|
|
2698
2893
|
});
|
|
2699
|
-
const onPress =
|
|
2894
|
+
const onPress = React20.useCallback(
|
|
2700
2895
|
(ev) => {
|
|
2701
2896
|
if (disabled) return;
|
|
2702
2897
|
setChecked(!checked);
|
|
@@ -2719,7 +2914,7 @@ var Root17 = React19.forwardRef(function Root18({
|
|
|
2719
2914
|
) });
|
|
2720
2915
|
});
|
|
2721
2916
|
Root17.displayName = "SwitchRoot";
|
|
2722
|
-
var Thumb =
|
|
2917
|
+
var Thumb = React20.forwardRef(function Thumb2({ asChild, ...props }, ref) {
|
|
2723
2918
|
useRootContext11();
|
|
2724
2919
|
const Component = asChild ? Slot : View12;
|
|
2725
2920
|
return /* @__PURE__ */ jsx17(Component, { ref, role: "presentation", ...props });
|
|
@@ -2735,13 +2930,13 @@ __export(progress_exports, {
|
|
|
2735
2930
|
});
|
|
2736
2931
|
|
|
2737
2932
|
// src/progress/progress.tsx
|
|
2738
|
-
import * as
|
|
2933
|
+
import * as React21 from "react";
|
|
2739
2934
|
import { View as View13 } from "react-native";
|
|
2740
2935
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2741
2936
|
var DEFAULT_MAX = 100;
|
|
2742
|
-
var RootContext12 =
|
|
2937
|
+
var RootContext12 = React21.createContext(null);
|
|
2743
2938
|
function useRootContext12() {
|
|
2744
|
-
const context =
|
|
2939
|
+
const context = React21.useContext(RootContext12);
|
|
2745
2940
|
if (!context) {
|
|
2746
2941
|
throw new Error(
|
|
2747
2942
|
"Progress compound components cannot be rendered outside the Progress.Root component"
|
|
@@ -2755,7 +2950,7 @@ function defaultGetValueLabel(value, max) {
|
|
|
2755
2950
|
function isValidValueNumber(value, max) {
|
|
2756
2951
|
return typeof value === "number" && !isNaN(value) && value <= max && value >= 0;
|
|
2757
2952
|
}
|
|
2758
|
-
var Root19 =
|
|
2953
|
+
var Root19 = React21.forwardRef(function Root20({ asChild, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, ...props }, ref) {
|
|
2759
2954
|
const max = maxProp ?? DEFAULT_MAX;
|
|
2760
2955
|
const isIndeterminate = valueProp === null || valueProp === void 0;
|
|
2761
2956
|
const value = isIndeterminate ? null : isValidValueNumber(valueProp, max) ? valueProp : 0;
|
|
@@ -2774,7 +2969,7 @@ var Root19 = React20.forwardRef(function Root20({ asChild, value: valueProp, max
|
|
|
2774
2969
|
) });
|
|
2775
2970
|
});
|
|
2776
2971
|
Root19.displayName = "ProgressRoot";
|
|
2777
|
-
var Indicator3 =
|
|
2972
|
+
var Indicator3 = React21.forwardRef(function Indicator4({ asChild, ...props }, ref) {
|
|
2778
2973
|
useRootContext12();
|
|
2779
2974
|
const Component = asChild ? Slot : View13;
|
|
2780
2975
|
return /* @__PURE__ */ jsx18(Component, { ref, ...props });
|
|
@@ -2788,10 +2983,10 @@ __export(toggle_exports, {
|
|
|
2788
2983
|
});
|
|
2789
2984
|
|
|
2790
2985
|
// src/toggle/toggle.tsx
|
|
2791
|
-
import * as
|
|
2986
|
+
import * as React22 from "react";
|
|
2792
2987
|
import { Pressable as Pressable11 } from "react-native";
|
|
2793
2988
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2794
|
-
var Root21 =
|
|
2989
|
+
var Root21 = React22.forwardRef(function Root22({
|
|
2795
2990
|
asChild,
|
|
2796
2991
|
pressed: pressedProp,
|
|
2797
2992
|
defaultPressed,
|
|
@@ -2805,7 +3000,7 @@ var Root21 = React21.forwardRef(function Root22({
|
|
|
2805
3000
|
defaultProp: defaultPressed,
|
|
2806
3001
|
onChange: onPressedChangeProp
|
|
2807
3002
|
});
|
|
2808
|
-
const onPress =
|
|
3003
|
+
const onPress = React22.useCallback(
|
|
2809
3004
|
(ev) => {
|
|
2810
3005
|
if (disabled) return;
|
|
2811
3006
|
setPressed((prev) => !prev);
|
|
@@ -2840,12 +3035,12 @@ __export(radio_group_exports, {
|
|
|
2840
3035
|
});
|
|
2841
3036
|
|
|
2842
3037
|
// src/radio-group/radio-group.tsx
|
|
2843
|
-
import * as
|
|
3038
|
+
import * as React23 from "react";
|
|
2844
3039
|
import { Pressable as Pressable12, View as View15 } from "react-native";
|
|
2845
3040
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2846
|
-
var RootContext13 =
|
|
3041
|
+
var RootContext13 = React23.createContext(null);
|
|
2847
3042
|
function useRootContext13() {
|
|
2848
|
-
const context =
|
|
3043
|
+
const context = React23.useContext(RootContext13);
|
|
2849
3044
|
if (!context) {
|
|
2850
3045
|
throw new Error(
|
|
2851
3046
|
"RadioGroup compound components cannot be rendered outside the RadioGroup.Root component"
|
|
@@ -2853,9 +3048,9 @@ function useRootContext13() {
|
|
|
2853
3048
|
}
|
|
2854
3049
|
return context;
|
|
2855
3050
|
}
|
|
2856
|
-
var ItemContext4 =
|
|
3051
|
+
var ItemContext4 = React23.createContext(null);
|
|
2857
3052
|
function useItemContext4() {
|
|
2858
|
-
const context =
|
|
3053
|
+
const context = React23.useContext(ItemContext4);
|
|
2859
3054
|
if (!context) {
|
|
2860
3055
|
throw new Error(
|
|
2861
3056
|
"RadioGroup.Indicator must be rendered inside a RadioGroup.Item component"
|
|
@@ -2863,7 +3058,7 @@ function useItemContext4() {
|
|
|
2863
3058
|
}
|
|
2864
3059
|
return context;
|
|
2865
3060
|
}
|
|
2866
|
-
var Root23 =
|
|
3061
|
+
var Root23 = React23.forwardRef(function Root24({
|
|
2867
3062
|
asChild,
|
|
2868
3063
|
value: valueProp,
|
|
2869
3064
|
defaultValue,
|
|
@@ -2876,7 +3071,7 @@ var Root23 = React22.forwardRef(function Root24({
|
|
|
2876
3071
|
defaultProp: defaultValue,
|
|
2877
3072
|
onChange: onValueChangeProp
|
|
2878
3073
|
});
|
|
2879
|
-
const onValueChange =
|
|
3074
|
+
const onValueChange = React23.useCallback(
|
|
2880
3075
|
(itemValue) => {
|
|
2881
3076
|
setValue(itemValue);
|
|
2882
3077
|
},
|
|
@@ -2886,7 +3081,7 @@ var Root23 = React22.forwardRef(function Root24({
|
|
|
2886
3081
|
return /* @__PURE__ */ jsx20(RootContext13.Provider, { value: { value, disabled, onValueChange }, children: /* @__PURE__ */ jsx20(Component, { ref, role: "radiogroup", ...props }) });
|
|
2887
3082
|
});
|
|
2888
3083
|
Root23.displayName = "RadioGroupRoot";
|
|
2889
|
-
var Item10 =
|
|
3084
|
+
var Item10 = React23.forwardRef(function Item11({
|
|
2890
3085
|
asChild,
|
|
2891
3086
|
value: itemValue,
|
|
2892
3087
|
disabled: disabledProp = false,
|
|
@@ -2896,7 +3091,7 @@ var Item10 = React22.forwardRef(function Item11({
|
|
|
2896
3091
|
const { disabled: rootDisabled, value: rootValue, onValueChange } = useRootContext13();
|
|
2897
3092
|
const isDisabled = rootDisabled || disabledProp;
|
|
2898
3093
|
const checked = rootValue === itemValue;
|
|
2899
|
-
const onPress =
|
|
3094
|
+
const onPress = React23.useCallback(
|
|
2900
3095
|
(ev) => {
|
|
2901
3096
|
if (isDisabled) return;
|
|
2902
3097
|
onValueChange(itemValue);
|
|
@@ -2919,7 +3114,7 @@ var Item10 = React22.forwardRef(function Item11({
|
|
|
2919
3114
|
) });
|
|
2920
3115
|
});
|
|
2921
3116
|
Item10.displayName = "RadioGroupItem";
|
|
2922
|
-
var Indicator5 =
|
|
3117
|
+
var Indicator5 = React23.forwardRef(function Indicator6({ asChild, forceMount, ...props }, ref) {
|
|
2923
3118
|
const { checked, disabled } = useItemContext4();
|
|
2924
3119
|
if (!forceMount && !checked) {
|
|
2925
3120
|
return null;
|
|
@@ -2947,12 +3142,12 @@ __export(toggle_group_exports, {
|
|
|
2947
3142
|
});
|
|
2948
3143
|
|
|
2949
3144
|
// src/toggle-group/toggle-group.tsx
|
|
2950
|
-
import * as
|
|
3145
|
+
import * as React24 from "react";
|
|
2951
3146
|
import { Pressable as Pressable13, View as View16 } from "react-native";
|
|
2952
3147
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2953
|
-
var RootContext14 =
|
|
3148
|
+
var RootContext14 = React24.createContext(null);
|
|
2954
3149
|
function useRootContext14() {
|
|
2955
|
-
const context =
|
|
3150
|
+
const context = React24.useContext(RootContext14);
|
|
2956
3151
|
if (!context) {
|
|
2957
3152
|
throw new Error(
|
|
2958
3153
|
"ToggleGroup compound components cannot be rendered outside the ToggleGroup.Root component"
|
|
@@ -2960,7 +3155,7 @@ function useRootContext14() {
|
|
|
2960
3155
|
}
|
|
2961
3156
|
return context;
|
|
2962
3157
|
}
|
|
2963
|
-
var Root25 =
|
|
3158
|
+
var Root25 = React24.forwardRef(function Root26({
|
|
2964
3159
|
asChild,
|
|
2965
3160
|
type,
|
|
2966
3161
|
value: valueProp,
|
|
@@ -2974,7 +3169,7 @@ var Root25 = React23.forwardRef(function Root26({
|
|
|
2974
3169
|
defaultProp: defaultValue,
|
|
2975
3170
|
onChange: onValueChangeProp
|
|
2976
3171
|
});
|
|
2977
|
-
const onValueChange =
|
|
3172
|
+
const onValueChange = React24.useCallback(
|
|
2978
3173
|
(newValue) => {
|
|
2979
3174
|
setValue(newValue);
|
|
2980
3175
|
},
|
|
@@ -2984,7 +3179,7 @@ var Root25 = React23.forwardRef(function Root26({
|
|
|
2984
3179
|
return /* @__PURE__ */ jsx21(RootContext14.Provider, { value: { type, value, disabled, onValueChange }, children: /* @__PURE__ */ jsx21(Component, { ref, role: "group", ...props }) });
|
|
2985
3180
|
});
|
|
2986
3181
|
Root25.displayName = "ToggleGroupRoot";
|
|
2987
|
-
var Item12 =
|
|
3182
|
+
var Item12 = React24.forwardRef(function Item13({
|
|
2988
3183
|
asChild,
|
|
2989
3184
|
value: itemValue,
|
|
2990
3185
|
disabled: disabledProp = false,
|
|
@@ -2994,7 +3189,7 @@ var Item12 = React23.forwardRef(function Item13({
|
|
|
2994
3189
|
const { type, disabled: rootDisabled, value, onValueChange } = useRootContext14();
|
|
2995
3190
|
const isDisabled = rootDisabled || disabledProp;
|
|
2996
3191
|
const isSelected = toggleGroupUtils.getIsSelected(value, itemValue);
|
|
2997
|
-
const onPress =
|
|
3192
|
+
const onPress = React24.useCallback(
|
|
2998
3193
|
(ev) => {
|
|
2999
3194
|
if (isDisabled) return;
|
|
3000
3195
|
if (type === "single") {
|
|
@@ -3034,12 +3229,12 @@ __export(collapsible_exports, {
|
|
|
3034
3229
|
});
|
|
3035
3230
|
|
|
3036
3231
|
// src/collapsible/collapsible.tsx
|
|
3037
|
-
import * as
|
|
3232
|
+
import * as React25 from "react";
|
|
3038
3233
|
import { Pressable as Pressable14, View as View17 } from "react-native";
|
|
3039
3234
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3040
|
-
var RootContext15 =
|
|
3235
|
+
var RootContext15 = React25.createContext(null);
|
|
3041
3236
|
function useRootContext15() {
|
|
3042
|
-
const context =
|
|
3237
|
+
const context = React25.useContext(RootContext15);
|
|
3043
3238
|
if (!context) {
|
|
3044
3239
|
throw new Error(
|
|
3045
3240
|
"Collapsible compound components cannot be rendered outside the Collapsible.Root component"
|
|
@@ -3047,7 +3242,7 @@ function useRootContext15() {
|
|
|
3047
3242
|
}
|
|
3048
3243
|
return context;
|
|
3049
3244
|
}
|
|
3050
|
-
var Root27 =
|
|
3245
|
+
var Root27 = React25.forwardRef(function Root28({
|
|
3051
3246
|
asChild,
|
|
3052
3247
|
open: openProp,
|
|
3053
3248
|
defaultOpen,
|
|
@@ -3060,7 +3255,7 @@ var Root27 = React24.forwardRef(function Root28({
|
|
|
3060
3255
|
defaultProp: defaultOpen,
|
|
3061
3256
|
onChange: onOpenChangeProp
|
|
3062
3257
|
});
|
|
3063
|
-
const onOpenChange =
|
|
3258
|
+
const onOpenChange = React25.useCallback(
|
|
3064
3259
|
(value) => {
|
|
3065
3260
|
setOpen(value);
|
|
3066
3261
|
},
|
|
@@ -3077,10 +3272,10 @@ var Root27 = React24.forwardRef(function Root28({
|
|
|
3077
3272
|
) });
|
|
3078
3273
|
});
|
|
3079
3274
|
Root27.displayName = "CollapsibleRoot";
|
|
3080
|
-
var Trigger17 =
|
|
3275
|
+
var Trigger17 = React25.forwardRef(function Trigger18({ asChild, onPress: onPressProp, disabled: disabledProp, ...props }, ref) {
|
|
3081
3276
|
const { open, disabled: rootDisabled, onOpenChange } = useRootContext15();
|
|
3082
3277
|
const isDisabled = rootDisabled || disabledProp;
|
|
3083
|
-
const onPress =
|
|
3278
|
+
const onPress = React25.useCallback(
|
|
3084
3279
|
(ev) => {
|
|
3085
3280
|
if (isDisabled) return;
|
|
3086
3281
|
onOpenChange(!open);
|
|
@@ -3103,7 +3298,7 @@ var Trigger17 = React24.forwardRef(function Trigger18({ asChild, onPress: onPres
|
|
|
3103
3298
|
);
|
|
3104
3299
|
});
|
|
3105
3300
|
Trigger17.displayName = "CollapsibleTrigger";
|
|
3106
|
-
var Content17 =
|
|
3301
|
+
var Content17 = React25.forwardRef(function Content18({ asChild, forceMount, ...props }, ref) {
|
|
3107
3302
|
const { open } = useRootContext15();
|
|
3108
3303
|
if (!forceMount && !open) {
|
|
3109
3304
|
return null;
|
|
@@ -3133,12 +3328,12 @@ __export(accordion_exports, {
|
|
|
3133
3328
|
});
|
|
3134
3329
|
|
|
3135
3330
|
// src/accordion/accordion.tsx
|
|
3136
|
-
import * as
|
|
3331
|
+
import * as React26 from "react";
|
|
3137
3332
|
import { Pressable as Pressable15, View as View18 } from "react-native";
|
|
3138
3333
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3139
|
-
var RootContext16 =
|
|
3334
|
+
var RootContext16 = React26.createContext(null);
|
|
3140
3335
|
function useRootContext16() {
|
|
3141
|
-
const context =
|
|
3336
|
+
const context = React26.useContext(RootContext16);
|
|
3142
3337
|
if (!context) {
|
|
3143
3338
|
throw new Error(
|
|
3144
3339
|
"Accordion compound components cannot be rendered outside the Accordion.Root component"
|
|
@@ -3146,9 +3341,9 @@ function useRootContext16() {
|
|
|
3146
3341
|
}
|
|
3147
3342
|
return context;
|
|
3148
3343
|
}
|
|
3149
|
-
var ItemContext5 =
|
|
3344
|
+
var ItemContext5 = React26.createContext(null);
|
|
3150
3345
|
function useItemContext5() {
|
|
3151
|
-
const context =
|
|
3346
|
+
const context = React26.useContext(ItemContext5);
|
|
3152
3347
|
if (!context) {
|
|
3153
3348
|
throw new Error(
|
|
3154
3349
|
"Accordion.Item compound components cannot be rendered outside the Accordion.Item component"
|
|
@@ -3160,7 +3355,7 @@ function isItemExpanded(rootValue, itemValue) {
|
|
|
3160
3355
|
if (rootValue === void 0) return false;
|
|
3161
3356
|
return Array.isArray(rootValue) ? rootValue.includes(itemValue) : rootValue === itemValue;
|
|
3162
3357
|
}
|
|
3163
|
-
var Root29 =
|
|
3358
|
+
var Root29 = React26.forwardRef(function Root30({
|
|
3164
3359
|
asChild,
|
|
3165
3360
|
type,
|
|
3166
3361
|
value: valueProp,
|
|
@@ -3176,7 +3371,7 @@ var Root29 = React25.forwardRef(function Root30({
|
|
|
3176
3371
|
defaultProp: defaultValue,
|
|
3177
3372
|
onChange: onValueChangeProp
|
|
3178
3373
|
});
|
|
3179
|
-
const onValueChange =
|
|
3374
|
+
const onValueChange = React26.useCallback(
|
|
3180
3375
|
(newValue) => {
|
|
3181
3376
|
setValue(newValue);
|
|
3182
3377
|
},
|
|
@@ -3192,7 +3387,7 @@ var Root29 = React25.forwardRef(function Root30({
|
|
|
3192
3387
|
);
|
|
3193
3388
|
});
|
|
3194
3389
|
Root29.displayName = "AccordionRoot";
|
|
3195
|
-
var Item14 =
|
|
3390
|
+
var Item14 = React26.forwardRef(function Item15({ asChild, value: itemValue, disabled: disabledProp = false, ...props }, ref) {
|
|
3196
3391
|
const { value: rootValue, disabled: rootDisabled } = useRootContext16();
|
|
3197
3392
|
const expanded = isItemExpanded(rootValue, itemValue);
|
|
3198
3393
|
const isDisabled = rootDisabled || disabledProp;
|
|
@@ -3206,16 +3401,16 @@ var Item14 = React25.forwardRef(function Item15({ asChild, value: itemValue, dis
|
|
|
3206
3401
|
);
|
|
3207
3402
|
});
|
|
3208
3403
|
Item14.displayName = "AccordionItem";
|
|
3209
|
-
var Header =
|
|
3404
|
+
var Header = React26.forwardRef(function Header2({ asChild, ...props }, ref) {
|
|
3210
3405
|
const Component = asChild ? Slot : View18;
|
|
3211
3406
|
return /* @__PURE__ */ jsx23(Component, { ref, role: "heading", ...props });
|
|
3212
3407
|
});
|
|
3213
3408
|
Header.displayName = "AccordionHeader";
|
|
3214
|
-
var Trigger19 =
|
|
3409
|
+
var Trigger19 = React26.forwardRef(function Trigger20({ asChild, onPress: onPressProp, disabled: disabledProp, ...props }, ref) {
|
|
3215
3410
|
const { type, collapsible, onValueChange, value: rootValue } = useRootContext16();
|
|
3216
3411
|
const { value: itemValue, isExpanded, disabled: itemDisabled } = useItemContext5();
|
|
3217
3412
|
const isDisabled = itemDisabled || disabledProp;
|
|
3218
|
-
const onPress =
|
|
3413
|
+
const onPress = React26.useCallback(
|
|
3219
3414
|
(ev) => {
|
|
3220
3415
|
if (isDisabled) return;
|
|
3221
3416
|
if (type === "single") {
|
|
@@ -3251,7 +3446,7 @@ var Trigger19 = React25.forwardRef(function Trigger20({ asChild, onPress: onPres
|
|
|
3251
3446
|
);
|
|
3252
3447
|
});
|
|
3253
3448
|
Trigger19.displayName = "AccordionTrigger";
|
|
3254
|
-
var Content19 =
|
|
3449
|
+
var Content19 = React26.forwardRef(function Content20({ asChild, forceMount, ...props }, ref) {
|
|
3255
3450
|
const { isExpanded } = useItemContext5();
|
|
3256
3451
|
if (!forceMount && !isExpanded) {
|
|
3257
3452
|
return null;
|
|
@@ -3279,7 +3474,7 @@ __export(slider_exports, {
|
|
|
3279
3474
|
});
|
|
3280
3475
|
|
|
3281
3476
|
// src/slider/slider.tsx
|
|
3282
|
-
import * as
|
|
3477
|
+
import * as React27 from "react";
|
|
3283
3478
|
import { Pressable as Pressable16, View as View19 } from "react-native";
|
|
3284
3479
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3285
3480
|
var DEFAULT_MIN = 0;
|
|
@@ -3297,11 +3492,11 @@ function snapValue(raw, min, max, step) {
|
|
|
3297
3492
|
if (max - clamped < Math.abs(clamped - snapped)) return max;
|
|
3298
3493
|
return Number(snapped.toFixed(Math.max(decimalsOf(step), decimalsOf(min))));
|
|
3299
3494
|
}
|
|
3300
|
-
var RootContext17 =
|
|
3301
|
-
var InternalContext4 =
|
|
3495
|
+
var RootContext17 = React27.createContext(null);
|
|
3496
|
+
var InternalContext4 = React27.createContext(() => {
|
|
3302
3497
|
});
|
|
3303
3498
|
function useRootContext17() {
|
|
3304
|
-
const context =
|
|
3499
|
+
const context = React27.useContext(RootContext17);
|
|
3305
3500
|
if (!context) {
|
|
3306
3501
|
throw new Error(
|
|
3307
3502
|
"Slider compound components cannot be rendered outside the Slider.Root component"
|
|
@@ -3309,7 +3504,7 @@ function useRootContext17() {
|
|
|
3309
3504
|
}
|
|
3310
3505
|
return context;
|
|
3311
3506
|
}
|
|
3312
|
-
var Root31 =
|
|
3507
|
+
var Root31 = React27.forwardRef(function Root32({
|
|
3313
3508
|
asChild,
|
|
3314
3509
|
value: valueProp,
|
|
3315
3510
|
defaultValue,
|
|
@@ -3325,19 +3520,19 @@ var Root31 = React26.forwardRef(function Root32({
|
|
|
3325
3520
|
defaultProp: defaultValue,
|
|
3326
3521
|
onChange: onValueChangeProp
|
|
3327
3522
|
});
|
|
3328
|
-
const onValueChange =
|
|
3523
|
+
const onValueChange = React27.useCallback(
|
|
3329
3524
|
(newValue) => {
|
|
3330
3525
|
setValue(newValue);
|
|
3331
3526
|
},
|
|
3332
3527
|
[setValue]
|
|
3333
3528
|
);
|
|
3334
3529
|
const percent = max > min ? (Math.min(max, Math.max(min, value)) - min) / (max - min) * 100 : 0;
|
|
3335
|
-
const valueRef =
|
|
3530
|
+
const valueRef = React27.useRef(value);
|
|
3336
3531
|
valueRef.current = value;
|
|
3337
|
-
const rootRef =
|
|
3338
|
-
const composedRef =
|
|
3339
|
-
const rectRef =
|
|
3340
|
-
const pointerXRef =
|
|
3532
|
+
const rootRef = React27.useRef(null);
|
|
3533
|
+
const composedRef = React27.useMemo(() => composeRefs(ref, rootRef), [ref]);
|
|
3534
|
+
const rectRef = React27.useRef(null);
|
|
3535
|
+
const pointerXRef = React27.useRef(0);
|
|
3341
3536
|
const commitValue = (raw) => {
|
|
3342
3537
|
if (disabled) return;
|
|
3343
3538
|
const next = snapValue(raw, min, max, step);
|
|
@@ -3400,21 +3595,21 @@ var Root31 = React26.forwardRef(function Root32({
|
|
|
3400
3595
|
return /* @__PURE__ */ jsx24(RootContext17.Provider, { value: { value, min, max, step, disabled, onValueChange, percent }, children: /* @__PURE__ */ jsx24(InternalContext4.Provider, { value: onKeyDown, children: /* @__PURE__ */ jsx24(Component, { ref: composedRef, role: "group", ...responderProps, ...props }) }) });
|
|
3401
3596
|
});
|
|
3402
3597
|
Root31.displayName = "SliderRoot";
|
|
3403
|
-
var Track =
|
|
3598
|
+
var Track = React27.forwardRef(function Track2({ asChild, ...props }, ref) {
|
|
3404
3599
|
useRootContext17();
|
|
3405
3600
|
const Component = asChild ? Slot : View19;
|
|
3406
3601
|
return /* @__PURE__ */ jsx24(Component, { ref, ...props });
|
|
3407
3602
|
});
|
|
3408
3603
|
Track.displayName = "SliderTrack";
|
|
3409
|
-
var Range =
|
|
3604
|
+
var Range = React27.forwardRef(function Range2({ asChild, style, ...props }, ref) {
|
|
3410
3605
|
const { percent } = useRootContext17();
|
|
3411
3606
|
const Component = asChild ? Slot : View19;
|
|
3412
3607
|
return /* @__PURE__ */ jsx24(Component, { ref, style: [{ width: `${percent}%` }, style], ...props });
|
|
3413
3608
|
});
|
|
3414
3609
|
Range.displayName = "SliderRange";
|
|
3415
|
-
var Thumb3 =
|
|
3610
|
+
var Thumb3 = React27.forwardRef(function Thumb4({ asChild, ...props }, ref) {
|
|
3416
3611
|
const { value, min, max, disabled, percent } = useRootContext17();
|
|
3417
|
-
const onKeyDown =
|
|
3612
|
+
const onKeyDown = React27.useContext(InternalContext4);
|
|
3418
3613
|
const Component = asChild ? Slot : Pressable16;
|
|
3419
3614
|
const merged = mergeProps(
|
|
3420
3615
|
{ style: { position: "absolute", left: `${percent}%` }, onKeyDown },
|
|
@@ -3448,12 +3643,12 @@ __export(toast_exports, {
|
|
|
3448
3643
|
});
|
|
3449
3644
|
|
|
3450
3645
|
// src/toast/toast.tsx
|
|
3451
|
-
import * as
|
|
3646
|
+
import * as React28 from "react";
|
|
3452
3647
|
import { Pressable as Pressable17, Text as Text8, View as View20 } from "react-native";
|
|
3453
3648
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3454
|
-
var RootContext18 =
|
|
3649
|
+
var RootContext18 = React28.createContext(null);
|
|
3455
3650
|
function useRootContext18() {
|
|
3456
|
-
const context =
|
|
3651
|
+
const context = React28.useContext(RootContext18);
|
|
3457
3652
|
if (!context) {
|
|
3458
3653
|
throw new Error(
|
|
3459
3654
|
"Toast compound components cannot be rendered outside the Toast.Root component"
|
|
@@ -3461,7 +3656,7 @@ function useRootContext18() {
|
|
|
3461
3656
|
}
|
|
3462
3657
|
return context;
|
|
3463
3658
|
}
|
|
3464
|
-
var Root33 =
|
|
3659
|
+
var Root33 = React28.forwardRef(function Root34({
|
|
3465
3660
|
asChild,
|
|
3466
3661
|
open: openProp,
|
|
3467
3662
|
defaultOpen,
|
|
@@ -3474,7 +3669,7 @@ var Root33 = React27.forwardRef(function Root34({
|
|
|
3474
3669
|
defaultProp: defaultOpen,
|
|
3475
3670
|
onChange: onOpenChangeProp
|
|
3476
3671
|
});
|
|
3477
|
-
const onOpenChange =
|
|
3672
|
+
const onOpenChange = React28.useCallback(
|
|
3478
3673
|
(value) => {
|
|
3479
3674
|
setOpen(value);
|
|
3480
3675
|
},
|
|
@@ -3495,19 +3690,19 @@ var Root33 = React27.forwardRef(function Root34({
|
|
|
3495
3690
|
) });
|
|
3496
3691
|
});
|
|
3497
3692
|
Root33.displayName = "ToastRoot";
|
|
3498
|
-
var Title5 =
|
|
3693
|
+
var Title5 = React28.forwardRef(function Title6({ asChild, ...props }, ref) {
|
|
3499
3694
|
useRootContext18();
|
|
3500
3695
|
const Component = asChild ? Slot : Text8;
|
|
3501
3696
|
return /* @__PURE__ */ jsx25(Component, { ref, ...props });
|
|
3502
3697
|
});
|
|
3503
3698
|
Title5.displayName = "ToastTitle";
|
|
3504
|
-
var Description5 =
|
|
3699
|
+
var Description5 = React28.forwardRef(function Description6({ asChild, ...props }, ref) {
|
|
3505
3700
|
useRootContext18();
|
|
3506
3701
|
const Component = asChild ? Slot : Text8;
|
|
3507
3702
|
return /* @__PURE__ */ jsx25(Component, { ref, ...props });
|
|
3508
3703
|
});
|
|
3509
3704
|
Description5.displayName = "ToastDescription";
|
|
3510
|
-
var Action3 =
|
|
3705
|
+
var Action3 = React28.forwardRef(function Action4({
|
|
3511
3706
|
asChild,
|
|
3512
3707
|
altText: _altText,
|
|
3513
3708
|
disabled = false,
|
|
@@ -3515,7 +3710,7 @@ var Action3 = React27.forwardRef(function Action4({
|
|
|
3515
3710
|
...props
|
|
3516
3711
|
}, ref) {
|
|
3517
3712
|
useRootContext18();
|
|
3518
|
-
const onPress =
|
|
3713
|
+
const onPress = React28.useCallback(
|
|
3519
3714
|
(ev) => {
|
|
3520
3715
|
if (disabled) return;
|
|
3521
3716
|
onPressProp?.(ev);
|
|
@@ -3536,14 +3731,14 @@ var Action3 = React27.forwardRef(function Action4({
|
|
|
3536
3731
|
);
|
|
3537
3732
|
});
|
|
3538
3733
|
Action3.displayName = "ToastAction";
|
|
3539
|
-
var Close5 =
|
|
3734
|
+
var Close5 = React28.forwardRef(function Close6({
|
|
3540
3735
|
asChild,
|
|
3541
3736
|
disabled = false,
|
|
3542
3737
|
onPress: onPressProp,
|
|
3543
3738
|
...props
|
|
3544
3739
|
}, ref) {
|
|
3545
3740
|
const { onOpenChange } = useRootContext18();
|
|
3546
|
-
const onPress =
|
|
3741
|
+
const onPress = React28.useCallback(
|
|
3547
3742
|
(ev) => {
|
|
3548
3743
|
if (disabled) return;
|
|
3549
3744
|
onOpenChange(false);
|
|
@@ -3578,15 +3773,15 @@ __export(tooltip_exports, {
|
|
|
3578
3773
|
});
|
|
3579
3774
|
|
|
3580
3775
|
// src/tooltip/tooltip.tsx
|
|
3581
|
-
import * as
|
|
3776
|
+
import * as React29 from "react";
|
|
3582
3777
|
import {
|
|
3583
3778
|
Pressable as Pressable18,
|
|
3584
3779
|
View as View21
|
|
3585
3780
|
} from "react-native";
|
|
3586
3781
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3587
|
-
var InternalContext5 =
|
|
3782
|
+
var InternalContext5 = React29.createContext(null);
|
|
3588
3783
|
function useInternalContext4() {
|
|
3589
|
-
const context =
|
|
3784
|
+
const context = React29.useContext(InternalContext5);
|
|
3590
3785
|
if (!context) {
|
|
3591
3786
|
throw new Error(
|
|
3592
3787
|
"Tooltip compound components cannot be rendered outside the Tooltip.Root component"
|
|
@@ -3594,9 +3789,9 @@ function useInternalContext4() {
|
|
|
3594
3789
|
}
|
|
3595
3790
|
return context;
|
|
3596
3791
|
}
|
|
3597
|
-
var RootContext19 =
|
|
3792
|
+
var RootContext19 = React29.createContext(null);
|
|
3598
3793
|
function useRootContext19() {
|
|
3599
|
-
const context =
|
|
3794
|
+
const context = React29.useContext(RootContext19);
|
|
3600
3795
|
if (!context) {
|
|
3601
3796
|
throw new Error(
|
|
3602
3797
|
"Tooltip compound components cannot be rendered outside the Tooltip.Root component"
|
|
@@ -3611,14 +3806,14 @@ function Root35({
|
|
|
3611
3806
|
delayDuration = 0,
|
|
3612
3807
|
children
|
|
3613
3808
|
}) {
|
|
3614
|
-
const nativeID =
|
|
3809
|
+
const nativeID = React29.useId();
|
|
3615
3810
|
const [open = false, onOpenChange] = useControllableState({
|
|
3616
3811
|
prop: openProp,
|
|
3617
3812
|
defaultProp: defaultOpen,
|
|
3618
3813
|
onChange: onOpenChangeProp
|
|
3619
3814
|
});
|
|
3620
|
-
const [triggerPosition, setTriggerPosition] =
|
|
3621
|
-
const [contentLayout, setContentLayout] =
|
|
3815
|
+
const [triggerPosition, setTriggerPosition] = React29.useState(null);
|
|
3816
|
+
const [contentLayout, setContentLayout] = React29.useState(null);
|
|
3622
3817
|
return /* @__PURE__ */ jsx26(InternalContext5.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx26(
|
|
3623
3818
|
RootContext19.Provider,
|
|
3624
3819
|
{
|
|
@@ -3636,7 +3831,7 @@ function Root35({
|
|
|
3636
3831
|
) });
|
|
3637
3832
|
}
|
|
3638
3833
|
Root35.displayName = "TooltipRoot";
|
|
3639
|
-
var Trigger21 =
|
|
3834
|
+
var Trigger21 = React29.forwardRef(function Trigger22({
|
|
3640
3835
|
asChild,
|
|
3641
3836
|
openOnPress = false,
|
|
3642
3837
|
onPress: onPressProp,
|
|
@@ -3651,20 +3846,18 @@ var Trigger21 = React28.forwardRef(function Trigger22({
|
|
|
3651
3846
|
...props
|
|
3652
3847
|
}, ref) {
|
|
3653
3848
|
const { open, onOpenChange, delayDuration, setTriggerPosition } = useRootContext19();
|
|
3654
|
-
const delayTimer =
|
|
3655
|
-
const clearDelay =
|
|
3849
|
+
const delayTimer = React29.useRef(null);
|
|
3850
|
+
const clearDelay = React29.useCallback(() => {
|
|
3656
3851
|
if (delayTimer.current !== null) clearTimeout(delayTimer.current);
|
|
3657
3852
|
delayTimer.current = null;
|
|
3658
3853
|
}, []);
|
|
3659
|
-
|
|
3854
|
+
React29.useEffect(() => clearDelay, [clearDelay]);
|
|
3660
3855
|
const augmentedRef = useAugmentedRef({
|
|
3661
3856
|
ref,
|
|
3662
3857
|
methods: {
|
|
3663
3858
|
open: () => {
|
|
3664
3859
|
onOpenChange(true);
|
|
3665
|
-
augmentedRef.current
|
|
3666
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
3667
|
-
});
|
|
3860
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
3668
3861
|
},
|
|
3669
3862
|
close: () => {
|
|
3670
3863
|
setTriggerPosition(null);
|
|
@@ -3672,15 +3865,13 @@ var Trigger21 = React28.forwardRef(function Trigger22({
|
|
|
3672
3865
|
}
|
|
3673
3866
|
}
|
|
3674
3867
|
});
|
|
3675
|
-
const show =
|
|
3868
|
+
const show = React29.useCallback(() => {
|
|
3676
3869
|
clearDelay();
|
|
3677
3870
|
if (disabled) return;
|
|
3678
|
-
augmentedRef.current
|
|
3679
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
3680
|
-
});
|
|
3871
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
3681
3872
|
onOpenChange(true);
|
|
3682
3873
|
}, [augmentedRef, clearDelay, disabled, onOpenChange, setTriggerPosition]);
|
|
3683
|
-
const hide =
|
|
3874
|
+
const hide = React29.useCallback(() => {
|
|
3684
3875
|
if (!open) return;
|
|
3685
3876
|
setTriggerPosition(null);
|
|
3686
3877
|
onOpenChange(false);
|
|
@@ -3699,48 +3890,48 @@ var Trigger21 = React28.forwardRef(function Trigger22({
|
|
|
3699
3890
|
hide();
|
|
3700
3891
|
onHoverOutProp?.(ev);
|
|
3701
3892
|
};
|
|
3702
|
-
const hoverHandlers =
|
|
3703
|
-
|
|
3893
|
+
const hoverHandlers = React29.useRef({ handleHoverIn, handleHoverOut });
|
|
3894
|
+
React29.useLayoutEffect(() => {
|
|
3704
3895
|
hoverHandlers.current = { handleHoverIn, handleHoverOut };
|
|
3705
3896
|
});
|
|
3706
|
-
const onHoverIn =
|
|
3897
|
+
const onHoverIn = React29.useCallback(
|
|
3707
3898
|
(ev) => hoverHandlers.current.handleHoverIn(ev),
|
|
3708
3899
|
[]
|
|
3709
3900
|
);
|
|
3710
|
-
const onHoverOut =
|
|
3901
|
+
const onHoverOut = React29.useCallback(
|
|
3711
3902
|
(ev) => hoverHandlers.current.handleHoverOut(ev),
|
|
3712
3903
|
[]
|
|
3713
3904
|
);
|
|
3714
|
-
const pressing =
|
|
3715
|
-
const onPointerDown =
|
|
3905
|
+
const pressing = React29.useRef(false);
|
|
3906
|
+
const onPointerDown = React29.useCallback(
|
|
3716
3907
|
(ev) => {
|
|
3717
3908
|
pressing.current = true;
|
|
3718
3909
|
onPointerDownProp?.(ev);
|
|
3719
3910
|
},
|
|
3720
3911
|
[onPointerDownProp]
|
|
3721
3912
|
);
|
|
3722
|
-
const onPointerUp =
|
|
3913
|
+
const onPointerUp = React29.useCallback(
|
|
3723
3914
|
(ev) => {
|
|
3724
3915
|
pressing.current = false;
|
|
3725
3916
|
onPointerUpProp?.(ev);
|
|
3726
3917
|
},
|
|
3727
3918
|
[onPointerUpProp]
|
|
3728
3919
|
);
|
|
3729
|
-
const onPressOut =
|
|
3920
|
+
const onPressOut = React29.useCallback(
|
|
3730
3921
|
(ev) => {
|
|
3731
3922
|
pressing.current = false;
|
|
3732
3923
|
onPressOutProp?.(ev);
|
|
3733
3924
|
},
|
|
3734
3925
|
[onPressOutProp]
|
|
3735
3926
|
);
|
|
3736
|
-
const onFocus =
|
|
3927
|
+
const onFocus = React29.useCallback(
|
|
3737
3928
|
(ev) => {
|
|
3738
3929
|
if (!pressing.current) show();
|
|
3739
3930
|
onFocusProp?.(ev);
|
|
3740
3931
|
},
|
|
3741
3932
|
[onFocusProp, show]
|
|
3742
3933
|
);
|
|
3743
|
-
const onBlur =
|
|
3934
|
+
const onBlur = React29.useCallback(
|
|
3744
3935
|
(ev) => {
|
|
3745
3936
|
pressing.current = false;
|
|
3746
3937
|
hide();
|
|
@@ -3748,7 +3939,7 @@ var Trigger21 = React28.forwardRef(function Trigger22({
|
|
|
3748
3939
|
},
|
|
3749
3940
|
[hide, onBlurProp]
|
|
3750
3941
|
);
|
|
3751
|
-
const onPress =
|
|
3942
|
+
const onPress = React29.useCallback(
|
|
3752
3943
|
(ev) => {
|
|
3753
3944
|
clearDelay();
|
|
3754
3945
|
if (openOnPress && !open) {
|
|
@@ -3790,9 +3981,9 @@ function Portal9({ forceMount, hostName, children }) {
|
|
|
3790
3981
|
return /* @__PURE__ */ jsx26(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx26(InternalContext5.Provider, { value: internalValue, children: /* @__PURE__ */ jsx26(RootContext19.Provider, { value: rootValue, children }) }) });
|
|
3791
3982
|
}
|
|
3792
3983
|
Portal9.displayName = "TooltipPortal";
|
|
3793
|
-
var Overlay13 =
|
|
3984
|
+
var Overlay13 = React29.forwardRef(function Overlay14({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
3794
3985
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext19();
|
|
3795
|
-
const onPress =
|
|
3986
|
+
const onPress = React29.useCallback(
|
|
3796
3987
|
(ev) => {
|
|
3797
3988
|
if (closeOnPress) {
|
|
3798
3989
|
setTriggerPosition(null);
|
|
@@ -3810,7 +4001,7 @@ var Overlay13 = React28.forwardRef(function Overlay14({ asChild, forceMount, onP
|
|
|
3810
4001
|
return /* @__PURE__ */ jsx26(Component, { ref, onPress, ...props });
|
|
3811
4002
|
});
|
|
3812
4003
|
Overlay13.displayName = "TooltipOverlay";
|
|
3813
|
-
var Content21 =
|
|
4004
|
+
var Content21 = React29.forwardRef(function Content22({
|
|
3814
4005
|
asChild,
|
|
3815
4006
|
forceMount,
|
|
3816
4007
|
align = "center",
|
|
@@ -3837,7 +4028,7 @@ var Content21 = React28.forwardRef(function Content22({
|
|
|
3837
4028
|
side,
|
|
3838
4029
|
disablePositioningStyle
|
|
3839
4030
|
});
|
|
3840
|
-
const onLayout =
|
|
4031
|
+
const onLayout = React29.useCallback(
|
|
3841
4032
|
(event) => {
|
|
3842
4033
|
setContentLayout(event.nativeEvent.layout);
|
|
3843
4034
|
onLayoutProp?.(event);
|
|
@@ -3874,15 +4065,15 @@ __export(hover_card_exports, {
|
|
|
3874
4065
|
});
|
|
3875
4066
|
|
|
3876
4067
|
// src/hover-card/hover-card.tsx
|
|
3877
|
-
import * as
|
|
4068
|
+
import * as React30 from "react";
|
|
3878
4069
|
import {
|
|
3879
4070
|
Pressable as Pressable19,
|
|
3880
4071
|
View as View22
|
|
3881
4072
|
} from "react-native";
|
|
3882
4073
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3883
|
-
var InternalContext6 =
|
|
4074
|
+
var InternalContext6 = React30.createContext(null);
|
|
3884
4075
|
function useInternalContext5() {
|
|
3885
|
-
const context =
|
|
4076
|
+
const context = React30.useContext(InternalContext6);
|
|
3886
4077
|
if (!context) {
|
|
3887
4078
|
throw new Error(
|
|
3888
4079
|
"HoverCard compound components cannot be rendered outside the HoverCard.Root component"
|
|
@@ -3890,9 +4081,9 @@ function useInternalContext5() {
|
|
|
3890
4081
|
}
|
|
3891
4082
|
return context;
|
|
3892
4083
|
}
|
|
3893
|
-
var RootContext20 =
|
|
4084
|
+
var RootContext20 = React30.createContext(null);
|
|
3894
4085
|
function useRootContext20() {
|
|
3895
|
-
const context =
|
|
4086
|
+
const context = React30.useContext(RootContext20);
|
|
3896
4087
|
if (!context) {
|
|
3897
4088
|
throw new Error(
|
|
3898
4089
|
"HoverCard compound components cannot be rendered outside the HoverCard.Root component"
|
|
@@ -3901,14 +4092,14 @@ function useRootContext20() {
|
|
|
3901
4092
|
return context;
|
|
3902
4093
|
}
|
|
3903
4094
|
function Root36({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
|
|
3904
|
-
const nativeID =
|
|
4095
|
+
const nativeID = React30.useId();
|
|
3905
4096
|
const [open = false, onOpenChange] = useControllableState({
|
|
3906
4097
|
prop: openProp,
|
|
3907
4098
|
defaultProp: defaultOpen,
|
|
3908
4099
|
onChange: onOpenChangeProp
|
|
3909
4100
|
});
|
|
3910
|
-
const [triggerPosition, setTriggerPosition] =
|
|
3911
|
-
const [contentLayout, setContentLayout] =
|
|
4101
|
+
const [triggerPosition, setTriggerPosition] = React30.useState(null);
|
|
4102
|
+
const [contentLayout, setContentLayout] = React30.useState(null);
|
|
3912
4103
|
return /* @__PURE__ */ jsx27(InternalContext6.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx27(
|
|
3913
4104
|
RootContext20.Provider,
|
|
3914
4105
|
{
|
|
@@ -3925,16 +4116,14 @@ function Root36({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, c
|
|
|
3925
4116
|
) });
|
|
3926
4117
|
}
|
|
3927
4118
|
Root36.displayName = "HoverCardRoot";
|
|
3928
|
-
var Trigger23 =
|
|
4119
|
+
var Trigger23 = React30.forwardRef(function Trigger24({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
|
|
3929
4120
|
const { open, onOpenChange, setTriggerPosition } = useRootContext20();
|
|
3930
4121
|
const augmentedRef = useAugmentedRef({
|
|
3931
4122
|
ref,
|
|
3932
4123
|
methods: {
|
|
3933
4124
|
open: () => {
|
|
3934
4125
|
onOpenChange(true);
|
|
3935
|
-
augmentedRef.current
|
|
3936
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
3937
|
-
});
|
|
4126
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
3938
4127
|
},
|
|
3939
4128
|
close: () => {
|
|
3940
4129
|
setTriggerPosition(null);
|
|
@@ -3942,12 +4131,10 @@ var Trigger23 = React29.forwardRef(function Trigger24({ asChild, onPress: onPres
|
|
|
3942
4131
|
}
|
|
3943
4132
|
}
|
|
3944
4133
|
});
|
|
3945
|
-
const onPress =
|
|
4134
|
+
const onPress = React30.useCallback(
|
|
3946
4135
|
(ev) => {
|
|
3947
4136
|
if (disabled) return;
|
|
3948
|
-
augmentedRef.current
|
|
3949
|
-
setTriggerPosition({ width, pageX, pageY, height });
|
|
3950
|
-
});
|
|
4137
|
+
measureTrigger(augmentedRef.current, setTriggerPosition);
|
|
3951
4138
|
onOpenChange(!open);
|
|
3952
4139
|
onPressProp?.(ev);
|
|
3953
4140
|
},
|
|
@@ -3976,9 +4163,9 @@ function Portal10({ forceMount, hostName, children }) {
|
|
|
3976
4163
|
return /* @__PURE__ */ jsx27(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx27(InternalContext6.Provider, { value: internalValue, children: /* @__PURE__ */ jsx27(RootContext20.Provider, { value: rootValue, children }) }) });
|
|
3977
4164
|
}
|
|
3978
4165
|
Portal10.displayName = "HoverCardPortal";
|
|
3979
|
-
var Overlay15 =
|
|
4166
|
+
var Overlay15 = React30.forwardRef(function Overlay16({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
|
|
3980
4167
|
const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext20();
|
|
3981
|
-
const onPress =
|
|
4168
|
+
const onPress = React30.useCallback(
|
|
3982
4169
|
(ev) => {
|
|
3983
4170
|
if (closeOnPress) {
|
|
3984
4171
|
setTriggerPosition(null);
|
|
@@ -3996,7 +4183,7 @@ var Overlay15 = React29.forwardRef(function Overlay16({ asChild, forceMount, onP
|
|
|
3996
4183
|
return /* @__PURE__ */ jsx27(Component, { ref, onPress, ...props });
|
|
3997
4184
|
});
|
|
3998
4185
|
Overlay15.displayName = "HoverCardOverlay";
|
|
3999
|
-
var Content23 =
|
|
4186
|
+
var Content23 = React30.forwardRef(function Content24({
|
|
4000
4187
|
asChild,
|
|
4001
4188
|
forceMount,
|
|
4002
4189
|
align = "start",
|
|
@@ -4023,7 +4210,7 @@ var Content23 = React29.forwardRef(function Content24({
|
|
|
4023
4210
|
side,
|
|
4024
4211
|
disablePositioningStyle
|
|
4025
4212
|
});
|
|
4026
|
-
const onLayout =
|
|
4213
|
+
const onLayout = React30.useCallback(
|
|
4027
4214
|
(event) => {
|
|
4028
4215
|
setContentLayout(event.nativeEvent.layout);
|
|
4029
4216
|
onLayoutProp?.(event);
|
|
@@ -4062,12 +4249,12 @@ __export(table_exports, {
|
|
|
4062
4249
|
});
|
|
4063
4250
|
|
|
4064
4251
|
// src/table/table.tsx
|
|
4065
|
-
import * as
|
|
4252
|
+
import * as React31 from "react";
|
|
4066
4253
|
import { View as View23, Text as Text9 } from "react-native";
|
|
4067
4254
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4068
|
-
var RootContext21 =
|
|
4255
|
+
var RootContext21 = React31.createContext(null);
|
|
4069
4256
|
function useRootContext21() {
|
|
4070
|
-
const context =
|
|
4257
|
+
const context = React31.useContext(RootContext21);
|
|
4071
4258
|
if (!context) {
|
|
4072
4259
|
throw new Error(
|
|
4073
4260
|
"Table compound components cannot be rendered outside the Table.Root component"
|
|
@@ -4075,42 +4262,42 @@ function useRootContext21() {
|
|
|
4075
4262
|
}
|
|
4076
4263
|
return context;
|
|
4077
4264
|
}
|
|
4078
|
-
var Root37 =
|
|
4265
|
+
var Root37 = React31.forwardRef(function Root38({ asChild, table, ...props }, ref) {
|
|
4079
4266
|
const Component = asChild ? Slot : View23;
|
|
4080
4267
|
return /* @__PURE__ */ jsx28(RootContext21.Provider, { value: { table }, children: /* @__PURE__ */ jsx28(Component, { ref, role: "table", ...props }) });
|
|
4081
4268
|
});
|
|
4082
4269
|
Root37.displayName = "TableRoot";
|
|
4083
|
-
var Header3 =
|
|
4270
|
+
var Header3 = React31.forwardRef(function Header4({ asChild, ...props }, ref) {
|
|
4084
4271
|
const Component = asChild ? Slot : View23;
|
|
4085
4272
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
|
|
4086
4273
|
});
|
|
4087
4274
|
Header3.displayName = "TableHeader";
|
|
4088
|
-
var HeaderRow =
|
|
4275
|
+
var HeaderRow = React31.forwardRef(function HeaderRow2({ asChild, ...props }, ref) {
|
|
4089
4276
|
const Component = asChild ? Slot : View23;
|
|
4090
4277
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "row", ...props });
|
|
4091
4278
|
});
|
|
4092
4279
|
HeaderRow.displayName = "TableHeaderRow";
|
|
4093
|
-
var HeaderCell =
|
|
4280
|
+
var HeaderCell = React31.forwardRef(function HeaderCell2({ asChild, ...props }, ref) {
|
|
4094
4281
|
const Component = asChild ? Slot : Text9;
|
|
4095
4282
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "columnheader", ...props });
|
|
4096
4283
|
});
|
|
4097
4284
|
HeaderCell.displayName = "TableHeaderCell";
|
|
4098
|
-
var Body =
|
|
4285
|
+
var Body = React31.forwardRef(function Body2({ asChild, ...props }, ref) {
|
|
4099
4286
|
const Component = asChild ? Slot : View23;
|
|
4100
4287
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
|
|
4101
4288
|
});
|
|
4102
4289
|
Body.displayName = "TableBody";
|
|
4103
|
-
var Row =
|
|
4290
|
+
var Row = React31.forwardRef(function Row2({ asChild, ...props }, ref) {
|
|
4104
4291
|
const Component = asChild ? Slot : View23;
|
|
4105
4292
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "row", ...props });
|
|
4106
4293
|
});
|
|
4107
4294
|
Row.displayName = "TableRow";
|
|
4108
|
-
var Cell =
|
|
4295
|
+
var Cell = React31.forwardRef(function Cell2({ asChild, ...props }, ref) {
|
|
4109
4296
|
const Component = asChild ? Slot : Text9;
|
|
4110
4297
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "cell", ...props });
|
|
4111
4298
|
});
|
|
4112
4299
|
Cell.displayName = "TableCell";
|
|
4113
|
-
var Footer =
|
|
4300
|
+
var Footer = React31.forwardRef(function Footer2({ asChild, ...props }, ref) {
|
|
4114
4301
|
const Component = asChild ? Slot : View23;
|
|
4115
4302
|
return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
|
|
4116
4303
|
});
|
|
@@ -4124,12 +4311,12 @@ __export(text_exports, {
|
|
|
4124
4311
|
});
|
|
4125
4312
|
|
|
4126
4313
|
// src/text/text.tsx
|
|
4127
|
-
import * as
|
|
4314
|
+
import * as React32 from "react";
|
|
4128
4315
|
import { Text as Text10 } from "react-native";
|
|
4129
4316
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4130
|
-
var TextClassContext =
|
|
4131
|
-
var Root39 =
|
|
4132
|
-
const textClass =
|
|
4317
|
+
var TextClassContext = React32.createContext(void 0);
|
|
4318
|
+
var Root39 = React32.forwardRef(function Root40({ asChild, className, ...props }, ref) {
|
|
4319
|
+
const textClass = React32.useContext(TextClassContext);
|
|
4133
4320
|
const Component = asChild ? Slot : Text10;
|
|
4134
4321
|
const mergedClassName = textClass ? className ? `${textClass} ${className}` : textClass : className;
|
|
4135
4322
|
return /* @__PURE__ */ jsx29(Component, { ref, className: mergedClassName, ...props });
|