@tallyui/primitives 0.1.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.
Files changed (128) hide show
  1. package/dist/index.d.ts +1370 -0
  2. package/dist/index.js +3954 -0
  3. package/package.json +47 -0
  4. package/src/__tests__/accordion.test.tsx +370 -0
  5. package/src/__tests__/alert-dialog.test.tsx +127 -0
  6. package/src/__tests__/animated.test.tsx +184 -0
  7. package/src/__tests__/checkbox.test.tsx +90 -0
  8. package/src/__tests__/collapsible.test.tsx +149 -0
  9. package/src/__tests__/combobox.test.tsx +292 -0
  10. package/src/__tests__/context-menu.test.tsx +226 -0
  11. package/src/__tests__/dialog.test.tsx +81 -0
  12. package/src/__tests__/dropdown-menu.test.tsx +119 -0
  13. package/src/__tests__/hooks.test.tsx +46 -0
  14. package/src/__tests__/hover-card.test.tsx +77 -0
  15. package/src/__tests__/image.test.tsx +53 -0
  16. package/src/__tests__/label.test.tsx +50 -0
  17. package/src/__tests__/list.test.tsx +63 -0
  18. package/src/__tests__/popover.test.tsx +63 -0
  19. package/src/__tests__/portal.test.tsx +66 -0
  20. package/src/__tests__/progress.test.tsx +70 -0
  21. package/src/__tests__/radio-group.test.tsx +164 -0
  22. package/src/__tests__/select.test.tsx +76 -0
  23. package/src/__tests__/separator.test.tsx +37 -0
  24. package/src/__tests__/slider.test.tsx +124 -0
  25. package/src/__tests__/slot.test.tsx +56 -0
  26. package/src/__tests__/switch.test.tsx +70 -0
  27. package/src/__tests__/table.test.tsx +172 -0
  28. package/src/__tests__/tabs.test.tsx +67 -0
  29. package/src/__tests__/text.test.tsx +59 -0
  30. package/src/__tests__/toast.test.tsx +137 -0
  31. package/src/__tests__/toggle-group.test.tsx +167 -0
  32. package/src/__tests__/toggle.test.tsx +60 -0
  33. package/src/__tests__/tooltip.test.tsx +77 -0
  34. package/src/__tests__/types.test-d.ts +106 -0
  35. package/src/__tests__/utils.test.ts +47 -0
  36. package/src/accordion/accordion.tsx +232 -0
  37. package/src/accordion/index.ts +12 -0
  38. package/src/accordion/types.ts +56 -0
  39. package/src/alert-dialog/alert-dialog.tsx +296 -0
  40. package/src/alert-dialog/index.ts +25 -0
  41. package/src/alert-dialog/types.ts +50 -0
  42. package/src/animated/index.ts +3 -0
  43. package/src/animated/presence.tsx +27 -0
  44. package/src/animated/types.ts +36 -0
  45. package/src/animated/use-presence.ts +44 -0
  46. package/src/checkbox/checkbox.tsx +106 -0
  47. package/src/checkbox/index.ts +2 -0
  48. package/src/checkbox/types.ts +19 -0
  49. package/src/collapsible/collapsible.tsx +135 -0
  50. package/src/collapsible/index.ts +2 -0
  51. package/src/collapsible/types.ts +25 -0
  52. package/src/combobox/combobox.tsx +325 -0
  53. package/src/combobox/index.ts +24 -0
  54. package/src/combobox/types.ts +84 -0
  55. package/src/context-menu/context-menu.tsx +654 -0
  56. package/src/context-menu/index.ts +40 -0
  57. package/src/context-menu/types.ts +117 -0
  58. package/src/dialog/dialog.tsx +260 -0
  59. package/src/dialog/index.ts +23 -0
  60. package/src/dialog/types.ts +47 -0
  61. package/src/dropdown-menu/dropdown-menu.tsx +654 -0
  62. package/src/dropdown-menu/index.ts +40 -0
  63. package/src/dropdown-menu/types.ts +117 -0
  64. package/src/hooks/index.ts +6 -0
  65. package/src/hooks/use-augmented-ref.ts +32 -0
  66. package/src/hooks/use-controllable-state.ts +87 -0
  67. package/src/hooks/use-relative-position.ts +253 -0
  68. package/src/hooks/use-relative-position.web.ts +9 -0
  69. package/src/hover-card/hover-card.tsx +271 -0
  70. package/src/hover-card/index.ts +17 -0
  71. package/src/hover-card/types.ts +50 -0
  72. package/src/image/image.tsx +29 -0
  73. package/src/image/index.ts +2 -0
  74. package/src/image/types.ts +10 -0
  75. package/src/index.ts +38 -0
  76. package/src/label/index.ts +2 -0
  77. package/src/label/label.tsx +45 -0
  78. package/src/label/types.ts +11 -0
  79. package/src/list/index.ts +2 -0
  80. package/src/list/list.tsx +54 -0
  81. package/src/list/types.ts +14 -0
  82. package/src/popover/index.ts +19 -0
  83. package/src/popover/popover.tsx +314 -0
  84. package/src/popover/types.ts +51 -0
  85. package/src/portal.tsx +60 -0
  86. package/src/progress/index.ts +2 -0
  87. package/src/progress/progress.tsx +92 -0
  88. package/src/progress/types.ts +16 -0
  89. package/src/radio-group/index.ts +2 -0
  90. package/src/radio-group/radio-group.tsx +160 -0
  91. package/src/radio-group/types.ts +31 -0
  92. package/src/select/index.ts +34 -0
  93. package/src/select/select.tsx +465 -0
  94. package/src/select/types.ts +112 -0
  95. package/src/separator/index.ts +2 -0
  96. package/src/separator/separator.tsx +32 -0
  97. package/src/separator/types.ts +8 -0
  98. package/src/slider/index.ts +2 -0
  99. package/src/slider/slider.tsx +139 -0
  100. package/src/slider/types.ts +35 -0
  101. package/src/slot.tsx +160 -0
  102. package/src/switch/index.ts +2 -0
  103. package/src/switch/switch.tsx +92 -0
  104. package/src/switch/types.ts +18 -0
  105. package/src/table/index.ts +12 -0
  106. package/src/table/table.tsx +160 -0
  107. package/src/table/types.ts +30 -0
  108. package/src/tabs/index.ts +15 -0
  109. package/src/tabs/tabs.tsx +140 -0
  110. package/src/tabs/types.ts +36 -0
  111. package/src/text/index.ts +2 -0
  112. package/src/text/text.tsx +40 -0
  113. package/src/text/types.ts +5 -0
  114. package/src/toast/index.ts +2 -0
  115. package/src/toast/toast.tsx +189 -0
  116. package/src/toast/types.ts +35 -0
  117. package/src/toggle/index.ts +2 -0
  118. package/src/toggle/toggle.tsx +59 -0
  119. package/src/toggle/types.ts +11 -0
  120. package/src/toggle-group/index.ts +2 -0
  121. package/src/toggle-group/toggle-group.tsx +123 -0
  122. package/src/toggle-group/types.ts +36 -0
  123. package/src/tooltip/index.ts +17 -0
  124. package/src/tooltip/tooltip.tsx +272 -0
  125. package/src/tooltip/types.ts +49 -0
  126. package/src/types.ts +129 -0
  127. package/src/uniwind-env.d.ts +31 -0
  128. package/src/utils.ts +67 -0
package/dist/index.js ADDED
@@ -0,0 +1,3954 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/slot.tsx
8
+ import * as React from "react";
9
+ import {
10
+ StyleSheet
11
+ } from "react-native";
12
+ import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
13
+ function composeRefs(...refs) {
14
+ return (node) => refs.forEach((ref) => {
15
+ if (typeof ref === "function") {
16
+ ref(node);
17
+ } else if (ref != null) {
18
+ ref.current = node;
19
+ }
20
+ });
21
+ }
22
+ function mergeProps(slotProps, childProps) {
23
+ const overrideProps = { ...childProps };
24
+ for (const propName in childProps) {
25
+ const slotPropValue = slotProps[propName];
26
+ const childPropValue = childProps[propName];
27
+ const isHandler = /^on[A-Z]/.test(propName);
28
+ if (isHandler) {
29
+ if (slotPropValue && childPropValue) {
30
+ overrideProps[propName] = (...args) => {
31
+ childPropValue(...args);
32
+ slotPropValue(...args);
33
+ };
34
+ } else if (slotPropValue) {
35
+ overrideProps[propName] = slotPropValue;
36
+ }
37
+ } else if (propName === "style") {
38
+ overrideProps[propName] = combineStyles(slotPropValue, childPropValue);
39
+ } else if (propName === "className") {
40
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
41
+ }
42
+ }
43
+ return { ...slotProps, ...overrideProps };
44
+ }
45
+ function combineStyles(slotStyle, childValue) {
46
+ if (typeof slotStyle === "function" && typeof childValue === "function") {
47
+ return (state) => {
48
+ return StyleSheet.flatten([slotStyle(state), childValue(state)]);
49
+ };
50
+ }
51
+ if (typeof slotStyle === "function") {
52
+ return (state) => {
53
+ return childValue ? StyleSheet.flatten([slotStyle(state), childValue]) : slotStyle(state);
54
+ };
55
+ }
56
+ if (typeof childValue === "function") {
57
+ return (state) => {
58
+ return slotStyle ? StyleSheet.flatten([slotStyle, childValue(state)]) : childValue(state);
59
+ };
60
+ }
61
+ return StyleSheet.flatten([slotStyle, childValue].filter(Boolean));
62
+ }
63
+ function isTextChildren(children) {
64
+ return Array.isArray(children) ? children.every((child) => typeof child === "string") : typeof children === "string";
65
+ }
66
+ function Slot(props) {
67
+ const { children, ref: forwardedRef, ...restOfProps } = props;
68
+ if (isTextChildren(children)) {
69
+ throw new Error(
70
+ "Slot: children must be a valid React element, not a string. Wrap text in a <Text> component."
71
+ );
72
+ }
73
+ if (!React.isValidElement(children)) {
74
+ return null;
75
+ }
76
+ const childrenProps = children.props ?? {};
77
+ if (children.type === React.Fragment) {
78
+ return /* @__PURE__ */ jsx(Fragment2, { children: React.Children.toArray(childrenProps.children).map(
79
+ (child) => React.isValidElement(child) ? Slot({ ...restOfProps, ref: forwardedRef, children: child }) : child
80
+ ) });
81
+ }
82
+ const { ref: childRef, ...childProps } = childrenProps;
83
+ return React.cloneElement(children, {
84
+ ...mergeProps(restOfProps, childProps),
85
+ ...children.type === "function" ? {} : {
86
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
87
+ }
88
+ });
89
+ }
90
+ Slot.displayName = "Slot";
91
+
92
+ // src/hooks/use-controllable-state.ts
93
+ import * as React2 from "react";
94
+ function useControllableState({
95
+ prop,
96
+ defaultProp,
97
+ onChange = () => {
98
+ }
99
+ }) {
100
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
101
+ defaultProp,
102
+ onChange
103
+ });
104
+ const isControlled = prop !== void 0;
105
+ const value = isControlled ? prop : uncontrolledProp;
106
+ const handleChange = useCallbackRef(onChange);
107
+ const setValue = React2.useCallback(
108
+ (nextValue) => {
109
+ if (isControlled) {
110
+ const setter = nextValue;
111
+ const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
112
+ if (value2 !== prop) handleChange(value2);
113
+ } else {
114
+ setUncontrolledProp(nextValue);
115
+ }
116
+ },
117
+ [isControlled, prop, setUncontrolledProp, handleChange]
118
+ );
119
+ return [value, setValue];
120
+ }
121
+ function useUncontrolledState({
122
+ defaultProp,
123
+ onChange
124
+ }) {
125
+ const uncontrolledState = React2.useState(defaultProp);
126
+ const [value] = uncontrolledState;
127
+ const prevValueRef = React2.useRef(value);
128
+ const handleChange = useCallbackRef(onChange);
129
+ React2.useEffect(() => {
130
+ if (prevValueRef.current !== value) {
131
+ handleChange(value);
132
+ prevValueRef.current = value;
133
+ }
134
+ }, [value, prevValueRef, handleChange]);
135
+ return uncontrolledState;
136
+ }
137
+ function useCallbackRef(callback) {
138
+ const callbackRef = React2.useRef(callback);
139
+ React2.useEffect(() => {
140
+ callbackRef.current = callback;
141
+ });
142
+ return React2.useMemo(
143
+ () => ((...args) => callbackRef.current?.(...args)),
144
+ []
145
+ );
146
+ }
147
+
148
+ // src/hooks/use-augmented-ref.ts
149
+ import * as React3 from "react";
150
+ function useAugmentedRef({
151
+ ref,
152
+ methods,
153
+ deps = []
154
+ }) {
155
+ const augmentedRef = React3.useRef(null);
156
+ React3.useImperativeHandle(
157
+ ref,
158
+ () => {
159
+ if (!augmentedRef.current) return null;
160
+ return Object.assign(augmentedRef.current, {
161
+ ...methods
162
+ });
163
+ },
164
+ [augmentedRef.current, methods]
165
+ );
166
+ return augmentedRef;
167
+ }
168
+
169
+ // src/hooks/use-relative-position.ts
170
+ import * as React4 from "react";
171
+ import {
172
+ Dimensions
173
+ } from "react-native";
174
+ var POSITION_ABSOLUTE = {
175
+ position: "absolute"
176
+ };
177
+ var HIDDEN_CONTENT = {
178
+ position: "absolute",
179
+ opacity: 0,
180
+ zIndex: -9999999
181
+ };
182
+ function useRelativePosition({
183
+ align,
184
+ avoidCollisions,
185
+ triggerPosition,
186
+ contentLayout,
187
+ alignOffset,
188
+ insets,
189
+ sideOffset,
190
+ side,
191
+ disablePositioningStyle
192
+ }) {
193
+ const dimensions = Dimensions.get("screen");
194
+ return React4.useMemo(() => {
195
+ if (disablePositioningStyle) {
196
+ return {};
197
+ }
198
+ if (!triggerPosition || !contentLayout) {
199
+ return HIDDEN_CONTENT;
200
+ }
201
+ return getContentStyle({
202
+ align,
203
+ avoidCollisions,
204
+ contentLayout,
205
+ side,
206
+ triggerPosition,
207
+ alignOffset,
208
+ insets,
209
+ sideOffset,
210
+ dimensions
211
+ });
212
+ }, [
213
+ align,
214
+ avoidCollisions,
215
+ side,
216
+ alignOffset,
217
+ insets,
218
+ triggerPosition,
219
+ contentLayout,
220
+ dimensions.width,
221
+ dimensions.height
222
+ ]);
223
+ }
224
+ function getSidePosition({
225
+ side,
226
+ triggerPosition,
227
+ contentLayout,
228
+ sideOffset,
229
+ insets,
230
+ avoidCollisions,
231
+ dimensions
232
+ }) {
233
+ const insetTop = insets?.top ?? 0;
234
+ const insetBottom = insets?.bottom ?? 0;
235
+ const positionTop = triggerPosition?.pageY - sideOffset - contentLayout.height;
236
+ const positionBottom = triggerPosition.pageY + triggerPosition.height + sideOffset;
237
+ if (!avoidCollisions) {
238
+ return {
239
+ top: side === "top" ? positionTop : positionBottom
240
+ };
241
+ }
242
+ if (side === "top") {
243
+ return {
244
+ top: Math.min(
245
+ Math.max(insetTop, positionTop),
246
+ dimensions.height - insetBottom - contentLayout.height
247
+ )
248
+ };
249
+ }
250
+ return {
251
+ top: Math.min(
252
+ dimensions.height - insetBottom - contentLayout.height,
253
+ positionBottom
254
+ )
255
+ };
256
+ }
257
+ function getAlignPosition({
258
+ align,
259
+ avoidCollisions,
260
+ contentLayout,
261
+ triggerPosition,
262
+ alignOffset,
263
+ insets,
264
+ dimensions
265
+ }) {
266
+ const insetLeft = insets?.left ?? 0;
267
+ const insetRight = insets?.right ?? 0;
268
+ const maxContentWidth = dimensions.width - insetLeft - insetRight;
269
+ const contentWidth = Math.min(contentLayout.width, maxContentWidth);
270
+ let left = getLeftPosition(
271
+ align,
272
+ triggerPosition.pageX,
273
+ triggerPosition.width,
274
+ contentWidth,
275
+ alignOffset,
276
+ insetLeft,
277
+ insetRight,
278
+ dimensions
279
+ );
280
+ if (avoidCollisions) {
281
+ const doesCollide = left < insetLeft || left + contentWidth > dimensions.width - insetRight;
282
+ if (doesCollide) {
283
+ const spaceLeft = left - insetLeft;
284
+ const spaceRight = dimensions.width - insetRight - (left + contentWidth);
285
+ if (spaceLeft > spaceRight && spaceLeft >= contentWidth) {
286
+ left = insetLeft;
287
+ } else if (spaceRight >= contentWidth) {
288
+ left = dimensions.width - insetRight - contentWidth;
289
+ } else {
290
+ const centeredPosition = Math.max(
291
+ insetLeft,
292
+ (dimensions.width - contentWidth - insetRight) / 2
293
+ );
294
+ left = centeredPosition;
295
+ }
296
+ }
297
+ }
298
+ return { left, maxWidth: maxContentWidth };
299
+ }
300
+ function getLeftPosition(align, triggerPageX, triggerWidth, contentWidth, alignOffset, insetLeft, insetRight, dimensions) {
301
+ let left = 0;
302
+ if (align === "start") {
303
+ left = triggerPageX;
304
+ }
305
+ if (align === "center") {
306
+ left = triggerPageX + triggerWidth / 2 - contentWidth / 2;
307
+ }
308
+ if (align === "end") {
309
+ left = triggerPageX + triggerWidth - contentWidth;
310
+ }
311
+ return Math.max(
312
+ insetLeft,
313
+ Math.min(left + alignOffset, dimensions.width - contentWidth - insetRight)
314
+ );
315
+ }
316
+ function getContentStyle({
317
+ align,
318
+ avoidCollisions,
319
+ contentLayout,
320
+ side,
321
+ triggerPosition,
322
+ alignOffset,
323
+ insets,
324
+ sideOffset,
325
+ dimensions
326
+ }) {
327
+ return Object.assign(
328
+ POSITION_ABSOLUTE,
329
+ getSidePosition({
330
+ side,
331
+ triggerPosition,
332
+ contentLayout,
333
+ sideOffset,
334
+ insets,
335
+ avoidCollisions,
336
+ dimensions
337
+ }),
338
+ getAlignPosition({
339
+ align,
340
+ avoidCollisions,
341
+ triggerPosition,
342
+ contentLayout,
343
+ alignOffset,
344
+ insets,
345
+ dimensions
346
+ })
347
+ );
348
+ }
349
+
350
+ // src/portal.tsx
351
+ import * as React5 from "react";
352
+ import { create } from "zustand";
353
+ import { Fragment as Fragment3, jsx as jsx2 } from "react/jsx-runtime";
354
+ var DEFAULT_PORTAL_HOST = "INTERNAL_PRIMITIVE_DEFAULT_HOST_NAME";
355
+ var usePortal = create(() => ({
356
+ map: (/* @__PURE__ */ new Map()).set(DEFAULT_PORTAL_HOST, /* @__PURE__ */ new Map())
357
+ }));
358
+ var updatePortal = (hostName, name, children) => {
359
+ usePortal.setState((prev) => {
360
+ const next = new Map(prev.map);
361
+ const portal = next.get(hostName) ?? /* @__PURE__ */ new Map();
362
+ portal.set(name, children);
363
+ next.set(hostName, portal);
364
+ return { map: next };
365
+ });
366
+ };
367
+ var removePortal = (hostName, name) => {
368
+ usePortal.setState((prev) => {
369
+ const next = new Map(prev.map);
370
+ const portal = next.get(hostName) ?? /* @__PURE__ */ new Map();
371
+ portal.delete(name);
372
+ next.set(hostName, portal);
373
+ return { map: next };
374
+ });
375
+ };
376
+ function PortalHost({ name = DEFAULT_PORTAL_HOST }) {
377
+ const portalMap = usePortal((state) => state.map).get(name) ?? /* @__PURE__ */ new Map();
378
+ if (portalMap.size === 0) return null;
379
+ return /* @__PURE__ */ jsx2(Fragment3, { children: Array.from(portalMap.values()) });
380
+ }
381
+ function Portal({
382
+ name,
383
+ hostName = DEFAULT_PORTAL_HOST,
384
+ children
385
+ }) {
386
+ React5.useEffect(() => {
387
+ updatePortal(hostName, name, children);
388
+ }, [hostName, name, children]);
389
+ React5.useEffect(() => {
390
+ return () => {
391
+ removePortal(hostName, name);
392
+ };
393
+ }, [hostName, name]);
394
+ return null;
395
+ }
396
+
397
+ // src/utils.ts
398
+ var toggleGroupUtils = {
399
+ getIsSelected(value, itemValue) {
400
+ if (value === void 0) return false;
401
+ if (typeof value === "string") return value === itemValue;
402
+ return value.includes(itemValue);
403
+ },
404
+ getNewSingleValue(original, itemValue) {
405
+ if (original === itemValue) return void 0;
406
+ return itemValue;
407
+ },
408
+ getNewMultipleValue(original, itemValue) {
409
+ if (original === void 0) return [itemValue];
410
+ if (typeof original === "string") {
411
+ return original === itemValue ? [] : [original, itemValue];
412
+ }
413
+ if (original.includes(itemValue)) {
414
+ return original.filter((v) => v !== itemValue);
415
+ }
416
+ return [...original, itemValue];
417
+ }
418
+ };
419
+ var EmptyGestureResponderEvent = {
420
+ nativeEvent: {
421
+ changedTouches: [],
422
+ identifier: "0",
423
+ locationX: 0,
424
+ locationY: 0,
425
+ pageX: 0,
426
+ pageY: 0,
427
+ target: "0",
428
+ timestamp: 0,
429
+ touches: []
430
+ },
431
+ bubbles: false,
432
+ cancelable: false,
433
+ currentTarget: {},
434
+ defaultPrevented: false,
435
+ eventPhase: 0,
436
+ persist: () => {
437
+ },
438
+ isDefaultPrevented: () => false,
439
+ isPropagationStopped: () => false,
440
+ isTrusted: false,
441
+ preventDefault: () => {
442
+ },
443
+ stopPropagation: () => {
444
+ },
445
+ target: {},
446
+ timeStamp: 0,
447
+ type: ""
448
+ };
449
+
450
+ // src/animated/index.ts
451
+ var animated_exports = {};
452
+ __export(animated_exports, {
453
+ Presence: () => Presence,
454
+ usePresence: () => usePresence
455
+ });
456
+
457
+ // src/animated/use-presence.ts
458
+ import { useState as useState2, useCallback as useCallback2, useEffect as useEffect3, useRef as useRef3 } from "react";
459
+ function usePresence(present, exitDuration = 150) {
460
+ const [isPresent, setIsPresent] = useState2(present);
461
+ const timerRef = useRef3(null);
462
+ const nodeRef = useRef3(null);
463
+ const ref = useCallback2((node) => {
464
+ nodeRef.current = node;
465
+ }, []);
466
+ useEffect3(() => {
467
+ if (present) {
468
+ if (timerRef.current) {
469
+ clearTimeout(timerRef.current);
470
+ timerRef.current = null;
471
+ }
472
+ setIsPresent(true);
473
+ } else {
474
+ timerRef.current = setTimeout(() => {
475
+ setIsPresent(false);
476
+ }, exitDuration);
477
+ }
478
+ return () => {
479
+ if (timerRef.current) {
480
+ clearTimeout(timerRef.current);
481
+ }
482
+ };
483
+ }, [present, exitDuration]);
484
+ return { isPresent, ref };
485
+ }
486
+
487
+ // src/animated/presence.tsx
488
+ import { Fragment as Fragment4, jsx as jsx3 } from "react/jsx-runtime";
489
+ function Presence({ present, forceMount, children }) {
490
+ const { isPresent } = usePresence(present);
491
+ const shouldRender = forceMount || isPresent;
492
+ if (!shouldRender) {
493
+ return null;
494
+ }
495
+ if (typeof children === "function") {
496
+ return /* @__PURE__ */ jsx3(Fragment4, { children: children({ present }) });
497
+ }
498
+ return /* @__PURE__ */ jsx3(Fragment4, { children });
499
+ }
500
+ Presence.displayName = "AnimatedPresence";
501
+
502
+ // src/alert-dialog/index.ts
503
+ var alert_dialog_exports = {};
504
+ __export(alert_dialog_exports, {
505
+ Action: () => Action,
506
+ Cancel: () => Cancel,
507
+ Content: () => Content,
508
+ Description: () => Description,
509
+ Overlay: () => Overlay,
510
+ Portal: () => Portal2,
511
+ Root: () => Root,
512
+ Title: () => Title,
513
+ Trigger: () => Trigger,
514
+ useRootContext: () => useRootContext
515
+ });
516
+
517
+ // src/alert-dialog/alert-dialog.tsx
518
+ import * as React6 from "react";
519
+ import { Pressable, Text, View } from "react-native";
520
+ import { jsx as jsx4 } from "react/jsx-runtime";
521
+ var RootContext = React6.createContext(null);
522
+ function useRootContext() {
523
+ const context = React6.useContext(RootContext);
524
+ if (!context) {
525
+ throw new Error(
526
+ "AlertDialog compound components cannot be rendered outside the AlertDialog.Root component"
527
+ );
528
+ }
529
+ return context;
530
+ }
531
+ var InternalContext = React6.createContext(null);
532
+ function useInternalContext() {
533
+ const context = React6.useContext(InternalContext);
534
+ if (!context) {
535
+ throw new Error(
536
+ "AlertDialog compound components cannot be rendered outside the AlertDialog.Root component"
537
+ );
538
+ }
539
+ return context;
540
+ }
541
+ function Root({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
542
+ const nativeID = React6.useId();
543
+ const [open = false, onOpenChange] = useControllableState({
544
+ prop: openProp,
545
+ defaultProp: defaultOpen,
546
+ onChange: onOpenChangeProp
547
+ });
548
+ return /* @__PURE__ */ jsx4(InternalContext.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx4(RootContext.Provider, { value: { open, onOpenChange }, children }) });
549
+ }
550
+ Root.displayName = "AlertDialogRoot";
551
+ var Trigger = React6.forwardRef(function Trigger2({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
552
+ const { open, onOpenChange } = useRootContext();
553
+ const onPress = React6.useCallback(
554
+ (ev) => {
555
+ onOpenChange(!open);
556
+ onPressProp?.(ev);
557
+ },
558
+ [onOpenChange, onPressProp, open]
559
+ );
560
+ const Component = asChild ? Slot : Pressable;
561
+ return /* @__PURE__ */ jsx4(
562
+ Component,
563
+ {
564
+ ref,
565
+ role: "button",
566
+ "aria-disabled": disabled || void 0,
567
+ onPress,
568
+ disabled: disabled || void 0,
569
+ ...props
570
+ }
571
+ );
572
+ });
573
+ Trigger.displayName = "AlertDialogTrigger";
574
+ function Portal2({ forceMount, hostName, children }) {
575
+ const internalValue = useInternalContext();
576
+ const rootValue = useRootContext();
577
+ if (!forceMount && !rootValue.open) {
578
+ return null;
579
+ }
580
+ return /* @__PURE__ */ jsx4(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx4(InternalContext.Provider, { value: internalValue, children: /* @__PURE__ */ jsx4(RootContext.Provider, { value: rootValue, children }) }) });
581
+ }
582
+ Portal2.displayName = "AlertDialogPortal";
583
+ var Overlay = React6.forwardRef(function Overlay2({ asChild, forceMount, ...props }, ref) {
584
+ const { open } = useRootContext();
585
+ if (!forceMount && !open) {
586
+ return null;
587
+ }
588
+ const Component = asChild ? Slot : View;
589
+ return /* @__PURE__ */ jsx4(Component, { ref, "aria-modal": true, ...props });
590
+ });
591
+ Overlay.displayName = "AlertDialogOverlay";
592
+ var Content = React6.forwardRef(function Content2({ asChild, forceMount, ...props }, ref) {
593
+ const { open } = useRootContext();
594
+ const { nativeID } = useInternalContext();
595
+ if (!forceMount && !open) {
596
+ return null;
597
+ }
598
+ const Component = asChild ? Slot : View;
599
+ return /* @__PURE__ */ jsx4(
600
+ Component,
601
+ {
602
+ ref,
603
+ role: "alertdialog",
604
+ nativeID,
605
+ "aria-labelledby": `${nativeID}_title`,
606
+ "aria-describedby": `${nativeID}_description`,
607
+ ...props
608
+ }
609
+ );
610
+ });
611
+ Content.displayName = "AlertDialogContent";
612
+ var Title = React6.forwardRef(function Title2({ asChild, ...props }, ref) {
613
+ const { nativeID } = useInternalContext();
614
+ const Component = asChild ? Slot : Text;
615
+ return /* @__PURE__ */ jsx4(Component, { ref, role: "heading", nativeID: `${nativeID}_title`, ...props });
616
+ });
617
+ Title.displayName = "AlertDialogTitle";
618
+ var Description = React6.forwardRef(function Description2({ asChild, ...props }, ref) {
619
+ const { nativeID } = useInternalContext();
620
+ const Component = asChild ? Slot : Text;
621
+ return /* @__PURE__ */ jsx4(Component, { ref, nativeID: `${nativeID}_description`, ...props });
622
+ });
623
+ Description.displayName = "AlertDialogDescription";
624
+ var Action = React6.forwardRef(function Action2({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
625
+ const { onOpenChange } = useRootContext();
626
+ const onPress = React6.useCallback(
627
+ (ev) => {
628
+ onOpenChange(false);
629
+ onPressProp?.(ev);
630
+ },
631
+ [onOpenChange, onPressProp]
632
+ );
633
+ const Component = asChild ? Slot : Pressable;
634
+ return /* @__PURE__ */ jsx4(
635
+ Component,
636
+ {
637
+ ref,
638
+ role: "button",
639
+ "aria-disabled": disabled || void 0,
640
+ onPress,
641
+ disabled: disabled || void 0,
642
+ ...props
643
+ }
644
+ );
645
+ });
646
+ Action.displayName = "AlertDialogAction";
647
+ var Cancel = React6.forwardRef(function Cancel2({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
648
+ const { onOpenChange } = useRootContext();
649
+ const onPress = React6.useCallback(
650
+ (ev) => {
651
+ onOpenChange(false);
652
+ onPressProp?.(ev);
653
+ },
654
+ [onOpenChange, onPressProp]
655
+ );
656
+ const Component = asChild ? Slot : Pressable;
657
+ return /* @__PURE__ */ jsx4(
658
+ Component,
659
+ {
660
+ ref,
661
+ role: "button",
662
+ "aria-disabled": disabled || void 0,
663
+ onPress,
664
+ disabled: disabled || void 0,
665
+ ...props
666
+ }
667
+ );
668
+ });
669
+ Cancel.displayName = "AlertDialogCancel";
670
+
671
+ // src/dialog/index.ts
672
+ var dialog_exports = {};
673
+ __export(dialog_exports, {
674
+ Close: () => Close,
675
+ Content: () => Content3,
676
+ Description: () => Description3,
677
+ Overlay: () => Overlay3,
678
+ Portal: () => Portal3,
679
+ Root: () => Root2,
680
+ Title: () => Title3,
681
+ Trigger: () => Trigger3,
682
+ useRootContext: () => useRootContext2
683
+ });
684
+
685
+ // src/dialog/dialog.tsx
686
+ import * as React7 from "react";
687
+ import { Pressable as Pressable2, Text as Text2, View as View2 } from "react-native";
688
+ import { jsx as jsx5 } from "react/jsx-runtime";
689
+ var RootContext2 = React7.createContext(null);
690
+ function useRootContext2() {
691
+ const context = React7.useContext(RootContext2);
692
+ if (!context) {
693
+ throw new Error(
694
+ "Dialog compound components cannot be rendered outside the Dialog.Root component"
695
+ );
696
+ }
697
+ return context;
698
+ }
699
+ var InternalContext2 = React7.createContext(null);
700
+ function useInternalContext2() {
701
+ const context = React7.useContext(InternalContext2);
702
+ if (!context) {
703
+ throw new Error(
704
+ "Dialog compound components cannot be rendered outside the Dialog.Root component"
705
+ );
706
+ }
707
+ return context;
708
+ }
709
+ function Root2({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
710
+ const nativeID = React7.useId();
711
+ const [open = false, onOpenChange] = useControllableState({
712
+ prop: openProp,
713
+ defaultProp: defaultOpen,
714
+ onChange: onOpenChangeProp
715
+ });
716
+ return /* @__PURE__ */ jsx5(InternalContext2.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx5(RootContext2.Provider, { value: { open, onOpenChange }, children }) });
717
+ }
718
+ Root2.displayName = "DialogRoot";
719
+ var Trigger3 = React7.forwardRef(function Trigger4({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
720
+ const { open, onOpenChange } = useRootContext2();
721
+ const onPress = React7.useCallback(
722
+ (ev) => {
723
+ onOpenChange(!open);
724
+ onPressProp?.(ev);
725
+ },
726
+ [onOpenChange, onPressProp, open]
727
+ );
728
+ const Component = asChild ? Slot : Pressable2;
729
+ return /* @__PURE__ */ jsx5(
730
+ Component,
731
+ {
732
+ ref,
733
+ role: "button",
734
+ "aria-disabled": disabled || void 0,
735
+ onPress,
736
+ disabled: disabled || void 0,
737
+ ...props
738
+ }
739
+ );
740
+ });
741
+ Trigger3.displayName = "DialogTrigger";
742
+ function Portal3({ forceMount, hostName, children }) {
743
+ const internalValue = useInternalContext2();
744
+ const rootValue = useRootContext2();
745
+ if (!forceMount && !rootValue.open) {
746
+ return null;
747
+ }
748
+ return /* @__PURE__ */ jsx5(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx5(InternalContext2.Provider, { value: internalValue, children: /* @__PURE__ */ jsx5(RootContext2.Provider, { value: rootValue, children }) }) });
749
+ }
750
+ Portal3.displayName = "DialogPortal";
751
+ var Overlay3 = React7.forwardRef(function Overlay4({ asChild, forceMount, ...props }, ref) {
752
+ const { open } = useRootContext2();
753
+ if (!forceMount && !open) {
754
+ return null;
755
+ }
756
+ const Component = asChild ? Slot : View2;
757
+ return /* @__PURE__ */ jsx5(Component, { ref, "aria-modal": true, ...props });
758
+ });
759
+ Overlay3.displayName = "DialogOverlay";
760
+ var Content3 = React7.forwardRef(function Content4({ asChild, forceMount, ...props }, ref) {
761
+ const { open } = useRootContext2();
762
+ const { nativeID } = useInternalContext2();
763
+ if (!forceMount && !open) {
764
+ return null;
765
+ }
766
+ const Component = asChild ? Slot : View2;
767
+ return /* @__PURE__ */ jsx5(
768
+ Component,
769
+ {
770
+ ref,
771
+ role: "dialog",
772
+ nativeID,
773
+ "aria-labelledby": `${nativeID}_title`,
774
+ "aria-describedby": `${nativeID}_description`,
775
+ ...props
776
+ }
777
+ );
778
+ });
779
+ Content3.displayName = "DialogContent";
780
+ var Title3 = React7.forwardRef(function Title4({ asChild, ...props }, ref) {
781
+ const { nativeID } = useInternalContext2();
782
+ const Component = asChild ? Slot : Text2;
783
+ return /* @__PURE__ */ jsx5(Component, { ref, role: "heading", nativeID: `${nativeID}_title`, ...props });
784
+ });
785
+ Title3.displayName = "DialogTitle";
786
+ var Description3 = React7.forwardRef(function Description4({ asChild, ...props }, ref) {
787
+ const { nativeID } = useInternalContext2();
788
+ const Component = asChild ? Slot : Text2;
789
+ return /* @__PURE__ */ jsx5(Component, { ref, nativeID: `${nativeID}_description`, ...props });
790
+ });
791
+ Description3.displayName = "DialogDescription";
792
+ var Close = React7.forwardRef(function Close2({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
793
+ const { onOpenChange } = useRootContext2();
794
+ const onPress = React7.useCallback(
795
+ (ev) => {
796
+ onOpenChange(false);
797
+ onPressProp?.(ev);
798
+ },
799
+ [onOpenChange, onPressProp]
800
+ );
801
+ const Component = asChild ? Slot : Pressable2;
802
+ return /* @__PURE__ */ jsx5(
803
+ Component,
804
+ {
805
+ ref,
806
+ role: "button",
807
+ "aria-disabled": disabled || void 0,
808
+ onPress,
809
+ disabled: disabled || void 0,
810
+ ...props
811
+ }
812
+ );
813
+ });
814
+ Close.displayName = "DialogClose";
815
+
816
+ // src/popover/index.ts
817
+ var popover_exports = {};
818
+ __export(popover_exports, {
819
+ Close: () => Close3,
820
+ Content: () => Content5,
821
+ Overlay: () => Overlay5,
822
+ Portal: () => Portal4,
823
+ Root: () => Root3,
824
+ Trigger: () => Trigger5,
825
+ useRootContext: () => useRootContext3
826
+ });
827
+
828
+ // src/popover/popover.tsx
829
+ import * as React8 from "react";
830
+ import {
831
+ Pressable as Pressable3,
832
+ View as View3
833
+ } from "react-native";
834
+ import { jsx as jsx6 } from "react/jsx-runtime";
835
+ var InternalContext3 = React8.createContext(null);
836
+ function useInternalContext3() {
837
+ const context = React8.useContext(InternalContext3);
838
+ if (!context) {
839
+ throw new Error(
840
+ "Popover compound components cannot be rendered outside the Popover.Root component"
841
+ );
842
+ }
843
+ return context;
844
+ }
845
+ var RootContext3 = React8.createContext(null);
846
+ function useRootContext3() {
847
+ const context = React8.useContext(RootContext3);
848
+ if (!context) {
849
+ throw new Error(
850
+ "Popover compound components cannot be rendered outside the Popover.Root component"
851
+ );
852
+ }
853
+ return context;
854
+ }
855
+ function Root3({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
856
+ const nativeID = React8.useId();
857
+ const [open = false, onOpenChange] = useControllableState({
858
+ prop: openProp,
859
+ defaultProp: defaultOpen,
860
+ onChange: onOpenChangeProp
861
+ });
862
+ const [triggerPosition, setTriggerPosition] = React8.useState(null);
863
+ const [contentLayout, setContentLayout] = React8.useState(null);
864
+ return /* @__PURE__ */ jsx6(InternalContext3.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx6(
865
+ RootContext3.Provider,
866
+ {
867
+ value: {
868
+ open,
869
+ onOpenChange,
870
+ triggerPosition,
871
+ setTriggerPosition,
872
+ contentLayout,
873
+ setContentLayout
874
+ },
875
+ children
876
+ }
877
+ ) });
878
+ }
879
+ Root3.displayName = "PopoverRoot";
880
+ var Trigger5 = React8.forwardRef(function Trigger6({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
881
+ const { open, onOpenChange, setTriggerPosition } = useRootContext3();
882
+ const augmentedRef = useAugmentedRef({
883
+ ref,
884
+ methods: {
885
+ open: () => {
886
+ onOpenChange(true);
887
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
888
+ setTriggerPosition({ width, pageX, pageY, height });
889
+ });
890
+ },
891
+ close: () => {
892
+ setTriggerPosition(null);
893
+ onOpenChange(false);
894
+ }
895
+ }
896
+ });
897
+ const onPress = React8.useCallback(
898
+ (ev) => {
899
+ if (disabled) return;
900
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
901
+ setTriggerPosition({ width, pageX, pageY, height });
902
+ });
903
+ onOpenChange(!open);
904
+ onPressProp?.(ev);
905
+ },
906
+ [augmentedRef, disabled, onOpenChange, onPressProp, open, setTriggerPosition]
907
+ );
908
+ const Component = asChild ? Slot : Pressable3;
909
+ return /* @__PURE__ */ jsx6(
910
+ Component,
911
+ {
912
+ ref: augmentedRef,
913
+ role: "button",
914
+ "aria-disabled": disabled || void 0,
915
+ onPress,
916
+ disabled: disabled || void 0,
917
+ ...props
918
+ }
919
+ );
920
+ });
921
+ Trigger5.displayName = "PopoverTrigger";
922
+ function Portal4({ forceMount, hostName, children }) {
923
+ const internalValue = useInternalContext3();
924
+ const rootValue = useRootContext3();
925
+ if (!forceMount && !rootValue.open) {
926
+ return null;
927
+ }
928
+ return /* @__PURE__ */ jsx6(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx6(InternalContext3.Provider, { value: internalValue, children: /* @__PURE__ */ jsx6(RootContext3.Provider, { value: rootValue, children }) }) });
929
+ }
930
+ Portal4.displayName = "PopoverPortal";
931
+ var Overlay5 = React8.forwardRef(function Overlay6({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
932
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext3();
933
+ const onPress = React8.useCallback(
934
+ (ev) => {
935
+ if (closeOnPress) {
936
+ setTriggerPosition(null);
937
+ setContentLayout(null);
938
+ onOpenChange(false);
939
+ }
940
+ onPressProp?.(ev);
941
+ },
942
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
943
+ );
944
+ if (!forceMount && !open) {
945
+ return null;
946
+ }
947
+ const Component = asChild ? Slot : Pressable3;
948
+ return /* @__PURE__ */ jsx6(Component, { ref, onPress, ...props });
949
+ });
950
+ Overlay5.displayName = "PopoverOverlay";
951
+ var Content5 = React8.forwardRef(function Content6({
952
+ asChild,
953
+ forceMount,
954
+ align = "start",
955
+ side = "bottom",
956
+ sideOffset = 0,
957
+ alignOffset = 0,
958
+ avoidCollisions = true,
959
+ insets,
960
+ style,
961
+ disablePositioningStyle,
962
+ onLayout: onLayoutProp,
963
+ ...props
964
+ }, ref) {
965
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext3();
966
+ const { nativeID } = useInternalContext3();
967
+ const positionStyle = useRelativePosition({
968
+ align,
969
+ avoidCollisions,
970
+ triggerPosition,
971
+ contentLayout,
972
+ alignOffset,
973
+ insets,
974
+ sideOffset,
975
+ side,
976
+ disablePositioningStyle
977
+ });
978
+ const onLayout = React8.useCallback(
979
+ (event) => {
980
+ setContentLayout(event.nativeEvent.layout);
981
+ onLayoutProp?.(event);
982
+ },
983
+ [onLayoutProp, setContentLayout]
984
+ );
985
+ if (!forceMount && !open) {
986
+ return null;
987
+ }
988
+ const Component = asChild ? Slot : View3;
989
+ return /* @__PURE__ */ jsx6(
990
+ Component,
991
+ {
992
+ ref,
993
+ role: "dialog",
994
+ nativeID,
995
+ "aria-labelledby": `${nativeID}_title`,
996
+ "aria-describedby": `${nativeID}_description`,
997
+ "aria-modal": true,
998
+ style: [positionStyle, style],
999
+ onLayout,
1000
+ ...props
1001
+ }
1002
+ );
1003
+ });
1004
+ Content5.displayName = "PopoverContent";
1005
+ var Close3 = React8.forwardRef(function Close4({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
1006
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext3();
1007
+ const onPress = React8.useCallback(
1008
+ (ev) => {
1009
+ if (disabled) return;
1010
+ setTriggerPosition(null);
1011
+ setContentLayout(null);
1012
+ onOpenChange(false);
1013
+ onPressProp?.(ev);
1014
+ },
1015
+ [disabled, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1016
+ );
1017
+ const Component = asChild ? Slot : Pressable3;
1018
+ return /* @__PURE__ */ jsx6(
1019
+ Component,
1020
+ {
1021
+ ref,
1022
+ role: "button",
1023
+ "aria-disabled": disabled || void 0,
1024
+ onPress,
1025
+ disabled: disabled || void 0,
1026
+ ...props
1027
+ }
1028
+ );
1029
+ });
1030
+ Close3.displayName = "PopoverClose";
1031
+
1032
+ // src/select/index.ts
1033
+ var select_exports = {};
1034
+ __export(select_exports, {
1035
+ Content: () => Content7,
1036
+ Group: () => Group,
1037
+ Item: () => Item,
1038
+ ItemIndicator: () => ItemIndicator,
1039
+ ItemText: () => ItemText,
1040
+ Label: () => Label,
1041
+ Overlay: () => Overlay7,
1042
+ Portal: () => Portal5,
1043
+ Root: () => Root4,
1044
+ Separator: () => Separator,
1045
+ Trigger: () => Trigger7,
1046
+ Value: () => Value,
1047
+ useItemContext: () => useItemContext,
1048
+ useRootContext: () => useRootContext4
1049
+ });
1050
+
1051
+ // src/select/select.tsx
1052
+ import * as React9 from "react";
1053
+ import {
1054
+ Pressable as Pressable4,
1055
+ Text as Text3,
1056
+ View as View4
1057
+ } from "react-native";
1058
+ import { jsx as jsx7 } from "react/jsx-runtime";
1059
+ var RootContext4 = React9.createContext(null);
1060
+ function useRootContext4() {
1061
+ const context = React9.useContext(RootContext4);
1062
+ if (!context) {
1063
+ throw new Error(
1064
+ "Select compound components cannot be rendered outside the Select.Root component"
1065
+ );
1066
+ }
1067
+ return context;
1068
+ }
1069
+ var ItemContext = React9.createContext(null);
1070
+ function useItemContext() {
1071
+ const context = React9.useContext(ItemContext);
1072
+ if (!context) {
1073
+ throw new Error(
1074
+ "Select.Item compound components cannot be rendered outside a Select.Item component"
1075
+ );
1076
+ }
1077
+ return context;
1078
+ }
1079
+ function Root4({
1080
+ value: valueProp,
1081
+ defaultValue,
1082
+ onValueChange: onValueChangeProp,
1083
+ open: openProp,
1084
+ defaultOpen,
1085
+ onOpenChange: onOpenChangeProp,
1086
+ disabled,
1087
+ children
1088
+ }) {
1089
+ const nativeID = React9.useId();
1090
+ const [value, onValueChange] = useControllableState({
1091
+ prop: valueProp,
1092
+ defaultProp: defaultValue,
1093
+ onChange: onValueChangeProp
1094
+ });
1095
+ const [open = false, onOpenChange] = useControllableState({
1096
+ prop: openProp,
1097
+ defaultProp: defaultOpen,
1098
+ onChange: onOpenChangeProp
1099
+ });
1100
+ const [triggerPosition, setTriggerPosition] = React9.useState(null);
1101
+ const [contentLayout, setContentLayout] = React9.useState(null);
1102
+ return /* @__PURE__ */ jsx7(
1103
+ RootContext4.Provider,
1104
+ {
1105
+ value: {
1106
+ value,
1107
+ onValueChange,
1108
+ open,
1109
+ onOpenChange,
1110
+ triggerPosition,
1111
+ setTriggerPosition,
1112
+ contentLayout,
1113
+ setContentLayout,
1114
+ nativeID,
1115
+ disabled
1116
+ },
1117
+ children
1118
+ }
1119
+ );
1120
+ }
1121
+ Root4.displayName = "SelectRoot";
1122
+ var Trigger7 = React9.forwardRef(function Trigger8({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
1123
+ const { open, onOpenChange, disabled: disabledRoot, setTriggerPosition } = useRootContext4();
1124
+ const augmentedRef = useAugmentedRef({
1125
+ ref,
1126
+ methods: {
1127
+ open: () => {
1128
+ onOpenChange(true);
1129
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1130
+ setTriggerPosition({ width, pageX, pageY, height });
1131
+ });
1132
+ },
1133
+ close: () => {
1134
+ setTriggerPosition(null);
1135
+ onOpenChange(false);
1136
+ }
1137
+ }
1138
+ });
1139
+ const onPress = React9.useCallback(
1140
+ (ev) => {
1141
+ if (disabled || disabledRoot) return;
1142
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1143
+ setTriggerPosition({ width, pageX, pageY, height });
1144
+ });
1145
+ onOpenChange(!open);
1146
+ onPressProp?.(ev);
1147
+ },
1148
+ [augmentedRef, disabled, disabledRoot, onOpenChange, onPressProp, open, setTriggerPosition]
1149
+ );
1150
+ const Component = asChild ? Slot : Pressable4;
1151
+ return /* @__PURE__ */ jsx7(
1152
+ Component,
1153
+ {
1154
+ ref: augmentedRef,
1155
+ role: "combobox",
1156
+ "aria-expanded": open,
1157
+ "aria-disabled": disabled || disabledRoot || void 0,
1158
+ onPress,
1159
+ disabled: disabled || disabledRoot || void 0,
1160
+ ...props
1161
+ }
1162
+ );
1163
+ });
1164
+ Trigger7.displayName = "SelectTrigger";
1165
+ var Value = React9.forwardRef(function Value2({ asChild, placeholder, ...props }, ref) {
1166
+ const { value } = useRootContext4();
1167
+ const Component = asChild ? Slot : Text3;
1168
+ return /* @__PURE__ */ jsx7(Component, { ref, ...props, children: value?.label ?? placeholder });
1169
+ });
1170
+ Value.displayName = "SelectValue";
1171
+ function Portal5({ forceMount, hostName, children }) {
1172
+ const rootValue = useRootContext4();
1173
+ if (!forceMount && !rootValue.open) {
1174
+ return null;
1175
+ }
1176
+ return /* @__PURE__ */ jsx7(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx7(RootContext4.Provider, { value: rootValue, children }) });
1177
+ }
1178
+ Portal5.displayName = "SelectPortal";
1179
+ var Overlay7 = React9.forwardRef(function Overlay8({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
1180
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext4();
1181
+ const onPress = React9.useCallback(
1182
+ (ev) => {
1183
+ if (closeOnPress) {
1184
+ setTriggerPosition(null);
1185
+ setContentLayout(null);
1186
+ onOpenChange(false);
1187
+ }
1188
+ onPressProp?.(ev);
1189
+ },
1190
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1191
+ );
1192
+ if (!forceMount && !open) {
1193
+ return null;
1194
+ }
1195
+ const Component = asChild ? Slot : Pressable4;
1196
+ return /* @__PURE__ */ jsx7(Component, { ref, onPress, ...props });
1197
+ });
1198
+ Overlay7.displayName = "SelectOverlay";
1199
+ var Content7 = React9.forwardRef(function Content8({
1200
+ asChild,
1201
+ forceMount,
1202
+ align = "start",
1203
+ side = "bottom",
1204
+ sideOffset = 0,
1205
+ alignOffset = 0,
1206
+ avoidCollisions = true,
1207
+ insets,
1208
+ style,
1209
+ disablePositioningStyle,
1210
+ onLayout: onLayoutProp,
1211
+ ...props
1212
+ }, ref) {
1213
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext4();
1214
+ const positionStyle = useRelativePosition({
1215
+ align,
1216
+ avoidCollisions,
1217
+ triggerPosition,
1218
+ contentLayout,
1219
+ alignOffset,
1220
+ insets,
1221
+ sideOffset,
1222
+ side,
1223
+ disablePositioningStyle
1224
+ });
1225
+ const onLayout = React9.useCallback(
1226
+ (event) => {
1227
+ setContentLayout(event.nativeEvent.layout);
1228
+ onLayoutProp?.(event);
1229
+ },
1230
+ [onLayoutProp, setContentLayout]
1231
+ );
1232
+ if (!forceMount && !open) {
1233
+ return null;
1234
+ }
1235
+ const Component = asChild ? Slot : View4;
1236
+ return /* @__PURE__ */ jsx7(
1237
+ Component,
1238
+ {
1239
+ ref,
1240
+ role: "list",
1241
+ "aria-modal": true,
1242
+ style: [positionStyle, style],
1243
+ onLayout,
1244
+ ...props
1245
+ }
1246
+ );
1247
+ });
1248
+ Content7.displayName = "SelectContent";
1249
+ var Item = React9.forwardRef(function Item2({ asChild, value: itemValue, label, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
1250
+ const { value, onValueChange, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext4();
1251
+ const onPress = React9.useCallback(
1252
+ (ev) => {
1253
+ if (disabled) return;
1254
+ onValueChange({ value: itemValue, label });
1255
+ if (closeOnPress) {
1256
+ setTriggerPosition(null);
1257
+ setContentLayout(null);
1258
+ onOpenChange(false);
1259
+ }
1260
+ onPressProp?.(ev);
1261
+ },
1262
+ [closeOnPress, disabled, itemValue, label, onOpenChange, onPressProp, onValueChange, setContentLayout, setTriggerPosition]
1263
+ );
1264
+ const Component = asChild ? Slot : Pressable4;
1265
+ return /* @__PURE__ */ jsx7(ItemContext.Provider, { value: { itemValue, label }, children: /* @__PURE__ */ jsx7(
1266
+ Component,
1267
+ {
1268
+ ref,
1269
+ role: "option",
1270
+ "aria-checked": value?.value === itemValue,
1271
+ "aria-disabled": disabled || void 0,
1272
+ onPress,
1273
+ disabled: disabled || void 0,
1274
+ ...props
1275
+ }
1276
+ ) });
1277
+ });
1278
+ Item.displayName = "SelectItem";
1279
+ var ItemText = React9.forwardRef(function ItemText2({ asChild, ...props }, ref) {
1280
+ const { label } = useItemContext();
1281
+ const Component = asChild ? Slot : Text3;
1282
+ return /* @__PURE__ */ jsx7(Component, { ref, ...props, children: label });
1283
+ });
1284
+ ItemText.displayName = "SelectItemText";
1285
+ var ItemIndicator = React9.forwardRef(function ItemIndicator2({ asChild, forceMount, ...props }, ref) {
1286
+ const { itemValue } = useItemContext();
1287
+ const { value } = useRootContext4();
1288
+ if (!forceMount && value?.value !== itemValue) {
1289
+ return null;
1290
+ }
1291
+ const Component = asChild ? Slot : View4;
1292
+ return /* @__PURE__ */ jsx7(Component, { ref, role: "presentation", ...props });
1293
+ });
1294
+ ItemIndicator.displayName = "SelectItemIndicator";
1295
+ var Group = React9.forwardRef(function Group2({ asChild, ...props }, ref) {
1296
+ const Component = asChild ? Slot : View4;
1297
+ return /* @__PURE__ */ jsx7(Component, { ref, role: "group", ...props });
1298
+ });
1299
+ Group.displayName = "SelectGroup";
1300
+ var Label = React9.forwardRef(function Label2({ asChild, ...props }, ref) {
1301
+ const Component = asChild ? Slot : Text3;
1302
+ return /* @__PURE__ */ jsx7(Component, { ref, ...props });
1303
+ });
1304
+ Label.displayName = "SelectLabel";
1305
+ var Separator = React9.forwardRef(function Separator2({ asChild, decorative, ...props }, ref) {
1306
+ const Component = asChild ? Slot : View4;
1307
+ return /* @__PURE__ */ jsx7(
1308
+ Component,
1309
+ {
1310
+ ref,
1311
+ role: decorative ? "presentation" : "separator",
1312
+ ...props
1313
+ }
1314
+ );
1315
+ });
1316
+ Separator.displayName = "SelectSeparator";
1317
+
1318
+ // src/tabs/index.ts
1319
+ var tabs_exports = {};
1320
+ __export(tabs_exports, {
1321
+ Content: () => Content9,
1322
+ List: () => List,
1323
+ Root: () => Root5,
1324
+ Trigger: () => Trigger9,
1325
+ useRootContext: () => useRootContext5
1326
+ });
1327
+
1328
+ // src/tabs/tabs.tsx
1329
+ import * as React10 from "react";
1330
+ import { Pressable as Pressable5, View as View5 } from "react-native";
1331
+ import { jsx as jsx8 } from "react/jsx-runtime";
1332
+ var RootContext5 = React10.createContext(null);
1333
+ function useRootContext5() {
1334
+ const context = React10.useContext(RootContext5);
1335
+ if (!context) {
1336
+ throw new Error(
1337
+ "Tabs compound components cannot be rendered outside the Tabs.Root component"
1338
+ );
1339
+ }
1340
+ return context;
1341
+ }
1342
+ function Root5({
1343
+ value: valueProp,
1344
+ defaultValue,
1345
+ onValueChange: onValueChangeProp,
1346
+ children
1347
+ }) {
1348
+ const nativeID = React10.useId();
1349
+ const [value = "", onValueChange] = useControllableState({
1350
+ prop: valueProp,
1351
+ defaultProp: defaultValue,
1352
+ onChange: onValueChangeProp
1353
+ });
1354
+ return /* @__PURE__ */ jsx8(RootContext5.Provider, { value: { value, onValueChange, nativeID }, children });
1355
+ }
1356
+ Root5.displayName = "TabsRoot";
1357
+ var List = React10.forwardRef(function List2({ asChild, ...props }, ref) {
1358
+ const Component = asChild ? Slot : View5;
1359
+ return /* @__PURE__ */ jsx8(Component, { ref, role: "tablist", ...props });
1360
+ });
1361
+ List.displayName = "TabsList";
1362
+ var Trigger9 = React10.forwardRef(function Trigger10({ asChild, onPress: onPressProp, disabled, value: tabValue, ...props }, ref) {
1363
+ const { onValueChange, value: rootValue, nativeID } = useRootContext5();
1364
+ const onPress = React10.useCallback(
1365
+ (ev) => {
1366
+ if (disabled) return;
1367
+ onValueChange(tabValue);
1368
+ onPressProp?.(ev);
1369
+ },
1370
+ [disabled, onValueChange, tabValue, onPressProp]
1371
+ );
1372
+ const isActive = rootValue === tabValue;
1373
+ const Component = asChild ? Slot : Pressable5;
1374
+ return /* @__PURE__ */ jsx8(
1375
+ Component,
1376
+ {
1377
+ ref,
1378
+ nativeID: `${nativeID}-tab-${tabValue}`,
1379
+ "aria-disabled": disabled || void 0,
1380
+ "aria-selected": isActive,
1381
+ role: "tab",
1382
+ onPress,
1383
+ disabled: disabled || void 0,
1384
+ ...props
1385
+ }
1386
+ );
1387
+ });
1388
+ Trigger9.displayName = "TabsTrigger";
1389
+ var Content9 = React10.forwardRef(function Content10({ asChild, forceMount, value: tabValue, ...props }, ref) {
1390
+ const { value: rootValue, nativeID } = useRootContext5();
1391
+ if (!forceMount && rootValue !== tabValue) {
1392
+ return null;
1393
+ }
1394
+ const Component = asChild ? Slot : View5;
1395
+ return /* @__PURE__ */ jsx8(
1396
+ Component,
1397
+ {
1398
+ ref,
1399
+ "aria-hidden": rootValue !== tabValue,
1400
+ "aria-labelledby": `${nativeID}-tab-${tabValue}`,
1401
+ role: "tabpanel",
1402
+ ...props
1403
+ }
1404
+ );
1405
+ });
1406
+ Content9.displayName = "TabsContent";
1407
+
1408
+ // src/context-menu/index.ts
1409
+ var context_menu_exports = {};
1410
+ __export(context_menu_exports, {
1411
+ CheckboxItem: () => CheckboxItem,
1412
+ Content: () => Content11,
1413
+ Group: () => Group3,
1414
+ Item: () => Item3,
1415
+ ItemIndicator: () => ItemIndicator3,
1416
+ Label: () => Label3,
1417
+ Overlay: () => Overlay9,
1418
+ Portal: () => Portal6,
1419
+ RadioGroup: () => RadioGroup,
1420
+ RadioItem: () => RadioItem,
1421
+ Root: () => Root6,
1422
+ Separator: () => Separator3,
1423
+ Sub: () => Sub,
1424
+ SubContent: () => SubContent,
1425
+ SubTrigger: () => SubTrigger,
1426
+ Trigger: () => Trigger11,
1427
+ useRootContext: () => useRootContext6,
1428
+ useSubContext: () => useSubContext
1429
+ });
1430
+
1431
+ // src/context-menu/context-menu.tsx
1432
+ import * as React11 from "react";
1433
+ import {
1434
+ Pressable as Pressable6,
1435
+ Text as Text4,
1436
+ View as View6
1437
+ } from "react-native";
1438
+ import { jsx as jsx9 } from "react/jsx-runtime";
1439
+ var RootContext6 = React11.createContext(null);
1440
+ function useRootContext6() {
1441
+ const context = React11.useContext(RootContext6);
1442
+ if (!context) {
1443
+ throw new Error(
1444
+ "ContextMenu compound components cannot be rendered outside the ContextMenu.Root component"
1445
+ );
1446
+ }
1447
+ return context;
1448
+ }
1449
+ var FormItemContext = React11.createContext(null);
1450
+ function useFormItemContext() {
1451
+ const context = React11.useContext(FormItemContext);
1452
+ if (!context) {
1453
+ throw new Error(
1454
+ "ContextMenu.ItemIndicator must be rendered inside a CheckboxItem or RadioItem"
1455
+ );
1456
+ }
1457
+ return context;
1458
+ }
1459
+ var RadioItemContext = React11.createContext(null);
1460
+ var SubContext = React11.createContext(null);
1461
+ function useSubContext() {
1462
+ const context = React11.useContext(SubContext);
1463
+ if (!context) {
1464
+ throw new Error(
1465
+ "ContextMenu.Sub compound components cannot be rendered outside a ContextMenu.Sub component"
1466
+ );
1467
+ }
1468
+ return context;
1469
+ }
1470
+ function Root6({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
1471
+ const nativeID = React11.useId();
1472
+ const [open = false, onOpenChange] = useControllableState({
1473
+ prop: openProp,
1474
+ defaultProp: defaultOpen,
1475
+ onChange: onOpenChangeProp
1476
+ });
1477
+ const [triggerPosition, setTriggerPosition] = React11.useState(null);
1478
+ const [contentLayout, setContentLayout] = React11.useState(null);
1479
+ return /* @__PURE__ */ jsx9(
1480
+ RootContext6.Provider,
1481
+ {
1482
+ value: {
1483
+ open,
1484
+ onOpenChange,
1485
+ triggerPosition,
1486
+ setTriggerPosition,
1487
+ contentLayout,
1488
+ setContentLayout,
1489
+ nativeID
1490
+ },
1491
+ children
1492
+ }
1493
+ );
1494
+ }
1495
+ Root6.displayName = "ContextMenuRoot";
1496
+ var Trigger11 = React11.forwardRef(function Trigger12({ asChild, onLongPress: onLongPressProp, disabled, ...props }, ref) {
1497
+ const { open, onOpenChange, setTriggerPosition } = useRootContext6();
1498
+ const augmentedRef = useAugmentedRef({
1499
+ ref,
1500
+ methods: {
1501
+ open: () => {
1502
+ onOpenChange(true);
1503
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1504
+ setTriggerPosition({ width, pageX, pageY, height });
1505
+ });
1506
+ },
1507
+ close: () => {
1508
+ setTriggerPosition(null);
1509
+ onOpenChange(false);
1510
+ }
1511
+ }
1512
+ });
1513
+ const onLongPress = React11.useCallback(
1514
+ (ev) => {
1515
+ if (disabled) return;
1516
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1517
+ setTriggerPosition({ width, pageX, pageY, height });
1518
+ });
1519
+ onOpenChange(!open);
1520
+ onLongPressProp?.(ev);
1521
+ },
1522
+ [augmentedRef, disabled, onOpenChange, onLongPressProp, open, setTriggerPosition]
1523
+ );
1524
+ const Component = asChild ? Slot : Pressable6;
1525
+ return /* @__PURE__ */ jsx9(
1526
+ Component,
1527
+ {
1528
+ ref: augmentedRef,
1529
+ role: "button",
1530
+ "aria-expanded": open,
1531
+ "aria-disabled": disabled || void 0,
1532
+ onLongPress,
1533
+ disabled: disabled || void 0,
1534
+ ...props
1535
+ }
1536
+ );
1537
+ });
1538
+ Trigger11.displayName = "ContextMenuTrigger";
1539
+ function Portal6({ forceMount, hostName, children }) {
1540
+ const rootValue = useRootContext6();
1541
+ if (!forceMount && !rootValue.open) {
1542
+ return null;
1543
+ }
1544
+ return /* @__PURE__ */ jsx9(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx9(RootContext6.Provider, { value: rootValue, children }) });
1545
+ }
1546
+ Portal6.displayName = "ContextMenuPortal";
1547
+ var Overlay9 = React11.forwardRef(function Overlay10({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
1548
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
1549
+ const onPress = React11.useCallback(
1550
+ (ev) => {
1551
+ if (closeOnPress) {
1552
+ setTriggerPosition(null);
1553
+ setContentLayout(null);
1554
+ onOpenChange(false);
1555
+ }
1556
+ onPressProp?.(ev);
1557
+ },
1558
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1559
+ );
1560
+ if (!forceMount && !open) {
1561
+ return null;
1562
+ }
1563
+ const Component = asChild ? Slot : Pressable6;
1564
+ return /* @__PURE__ */ jsx9(Component, { ref, onPress, ...props });
1565
+ });
1566
+ Overlay9.displayName = "ContextMenuOverlay";
1567
+ var Content11 = React11.forwardRef(function Content12({
1568
+ asChild,
1569
+ forceMount,
1570
+ align = "start",
1571
+ side = "bottom",
1572
+ sideOffset = 0,
1573
+ alignOffset = 0,
1574
+ avoidCollisions = true,
1575
+ insets,
1576
+ style,
1577
+ disablePositioningStyle,
1578
+ onLayout: onLayoutProp,
1579
+ ...props
1580
+ }, ref) {
1581
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext6();
1582
+ const positionStyle = useRelativePosition({
1583
+ align,
1584
+ avoidCollisions,
1585
+ triggerPosition,
1586
+ contentLayout,
1587
+ alignOffset,
1588
+ insets,
1589
+ sideOffset,
1590
+ side,
1591
+ disablePositioningStyle
1592
+ });
1593
+ const onLayout = React11.useCallback(
1594
+ (event) => {
1595
+ setContentLayout(event.nativeEvent.layout);
1596
+ onLayoutProp?.(event);
1597
+ },
1598
+ [onLayoutProp, setContentLayout]
1599
+ );
1600
+ if (!forceMount && !open) {
1601
+ return null;
1602
+ }
1603
+ const Component = asChild ? Slot : View6;
1604
+ return /* @__PURE__ */ jsx9(
1605
+ Component,
1606
+ {
1607
+ ref,
1608
+ role: "menu",
1609
+ "aria-modal": true,
1610
+ style: [positionStyle, style],
1611
+ onLayout,
1612
+ ...props
1613
+ }
1614
+ );
1615
+ });
1616
+ Content11.displayName = "ContextMenuContent";
1617
+ var Item3 = React11.forwardRef(function Item4({ asChild, textValue, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
1618
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
1619
+ const onPress = React11.useCallback(
1620
+ (ev) => {
1621
+ if (disabled) return;
1622
+ if (closeOnPress) {
1623
+ setTriggerPosition(null);
1624
+ setContentLayout(null);
1625
+ onOpenChange(false);
1626
+ }
1627
+ onPressProp?.(ev);
1628
+ },
1629
+ [closeOnPress, disabled, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1630
+ );
1631
+ const Component = asChild ? Slot : Pressable6;
1632
+ return /* @__PURE__ */ jsx9(
1633
+ Component,
1634
+ {
1635
+ ref,
1636
+ role: "menuitem",
1637
+ "aria-valuetext": textValue,
1638
+ "aria-disabled": disabled || void 0,
1639
+ onPress,
1640
+ disabled: disabled || void 0,
1641
+ ...props
1642
+ }
1643
+ );
1644
+ });
1645
+ Item3.displayName = "ContextMenuItem";
1646
+ var Group3 = React11.forwardRef(function Group4({ asChild, ...props }, ref) {
1647
+ const Component = asChild ? Slot : View6;
1648
+ return /* @__PURE__ */ jsx9(Component, { ref, role: "group", ...props });
1649
+ });
1650
+ Group3.displayName = "ContextMenuGroup";
1651
+ var Label3 = React11.forwardRef(function Label4({ asChild, ...props }, ref) {
1652
+ const Component = asChild ? Slot : Text4;
1653
+ return /* @__PURE__ */ jsx9(Component, { ref, ...props });
1654
+ });
1655
+ Label3.displayName = "ContextMenuLabel";
1656
+ var CheckboxItem = React11.forwardRef(function CheckboxItem2({
1657
+ asChild,
1658
+ checked,
1659
+ onCheckedChange,
1660
+ textValue,
1661
+ onPress: onPressProp,
1662
+ closeOnPress = true,
1663
+ disabled,
1664
+ ...props
1665
+ }, ref) {
1666
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
1667
+ const onPress = React11.useCallback(
1668
+ (ev) => {
1669
+ if (disabled) return;
1670
+ onCheckedChange(!checked);
1671
+ if (closeOnPress) {
1672
+ setTriggerPosition(null);
1673
+ setContentLayout(null);
1674
+ onOpenChange(false);
1675
+ }
1676
+ onPressProp?.(ev);
1677
+ },
1678
+ [checked, closeOnPress, disabled, onCheckedChange, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1679
+ );
1680
+ const Component = asChild ? Slot : Pressable6;
1681
+ return /* @__PURE__ */ jsx9(FormItemContext.Provider, { value: { checked }, children: /* @__PURE__ */ jsx9(
1682
+ Component,
1683
+ {
1684
+ ref,
1685
+ role: "checkbox",
1686
+ "aria-checked": checked,
1687
+ "aria-valuetext": textValue,
1688
+ "aria-disabled": disabled || void 0,
1689
+ onPress,
1690
+ disabled: disabled || void 0,
1691
+ ...props
1692
+ }
1693
+ ) });
1694
+ });
1695
+ CheckboxItem.displayName = "ContextMenuCheckboxItem";
1696
+ var RadioGroup = React11.forwardRef(function RadioGroup2({ asChild, value, onValueChange, ...props }, ref) {
1697
+ const Component = asChild ? Slot : View6;
1698
+ return /* @__PURE__ */ jsx9(FormItemContext.Provider, { value: { value, onValueChange }, children: /* @__PURE__ */ jsx9(Component, { ref, role: "radiogroup", ...props }) });
1699
+ });
1700
+ RadioGroup.displayName = "ContextMenuRadioGroup";
1701
+ var RadioItem = React11.forwardRef(function RadioItem2({
1702
+ asChild,
1703
+ value: itemValue,
1704
+ textValue,
1705
+ onPress: onPressProp,
1706
+ disabled,
1707
+ closeOnPress = true,
1708
+ ...props
1709
+ }, ref) {
1710
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext6();
1711
+ const formContext = useFormItemContext();
1712
+ const onPress = React11.useCallback(
1713
+ (ev) => {
1714
+ if (disabled) return;
1715
+ formContext.onValueChange(itemValue);
1716
+ if (closeOnPress) {
1717
+ setTriggerPosition(null);
1718
+ setContentLayout(null);
1719
+ onOpenChange(false);
1720
+ }
1721
+ onPressProp?.(ev);
1722
+ },
1723
+ [closeOnPress, disabled, formContext, itemValue, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1724
+ );
1725
+ const Component = asChild ? Slot : Pressable6;
1726
+ return /* @__PURE__ */ jsx9(RadioItemContext.Provider, { value: { itemValue }, children: /* @__PURE__ */ jsx9(
1727
+ Component,
1728
+ {
1729
+ ref,
1730
+ role: "radio",
1731
+ "aria-checked": formContext.value === itemValue,
1732
+ "aria-valuetext": textValue,
1733
+ "aria-disabled": disabled || void 0,
1734
+ onPress,
1735
+ disabled: disabled || void 0,
1736
+ ...props
1737
+ }
1738
+ ) });
1739
+ });
1740
+ RadioItem.displayName = "ContextMenuRadioItem";
1741
+ var ItemIndicator3 = React11.forwardRef(function ItemIndicator4({ asChild, forceMount, ...props }, ref) {
1742
+ const formContext = useFormItemContext();
1743
+ const radioItemContext = React11.useContext(RadioItemContext);
1744
+ if (!forceMount) {
1745
+ if (radioItemContext) {
1746
+ const ctx = formContext;
1747
+ if (ctx.value !== radioItemContext.itemValue) {
1748
+ return null;
1749
+ }
1750
+ } else {
1751
+ const ctx = formContext;
1752
+ if (!ctx.checked) {
1753
+ return null;
1754
+ }
1755
+ }
1756
+ }
1757
+ const Component = asChild ? Slot : View6;
1758
+ return /* @__PURE__ */ jsx9(Component, { ref, role: "presentation", ...props });
1759
+ });
1760
+ ItemIndicator3.displayName = "ContextMenuItemIndicator";
1761
+ var Separator3 = React11.forwardRef(function Separator4({ asChild, decorative, ...props }, ref) {
1762
+ const Component = asChild ? Slot : View6;
1763
+ return /* @__PURE__ */ jsx9(
1764
+ Component,
1765
+ {
1766
+ ref,
1767
+ role: decorative ? "presentation" : "separator",
1768
+ ...props
1769
+ }
1770
+ );
1771
+ });
1772
+ Separator3.displayName = "ContextMenuSeparator";
1773
+ function Sub({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
1774
+ const nativeID = React11.useId();
1775
+ const [open = false, onOpenChange] = useControllableState({
1776
+ prop: openProp,
1777
+ defaultProp: defaultOpen,
1778
+ onChange: onOpenChangeProp
1779
+ });
1780
+ return /* @__PURE__ */ jsx9(SubContext.Provider, { value: { nativeID, open, onOpenChange }, children });
1781
+ }
1782
+ Sub.displayName = "ContextMenuSub";
1783
+ var SubTrigger = React11.forwardRef(function SubTrigger2({ asChild, textValue, onPress: onPressProp, disabled, ...props }, ref) {
1784
+ const { open, onOpenChange } = useSubContext();
1785
+ const onPress = React11.useCallback(
1786
+ (ev) => {
1787
+ if (disabled) return;
1788
+ onOpenChange(!open);
1789
+ onPressProp?.(ev);
1790
+ },
1791
+ [disabled, onOpenChange, onPressProp, open]
1792
+ );
1793
+ const Component = asChild ? Slot : Pressable6;
1794
+ return /* @__PURE__ */ jsx9(
1795
+ Component,
1796
+ {
1797
+ ref,
1798
+ role: "menuitem",
1799
+ "aria-expanded": open,
1800
+ "aria-valuetext": textValue,
1801
+ "aria-disabled": disabled || void 0,
1802
+ onPress,
1803
+ disabled: disabled || void 0,
1804
+ ...props
1805
+ }
1806
+ );
1807
+ });
1808
+ SubTrigger.displayName = "ContextMenuSubTrigger";
1809
+ var SubContent = React11.forwardRef(function SubContent2({ asChild, forceMount, ...props }, ref) {
1810
+ const { open, nativeID } = useSubContext();
1811
+ if (!forceMount && !open) {
1812
+ return null;
1813
+ }
1814
+ const Component = asChild ? Slot : View6;
1815
+ return /* @__PURE__ */ jsx9(Component, { ref, role: "menu", "aria-labelledby": nativeID, ...props });
1816
+ });
1817
+ SubContent.displayName = "ContextMenuSubContent";
1818
+
1819
+ // src/dropdown-menu/index.ts
1820
+ var dropdown_menu_exports = {};
1821
+ __export(dropdown_menu_exports, {
1822
+ CheckboxItem: () => CheckboxItem3,
1823
+ Content: () => Content13,
1824
+ Group: () => Group5,
1825
+ Item: () => Item5,
1826
+ ItemIndicator: () => ItemIndicator5,
1827
+ Label: () => Label5,
1828
+ Overlay: () => Overlay11,
1829
+ Portal: () => Portal7,
1830
+ RadioGroup: () => RadioGroup3,
1831
+ RadioItem: () => RadioItem3,
1832
+ Root: () => Root7,
1833
+ Separator: () => Separator5,
1834
+ Sub: () => Sub2,
1835
+ SubContent: () => SubContent3,
1836
+ SubTrigger: () => SubTrigger3,
1837
+ Trigger: () => Trigger13,
1838
+ useRootContext: () => useRootContext7,
1839
+ useSubContext: () => useSubContext2
1840
+ });
1841
+
1842
+ // src/dropdown-menu/dropdown-menu.tsx
1843
+ import * as React12 from "react";
1844
+ import {
1845
+ Pressable as Pressable7,
1846
+ Text as Text5,
1847
+ View as View7
1848
+ } from "react-native";
1849
+ import { jsx as jsx10 } from "react/jsx-runtime";
1850
+ var RootContext7 = React12.createContext(null);
1851
+ function useRootContext7() {
1852
+ const context = React12.useContext(RootContext7);
1853
+ if (!context) {
1854
+ throw new Error(
1855
+ "DropdownMenu compound components cannot be rendered outside the DropdownMenu.Root component"
1856
+ );
1857
+ }
1858
+ return context;
1859
+ }
1860
+ var FormItemContext2 = React12.createContext(null);
1861
+ function useFormItemContext2() {
1862
+ const context = React12.useContext(FormItemContext2);
1863
+ if (!context) {
1864
+ throw new Error(
1865
+ "DropdownMenu.ItemIndicator must be rendered inside a CheckboxItem or RadioItem"
1866
+ );
1867
+ }
1868
+ return context;
1869
+ }
1870
+ var RadioItemContext2 = React12.createContext(null);
1871
+ var SubContext2 = React12.createContext(null);
1872
+ function useSubContext2() {
1873
+ const context = React12.useContext(SubContext2);
1874
+ if (!context) {
1875
+ throw new Error(
1876
+ "DropdownMenu.Sub compound components cannot be rendered outside a DropdownMenu.Sub component"
1877
+ );
1878
+ }
1879
+ return context;
1880
+ }
1881
+ function Root7({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
1882
+ const nativeID = React12.useId();
1883
+ const [open = false, onOpenChange] = useControllableState({
1884
+ prop: openProp,
1885
+ defaultProp: defaultOpen,
1886
+ onChange: onOpenChangeProp
1887
+ });
1888
+ const [triggerPosition, setTriggerPosition] = React12.useState(null);
1889
+ const [contentLayout, setContentLayout] = React12.useState(null);
1890
+ return /* @__PURE__ */ jsx10(
1891
+ RootContext7.Provider,
1892
+ {
1893
+ value: {
1894
+ open,
1895
+ onOpenChange,
1896
+ triggerPosition,
1897
+ setTriggerPosition,
1898
+ contentLayout,
1899
+ setContentLayout,
1900
+ nativeID
1901
+ },
1902
+ children
1903
+ }
1904
+ );
1905
+ }
1906
+ Root7.displayName = "DropdownMenuRoot";
1907
+ var Trigger13 = React12.forwardRef(function Trigger14({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
1908
+ const { open, onOpenChange, setTriggerPosition } = useRootContext7();
1909
+ const augmentedRef = useAugmentedRef({
1910
+ ref,
1911
+ methods: {
1912
+ open: () => {
1913
+ onOpenChange(true);
1914
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1915
+ setTriggerPosition({ width, pageX, pageY, height });
1916
+ });
1917
+ },
1918
+ close: () => {
1919
+ setTriggerPosition(null);
1920
+ onOpenChange(false);
1921
+ }
1922
+ }
1923
+ });
1924
+ const onPress = React12.useCallback(
1925
+ (ev) => {
1926
+ if (disabled) return;
1927
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
1928
+ setTriggerPosition({ width, pageX, pageY, height });
1929
+ });
1930
+ onOpenChange(!open);
1931
+ onPressProp?.(ev);
1932
+ },
1933
+ [augmentedRef, disabled, onOpenChange, onPressProp, open, setTriggerPosition]
1934
+ );
1935
+ const Component = asChild ? Slot : Pressable7;
1936
+ return /* @__PURE__ */ jsx10(
1937
+ Component,
1938
+ {
1939
+ ref: augmentedRef,
1940
+ role: "button",
1941
+ "aria-expanded": open,
1942
+ "aria-disabled": disabled || void 0,
1943
+ onPress,
1944
+ disabled: disabled || void 0,
1945
+ ...props
1946
+ }
1947
+ );
1948
+ });
1949
+ Trigger13.displayName = "DropdownMenuTrigger";
1950
+ function Portal7({ forceMount, hostName, children }) {
1951
+ const rootValue = useRootContext7();
1952
+ if (!forceMount && !rootValue.open) {
1953
+ return null;
1954
+ }
1955
+ return /* @__PURE__ */ jsx10(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx10(RootContext7.Provider, { value: rootValue, children }) });
1956
+ }
1957
+ Portal7.displayName = "DropdownMenuPortal";
1958
+ var Overlay11 = React12.forwardRef(function Overlay12({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
1959
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
1960
+ const onPress = React12.useCallback(
1961
+ (ev) => {
1962
+ if (closeOnPress) {
1963
+ setTriggerPosition(null);
1964
+ setContentLayout(null);
1965
+ onOpenChange(false);
1966
+ }
1967
+ onPressProp?.(ev);
1968
+ },
1969
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
1970
+ );
1971
+ if (!forceMount && !open) {
1972
+ return null;
1973
+ }
1974
+ const Component = asChild ? Slot : Pressable7;
1975
+ return /* @__PURE__ */ jsx10(Component, { ref, onPress, ...props });
1976
+ });
1977
+ Overlay11.displayName = "DropdownMenuOverlay";
1978
+ var Content13 = React12.forwardRef(function Content14({
1979
+ asChild,
1980
+ forceMount,
1981
+ align = "start",
1982
+ side = "bottom",
1983
+ sideOffset = 0,
1984
+ alignOffset = 0,
1985
+ avoidCollisions = true,
1986
+ insets,
1987
+ style,
1988
+ disablePositioningStyle,
1989
+ onLayout: onLayoutProp,
1990
+ ...props
1991
+ }, ref) {
1992
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext7();
1993
+ const positionStyle = useRelativePosition({
1994
+ align,
1995
+ avoidCollisions,
1996
+ triggerPosition,
1997
+ contentLayout,
1998
+ alignOffset,
1999
+ insets,
2000
+ sideOffset,
2001
+ side,
2002
+ disablePositioningStyle
2003
+ });
2004
+ const onLayout = React12.useCallback(
2005
+ (event) => {
2006
+ setContentLayout(event.nativeEvent.layout);
2007
+ onLayoutProp?.(event);
2008
+ },
2009
+ [onLayoutProp, setContentLayout]
2010
+ );
2011
+ if (!forceMount && !open) {
2012
+ return null;
2013
+ }
2014
+ const Component = asChild ? Slot : View7;
2015
+ return /* @__PURE__ */ jsx10(
2016
+ Component,
2017
+ {
2018
+ ref,
2019
+ role: "menu",
2020
+ "aria-modal": true,
2021
+ style: [positionStyle, style],
2022
+ onLayout,
2023
+ ...props
2024
+ }
2025
+ );
2026
+ });
2027
+ Content13.displayName = "DropdownMenuContent";
2028
+ var Item5 = React12.forwardRef(function Item6({ asChild, textValue, onPress: onPressProp, disabled, closeOnPress = true, ...props }, ref) {
2029
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
2030
+ const onPress = React12.useCallback(
2031
+ (ev) => {
2032
+ if (disabled) return;
2033
+ if (closeOnPress) {
2034
+ setTriggerPosition(null);
2035
+ setContentLayout(null);
2036
+ onOpenChange(false);
2037
+ }
2038
+ onPressProp?.(ev);
2039
+ },
2040
+ [closeOnPress, disabled, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
2041
+ );
2042
+ const Component = asChild ? Slot : Pressable7;
2043
+ return /* @__PURE__ */ jsx10(
2044
+ Component,
2045
+ {
2046
+ ref,
2047
+ role: "menuitem",
2048
+ "aria-valuetext": textValue,
2049
+ "aria-disabled": disabled || void 0,
2050
+ onPress,
2051
+ disabled: disabled || void 0,
2052
+ ...props
2053
+ }
2054
+ );
2055
+ });
2056
+ Item5.displayName = "DropdownMenuItem";
2057
+ var Group5 = React12.forwardRef(function Group6({ asChild, ...props }, ref) {
2058
+ const Component = asChild ? Slot : View7;
2059
+ return /* @__PURE__ */ jsx10(Component, { ref, role: "group", ...props });
2060
+ });
2061
+ Group5.displayName = "DropdownMenuGroup";
2062
+ var Label5 = React12.forwardRef(function Label6({ asChild, ...props }, ref) {
2063
+ const Component = asChild ? Slot : Text5;
2064
+ return /* @__PURE__ */ jsx10(Component, { ref, ...props });
2065
+ });
2066
+ Label5.displayName = "DropdownMenuLabel";
2067
+ var CheckboxItem3 = React12.forwardRef(function CheckboxItem4({
2068
+ asChild,
2069
+ checked,
2070
+ onCheckedChange,
2071
+ textValue,
2072
+ onPress: onPressProp,
2073
+ closeOnPress = true,
2074
+ disabled,
2075
+ ...props
2076
+ }, ref) {
2077
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
2078
+ const onPress = React12.useCallback(
2079
+ (ev) => {
2080
+ if (disabled) return;
2081
+ onCheckedChange(!checked);
2082
+ if (closeOnPress) {
2083
+ setTriggerPosition(null);
2084
+ setContentLayout(null);
2085
+ onOpenChange(false);
2086
+ }
2087
+ onPressProp?.(ev);
2088
+ },
2089
+ [checked, closeOnPress, disabled, onCheckedChange, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
2090
+ );
2091
+ const Component = asChild ? Slot : Pressable7;
2092
+ return /* @__PURE__ */ jsx10(FormItemContext2.Provider, { value: { checked }, children: /* @__PURE__ */ jsx10(
2093
+ Component,
2094
+ {
2095
+ ref,
2096
+ role: "checkbox",
2097
+ "aria-checked": checked,
2098
+ "aria-valuetext": textValue,
2099
+ "aria-disabled": disabled || void 0,
2100
+ onPress,
2101
+ disabled: disabled || void 0,
2102
+ ...props
2103
+ }
2104
+ ) });
2105
+ });
2106
+ CheckboxItem3.displayName = "DropdownMenuCheckboxItem";
2107
+ var RadioGroup3 = React12.forwardRef(function RadioGroup4({ asChild, value, onValueChange, ...props }, ref) {
2108
+ const Component = asChild ? Slot : View7;
2109
+ return /* @__PURE__ */ jsx10(FormItemContext2.Provider, { value: { value, onValueChange }, children: /* @__PURE__ */ jsx10(Component, { ref, role: "radiogroup", ...props }) });
2110
+ });
2111
+ RadioGroup3.displayName = "DropdownMenuRadioGroup";
2112
+ var RadioItem3 = React12.forwardRef(function RadioItem4({
2113
+ asChild,
2114
+ value: itemValue,
2115
+ textValue,
2116
+ onPress: onPressProp,
2117
+ disabled,
2118
+ closeOnPress = true,
2119
+ ...props
2120
+ }, ref) {
2121
+ const { onOpenChange, setTriggerPosition, setContentLayout } = useRootContext7();
2122
+ const formContext = useFormItemContext2();
2123
+ const onPress = React12.useCallback(
2124
+ (ev) => {
2125
+ if (disabled) return;
2126
+ formContext.onValueChange(itemValue);
2127
+ if (closeOnPress) {
2128
+ setTriggerPosition(null);
2129
+ setContentLayout(null);
2130
+ onOpenChange(false);
2131
+ }
2132
+ onPressProp?.(ev);
2133
+ },
2134
+ [closeOnPress, disabled, formContext, itemValue, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
2135
+ );
2136
+ const Component = asChild ? Slot : Pressable7;
2137
+ return /* @__PURE__ */ jsx10(RadioItemContext2.Provider, { value: { itemValue }, children: /* @__PURE__ */ jsx10(
2138
+ Component,
2139
+ {
2140
+ ref,
2141
+ role: "radio",
2142
+ "aria-checked": formContext.value === itemValue,
2143
+ "aria-valuetext": textValue,
2144
+ "aria-disabled": disabled || void 0,
2145
+ onPress,
2146
+ disabled: disabled || void 0,
2147
+ ...props
2148
+ }
2149
+ ) });
2150
+ });
2151
+ RadioItem3.displayName = "DropdownMenuRadioItem";
2152
+ var ItemIndicator5 = React12.forwardRef(function ItemIndicator6({ asChild, forceMount, ...props }, ref) {
2153
+ const formContext = useFormItemContext2();
2154
+ const radioItemContext = React12.useContext(RadioItemContext2);
2155
+ if (!forceMount) {
2156
+ if (radioItemContext) {
2157
+ const ctx = formContext;
2158
+ if (ctx.value !== radioItemContext.itemValue) {
2159
+ return null;
2160
+ }
2161
+ } else {
2162
+ const ctx = formContext;
2163
+ if (!ctx.checked) {
2164
+ return null;
2165
+ }
2166
+ }
2167
+ }
2168
+ const Component = asChild ? Slot : View7;
2169
+ return /* @__PURE__ */ jsx10(Component, { ref, role: "presentation", ...props });
2170
+ });
2171
+ ItemIndicator5.displayName = "DropdownMenuItemIndicator";
2172
+ var Separator5 = React12.forwardRef(function Separator6({ asChild, decorative, ...props }, ref) {
2173
+ const Component = asChild ? Slot : View7;
2174
+ return /* @__PURE__ */ jsx10(
2175
+ Component,
2176
+ {
2177
+ ref,
2178
+ role: decorative ? "presentation" : "separator",
2179
+ ...props
2180
+ }
2181
+ );
2182
+ });
2183
+ Separator5.displayName = "DropdownMenuSeparator";
2184
+ function Sub2({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
2185
+ const nativeID = React12.useId();
2186
+ const [open = false, onOpenChange] = useControllableState({
2187
+ prop: openProp,
2188
+ defaultProp: defaultOpen,
2189
+ onChange: onOpenChangeProp
2190
+ });
2191
+ return /* @__PURE__ */ jsx10(SubContext2.Provider, { value: { nativeID, open, onOpenChange }, children });
2192
+ }
2193
+ Sub2.displayName = "DropdownMenuSub";
2194
+ var SubTrigger3 = React12.forwardRef(function SubTrigger4({ asChild, textValue, onPress: onPressProp, disabled, ...props }, ref) {
2195
+ const { open, onOpenChange } = useSubContext2();
2196
+ const onPress = React12.useCallback(
2197
+ (ev) => {
2198
+ if (disabled) return;
2199
+ onOpenChange(!open);
2200
+ onPressProp?.(ev);
2201
+ },
2202
+ [disabled, onOpenChange, onPressProp, open]
2203
+ );
2204
+ const Component = asChild ? Slot : Pressable7;
2205
+ return /* @__PURE__ */ jsx10(
2206
+ Component,
2207
+ {
2208
+ ref,
2209
+ role: "menuitem",
2210
+ "aria-expanded": open,
2211
+ "aria-valuetext": textValue,
2212
+ "aria-disabled": disabled || void 0,
2213
+ onPress,
2214
+ disabled: disabled || void 0,
2215
+ ...props
2216
+ }
2217
+ );
2218
+ });
2219
+ SubTrigger3.displayName = "DropdownMenuSubTrigger";
2220
+ var SubContent3 = React12.forwardRef(function SubContent4({ asChild, forceMount, ...props }, ref) {
2221
+ const { open, nativeID } = useSubContext2();
2222
+ if (!forceMount && !open) {
2223
+ return null;
2224
+ }
2225
+ const Component = asChild ? Slot : View7;
2226
+ return /* @__PURE__ */ jsx10(Component, { ref, role: "menu", "aria-labelledby": nativeID, ...props });
2227
+ });
2228
+ SubContent3.displayName = "DropdownMenuSubContent";
2229
+
2230
+ // src/list/index.ts
2231
+ var list_exports = {};
2232
+ __export(list_exports, {
2233
+ Item: () => Item7,
2234
+ Root: () => Root8,
2235
+ useItemContext: () => useItemContext2
2236
+ });
2237
+
2238
+ // src/list/list.tsx
2239
+ import React13 from "react";
2240
+ import { FlatList, View as View8 } from "react-native";
2241
+ import { jsx as jsx11 } from "react/jsx-runtime";
2242
+ var ItemContext2 = React13.createContext(null);
2243
+ function useItemContext2() {
2244
+ const context = React13.useContext(ItemContext2);
2245
+ if (!context) {
2246
+ throw new Error("useItemContext must be used within a List.Item");
2247
+ }
2248
+ return context;
2249
+ }
2250
+ function RootInner({ data, renderItem, keyExtractor, estimatedItemSize, ...props }, ref) {
2251
+ return /* @__PURE__ */ jsx11(
2252
+ FlatList,
2253
+ {
2254
+ ref,
2255
+ data,
2256
+ keyExtractor,
2257
+ getItemLayout: estimatedItemSize ? (_, index) => ({
2258
+ length: estimatedItemSize,
2259
+ offset: estimatedItemSize * index,
2260
+ index
2261
+ }) : void 0,
2262
+ renderItem: ({ item, index }) => /* @__PURE__ */ jsx11(ItemContext2.Provider, { value: { item, index }, children: renderItem({ item, index }) }),
2263
+ ...props
2264
+ }
2265
+ );
2266
+ }
2267
+ var Root8 = React13.forwardRef(RootInner);
2268
+ var Item7 = React13.forwardRef(
2269
+ ({ children, ...props }, ref) => /* @__PURE__ */ jsx11(View8, { ref, ...props, children })
2270
+ );
2271
+ Item7.displayName = "ListItem";
2272
+
2273
+ // src/image/index.ts
2274
+ var image_exports = {};
2275
+ __export(image_exports, {
2276
+ Root: () => Root9
2277
+ });
2278
+
2279
+ // src/image/image.tsx
2280
+ import React14 from "react";
2281
+ import { Image as RNImage } from "react-native";
2282
+ import { jsx as jsx12 } from "react/jsx-runtime";
2283
+ var contentFitToResizeMode = {
2284
+ cover: "cover",
2285
+ contain: "contain",
2286
+ fill: "stretch",
2287
+ none: "center",
2288
+ "scale-down": "contain"
2289
+ };
2290
+ var Root9 = React14.forwardRef(
2291
+ ({ source, alt, placeholder, contentFit = "cover", style, ...props }, ref) => {
2292
+ return /* @__PURE__ */ jsx12(
2293
+ RNImage,
2294
+ {
2295
+ ref,
2296
+ source,
2297
+ accessibilityLabel: alt,
2298
+ alt,
2299
+ resizeMode: contentFitToResizeMode[contentFit],
2300
+ defaultSource: placeholder,
2301
+ style,
2302
+ ...props
2303
+ }
2304
+ );
2305
+ }
2306
+ );
2307
+ Root9.displayName = "ImageRoot";
2308
+
2309
+ // src/label/index.ts
2310
+ var label_exports = {};
2311
+ __export(label_exports, {
2312
+ Root: () => Root10,
2313
+ useRootContext: () => useRootContext8
2314
+ });
2315
+
2316
+ // src/label/label.tsx
2317
+ import * as React15 from "react";
2318
+ import { Text as Text6 } from "react-native";
2319
+ import { jsx as jsx13 } from "react/jsx-runtime";
2320
+ var RootContext8 = React15.createContext(null);
2321
+ function useRootContext8() {
2322
+ const context = React15.useContext(RootContext8);
2323
+ if (!context) {
2324
+ throw new Error(
2325
+ "Label compound components cannot be rendered outside the Label.Root component"
2326
+ );
2327
+ }
2328
+ return context;
2329
+ }
2330
+ var Root10 = React15.forwardRef(function Root11({ asChild, nativeID, ...props }, ref) {
2331
+ const Component = asChild ? Slot : Text6;
2332
+ return /* @__PURE__ */ jsx13(RootContext8.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx13(Component, { ref, nativeID, ...props }) });
2333
+ });
2334
+ Root10.displayName = "LabelRoot";
2335
+
2336
+ // src/separator/index.ts
2337
+ var separator_exports = {};
2338
+ __export(separator_exports, {
2339
+ Root: () => Root12
2340
+ });
2341
+
2342
+ // src/separator/separator.tsx
2343
+ import * as React16 from "react";
2344
+ import { View as View9 } from "react-native";
2345
+ import { jsx as jsx14 } from "react/jsx-runtime";
2346
+ var Root12 = React16.forwardRef(function Root13({ asChild, orientation = "horizontal", decorative = false, ...props }, ref) {
2347
+ const Component = asChild ? Slot : View9;
2348
+ return /* @__PURE__ */ jsx14(
2349
+ Component,
2350
+ {
2351
+ ref,
2352
+ role: decorative ? "presentation" : "separator",
2353
+ "aria-orientation": orientation,
2354
+ ...props
2355
+ }
2356
+ );
2357
+ });
2358
+ Root12.displayName = "SeparatorRoot";
2359
+
2360
+ // src/combobox/index.ts
2361
+ var combobox_exports = {};
2362
+ __export(combobox_exports, {
2363
+ Content: () => Content15,
2364
+ Empty: () => Empty,
2365
+ Input: () => Input,
2366
+ Item: () => Item8,
2367
+ ItemText: () => ItemText3,
2368
+ Portal: () => Portal8,
2369
+ Root: () => Root14,
2370
+ Trigger: () => Trigger15,
2371
+ useRootContext: () => useRootContext9
2372
+ });
2373
+
2374
+ // src/combobox/combobox.tsx
2375
+ import * as React17 from "react";
2376
+ import {
2377
+ Pressable as Pressable8,
2378
+ Text as Text7,
2379
+ TextInput,
2380
+ View as View10
2381
+ } from "react-native";
2382
+ import { jsx as jsx15 } from "react/jsx-runtime";
2383
+ var RootContext9 = React17.createContext(null);
2384
+ function useRootContext9() {
2385
+ const context = React17.useContext(RootContext9);
2386
+ if (!context) {
2387
+ throw new Error(
2388
+ "Combobox compound components cannot be rendered outside the Combobox.Root component"
2389
+ );
2390
+ }
2391
+ return context;
2392
+ }
2393
+ var ItemContext3 = React17.createContext(null);
2394
+ function useItemContext3() {
2395
+ const context = React17.useContext(ItemContext3);
2396
+ if (!context) {
2397
+ throw new Error(
2398
+ "Combobox.Item compound components cannot be rendered outside a Combobox.Item component"
2399
+ );
2400
+ }
2401
+ return context;
2402
+ }
2403
+ function Root14({
2404
+ value: valueProp,
2405
+ defaultValue,
2406
+ onValueChange: onValueChangeProp,
2407
+ open: openProp,
2408
+ defaultOpen,
2409
+ onOpenChange: onOpenChangeProp,
2410
+ searchValue: searchValueProp,
2411
+ onSearchValueChange: onSearchValueChangeProp,
2412
+ children
2413
+ }) {
2414
+ const nativeID = React17.useId();
2415
+ const [value, onValueChange] = useControllableState({
2416
+ prop: valueProp,
2417
+ defaultProp: defaultValue,
2418
+ onChange: onValueChangeProp
2419
+ });
2420
+ const [open = false, onOpenChange] = useControllableState({
2421
+ prop: openProp,
2422
+ defaultProp: defaultOpen,
2423
+ onChange: onOpenChangeProp
2424
+ });
2425
+ const [searchValue = "", onSearchValueChange] = useControllableState({
2426
+ prop: searchValueProp,
2427
+ defaultProp: "",
2428
+ onChange: onSearchValueChangeProp
2429
+ });
2430
+ return /* @__PURE__ */ jsx15(
2431
+ RootContext9.Provider,
2432
+ {
2433
+ value: {
2434
+ value,
2435
+ onValueChange,
2436
+ open,
2437
+ onOpenChange,
2438
+ searchValue,
2439
+ onSearchValueChange,
2440
+ nativeID
2441
+ },
2442
+ children
2443
+ }
2444
+ );
2445
+ }
2446
+ Root14.displayName = "ComboboxRoot";
2447
+ var Input = React17.forwardRef(function Input2({ asChild, placeholder, ...props }, ref) {
2448
+ const { open, onOpenChange, searchValue, onSearchValueChange } = useRootContext9();
2449
+ const onChange = React17.useCallback(
2450
+ (ev) => {
2451
+ onSearchValueChange(ev.nativeEvent.text);
2452
+ if (!open) {
2453
+ onOpenChange(true);
2454
+ }
2455
+ },
2456
+ [onSearchValueChange, onOpenChange, open]
2457
+ );
2458
+ const onFocus = React17.useCallback(() => {
2459
+ if (!open) {
2460
+ onOpenChange(true);
2461
+ }
2462
+ }, [onOpenChange, open]);
2463
+ const Component = asChild ? Slot : TextInput;
2464
+ return /* @__PURE__ */ jsx15(
2465
+ Component,
2466
+ {
2467
+ ref,
2468
+ role: "combobox",
2469
+ "aria-expanded": open,
2470
+ "aria-autocomplete": "list",
2471
+ placeholder,
2472
+ value: searchValue,
2473
+ onChange,
2474
+ onFocus,
2475
+ ...props
2476
+ }
2477
+ );
2478
+ });
2479
+ Input.displayName = "ComboboxInput";
2480
+ var Trigger15 = React17.forwardRef(function Trigger16({ asChild, onPress: onPressProp, ...props }, ref) {
2481
+ const { open, onOpenChange } = useRootContext9();
2482
+ const onPress = React17.useCallback(
2483
+ (ev) => {
2484
+ onOpenChange(!open);
2485
+ onPressProp?.(ev);
2486
+ },
2487
+ [onOpenChange, onPressProp, open]
2488
+ );
2489
+ const Component = asChild ? Slot : Pressable8;
2490
+ return /* @__PURE__ */ jsx15(
2491
+ Component,
2492
+ {
2493
+ ref,
2494
+ role: "button",
2495
+ "aria-expanded": open,
2496
+ onPress,
2497
+ ...props
2498
+ }
2499
+ );
2500
+ });
2501
+ Trigger15.displayName = "ComboboxTrigger";
2502
+ function Portal8({ forceMount, hostName, children }) {
2503
+ const rootValue = useRootContext9();
2504
+ if (!forceMount && !rootValue.open) {
2505
+ return null;
2506
+ }
2507
+ return /* @__PURE__ */ jsx15(Portal, { hostName, name: `${rootValue.nativeID}_portal`, children: /* @__PURE__ */ jsx15(RootContext9.Provider, { value: rootValue, children }) });
2508
+ }
2509
+ Portal8.displayName = "ComboboxPortal";
2510
+ var Content15 = React17.forwardRef(function Content16({ asChild, forceMount, ...props }, ref) {
2511
+ const { open } = useRootContext9();
2512
+ if (!forceMount && !open) {
2513
+ return null;
2514
+ }
2515
+ const Component = asChild ? Slot : View10;
2516
+ return /* @__PURE__ */ jsx15(Component, { ref, role: "listbox", ...props });
2517
+ });
2518
+ Content15.displayName = "ComboboxContent";
2519
+ var Item8 = React17.forwardRef(function Item9({ asChild, value: itemValue, label, onPress: onPressProp, ...props }, ref) {
2520
+ const { value, onValueChange, onOpenChange, onSearchValueChange } = useRootContext9();
2521
+ const isSelected = value?.value === itemValue;
2522
+ const onPress = React17.useCallback(
2523
+ (ev) => {
2524
+ onValueChange({ value: itemValue, label });
2525
+ onOpenChange(false);
2526
+ onSearchValueChange("");
2527
+ onPressProp?.(ev);
2528
+ },
2529
+ [itemValue, label, onOpenChange, onPressProp, onSearchValueChange, onValueChange]
2530
+ );
2531
+ const Component = asChild ? Slot : Pressable8;
2532
+ return /* @__PURE__ */ jsx15(ItemContext3.Provider, { value: { itemValue, label }, children: /* @__PURE__ */ jsx15(
2533
+ Component,
2534
+ {
2535
+ ref,
2536
+ role: "option",
2537
+ "aria-selected": isSelected,
2538
+ onPress,
2539
+ ...props
2540
+ }
2541
+ ) });
2542
+ });
2543
+ Item8.displayName = "ComboboxItem";
2544
+ var ItemText3 = React17.forwardRef(function ItemText4({ asChild, ...props }, ref) {
2545
+ const { label } = useItemContext3();
2546
+ const Component = asChild ? Slot : Text7;
2547
+ return /* @__PURE__ */ jsx15(Component, { ref, ...props, children: label });
2548
+ });
2549
+ ItemText3.displayName = "ComboboxItemText";
2550
+ var Empty = React17.forwardRef(function Empty2({ asChild, ...props }, ref) {
2551
+ const Component = asChild ? Slot : View10;
2552
+ return /* @__PURE__ */ jsx15(Component, { ref, ...props });
2553
+ });
2554
+ Empty.displayName = "ComboboxEmpty";
2555
+
2556
+ // src/checkbox/index.ts
2557
+ var checkbox_exports = {};
2558
+ __export(checkbox_exports, {
2559
+ Indicator: () => Indicator,
2560
+ Root: () => Root15,
2561
+ useRootContext: () => useRootContext10
2562
+ });
2563
+
2564
+ // src/checkbox/checkbox.tsx
2565
+ import * as React18 from "react";
2566
+ import { Pressable as Pressable9, View as View11 } from "react-native";
2567
+ import { jsx as jsx16 } from "react/jsx-runtime";
2568
+ var RootContext10 = React18.createContext(null);
2569
+ function useRootContext10() {
2570
+ const context = React18.useContext(RootContext10);
2571
+ if (!context) {
2572
+ throw new Error(
2573
+ "Checkbox compound components cannot be rendered outside the Checkbox.Root component"
2574
+ );
2575
+ }
2576
+ return context;
2577
+ }
2578
+ var Root15 = React18.forwardRef(function Root16({
2579
+ asChild,
2580
+ checked: checkedProp,
2581
+ defaultChecked,
2582
+ onCheckedChange: onCheckedChangeProp,
2583
+ disabled = false,
2584
+ onPress: onPressProp,
2585
+ ...props
2586
+ }, ref) {
2587
+ const [checked = false, setChecked] = useControllableState({
2588
+ prop: checkedProp,
2589
+ defaultProp: defaultChecked,
2590
+ onChange: onCheckedChangeProp
2591
+ });
2592
+ const onPress = React18.useCallback(
2593
+ (ev) => {
2594
+ if (disabled) return;
2595
+ setChecked(!checked);
2596
+ onPressProp?.(ev);
2597
+ },
2598
+ [disabled, checked, setChecked, onPressProp]
2599
+ );
2600
+ const Component = asChild ? Slot : Pressable9;
2601
+ return /* @__PURE__ */ jsx16(RootContext10.Provider, { value: { checked, disabled, onCheckedChange: setChecked }, children: /* @__PURE__ */ jsx16(
2602
+ Component,
2603
+ {
2604
+ ref,
2605
+ role: "checkbox",
2606
+ "aria-checked": checked,
2607
+ "aria-disabled": disabled || void 0,
2608
+ onPress,
2609
+ disabled: disabled || void 0,
2610
+ ...props
2611
+ }
2612
+ ) });
2613
+ });
2614
+ Root15.displayName = "CheckboxRoot";
2615
+ var Indicator = React18.forwardRef(function Indicator2({ asChild, forceMount, ...props }, ref) {
2616
+ const { checked, disabled } = useRootContext10();
2617
+ if (!forceMount && !checked) {
2618
+ return null;
2619
+ }
2620
+ const Component = asChild ? Slot : View11;
2621
+ return /* @__PURE__ */ jsx16(
2622
+ Component,
2623
+ {
2624
+ ref,
2625
+ role: "presentation",
2626
+ "aria-hidden": !(forceMount || checked),
2627
+ "aria-disabled": disabled || void 0,
2628
+ ...props
2629
+ }
2630
+ );
2631
+ });
2632
+ Indicator.displayName = "CheckboxIndicator";
2633
+
2634
+ // src/switch/index.ts
2635
+ var switch_exports = {};
2636
+ __export(switch_exports, {
2637
+ Root: () => Root17,
2638
+ Thumb: () => Thumb,
2639
+ useRootContext: () => useRootContext11
2640
+ });
2641
+
2642
+ // src/switch/switch.tsx
2643
+ import * as React19 from "react";
2644
+ import { Pressable as Pressable10, View as View12 } from "react-native";
2645
+ import { jsx as jsx17 } from "react/jsx-runtime";
2646
+ var RootContext11 = React19.createContext(null);
2647
+ function useRootContext11() {
2648
+ const context = React19.useContext(RootContext11);
2649
+ if (!context) {
2650
+ throw new Error(
2651
+ "Switch compound components cannot be rendered outside the Switch.Root component"
2652
+ );
2653
+ }
2654
+ return context;
2655
+ }
2656
+ var Root17 = React19.forwardRef(function Root18({
2657
+ asChild,
2658
+ checked: checkedProp,
2659
+ defaultChecked,
2660
+ onCheckedChange: onCheckedChangeProp,
2661
+ disabled = false,
2662
+ onPress: onPressProp,
2663
+ ...props
2664
+ }, ref) {
2665
+ const [checked = false, setChecked] = useControllableState({
2666
+ prop: checkedProp,
2667
+ defaultProp: defaultChecked,
2668
+ onChange: onCheckedChangeProp
2669
+ });
2670
+ const onPress = React19.useCallback(
2671
+ (ev) => {
2672
+ if (disabled) return;
2673
+ setChecked(!checked);
2674
+ onPressProp?.(ev);
2675
+ },
2676
+ [disabled, checked, setChecked, onPressProp]
2677
+ );
2678
+ const Component = asChild ? Slot : Pressable10;
2679
+ return /* @__PURE__ */ jsx17(RootContext11.Provider, { value: { checked, disabled }, children: /* @__PURE__ */ jsx17(
2680
+ Component,
2681
+ {
2682
+ ref,
2683
+ role: "switch",
2684
+ "aria-checked": checked,
2685
+ "aria-disabled": disabled || void 0,
2686
+ onPress,
2687
+ disabled: disabled || void 0,
2688
+ ...props
2689
+ }
2690
+ ) });
2691
+ });
2692
+ Root17.displayName = "SwitchRoot";
2693
+ var Thumb = React19.forwardRef(function Thumb2({ asChild, ...props }, ref) {
2694
+ useRootContext11();
2695
+ const Component = asChild ? Slot : View12;
2696
+ return /* @__PURE__ */ jsx17(Component, { ref, role: "presentation", ...props });
2697
+ });
2698
+ Thumb.displayName = "SwitchThumb";
2699
+
2700
+ // src/progress/index.ts
2701
+ var progress_exports = {};
2702
+ __export(progress_exports, {
2703
+ Indicator: () => Indicator3,
2704
+ Root: () => Root19,
2705
+ useRootContext: () => useRootContext12
2706
+ });
2707
+
2708
+ // src/progress/progress.tsx
2709
+ import * as React20 from "react";
2710
+ import { View as View13 } from "react-native";
2711
+ import { jsx as jsx18 } from "react/jsx-runtime";
2712
+ var DEFAULT_MAX = 100;
2713
+ var RootContext12 = React20.createContext(null);
2714
+ function useRootContext12() {
2715
+ const context = React20.useContext(RootContext12);
2716
+ if (!context) {
2717
+ throw new Error(
2718
+ "Progress compound components cannot be rendered outside the Progress.Root component"
2719
+ );
2720
+ }
2721
+ return context;
2722
+ }
2723
+ function defaultGetValueLabel(value, max) {
2724
+ return `${Math.round(value / max * 100)}%`;
2725
+ }
2726
+ function isValidValueNumber(value, max) {
2727
+ return typeof value === "number" && !isNaN(value) && value <= max && value >= 0;
2728
+ }
2729
+ var Root19 = React20.forwardRef(function Root20({ asChild, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, ...props }, ref) {
2730
+ const max = maxProp ?? DEFAULT_MAX;
2731
+ const isIndeterminate = valueProp === null || valueProp === void 0;
2732
+ const value = isIndeterminate ? null : isValidValueNumber(valueProp, max) ? valueProp : 0;
2733
+ const Component = asChild ? Slot : View13;
2734
+ return /* @__PURE__ */ jsx18(RootContext12.Provider, { value: { value, max }, children: /* @__PURE__ */ jsx18(
2735
+ Component,
2736
+ {
2737
+ ref,
2738
+ role: "progressbar",
2739
+ "aria-valuemin": 0,
2740
+ "aria-valuemax": max,
2741
+ "aria-valuenow": value ?? void 0,
2742
+ "aria-valuetext": value != null ? getValueLabel(value, max) : void 0,
2743
+ ...props
2744
+ }
2745
+ ) });
2746
+ });
2747
+ Root19.displayName = "ProgressRoot";
2748
+ var Indicator3 = React20.forwardRef(function Indicator4({ asChild, ...props }, ref) {
2749
+ useRootContext12();
2750
+ const Component = asChild ? Slot : View13;
2751
+ return /* @__PURE__ */ jsx18(Component, { ref, ...props });
2752
+ });
2753
+ Indicator3.displayName = "ProgressIndicator";
2754
+
2755
+ // src/toggle/index.ts
2756
+ var toggle_exports = {};
2757
+ __export(toggle_exports, {
2758
+ Root: () => Root21
2759
+ });
2760
+
2761
+ // src/toggle/toggle.tsx
2762
+ import * as React21 from "react";
2763
+ import { Pressable as Pressable11 } from "react-native";
2764
+ import { jsx as jsx19 } from "react/jsx-runtime";
2765
+ var Root21 = React21.forwardRef(function Root22({
2766
+ asChild,
2767
+ pressed: pressedProp,
2768
+ defaultPressed,
2769
+ onPressedChange: onPressedChangeProp,
2770
+ disabled = false,
2771
+ onPress: onPressProp,
2772
+ ...props
2773
+ }, ref) {
2774
+ const [pressed = false, setPressed] = useControllableState({
2775
+ prop: pressedProp,
2776
+ defaultProp: defaultPressed,
2777
+ onChange: onPressedChangeProp
2778
+ });
2779
+ const onPress = React21.useCallback(
2780
+ (ev) => {
2781
+ if (disabled) return;
2782
+ setPressed((prev) => !prev);
2783
+ onPressProp?.(ev);
2784
+ },
2785
+ [disabled, setPressed, onPressProp]
2786
+ );
2787
+ const Component = asChild ? Slot : Pressable11;
2788
+ return /* @__PURE__ */ jsx19(
2789
+ Component,
2790
+ {
2791
+ ref,
2792
+ role: "button",
2793
+ "aria-pressed": pressed,
2794
+ "aria-disabled": disabled || void 0,
2795
+ onPress,
2796
+ disabled: disabled || void 0,
2797
+ ...props
2798
+ }
2799
+ );
2800
+ });
2801
+ Root21.displayName = "ToggleRoot";
2802
+
2803
+ // src/radio-group/index.ts
2804
+ var radio_group_exports = {};
2805
+ __export(radio_group_exports, {
2806
+ Indicator: () => Indicator5,
2807
+ Item: () => Item10,
2808
+ Root: () => Root23,
2809
+ useItemContext: () => useItemContext4,
2810
+ useRootContext: () => useRootContext13
2811
+ });
2812
+
2813
+ // src/radio-group/radio-group.tsx
2814
+ import * as React22 from "react";
2815
+ import { Pressable as Pressable12, View as View15 } from "react-native";
2816
+ import { jsx as jsx20 } from "react/jsx-runtime";
2817
+ var RootContext13 = React22.createContext(null);
2818
+ function useRootContext13() {
2819
+ const context = React22.useContext(RootContext13);
2820
+ if (!context) {
2821
+ throw new Error(
2822
+ "RadioGroup compound components cannot be rendered outside the RadioGroup.Root component"
2823
+ );
2824
+ }
2825
+ return context;
2826
+ }
2827
+ var ItemContext4 = React22.createContext(null);
2828
+ function useItemContext4() {
2829
+ const context = React22.useContext(ItemContext4);
2830
+ if (!context) {
2831
+ throw new Error(
2832
+ "RadioGroup.Indicator must be rendered inside a RadioGroup.Item component"
2833
+ );
2834
+ }
2835
+ return context;
2836
+ }
2837
+ var Root23 = React22.forwardRef(function Root24({
2838
+ asChild,
2839
+ value: valueProp,
2840
+ defaultValue,
2841
+ onValueChange: onValueChangeProp,
2842
+ disabled = false,
2843
+ ...props
2844
+ }, ref) {
2845
+ const [value, setValue] = useControllableState({
2846
+ prop: valueProp,
2847
+ defaultProp: defaultValue,
2848
+ onChange: onValueChangeProp
2849
+ });
2850
+ const onValueChange = React22.useCallback(
2851
+ (itemValue) => {
2852
+ setValue(itemValue);
2853
+ },
2854
+ [setValue]
2855
+ );
2856
+ const Component = asChild ? Slot : View15;
2857
+ return /* @__PURE__ */ jsx20(RootContext13.Provider, { value: { value, disabled, onValueChange }, children: /* @__PURE__ */ jsx20(Component, { ref, role: "radiogroup", ...props }) });
2858
+ });
2859
+ Root23.displayName = "RadioGroupRoot";
2860
+ var Item10 = React22.forwardRef(function Item11({
2861
+ asChild,
2862
+ value: itemValue,
2863
+ disabled: disabledProp = false,
2864
+ onPress: onPressProp,
2865
+ ...props
2866
+ }, ref) {
2867
+ const { disabled: rootDisabled, value: rootValue, onValueChange } = useRootContext13();
2868
+ const isDisabled = rootDisabled || disabledProp;
2869
+ const checked = rootValue === itemValue;
2870
+ const onPress = React22.useCallback(
2871
+ (ev) => {
2872
+ if (isDisabled) return;
2873
+ onValueChange(itemValue);
2874
+ onPressProp?.(ev);
2875
+ },
2876
+ [isDisabled, onValueChange, itemValue, onPressProp]
2877
+ );
2878
+ const Component = asChild ? Slot : Pressable12;
2879
+ return /* @__PURE__ */ jsx20(ItemContext4.Provider, { value: { value: itemValue, checked, disabled: isDisabled }, children: /* @__PURE__ */ jsx20(
2880
+ Component,
2881
+ {
2882
+ ref,
2883
+ role: "radio",
2884
+ "aria-checked": checked,
2885
+ "aria-disabled": isDisabled || void 0,
2886
+ onPress,
2887
+ disabled: isDisabled || void 0,
2888
+ ...props
2889
+ }
2890
+ ) });
2891
+ });
2892
+ Item10.displayName = "RadioGroupItem";
2893
+ var Indicator5 = React22.forwardRef(function Indicator6({ asChild, forceMount, ...props }, ref) {
2894
+ const { checked, disabled } = useItemContext4();
2895
+ if (!forceMount && !checked) {
2896
+ return null;
2897
+ }
2898
+ const Component = asChild ? Slot : View15;
2899
+ return /* @__PURE__ */ jsx20(
2900
+ Component,
2901
+ {
2902
+ ref,
2903
+ role: "presentation",
2904
+ "aria-hidden": !(forceMount || checked),
2905
+ "aria-disabled": disabled || void 0,
2906
+ ...props
2907
+ }
2908
+ );
2909
+ });
2910
+ Indicator5.displayName = "RadioGroupIndicator";
2911
+
2912
+ // src/toggle-group/index.ts
2913
+ var toggle_group_exports = {};
2914
+ __export(toggle_group_exports, {
2915
+ Item: () => Item12,
2916
+ Root: () => Root25,
2917
+ useRootContext: () => useRootContext14
2918
+ });
2919
+
2920
+ // src/toggle-group/toggle-group.tsx
2921
+ import * as React23 from "react";
2922
+ import { Pressable as Pressable13, View as View16 } from "react-native";
2923
+ import { jsx as jsx21 } from "react/jsx-runtime";
2924
+ var RootContext14 = React23.createContext(null);
2925
+ function useRootContext14() {
2926
+ const context = React23.useContext(RootContext14);
2927
+ if (!context) {
2928
+ throw new Error(
2929
+ "ToggleGroup compound components cannot be rendered outside the ToggleGroup.Root component"
2930
+ );
2931
+ }
2932
+ return context;
2933
+ }
2934
+ var Root25 = React23.forwardRef(function Root26({
2935
+ asChild,
2936
+ type,
2937
+ value: valueProp,
2938
+ defaultValue,
2939
+ onValueChange: onValueChangeProp,
2940
+ disabled = false,
2941
+ ...props
2942
+ }, ref) {
2943
+ const [value, setValue] = useControllableState({
2944
+ prop: valueProp,
2945
+ defaultProp: defaultValue,
2946
+ onChange: onValueChangeProp
2947
+ });
2948
+ const onValueChange = React23.useCallback(
2949
+ (newValue) => {
2950
+ setValue(newValue);
2951
+ },
2952
+ [setValue]
2953
+ );
2954
+ const Component = asChild ? Slot : View16;
2955
+ return /* @__PURE__ */ jsx21(RootContext14.Provider, { value: { type, value, disabled, onValueChange }, children: /* @__PURE__ */ jsx21(Component, { ref, role: "group", ...props }) });
2956
+ });
2957
+ Root25.displayName = "ToggleGroupRoot";
2958
+ var Item12 = React23.forwardRef(function Item13({
2959
+ asChild,
2960
+ value: itemValue,
2961
+ disabled: disabledProp = false,
2962
+ onPress: onPressProp,
2963
+ ...props
2964
+ }, ref) {
2965
+ const { type, disabled: rootDisabled, value, onValueChange } = useRootContext14();
2966
+ const isDisabled = rootDisabled || disabledProp;
2967
+ const isSelected = toggleGroupUtils.getIsSelected(value, itemValue);
2968
+ const onPress = React23.useCallback(
2969
+ (ev) => {
2970
+ if (isDisabled) return;
2971
+ if (type === "single") {
2972
+ const newValue = toggleGroupUtils.getNewSingleValue(value, itemValue);
2973
+ onValueChange(newValue ?? "");
2974
+ } else {
2975
+ const newValue = toggleGroupUtils.getNewMultipleValue(value, itemValue);
2976
+ onValueChange(newValue);
2977
+ }
2978
+ onPressProp?.(ev);
2979
+ },
2980
+ [isDisabled, type, value, itemValue, onValueChange, onPressProp]
2981
+ );
2982
+ const Component = asChild ? Slot : Pressable13;
2983
+ return /* @__PURE__ */ jsx21(
2984
+ Component,
2985
+ {
2986
+ ref,
2987
+ role: "button",
2988
+ "aria-pressed": isSelected,
2989
+ "aria-disabled": isDisabled || void 0,
2990
+ onPress,
2991
+ disabled: isDisabled || void 0,
2992
+ ...props
2993
+ }
2994
+ );
2995
+ });
2996
+ Item12.displayName = "ToggleGroupItem";
2997
+
2998
+ // src/collapsible/index.ts
2999
+ var collapsible_exports = {};
3000
+ __export(collapsible_exports, {
3001
+ Content: () => Content17,
3002
+ Root: () => Root27,
3003
+ Trigger: () => Trigger17,
3004
+ useRootContext: () => useRootContext15
3005
+ });
3006
+
3007
+ // src/collapsible/collapsible.tsx
3008
+ import * as React24 from "react";
3009
+ import { Pressable as Pressable14, View as View17 } from "react-native";
3010
+ import { jsx as jsx22 } from "react/jsx-runtime";
3011
+ var RootContext15 = React24.createContext(null);
3012
+ function useRootContext15() {
3013
+ const context = React24.useContext(RootContext15);
3014
+ if (!context) {
3015
+ throw new Error(
3016
+ "Collapsible compound components cannot be rendered outside the Collapsible.Root component"
3017
+ );
3018
+ }
3019
+ return context;
3020
+ }
3021
+ var Root27 = React24.forwardRef(function Root28({
3022
+ asChild,
3023
+ open: openProp,
3024
+ defaultOpen,
3025
+ onOpenChange: onOpenChangeProp,
3026
+ disabled = false,
3027
+ ...props
3028
+ }, ref) {
3029
+ const [open = false, setOpen] = useControllableState({
3030
+ prop: openProp,
3031
+ defaultProp: defaultOpen,
3032
+ onChange: onOpenChangeProp
3033
+ });
3034
+ const onOpenChange = React24.useCallback(
3035
+ (value) => {
3036
+ setOpen(value);
3037
+ },
3038
+ [setOpen]
3039
+ );
3040
+ const Component = asChild ? Slot : View17;
3041
+ return /* @__PURE__ */ jsx22(RootContext15.Provider, { value: { open, disabled, onOpenChange }, children: /* @__PURE__ */ jsx22(
3042
+ Component,
3043
+ {
3044
+ ref,
3045
+ "aria-disabled": disabled || void 0,
3046
+ ...props
3047
+ }
3048
+ ) });
3049
+ });
3050
+ Root27.displayName = "CollapsibleRoot";
3051
+ var Trigger17 = React24.forwardRef(function Trigger18({ asChild, onPress: onPressProp, disabled: disabledProp, ...props }, ref) {
3052
+ const { open, disabled: rootDisabled, onOpenChange } = useRootContext15();
3053
+ const isDisabled = rootDisabled || disabledProp;
3054
+ const onPress = React24.useCallback(
3055
+ (ev) => {
3056
+ if (isDisabled) return;
3057
+ onOpenChange(!open);
3058
+ onPressProp?.(ev);
3059
+ },
3060
+ [isDisabled, open, onOpenChange, onPressProp]
3061
+ );
3062
+ const Component = asChild ? Slot : Pressable14;
3063
+ return /* @__PURE__ */ jsx22(
3064
+ Component,
3065
+ {
3066
+ ref,
3067
+ role: "button",
3068
+ "aria-expanded": open,
3069
+ "aria-disabled": isDisabled || void 0,
3070
+ onPress,
3071
+ disabled: isDisabled || void 0,
3072
+ ...props
3073
+ }
3074
+ );
3075
+ });
3076
+ Trigger17.displayName = "CollapsibleTrigger";
3077
+ var Content17 = React24.forwardRef(function Content18({ asChild, forceMount, ...props }, ref) {
3078
+ const { open } = useRootContext15();
3079
+ if (!forceMount && !open) {
3080
+ return null;
3081
+ }
3082
+ const Component = asChild ? Slot : View17;
3083
+ return /* @__PURE__ */ jsx22(
3084
+ Component,
3085
+ {
3086
+ ref,
3087
+ role: "region",
3088
+ ...props
3089
+ }
3090
+ );
3091
+ });
3092
+ Content17.displayName = "CollapsibleContent";
3093
+
3094
+ // src/accordion/index.ts
3095
+ var accordion_exports = {};
3096
+ __export(accordion_exports, {
3097
+ Content: () => Content19,
3098
+ Header: () => Header,
3099
+ Item: () => Item14,
3100
+ Root: () => Root29,
3101
+ Trigger: () => Trigger19,
3102
+ useItemContext: () => useItemContext5,
3103
+ useRootContext: () => useRootContext16
3104
+ });
3105
+
3106
+ // src/accordion/accordion.tsx
3107
+ import * as React25 from "react";
3108
+ import { Pressable as Pressable15, View as View18 } from "react-native";
3109
+ import { jsx as jsx23 } from "react/jsx-runtime";
3110
+ var RootContext16 = React25.createContext(null);
3111
+ function useRootContext16() {
3112
+ const context = React25.useContext(RootContext16);
3113
+ if (!context) {
3114
+ throw new Error(
3115
+ "Accordion compound components cannot be rendered outside the Accordion.Root component"
3116
+ );
3117
+ }
3118
+ return context;
3119
+ }
3120
+ var ItemContext5 = React25.createContext(null);
3121
+ function useItemContext5() {
3122
+ const context = React25.useContext(ItemContext5);
3123
+ if (!context) {
3124
+ throw new Error(
3125
+ "Accordion.Item compound components cannot be rendered outside the Accordion.Item component"
3126
+ );
3127
+ }
3128
+ return context;
3129
+ }
3130
+ function isItemExpanded(rootValue, itemValue) {
3131
+ if (rootValue === void 0) return false;
3132
+ return Array.isArray(rootValue) ? rootValue.includes(itemValue) : rootValue === itemValue;
3133
+ }
3134
+ var Root29 = React25.forwardRef(function Root30({
3135
+ asChild,
3136
+ type,
3137
+ value: valueProp,
3138
+ defaultValue,
3139
+ onValueChange: onValueChangeProp,
3140
+ disabled = false,
3141
+ ...rest
3142
+ }, ref) {
3143
+ const collapsible = rest.collapsible ?? false;
3144
+ const { collapsible: _collapsible, ...props } = rest;
3145
+ const [value, setValue] = useControllableState({
3146
+ prop: valueProp,
3147
+ defaultProp: defaultValue,
3148
+ onChange: onValueChangeProp
3149
+ });
3150
+ const onValueChange = React25.useCallback(
3151
+ (newValue) => {
3152
+ setValue(newValue);
3153
+ },
3154
+ [setValue]
3155
+ );
3156
+ const Component = asChild ? Slot : View18;
3157
+ return /* @__PURE__ */ jsx23(
3158
+ RootContext16.Provider,
3159
+ {
3160
+ value: { type, value, onValueChange, collapsible, disabled },
3161
+ children: /* @__PURE__ */ jsx23(Component, { ref, ...props })
3162
+ }
3163
+ );
3164
+ });
3165
+ Root29.displayName = "AccordionRoot";
3166
+ var Item14 = React25.forwardRef(function Item15({ asChild, value: itemValue, disabled: disabledProp = false, ...props }, ref) {
3167
+ const { value: rootValue, disabled: rootDisabled } = useRootContext16();
3168
+ const expanded = isItemExpanded(rootValue, itemValue);
3169
+ const isDisabled = rootDisabled || disabledProp;
3170
+ const Component = asChild ? Slot : View18;
3171
+ return /* @__PURE__ */ jsx23(
3172
+ ItemContext5.Provider,
3173
+ {
3174
+ value: { value: itemValue, isExpanded: expanded, disabled: isDisabled },
3175
+ children: /* @__PURE__ */ jsx23(Component, { ref, ...props })
3176
+ }
3177
+ );
3178
+ });
3179
+ Item14.displayName = "AccordionItem";
3180
+ var Header = React25.forwardRef(function Header2({ asChild, ...props }, ref) {
3181
+ const Component = asChild ? Slot : View18;
3182
+ return /* @__PURE__ */ jsx23(Component, { ref, role: "heading", ...props });
3183
+ });
3184
+ Header.displayName = "AccordionHeader";
3185
+ var Trigger19 = React25.forwardRef(function Trigger20({ asChild, onPress: onPressProp, disabled: disabledProp, ...props }, ref) {
3186
+ const { type, collapsible, onValueChange, value: rootValue } = useRootContext16();
3187
+ const { value: itemValue, isExpanded, disabled: itemDisabled } = useItemContext5();
3188
+ const isDisabled = itemDisabled || disabledProp;
3189
+ const onPress = React25.useCallback(
3190
+ (ev) => {
3191
+ if (isDisabled) return;
3192
+ if (type === "single") {
3193
+ if (isExpanded && !collapsible) {
3194
+ onPressProp?.(ev);
3195
+ return;
3196
+ }
3197
+ onValueChange(isExpanded ? "" : itemValue);
3198
+ } else {
3199
+ const currentValue = Array.isArray(rootValue) ? rootValue : [];
3200
+ if (isExpanded) {
3201
+ onValueChange(currentValue.filter((v) => v !== itemValue));
3202
+ } else {
3203
+ onValueChange([...currentValue, itemValue]);
3204
+ }
3205
+ }
3206
+ onPressProp?.(ev);
3207
+ },
3208
+ [isDisabled, type, collapsible, isExpanded, itemValue, rootValue, onValueChange, onPressProp]
3209
+ );
3210
+ const Component = asChild ? Slot : Pressable15;
3211
+ return /* @__PURE__ */ jsx23(
3212
+ Component,
3213
+ {
3214
+ ref,
3215
+ role: "button",
3216
+ "aria-expanded": isExpanded,
3217
+ "aria-disabled": isDisabled || void 0,
3218
+ onPress,
3219
+ disabled: isDisabled || void 0,
3220
+ ...props
3221
+ }
3222
+ );
3223
+ });
3224
+ Trigger19.displayName = "AccordionTrigger";
3225
+ var Content19 = React25.forwardRef(function Content20({ asChild, forceMount, ...props }, ref) {
3226
+ const { isExpanded } = useItemContext5();
3227
+ if (!forceMount && !isExpanded) {
3228
+ return null;
3229
+ }
3230
+ const Component = asChild ? Slot : View18;
3231
+ return /* @__PURE__ */ jsx23(
3232
+ Component,
3233
+ {
3234
+ ref,
3235
+ role: "region",
3236
+ ...props
3237
+ }
3238
+ );
3239
+ });
3240
+ Content19.displayName = "AccordionContent";
3241
+
3242
+ // src/slider/index.ts
3243
+ var slider_exports = {};
3244
+ __export(slider_exports, {
3245
+ Range: () => Range,
3246
+ Root: () => Root31,
3247
+ Thumb: () => Thumb3,
3248
+ Track: () => Track,
3249
+ useRootContext: () => useRootContext17
3250
+ });
3251
+
3252
+ // src/slider/slider.tsx
3253
+ import * as React26 from "react";
3254
+ import { Pressable as Pressable16, View as View19 } from "react-native";
3255
+ import { jsx as jsx24 } from "react/jsx-runtime";
3256
+ var DEFAULT_MIN = 0;
3257
+ var DEFAULT_MAX2 = 100;
3258
+ var DEFAULT_STEP = 1;
3259
+ var RootContext17 = React26.createContext(null);
3260
+ function useRootContext17() {
3261
+ const context = React26.useContext(RootContext17);
3262
+ if (!context) {
3263
+ throw new Error(
3264
+ "Slider compound components cannot be rendered outside the Slider.Root component"
3265
+ );
3266
+ }
3267
+ return context;
3268
+ }
3269
+ var Root31 = React26.forwardRef(function Root32({
3270
+ asChild,
3271
+ value: valueProp,
3272
+ defaultValue,
3273
+ onValueChange: onValueChangeProp,
3274
+ min = DEFAULT_MIN,
3275
+ max = DEFAULT_MAX2,
3276
+ step = DEFAULT_STEP,
3277
+ disabled = false,
3278
+ ...props
3279
+ }, ref) {
3280
+ const [value = DEFAULT_MIN, setValue] = useControllableState({
3281
+ prop: valueProp,
3282
+ defaultProp: defaultValue,
3283
+ onChange: onValueChangeProp
3284
+ });
3285
+ const onValueChange = React26.useCallback(
3286
+ (newValue) => {
3287
+ setValue(newValue);
3288
+ },
3289
+ [setValue]
3290
+ );
3291
+ const Component = asChild ? Slot : View19;
3292
+ return /* @__PURE__ */ jsx24(RootContext17.Provider, { value: { value, min, max, step, disabled, onValueChange }, children: /* @__PURE__ */ jsx24(Component, { ref, role: "group", ...props }) });
3293
+ });
3294
+ Root31.displayName = "SliderRoot";
3295
+ var Track = React26.forwardRef(function Track2({ asChild, ...props }, ref) {
3296
+ useRootContext17();
3297
+ const Component = asChild ? Slot : View19;
3298
+ return /* @__PURE__ */ jsx24(Component, { ref, ...props });
3299
+ });
3300
+ Track.displayName = "SliderTrack";
3301
+ var Range = React26.forwardRef(function Range2({ asChild, ...props }, ref) {
3302
+ useRootContext17();
3303
+ const Component = asChild ? Slot : View19;
3304
+ return /* @__PURE__ */ jsx24(Component, { ref, ...props });
3305
+ });
3306
+ Range.displayName = "SliderRange";
3307
+ var Thumb3 = React26.forwardRef(function Thumb4({ asChild, ...props }, ref) {
3308
+ const { value, min, max, disabled } = useRootContext17();
3309
+ const Component = asChild ? Slot : Pressable16;
3310
+ return /* @__PURE__ */ jsx24(
3311
+ Component,
3312
+ {
3313
+ ref,
3314
+ role: "slider",
3315
+ "aria-valuemin": min,
3316
+ "aria-valuemax": max,
3317
+ "aria-valuenow": value,
3318
+ disabled: disabled || void 0,
3319
+ "aria-disabled": disabled || void 0,
3320
+ ...props
3321
+ }
3322
+ );
3323
+ });
3324
+ Thumb3.displayName = "SliderThumb";
3325
+
3326
+ // src/toast/index.ts
3327
+ var toast_exports = {};
3328
+ __export(toast_exports, {
3329
+ Action: () => Action3,
3330
+ Close: () => Close5,
3331
+ Description: () => Description5,
3332
+ Root: () => Root33,
3333
+ Title: () => Title5,
3334
+ useRootContext: () => useRootContext18
3335
+ });
3336
+
3337
+ // src/toast/toast.tsx
3338
+ import * as React27 from "react";
3339
+ import { Pressable as Pressable17, Text as Text8, View as View20 } from "react-native";
3340
+ import { jsx as jsx25 } from "react/jsx-runtime";
3341
+ var RootContext18 = React27.createContext(null);
3342
+ function useRootContext18() {
3343
+ const context = React27.useContext(RootContext18);
3344
+ if (!context) {
3345
+ throw new Error(
3346
+ "Toast compound components cannot be rendered outside the Toast.Root component"
3347
+ );
3348
+ }
3349
+ return context;
3350
+ }
3351
+ var Root33 = React27.forwardRef(function Root34({
3352
+ asChild,
3353
+ open: openProp,
3354
+ defaultOpen,
3355
+ onOpenChange: onOpenChangeProp,
3356
+ type = "foreground",
3357
+ ...props
3358
+ }, ref) {
3359
+ const [open = false, setOpen] = useControllableState({
3360
+ prop: openProp,
3361
+ defaultProp: defaultOpen,
3362
+ onChange: onOpenChangeProp
3363
+ });
3364
+ const onOpenChange = React27.useCallback(
3365
+ (value) => {
3366
+ setOpen(value);
3367
+ },
3368
+ [setOpen]
3369
+ );
3370
+ if (!open) {
3371
+ return null;
3372
+ }
3373
+ const Component = asChild ? Slot : View20;
3374
+ return /* @__PURE__ */ jsx25(RootContext18.Provider, { value: { open, onOpenChange, type }, children: /* @__PURE__ */ jsx25(
3375
+ Component,
3376
+ {
3377
+ ref,
3378
+ role: "status",
3379
+ "aria-live": type === "foreground" ? "assertive" : "polite",
3380
+ ...props
3381
+ }
3382
+ ) });
3383
+ });
3384
+ Root33.displayName = "ToastRoot";
3385
+ var Title5 = React27.forwardRef(function Title6({ asChild, ...props }, ref) {
3386
+ useRootContext18();
3387
+ const Component = asChild ? Slot : Text8;
3388
+ return /* @__PURE__ */ jsx25(Component, { ref, ...props });
3389
+ });
3390
+ Title5.displayName = "ToastTitle";
3391
+ var Description5 = React27.forwardRef(function Description6({ asChild, ...props }, ref) {
3392
+ useRootContext18();
3393
+ const Component = asChild ? Slot : Text8;
3394
+ return /* @__PURE__ */ jsx25(Component, { ref, ...props });
3395
+ });
3396
+ Description5.displayName = "ToastDescription";
3397
+ var Action3 = React27.forwardRef(function Action4({
3398
+ asChild,
3399
+ altText: _altText,
3400
+ disabled = false,
3401
+ onPress: onPressProp,
3402
+ ...props
3403
+ }, ref) {
3404
+ useRootContext18();
3405
+ const onPress = React27.useCallback(
3406
+ (ev) => {
3407
+ if (disabled) return;
3408
+ onPressProp?.(ev);
3409
+ },
3410
+ [disabled, onPressProp]
3411
+ );
3412
+ const Component = asChild ? Slot : Pressable17;
3413
+ return /* @__PURE__ */ jsx25(
3414
+ Component,
3415
+ {
3416
+ ref,
3417
+ role: "button",
3418
+ "aria-disabled": disabled || void 0,
3419
+ onPress,
3420
+ disabled: disabled || void 0,
3421
+ ...props
3422
+ }
3423
+ );
3424
+ });
3425
+ Action3.displayName = "ToastAction";
3426
+ var Close5 = React27.forwardRef(function Close6({
3427
+ asChild,
3428
+ disabled = false,
3429
+ onPress: onPressProp,
3430
+ ...props
3431
+ }, ref) {
3432
+ const { onOpenChange } = useRootContext18();
3433
+ const onPress = React27.useCallback(
3434
+ (ev) => {
3435
+ if (disabled) return;
3436
+ onOpenChange(false);
3437
+ onPressProp?.(ev);
3438
+ },
3439
+ [disabled, onOpenChange, onPressProp]
3440
+ );
3441
+ const Component = asChild ? Slot : Pressable17;
3442
+ return /* @__PURE__ */ jsx25(
3443
+ Component,
3444
+ {
3445
+ ref,
3446
+ role: "button",
3447
+ "aria-disabled": disabled || void 0,
3448
+ onPress,
3449
+ disabled: disabled || void 0,
3450
+ ...props
3451
+ }
3452
+ );
3453
+ });
3454
+ Close5.displayName = "ToastClose";
3455
+
3456
+ // src/tooltip/index.ts
3457
+ var tooltip_exports = {};
3458
+ __export(tooltip_exports, {
3459
+ Content: () => Content21,
3460
+ Overlay: () => Overlay13,
3461
+ Portal: () => Portal9,
3462
+ Root: () => Root35,
3463
+ Trigger: () => Trigger21,
3464
+ useRootContext: () => useRootContext19
3465
+ });
3466
+
3467
+ // src/tooltip/tooltip.tsx
3468
+ import * as React28 from "react";
3469
+ import {
3470
+ Pressable as Pressable18,
3471
+ View as View21
3472
+ } from "react-native";
3473
+ import { jsx as jsx26 } from "react/jsx-runtime";
3474
+ var InternalContext4 = React28.createContext(null);
3475
+ function useInternalContext4() {
3476
+ const context = React28.useContext(InternalContext4);
3477
+ if (!context) {
3478
+ throw new Error(
3479
+ "Tooltip compound components cannot be rendered outside the Tooltip.Root component"
3480
+ );
3481
+ }
3482
+ return context;
3483
+ }
3484
+ var RootContext19 = React28.createContext(null);
3485
+ function useRootContext19() {
3486
+ const context = React28.useContext(RootContext19);
3487
+ if (!context) {
3488
+ throw new Error(
3489
+ "Tooltip compound components cannot be rendered outside the Tooltip.Root component"
3490
+ );
3491
+ }
3492
+ return context;
3493
+ }
3494
+ function Root35({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
3495
+ const nativeID = React28.useId();
3496
+ const [open = false, onOpenChange] = useControllableState({
3497
+ prop: openProp,
3498
+ defaultProp: defaultOpen,
3499
+ onChange: onOpenChangeProp
3500
+ });
3501
+ const [triggerPosition, setTriggerPosition] = React28.useState(null);
3502
+ const [contentLayout, setContentLayout] = React28.useState(null);
3503
+ return /* @__PURE__ */ jsx26(InternalContext4.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx26(
3504
+ RootContext19.Provider,
3505
+ {
3506
+ value: {
3507
+ open,
3508
+ onOpenChange,
3509
+ triggerPosition,
3510
+ setTriggerPosition,
3511
+ contentLayout,
3512
+ setContentLayout
3513
+ },
3514
+ children
3515
+ }
3516
+ ) });
3517
+ }
3518
+ Root35.displayName = "TooltipRoot";
3519
+ var Trigger21 = React28.forwardRef(function Trigger22({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
3520
+ const { open, onOpenChange, setTriggerPosition } = useRootContext19();
3521
+ const augmentedRef = useAugmentedRef({
3522
+ ref,
3523
+ methods: {
3524
+ open: () => {
3525
+ onOpenChange(true);
3526
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
3527
+ setTriggerPosition({ width, pageX, pageY, height });
3528
+ });
3529
+ },
3530
+ close: () => {
3531
+ setTriggerPosition(null);
3532
+ onOpenChange(false);
3533
+ }
3534
+ }
3535
+ });
3536
+ const onPress = React28.useCallback(
3537
+ (ev) => {
3538
+ if (disabled) return;
3539
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
3540
+ setTriggerPosition({ width, pageX, pageY, height });
3541
+ });
3542
+ onOpenChange(!open);
3543
+ onPressProp?.(ev);
3544
+ },
3545
+ [augmentedRef, disabled, onOpenChange, onPressProp, open, setTriggerPosition]
3546
+ );
3547
+ const Component = asChild ? Slot : Pressable18;
3548
+ return /* @__PURE__ */ jsx26(
3549
+ Component,
3550
+ {
3551
+ ref: augmentedRef,
3552
+ role: "button",
3553
+ "aria-disabled": disabled || void 0,
3554
+ onPress,
3555
+ disabled: disabled || void 0,
3556
+ ...props
3557
+ }
3558
+ );
3559
+ });
3560
+ Trigger21.displayName = "TooltipTrigger";
3561
+ function Portal9({ forceMount, hostName, children }) {
3562
+ const internalValue = useInternalContext4();
3563
+ const rootValue = useRootContext19();
3564
+ if (!forceMount && !rootValue.open) {
3565
+ return null;
3566
+ }
3567
+ return /* @__PURE__ */ jsx26(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx26(InternalContext4.Provider, { value: internalValue, children: /* @__PURE__ */ jsx26(RootContext19.Provider, { value: rootValue, children }) }) });
3568
+ }
3569
+ Portal9.displayName = "TooltipPortal";
3570
+ var Overlay13 = React28.forwardRef(function Overlay14({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
3571
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext19();
3572
+ const onPress = React28.useCallback(
3573
+ (ev) => {
3574
+ if (closeOnPress) {
3575
+ setTriggerPosition(null);
3576
+ setContentLayout(null);
3577
+ onOpenChange(false);
3578
+ }
3579
+ onPressProp?.(ev);
3580
+ },
3581
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
3582
+ );
3583
+ if (!forceMount && !open) {
3584
+ return null;
3585
+ }
3586
+ const Component = asChild ? Slot : Pressable18;
3587
+ return /* @__PURE__ */ jsx26(Component, { ref, onPress, ...props });
3588
+ });
3589
+ Overlay13.displayName = "TooltipOverlay";
3590
+ var Content21 = React28.forwardRef(function Content22({
3591
+ asChild,
3592
+ forceMount,
3593
+ align = "center",
3594
+ side = "top",
3595
+ sideOffset = 0,
3596
+ alignOffset = 0,
3597
+ avoidCollisions = true,
3598
+ insets,
3599
+ style,
3600
+ disablePositioningStyle,
3601
+ onLayout: onLayoutProp,
3602
+ ...props
3603
+ }, ref) {
3604
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext19();
3605
+ const { nativeID } = useInternalContext4();
3606
+ const positionStyle = useRelativePosition({
3607
+ align,
3608
+ avoidCollisions,
3609
+ triggerPosition,
3610
+ contentLayout,
3611
+ alignOffset,
3612
+ insets,
3613
+ sideOffset,
3614
+ side,
3615
+ disablePositioningStyle
3616
+ });
3617
+ const onLayout = React28.useCallback(
3618
+ (event) => {
3619
+ setContentLayout(event.nativeEvent.layout);
3620
+ onLayoutProp?.(event);
3621
+ },
3622
+ [onLayoutProp, setContentLayout]
3623
+ );
3624
+ if (!forceMount && !open) {
3625
+ return null;
3626
+ }
3627
+ const Component = asChild ? Slot : View21;
3628
+ return /* @__PURE__ */ jsx26(
3629
+ Component,
3630
+ {
3631
+ ref,
3632
+ role: "tooltip",
3633
+ nativeID,
3634
+ style: [positionStyle, style],
3635
+ onLayout,
3636
+ ...props
3637
+ }
3638
+ );
3639
+ });
3640
+ Content21.displayName = "TooltipContent";
3641
+
3642
+ // src/hover-card/index.ts
3643
+ var hover_card_exports = {};
3644
+ __export(hover_card_exports, {
3645
+ Content: () => Content23,
3646
+ Overlay: () => Overlay15,
3647
+ Portal: () => Portal10,
3648
+ Root: () => Root36,
3649
+ Trigger: () => Trigger23,
3650
+ useRootContext: () => useRootContext20
3651
+ });
3652
+
3653
+ // src/hover-card/hover-card.tsx
3654
+ import * as React29 from "react";
3655
+ import {
3656
+ Pressable as Pressable19,
3657
+ View as View22
3658
+ } from "react-native";
3659
+ import { jsx as jsx27 } from "react/jsx-runtime";
3660
+ var InternalContext5 = React29.createContext(null);
3661
+ function useInternalContext5() {
3662
+ const context = React29.useContext(InternalContext5);
3663
+ if (!context) {
3664
+ throw new Error(
3665
+ "HoverCard compound components cannot be rendered outside the HoverCard.Root component"
3666
+ );
3667
+ }
3668
+ return context;
3669
+ }
3670
+ var RootContext20 = React29.createContext(null);
3671
+ function useRootContext20() {
3672
+ const context = React29.useContext(RootContext20);
3673
+ if (!context) {
3674
+ throw new Error(
3675
+ "HoverCard compound components cannot be rendered outside the HoverCard.Root component"
3676
+ );
3677
+ }
3678
+ return context;
3679
+ }
3680
+ function Root36({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }) {
3681
+ const nativeID = React29.useId();
3682
+ const [open = false, onOpenChange] = useControllableState({
3683
+ prop: openProp,
3684
+ defaultProp: defaultOpen,
3685
+ onChange: onOpenChangeProp
3686
+ });
3687
+ const [triggerPosition, setTriggerPosition] = React29.useState(null);
3688
+ const [contentLayout, setContentLayout] = React29.useState(null);
3689
+ return /* @__PURE__ */ jsx27(InternalContext5.Provider, { value: { nativeID }, children: /* @__PURE__ */ jsx27(
3690
+ RootContext20.Provider,
3691
+ {
3692
+ value: {
3693
+ open,
3694
+ onOpenChange,
3695
+ triggerPosition,
3696
+ setTriggerPosition,
3697
+ contentLayout,
3698
+ setContentLayout
3699
+ },
3700
+ children
3701
+ }
3702
+ ) });
3703
+ }
3704
+ Root36.displayName = "HoverCardRoot";
3705
+ var Trigger23 = React29.forwardRef(function Trigger24({ asChild, onPress: onPressProp, disabled, ...props }, ref) {
3706
+ const { open, onOpenChange, setTriggerPosition } = useRootContext20();
3707
+ const augmentedRef = useAugmentedRef({
3708
+ ref,
3709
+ methods: {
3710
+ open: () => {
3711
+ onOpenChange(true);
3712
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
3713
+ setTriggerPosition({ width, pageX, pageY, height });
3714
+ });
3715
+ },
3716
+ close: () => {
3717
+ setTriggerPosition(null);
3718
+ onOpenChange(false);
3719
+ }
3720
+ }
3721
+ });
3722
+ const onPress = React29.useCallback(
3723
+ (ev) => {
3724
+ if (disabled) return;
3725
+ augmentedRef.current?.measure?.((_x, _y, width, height, pageX, pageY) => {
3726
+ setTriggerPosition({ width, pageX, pageY, height });
3727
+ });
3728
+ onOpenChange(!open);
3729
+ onPressProp?.(ev);
3730
+ },
3731
+ [augmentedRef, disabled, onOpenChange, onPressProp, open, setTriggerPosition]
3732
+ );
3733
+ const Component = asChild ? Slot : Pressable19;
3734
+ return /* @__PURE__ */ jsx27(
3735
+ Component,
3736
+ {
3737
+ ref: augmentedRef,
3738
+ role: "button",
3739
+ "aria-disabled": disabled || void 0,
3740
+ onPress,
3741
+ disabled: disabled || void 0,
3742
+ ...props
3743
+ }
3744
+ );
3745
+ });
3746
+ Trigger23.displayName = "HoverCardTrigger";
3747
+ function Portal10({ forceMount, hostName, children }) {
3748
+ const internalValue = useInternalContext5();
3749
+ const rootValue = useRootContext20();
3750
+ if (!forceMount && !rootValue.open) {
3751
+ return null;
3752
+ }
3753
+ return /* @__PURE__ */ jsx27(Portal, { hostName, name: `${internalValue.nativeID}_portal`, children: /* @__PURE__ */ jsx27(InternalContext5.Provider, { value: internalValue, children: /* @__PURE__ */ jsx27(RootContext20.Provider, { value: rootValue, children }) }) });
3754
+ }
3755
+ Portal10.displayName = "HoverCardPortal";
3756
+ var Overlay15 = React29.forwardRef(function Overlay16({ asChild, forceMount, onPress: onPressProp, closeOnPress = true, ...props }, ref) {
3757
+ const { open, onOpenChange, setTriggerPosition, setContentLayout } = useRootContext20();
3758
+ const onPress = React29.useCallback(
3759
+ (ev) => {
3760
+ if (closeOnPress) {
3761
+ setTriggerPosition(null);
3762
+ setContentLayout(null);
3763
+ onOpenChange(false);
3764
+ }
3765
+ onPressProp?.(ev);
3766
+ },
3767
+ [closeOnPress, onOpenChange, onPressProp, setContentLayout, setTriggerPosition]
3768
+ );
3769
+ if (!forceMount && !open) {
3770
+ return null;
3771
+ }
3772
+ const Component = asChild ? Slot : Pressable19;
3773
+ return /* @__PURE__ */ jsx27(Component, { ref, onPress, ...props });
3774
+ });
3775
+ Overlay15.displayName = "HoverCardOverlay";
3776
+ var Content23 = React29.forwardRef(function Content24({
3777
+ asChild,
3778
+ forceMount,
3779
+ align = "start",
3780
+ side = "bottom",
3781
+ sideOffset = 0,
3782
+ alignOffset = 0,
3783
+ avoidCollisions = true,
3784
+ insets,
3785
+ style,
3786
+ disablePositioningStyle,
3787
+ onLayout: onLayoutProp,
3788
+ ...props
3789
+ }, ref) {
3790
+ const { open, triggerPosition, contentLayout, setContentLayout } = useRootContext20();
3791
+ const { nativeID } = useInternalContext5();
3792
+ const positionStyle = useRelativePosition({
3793
+ align,
3794
+ avoidCollisions,
3795
+ triggerPosition,
3796
+ contentLayout,
3797
+ alignOffset,
3798
+ insets,
3799
+ sideOffset,
3800
+ side,
3801
+ disablePositioningStyle
3802
+ });
3803
+ const onLayout = React29.useCallback(
3804
+ (event) => {
3805
+ setContentLayout(event.nativeEvent.layout);
3806
+ onLayoutProp?.(event);
3807
+ },
3808
+ [onLayoutProp, setContentLayout]
3809
+ );
3810
+ if (!forceMount && !open) {
3811
+ return null;
3812
+ }
3813
+ const Component = asChild ? Slot : View22;
3814
+ return /* @__PURE__ */ jsx27(
3815
+ Component,
3816
+ {
3817
+ ref,
3818
+ nativeID,
3819
+ style: [positionStyle, style],
3820
+ onLayout,
3821
+ ...props
3822
+ }
3823
+ );
3824
+ });
3825
+ Content23.displayName = "HoverCardContent";
3826
+
3827
+ // src/table/index.ts
3828
+ var table_exports = {};
3829
+ __export(table_exports, {
3830
+ Body: () => Body,
3831
+ Cell: () => Cell,
3832
+ Footer: () => Footer,
3833
+ Header: () => Header3,
3834
+ HeaderCell: () => HeaderCell,
3835
+ HeaderRow: () => HeaderRow,
3836
+ Root: () => Root37,
3837
+ Row: () => Row,
3838
+ useRootContext: () => useRootContext21
3839
+ });
3840
+
3841
+ // src/table/table.tsx
3842
+ import * as React30 from "react";
3843
+ import { View as View23, Text as Text9 } from "react-native";
3844
+ import { jsx as jsx28 } from "react/jsx-runtime";
3845
+ var RootContext21 = React30.createContext(null);
3846
+ function useRootContext21() {
3847
+ const context = React30.useContext(RootContext21);
3848
+ if (!context) {
3849
+ throw new Error(
3850
+ "Table compound components cannot be rendered outside the Table.Root component"
3851
+ );
3852
+ }
3853
+ return context;
3854
+ }
3855
+ var Root37 = React30.forwardRef(function Root38({ asChild, table, ...props }, ref) {
3856
+ const Component = asChild ? Slot : View23;
3857
+ return /* @__PURE__ */ jsx28(RootContext21.Provider, { value: { table }, children: /* @__PURE__ */ jsx28(Component, { ref, role: "table", ...props }) });
3858
+ });
3859
+ Root37.displayName = "TableRoot";
3860
+ var Header3 = React30.forwardRef(function Header4({ asChild, ...props }, ref) {
3861
+ const Component = asChild ? Slot : View23;
3862
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
3863
+ });
3864
+ Header3.displayName = "TableHeader";
3865
+ var HeaderRow = React30.forwardRef(function HeaderRow2({ asChild, ...props }, ref) {
3866
+ const Component = asChild ? Slot : View23;
3867
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "row", ...props });
3868
+ });
3869
+ HeaderRow.displayName = "TableHeaderRow";
3870
+ var HeaderCell = React30.forwardRef(function HeaderCell2({ asChild, ...props }, ref) {
3871
+ const Component = asChild ? Slot : Text9;
3872
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "columnheader", ...props });
3873
+ });
3874
+ HeaderCell.displayName = "TableHeaderCell";
3875
+ var Body = React30.forwardRef(function Body2({ asChild, ...props }, ref) {
3876
+ const Component = asChild ? Slot : View23;
3877
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
3878
+ });
3879
+ Body.displayName = "TableBody";
3880
+ var Row = React30.forwardRef(function Row2({ asChild, ...props }, ref) {
3881
+ const Component = asChild ? Slot : View23;
3882
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "row", ...props });
3883
+ });
3884
+ Row.displayName = "TableRow";
3885
+ var Cell = React30.forwardRef(function Cell2({ asChild, ...props }, ref) {
3886
+ const Component = asChild ? Slot : Text9;
3887
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "cell", ...props });
3888
+ });
3889
+ Cell.displayName = "TableCell";
3890
+ var Footer = React30.forwardRef(function Footer2({ asChild, ...props }, ref) {
3891
+ const Component = asChild ? Slot : View23;
3892
+ return /* @__PURE__ */ jsx28(Component, { ref, role: "rowgroup", ...props });
3893
+ });
3894
+ Footer.displayName = "TableFooter";
3895
+
3896
+ // src/text/index.ts
3897
+ var text_exports = {};
3898
+ __export(text_exports, {
3899
+ Root: () => Root39,
3900
+ TextClassContext: () => TextClassContext
3901
+ });
3902
+
3903
+ // src/text/text.tsx
3904
+ import * as React31 from "react";
3905
+ import { Text as Text10 } from "react-native";
3906
+ import { jsx as jsx29 } from "react/jsx-runtime";
3907
+ var TextClassContext = React31.createContext(void 0);
3908
+ var Root39 = React31.forwardRef(function Root40({ asChild, className, ...props }, ref) {
3909
+ const textClass = React31.useContext(TextClassContext);
3910
+ const Component = asChild ? Slot : Text10;
3911
+ const mergedClassName = textClass ? className ? `${textClass} ${className}` : textClass : className;
3912
+ return /* @__PURE__ */ jsx29(Component, { ref, className: mergedClassName, ...props });
3913
+ });
3914
+ Root39.displayName = "TextRoot";
3915
+ export {
3916
+ accordion_exports as Accordion,
3917
+ alert_dialog_exports as AlertDialog,
3918
+ animated_exports as Animated,
3919
+ checkbox_exports as Checkbox,
3920
+ collapsible_exports as Collapsible,
3921
+ combobox_exports as Combobox,
3922
+ context_menu_exports as ContextMenu,
3923
+ dialog_exports as Dialog,
3924
+ dropdown_menu_exports as DropdownMenu,
3925
+ EmptyGestureResponderEvent,
3926
+ hover_card_exports as HoverCard,
3927
+ image_exports as Image,
3928
+ label_exports as Label,
3929
+ list_exports as List,
3930
+ popover_exports as Popover,
3931
+ Portal,
3932
+ PortalHost,
3933
+ progress_exports as Progress,
3934
+ radio_group_exports as RadioGroup,
3935
+ select_exports as Select,
3936
+ separator_exports as Separator,
3937
+ slider_exports as Slider,
3938
+ Slot,
3939
+ switch_exports as Switch,
3940
+ table_exports as Table,
3941
+ tabs_exports as Tabs,
3942
+ text_exports as Text,
3943
+ TextClassContext,
3944
+ toast_exports as Toast,
3945
+ toggle_exports as Toggle,
3946
+ toggle_group_exports as ToggleGroup,
3947
+ tooltip_exports as Tooltip,
3948
+ composeRefs,
3949
+ mergeProps,
3950
+ toggleGroupUtils,
3951
+ useAugmentedRef,
3952
+ useControllableState,
3953
+ useRelativePosition
3954
+ };