@marktiderman/genesis-ui-native 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YJV5MMZX.js → chunk-7HWS2JGX.js} +7 -741
- package/dist/chunk-7HWS2JGX.js.map +1 -0
- package/dist/{chunk-IDHW2NOP.js → chunk-C6Q5ZAVT.js} +232 -6
- package/dist/chunk-C6Q5ZAVT.js.map +1 -0
- package/dist/{chunk-YI7XVY2D.js → chunk-ON7WP4T6.js} +13 -479
- package/dist/chunk-ON7WP4T6.js.map +1 -0
- package/dist/chunk-PO3MK6IY.js +1231 -0
- package/dist/chunk-PO3MK6IY.js.map +1 -0
- package/dist/chunk-SXCG2REG.js +479 -0
- package/dist/chunk-SXCG2REG.js.map +1 -0
- package/dist/components/index.d.ts +10 -3
- package/dist/components/index.js +3 -4
- package/dist/data/index.d.ts +482 -4
- package/dist/data/index.js +1480 -17
- package/dist/data/index.js.map +1 -1
- package/dist/inbox-page-DZUR-PJ1.d.ts +199 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -5
- package/dist/layouts/index.d.ts +4 -195
- package/dist/layouts/index.js +3 -3
- package/package.json +2 -2
- package/src/components/__tests__/button-a11y.test.tsx +17 -0
- package/src/components/button.tsx +8 -2
- package/src/components/image.tsx +5 -0
- package/src/data/NativeDetailPanel.tsx +8 -1
- package/src/data/index.ts +1 -0
- package/src/data/resource-view/NativeResourceFormSheet.tsx +305 -0
- package/src/data/resource-view/NativeResourceView.tsx +536 -0
- package/src/data/resource-view/NativeResourceWorkspace.tsx +657 -0
- package/src/data/resource-view/__tests__/native-resource-view.test.tsx +977 -0
- package/src/data/resource-view/__tests__/native-resource-workspace.test.tsx +356 -0
- package/src/data/resource-view/display.tsx +259 -0
- package/src/data/resource-view/index.ts +61 -0
- package/src/data/resource-view/mapping.ts +333 -0
- package/src/data/resource-view/messages.ts +121 -0
- package/src/data/resource-view/use-native-resource-view.ts +309 -0
- package/dist/chunk-EFXCJ5AN.js +0 -234
- package/dist/chunk-EFXCJ5AN.js.map +0 -1
- package/dist/chunk-FIITITXO.js +0 -492
- package/dist/chunk-FIITITXO.js.map +0 -1
- package/dist/chunk-IDHW2NOP.js.map +0 -1
- package/dist/chunk-YI7XVY2D.js.map +0 -1
- package/dist/chunk-YJV5MMZX.js.map +0 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useReducedMotion } from './chunk-7PCWEY6R.js';
|
|
2
|
-
import { useGenesisModules } from './chunk-
|
|
2
|
+
import { useGenesisModules } from './chunk-C6Q5ZAVT.js';
|
|
3
3
|
import { useThemeMode, useThemeRoles } from './chunk-Z3AQYVUA.js';
|
|
4
4
|
import { cn } from './chunk-OHZD7KRO.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { View, Text, Platform, AccessibilityInfo, Animated, Pressable, Modal, StatusBar, Dimensions, TextInput, ScrollView, PanResponder } from 'react-native';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
7
|
import { createContext, useState, useEffect, useCallback, useMemo, useRef, useContext, Children, cloneElement, isValidElement } from 'react';
|
|
9
|
-
import { SafeAreaProvider,
|
|
8
|
+
import { SafeAreaProvider, SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
10
9
|
import { cva } from 'class-variance-authority';
|
|
11
10
|
|
|
12
11
|
function NativeHeaderCard({
|
|
@@ -340,205 +339,6 @@ function useToast() {
|
|
|
340
339
|
}
|
|
341
340
|
return ctx;
|
|
342
341
|
}
|
|
343
|
-
var REQUIRED_EXPORTS = ["BottomSheetModal", "BottomSheetView", "BottomSheetBackdrop", "BottomSheetModalProvider"];
|
|
344
|
-
var SheetLibraryContext = createContext(null);
|
|
345
|
-
function NativeSheetProvider({ bottomSheet, children }) {
|
|
346
|
-
const [library] = useState(() => isSheetLibrary(bottomSheet) ? bottomSheet : null);
|
|
347
|
-
const [problem] = useState(() => library ? null : invalidLibraryMessage(bottomSheet));
|
|
348
|
-
useEffect(() => {
|
|
349
|
-
if (problem) console.error(problem);
|
|
350
|
-
}, [problem]);
|
|
351
|
-
if (!library) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
352
|
-
const Provider = library.BottomSheetModalProvider;
|
|
353
|
-
return /* @__PURE__ */ jsx(SheetLibraryContext.Provider, { value: library, children: /* @__PURE__ */ jsx(Provider, { children }) });
|
|
354
|
-
}
|
|
355
|
-
function isSheetLibrary(value) {
|
|
356
|
-
if (!value || typeof value !== "object") return false;
|
|
357
|
-
const mod = value;
|
|
358
|
-
return REQUIRED_EXPORTS.every((name) => mod[name] != null);
|
|
359
|
-
}
|
|
360
|
-
function invalidLibraryMessage(value) {
|
|
361
|
-
const mod = value && typeof value === "object" ? value : {};
|
|
362
|
-
const missing = REQUIRED_EXPORTS.filter((name) => mod[name] == null);
|
|
363
|
-
return `NativeSheetProvider: \`bottomSheet\` is missing ${missing.join(", ")}, so sheets use the native modal. Pass the whole module: \`import * as BottomSheet from "@gorhom/bottom-sheet"\`.`;
|
|
364
|
-
}
|
|
365
|
-
function NativeSheet(props) {
|
|
366
|
-
const library = useContext(SheetLibraryContext);
|
|
367
|
-
if (library) return /* @__PURE__ */ jsx(LibrarySheet, { library, ...props });
|
|
368
|
-
return /* @__PURE__ */ jsx(ModalSheet, { ...props });
|
|
369
|
-
}
|
|
370
|
-
function NativeSheetScrollView({ style, ...props }) {
|
|
371
|
-
const library = useContext(SheetLibraryContext);
|
|
372
|
-
const Scroll = library?.BottomSheetScrollView ?? ScrollView;
|
|
373
|
-
const own = { flexGrow: 0 };
|
|
374
|
-
return /* @__PURE__ */ jsx(Scroll, { style: [own, ...Array.isArray(style) ? style : style ? [style] : []], ...props });
|
|
375
|
-
}
|
|
376
|
-
function LibrarySheet({
|
|
377
|
-
library,
|
|
378
|
-
open,
|
|
379
|
-
onOpenChange,
|
|
380
|
-
snapPoints = ["50%", "90%"],
|
|
381
|
-
initialSnapIndex = 0,
|
|
382
|
-
disableBackdropDismiss = false,
|
|
383
|
-
fitContent = false,
|
|
384
|
-
testID,
|
|
385
|
-
children
|
|
386
|
-
}) {
|
|
387
|
-
const sheet = useRef(null);
|
|
388
|
-
const wanted = useRef(open);
|
|
389
|
-
const onOpenChangeRef = useRef(onOpenChange);
|
|
390
|
-
onOpenChangeRef.current = onOpenChange;
|
|
391
|
-
useEffect(() => {
|
|
392
|
-
wanted.current = open;
|
|
393
|
-
if (open) sheet.current?.present();
|
|
394
|
-
else sheet.current?.dismiss();
|
|
395
|
-
}, [open]);
|
|
396
|
-
const BottomSheetModal = library.BottomSheetModal;
|
|
397
|
-
const BottomSheetView = library.BottomSheetView;
|
|
398
|
-
const BottomSheetBackdrop = library.BottomSheetBackdrop;
|
|
399
|
-
const onDismiss = useCallback(() => {
|
|
400
|
-
if (wanted.current) {
|
|
401
|
-
wanted.current = false;
|
|
402
|
-
onOpenChangeRef.current(false);
|
|
403
|
-
}
|
|
404
|
-
}, []);
|
|
405
|
-
const backdrop = useCallback(
|
|
406
|
-
(p) => /* @__PURE__ */ jsx(
|
|
407
|
-
BottomSheetBackdrop,
|
|
408
|
-
{
|
|
409
|
-
...p,
|
|
410
|
-
appearsOnIndex: 0,
|
|
411
|
-
disappearsOnIndex: -1,
|
|
412
|
-
pressBehavior: disableBackdropDismiss ? "none" : "close"
|
|
413
|
-
}
|
|
414
|
-
),
|
|
415
|
-
[BottomSheetBackdrop, disableBackdropDismiss]
|
|
416
|
-
);
|
|
417
|
-
return /* @__PURE__ */ jsx(
|
|
418
|
-
BottomSheetModal,
|
|
419
|
-
{
|
|
420
|
-
ref: sheet,
|
|
421
|
-
snapPoints: fitContent ? void 0 : snapPoints,
|
|
422
|
-
index: fitContent ? 0 : initialSnapIndex,
|
|
423
|
-
enableDynamicSizing: fitContent,
|
|
424
|
-
...fitContent ? { maxDynamicContentSize: Math.round(Dimensions.get("window").height * 0.9) } : {},
|
|
425
|
-
onDismiss,
|
|
426
|
-
enablePanDownToClose: !disableBackdropDismiss,
|
|
427
|
-
backdropComponent: backdrop,
|
|
428
|
-
children: /* @__PURE__ */ jsx(BottomSheetView, { testID: testID ?? "native-sheet", children })
|
|
429
|
-
}
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
function useReduceMotionAnswer() {
|
|
433
|
-
const [reduced, setReduced] = useState(null);
|
|
434
|
-
useEffect(() => {
|
|
435
|
-
let mounted = true;
|
|
436
|
-
AccessibilityInfo.isReduceMotionEnabled().then(
|
|
437
|
-
(value) => mounted && setReduced(value),
|
|
438
|
-
() => mounted && setReduced(false)
|
|
439
|
-
);
|
|
440
|
-
const sub = AccessibilityInfo.addEventListener("reduceMotionChanged", (value) => setReduced(value));
|
|
441
|
-
return () => {
|
|
442
|
-
mounted = false;
|
|
443
|
-
sub?.remove?.();
|
|
444
|
-
};
|
|
445
|
-
}, []);
|
|
446
|
-
return reduced;
|
|
447
|
-
}
|
|
448
|
-
function ModalSheet({ open, onOpenChange, disableBackdropDismiss = false, fitContent = false, testID, children }) {
|
|
449
|
-
const reducedMotion = useReduceMotionAnswer();
|
|
450
|
-
const roles = useThemeRoles();
|
|
451
|
-
const requestClose = () => {
|
|
452
|
-
if (!disableBackdropDismiss) onOpenChange(false);
|
|
453
|
-
};
|
|
454
|
-
const visible = open && reducedMotion !== null;
|
|
455
|
-
const animationType = reducedMotion ? "none" : "slide";
|
|
456
|
-
const id = testID ?? "native-sheet";
|
|
457
|
-
const ios = Platform.OS === "ios";
|
|
458
|
-
if (ios && !fitContent) {
|
|
459
|
-
return /* @__PURE__ */ jsx(
|
|
460
|
-
Modal,
|
|
461
|
-
{
|
|
462
|
-
visible,
|
|
463
|
-
animationType,
|
|
464
|
-
presentationStyle: "pageSheet",
|
|
465
|
-
allowSwipeDismissal: !disableBackdropDismiss,
|
|
466
|
-
backdropColor: roles.background,
|
|
467
|
-
onRequestClose: requestClose,
|
|
468
|
-
children: /* @__PURE__ */ jsx(SafeAreaProvider, { children: /* @__PURE__ */ jsx(
|
|
469
|
-
SheetBody,
|
|
470
|
-
{
|
|
471
|
-
testID: id,
|
|
472
|
-
onAccessibilityEscape: disableBackdropDismiss ? void 0 : requestClose,
|
|
473
|
-
style: { flex: 1, backgroundColor: roles.background },
|
|
474
|
-
children
|
|
475
|
-
}
|
|
476
|
-
) })
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
return /* @__PURE__ */ jsx(
|
|
481
|
-
Modal,
|
|
482
|
-
{
|
|
483
|
-
visible,
|
|
484
|
-
transparent: true,
|
|
485
|
-
animationType,
|
|
486
|
-
statusBarTranslucent: true,
|
|
487
|
-
navigationBarTranslucent: true,
|
|
488
|
-
onRequestClose: requestClose,
|
|
489
|
-
children: /* @__PURE__ */ jsx(SafeAreaProvider, { children: /* @__PURE__ */ jsxs(KeyboardPanel, { ios, children: [
|
|
490
|
-
/* @__PURE__ */ jsx(
|
|
491
|
-
Pressable,
|
|
492
|
-
{
|
|
493
|
-
testID: `${id}-backdrop`,
|
|
494
|
-
accessibilityRole: "button",
|
|
495
|
-
accessibilityLabel: "Close",
|
|
496
|
-
disabled: disableBackdropDismiss,
|
|
497
|
-
importantForAccessibility: disableBackdropDismiss ? "no-hide-descendants" : "auto",
|
|
498
|
-
onPress: requestClose,
|
|
499
|
-
style: { position: "absolute", top: 0, right: 0, bottom: 0, left: 0, backgroundColor: "rgba(0,0,0,0.4)" }
|
|
500
|
-
}
|
|
501
|
-
),
|
|
502
|
-
/* @__PURE__ */ jsxs(
|
|
503
|
-
SheetBody,
|
|
504
|
-
{
|
|
505
|
-
testID: id,
|
|
506
|
-
onAccessibilityEscape: disableBackdropDismiss ? void 0 : requestClose,
|
|
507
|
-
style: {
|
|
508
|
-
maxHeight: "90%",
|
|
509
|
-
borderTopLeftRadius: 28,
|
|
510
|
-
borderTopRightRadius: 28,
|
|
511
|
-
backgroundColor: roles.surface,
|
|
512
|
-
paddingTop: 12
|
|
513
|
-
},
|
|
514
|
-
children: [
|
|
515
|
-
/* @__PURE__ */ jsx(
|
|
516
|
-
View,
|
|
517
|
-
{
|
|
518
|
-
style: { alignSelf: "center", width: 32, height: 4, borderRadius: 2, marginBottom: 8, backgroundColor: roles.tertiaryLabel }
|
|
519
|
-
}
|
|
520
|
-
),
|
|
521
|
-
children
|
|
522
|
-
]
|
|
523
|
-
}
|
|
524
|
-
)
|
|
525
|
-
] }) })
|
|
526
|
-
}
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
function KeyboardPanel({ ios, children }) {
|
|
530
|
-
const insets = useSafeAreaInsets();
|
|
531
|
-
return /* @__PURE__ */ jsx(KeyboardAvoidingView, { behavior: ios ? "padding" : void 0, keyboardVerticalOffset: ios ? -insets.bottom : 0, style: { flex: 1, justifyContent: "flex-end" }, children });
|
|
532
|
-
}
|
|
533
|
-
function SheetBody({
|
|
534
|
-
testID,
|
|
535
|
-
style,
|
|
536
|
-
onAccessibilityEscape,
|
|
537
|
-
children
|
|
538
|
-
}) {
|
|
539
|
-
const insets = useSafeAreaInsets();
|
|
540
|
-
return /* @__PURE__ */ jsx(View, { testID, accessibilityViewIsModal: true, onAccessibilityEscape, style: { ...style, paddingBottom: insets.bottom }, children });
|
|
541
|
-
}
|
|
542
342
|
var FULL_SCREEN_DARK = "#000000";
|
|
543
343
|
function NativeFullScreenModal({ open, onOpenChange, tone = "dark", children, testID = "native-full-screen-modal" }) {
|
|
544
344
|
const reducedMotion = useReducedMotion();
|
|
@@ -1018,180 +818,6 @@ function NativeCombobox({
|
|
|
1018
818
|
) : null
|
|
1019
819
|
] });
|
|
1020
820
|
}
|
|
1021
|
-
function resolveDateTimePicker() {
|
|
1022
|
-
try {
|
|
1023
|
-
return __require("@react-native-community/datetimepicker").default;
|
|
1024
|
-
} catch {
|
|
1025
|
-
return null;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
function PickerButton({
|
|
1029
|
-
value,
|
|
1030
|
-
onChange,
|
|
1031
|
-
mode,
|
|
1032
|
-
formatLabel,
|
|
1033
|
-
disabled,
|
|
1034
|
-
className,
|
|
1035
|
-
testID
|
|
1036
|
-
}) {
|
|
1037
|
-
const { datePicker: ExpoUiPicker } = useGenesisModules();
|
|
1038
|
-
const Picker = ExpoUiPicker ? null : resolveDateTimePicker();
|
|
1039
|
-
const [showAndroid, setShowAndroid] = useState(false);
|
|
1040
|
-
const isIOS = Platform.OS === "ios";
|
|
1041
|
-
const label = useMemo(() => {
|
|
1042
|
-
if (formatLabel) return formatLabel(value);
|
|
1043
|
-
if (mode === "date") return value.toDateString();
|
|
1044
|
-
return value.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
1045
|
-
}, [formatLabel, mode, value]);
|
|
1046
|
-
if (ExpoUiPicker) {
|
|
1047
|
-
return /* @__PURE__ */ jsx(
|
|
1048
|
-
ExpoUiPickerButton,
|
|
1049
|
-
{
|
|
1050
|
-
Picker: ExpoUiPicker,
|
|
1051
|
-
value,
|
|
1052
|
-
onChange,
|
|
1053
|
-
mode,
|
|
1054
|
-
label,
|
|
1055
|
-
disabled,
|
|
1056
|
-
className,
|
|
1057
|
-
testID
|
|
1058
|
-
}
|
|
1059
|
-
);
|
|
1060
|
-
}
|
|
1061
|
-
if (!Picker) {
|
|
1062
|
-
return /* @__PURE__ */ jsxs(
|
|
1063
|
-
Text,
|
|
1064
|
-
{
|
|
1065
|
-
testID,
|
|
1066
|
-
className: cn(
|
|
1067
|
-
"min-h-[44px] rounded-md border border-input bg-background px-3 py-3 text-base text-muted-foreground",
|
|
1068
|
-
className
|
|
1069
|
-
),
|
|
1070
|
-
children: [
|
|
1071
|
-
label,
|
|
1072
|
-
" (picker module not installed)"
|
|
1073
|
-
]
|
|
1074
|
-
}
|
|
1075
|
-
);
|
|
1076
|
-
}
|
|
1077
|
-
if (isIOS) {
|
|
1078
|
-
return /* @__PURE__ */ jsx(
|
|
1079
|
-
Picker,
|
|
1080
|
-
{
|
|
1081
|
-
testID: testID ?? `native-${mode}-picker`,
|
|
1082
|
-
value,
|
|
1083
|
-
mode,
|
|
1084
|
-
display: "compact",
|
|
1085
|
-
disabled,
|
|
1086
|
-
style: disabled ? { opacity: 0.5 } : void 0,
|
|
1087
|
-
onChange: (_e, d) => {
|
|
1088
|
-
if (d && !disabled) onChange(d);
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
);
|
|
1092
|
-
}
|
|
1093
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1094
|
-
/* @__PURE__ */ jsx(
|
|
1095
|
-
Pressable,
|
|
1096
|
-
{
|
|
1097
|
-
testID: testID ?? `native-${mode}-picker`,
|
|
1098
|
-
accessibilityRole: "button",
|
|
1099
|
-
accessibilityLabel: `Pick a ${mode}`,
|
|
1100
|
-
accessibilityValue: { text: label },
|
|
1101
|
-
accessibilityState: { disabled },
|
|
1102
|
-
disabled,
|
|
1103
|
-
onPress: () => setShowAndroid(true),
|
|
1104
|
-
className: cn(
|
|
1105
|
-
"min-h-[44px] flex-row items-center rounded-md border border-input bg-background px-3",
|
|
1106
|
-
disabled && "opacity-50",
|
|
1107
|
-
className
|
|
1108
|
-
),
|
|
1109
|
-
children: /* @__PURE__ */ jsx(Text, { className: "flex-1 text-base text-foreground", children: label })
|
|
1110
|
-
}
|
|
1111
|
-
),
|
|
1112
|
-
showAndroid ? /* @__PURE__ */ jsx(
|
|
1113
|
-
Picker,
|
|
1114
|
-
{
|
|
1115
|
-
testID: testID ? `${testID}-picker` : void 0,
|
|
1116
|
-
value,
|
|
1117
|
-
mode,
|
|
1118
|
-
display: "default",
|
|
1119
|
-
onChange: (_e, d) => {
|
|
1120
|
-
setShowAndroid(false);
|
|
1121
|
-
if (d) onChange(d);
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
) : null
|
|
1125
|
-
] });
|
|
1126
|
-
}
|
|
1127
|
-
function ExpoUiPickerButton({
|
|
1128
|
-
Picker,
|
|
1129
|
-
value,
|
|
1130
|
-
onChange,
|
|
1131
|
-
mode,
|
|
1132
|
-
label,
|
|
1133
|
-
disabled,
|
|
1134
|
-
className,
|
|
1135
|
-
testID
|
|
1136
|
-
}) {
|
|
1137
|
-
const [showAndroid, setShowAndroid] = useState(false);
|
|
1138
|
-
if (Platform.OS === "ios") {
|
|
1139
|
-
return /* @__PURE__ */ jsx(
|
|
1140
|
-
Picker,
|
|
1141
|
-
{
|
|
1142
|
-
testID: testID ?? `native-${mode}-picker`,
|
|
1143
|
-
value,
|
|
1144
|
-
mode,
|
|
1145
|
-
display: "compact",
|
|
1146
|
-
disabled,
|
|
1147
|
-
style: disabled ? { opacity: 0.5 } : void 0,
|
|
1148
|
-
onValueChange: (_e, d) => {
|
|
1149
|
-
if (d && !disabled) onChange(d);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
);
|
|
1153
|
-
}
|
|
1154
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1155
|
-
/* @__PURE__ */ jsx(
|
|
1156
|
-
Pressable,
|
|
1157
|
-
{
|
|
1158
|
-
testID: testID ?? `native-${mode}-picker`,
|
|
1159
|
-
accessibilityRole: "button",
|
|
1160
|
-
accessibilityLabel: `Pick a ${mode}`,
|
|
1161
|
-
accessibilityValue: { text: label },
|
|
1162
|
-
accessibilityState: { disabled },
|
|
1163
|
-
disabled,
|
|
1164
|
-
onPress: () => setShowAndroid(true),
|
|
1165
|
-
className: cn(
|
|
1166
|
-
"min-h-[44px] flex-row items-center rounded-md border border-input bg-background px-3",
|
|
1167
|
-
disabled && "opacity-50",
|
|
1168
|
-
className
|
|
1169
|
-
),
|
|
1170
|
-
children: /* @__PURE__ */ jsx(Text, { className: "flex-1 text-base text-foreground", children: label })
|
|
1171
|
-
}
|
|
1172
|
-
),
|
|
1173
|
-
showAndroid ? /* @__PURE__ */ jsx(
|
|
1174
|
-
Picker,
|
|
1175
|
-
{
|
|
1176
|
-
testID: testID ? `${testID}-picker` : void 0,
|
|
1177
|
-
value,
|
|
1178
|
-
mode,
|
|
1179
|
-
presentation: "dialog",
|
|
1180
|
-
onValueChange: (_e, d) => {
|
|
1181
|
-
setShowAndroid(false);
|
|
1182
|
-
if (d) onChange(d);
|
|
1183
|
-
},
|
|
1184
|
-
onDismiss: () => setShowAndroid(false)
|
|
1185
|
-
}
|
|
1186
|
-
) : null
|
|
1187
|
-
] });
|
|
1188
|
-
}
|
|
1189
|
-
function NativeDatePicker(props) {
|
|
1190
|
-
return /* @__PURE__ */ jsx(PickerButton, { ...props, mode: "date" });
|
|
1191
|
-
}
|
|
1192
|
-
function NativeTimePicker(props) {
|
|
1193
|
-
return /* @__PURE__ */ jsx(PickerButton, { ...props, mode: "time" });
|
|
1194
|
-
}
|
|
1195
821
|
function clamp(v, min, max) {
|
|
1196
822
|
if (min !== void 0 && v < min) return min;
|
|
1197
823
|
if (max !== void 0 && v > max) return max;
|
|
@@ -1536,58 +1162,6 @@ function NativeRangeSlider({
|
|
|
1536
1162
|
}
|
|
1537
1163
|
);
|
|
1538
1164
|
}
|
|
1539
|
-
var SELECTED_LIFT = { shadowColor: "black", shadowOpacity: 0.08, shadowRadius: 2, shadowOffset: { width: 0, height: 1 }, elevation: 1 };
|
|
1540
|
-
var UNSELECTED_LIFT = { shadowColor: "black", shadowOpacity: 0, shadowRadius: 0, shadowOffset: { width: 0, height: 0 }, elevation: 0 };
|
|
1541
|
-
function NativeSegmentedControl({
|
|
1542
|
-
options,
|
|
1543
|
-
value,
|
|
1544
|
-
onChange,
|
|
1545
|
-
disabled,
|
|
1546
|
-
className,
|
|
1547
|
-
testID
|
|
1548
|
-
}) {
|
|
1549
|
-
return /* @__PURE__ */ jsx(
|
|
1550
|
-
View,
|
|
1551
|
-
{
|
|
1552
|
-
testID: testID ?? "native-segmented",
|
|
1553
|
-
accessibilityRole: "radiogroup",
|
|
1554
|
-
className: cn(
|
|
1555
|
-
"flex-row rounded-md border border-border bg-muted p-0.5",
|
|
1556
|
-
disabled && "opacity-50",
|
|
1557
|
-
className
|
|
1558
|
-
),
|
|
1559
|
-
children: options.map((opt) => {
|
|
1560
|
-
const selected = opt.value === value;
|
|
1561
|
-
return /* @__PURE__ */ jsx(
|
|
1562
|
-
Pressable,
|
|
1563
|
-
{
|
|
1564
|
-
testID: testID ? `${testID}-option-${String(opt.value)}` : `segmented-option-${String(opt.value)}`,
|
|
1565
|
-
disabled,
|
|
1566
|
-
accessibilityRole: "radio",
|
|
1567
|
-
accessibilityState: { selected, disabled },
|
|
1568
|
-
onPress: () => onChange(opt.value),
|
|
1569
|
-
className: cn(
|
|
1570
|
-
"min-h-[36px] flex-1 items-center justify-center rounded px-3 py-1",
|
|
1571
|
-
selected && "bg-background"
|
|
1572
|
-
),
|
|
1573
|
-
style: selected ? SELECTED_LIFT : UNSELECTED_LIFT,
|
|
1574
|
-
children: /* @__PURE__ */ jsx(
|
|
1575
|
-
Text,
|
|
1576
|
-
{
|
|
1577
|
-
className: cn(
|
|
1578
|
-
"text-sm",
|
|
1579
|
-
selected ? "font-semibold text-foreground" : "text-muted-foreground"
|
|
1580
|
-
),
|
|
1581
|
-
children: opt.label
|
|
1582
|
-
}
|
|
1583
|
-
)
|
|
1584
|
-
},
|
|
1585
|
-
String(opt.value)
|
|
1586
|
-
);
|
|
1587
|
-
})
|
|
1588
|
-
}
|
|
1589
|
-
);
|
|
1590
|
-
}
|
|
1591
1165
|
var ChipContext = createContext(null);
|
|
1592
1166
|
function NativeChipGroup({
|
|
1593
1167
|
mode = "multiple",
|
|
@@ -1760,263 +1334,6 @@ function Ellipsis() {
|
|
|
1760
1334
|
}
|
|
1761
1335
|
);
|
|
1762
1336
|
}
|
|
1763
|
-
var variantClasses2 = {
|
|
1764
|
-
info: "bg-secondary border-border",
|
|
1765
|
-
success: "bg-primary/10 border-primary/30",
|
|
1766
|
-
warning: "bg-warning/10 border-warning/30",
|
|
1767
|
-
destructive: "bg-destructive/10 border-destructive/30"
|
|
1768
|
-
};
|
|
1769
|
-
var titleClasses = {
|
|
1770
|
-
info: "text-foreground",
|
|
1771
|
-
success: "text-primary",
|
|
1772
|
-
warning: "text-warning",
|
|
1773
|
-
destructive: "text-destructive"
|
|
1774
|
-
};
|
|
1775
|
-
function NativeInlineAlert({
|
|
1776
|
-
variant = "info",
|
|
1777
|
-
title,
|
|
1778
|
-
description,
|
|
1779
|
-
icon,
|
|
1780
|
-
onDismiss,
|
|
1781
|
-
className,
|
|
1782
|
-
testID
|
|
1783
|
-
}) {
|
|
1784
|
-
return /* @__PURE__ */ jsxs(
|
|
1785
|
-
View,
|
|
1786
|
-
{
|
|
1787
|
-
testID: testID ?? `inline-alert-${variant}`,
|
|
1788
|
-
accessibilityRole: "alert",
|
|
1789
|
-
className: cn(
|
|
1790
|
-
"flex-row gap-3 rounded-md border p-3",
|
|
1791
|
-
variantClasses2[variant],
|
|
1792
|
-
className
|
|
1793
|
-
),
|
|
1794
|
-
children: [
|
|
1795
|
-
icon ? /* @__PURE__ */ jsx(View, { className: "pt-0.5", children: icon }) : null,
|
|
1796
|
-
/* @__PURE__ */ jsxs(View, { className: "flex-1", children: [
|
|
1797
|
-
title ? /* @__PURE__ */ jsx(Text, { className: cn("text-sm font-semibold", titleClasses[variant]), children: title }) : null,
|
|
1798
|
-
description ? /* @__PURE__ */ jsx(Text, { className: "mt-0.5 text-sm text-foreground/80", children: description }) : null
|
|
1799
|
-
] }),
|
|
1800
|
-
onDismiss ? /* @__PURE__ */ jsx(
|
|
1801
|
-
Pressable,
|
|
1802
|
-
{
|
|
1803
|
-
testID: testID ? `${testID}-dismiss` : void 0,
|
|
1804
|
-
accessibilityRole: "button",
|
|
1805
|
-
accessibilityLabel: "Dismiss",
|
|
1806
|
-
onPress: onDismiss,
|
|
1807
|
-
hitSlop: 8,
|
|
1808
|
-
className: "min-h-[24px] min-w-[24px] items-center justify-center",
|
|
1809
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-base text-muted-foreground", children: "\u2715" })
|
|
1810
|
-
}
|
|
1811
|
-
) : null
|
|
1812
|
-
]
|
|
1813
|
-
}
|
|
1814
|
-
);
|
|
1815
|
-
}
|
|
1816
|
-
function NativeBanner({
|
|
1817
|
-
variant = "info",
|
|
1818
|
-
title,
|
|
1819
|
-
description,
|
|
1820
|
-
icon,
|
|
1821
|
-
onDismiss,
|
|
1822
|
-
className,
|
|
1823
|
-
testID
|
|
1824
|
-
}) {
|
|
1825
|
-
return /* @__PURE__ */ jsxs(
|
|
1826
|
-
View,
|
|
1827
|
-
{
|
|
1828
|
-
testID: testID ?? `banner-${variant}`,
|
|
1829
|
-
accessibilityRole: "alert",
|
|
1830
|
-
accessibilityLiveRegion: "polite",
|
|
1831
|
-
className: cn(
|
|
1832
|
-
"flex-row items-start gap-3 border-b px-4 py-3",
|
|
1833
|
-
variantClasses2[variant],
|
|
1834
|
-
className
|
|
1835
|
-
),
|
|
1836
|
-
children: [
|
|
1837
|
-
icon ? /* @__PURE__ */ jsx(View, { className: "pt-0.5", children: icon }) : null,
|
|
1838
|
-
/* @__PURE__ */ jsxs(View, { className: "flex-1", children: [
|
|
1839
|
-
title ? /* @__PURE__ */ jsx(Text, { className: cn("text-sm font-semibold", titleClasses[variant]), children: title }) : null,
|
|
1840
|
-
description ? /* @__PURE__ */ jsx(Text, { className: "mt-0.5 text-sm text-foreground/80", children: description }) : null
|
|
1841
|
-
] }),
|
|
1842
|
-
onDismiss ? /* @__PURE__ */ jsx(
|
|
1843
|
-
Pressable,
|
|
1844
|
-
{
|
|
1845
|
-
testID: testID ? `${testID}-dismiss` : void 0,
|
|
1846
|
-
accessibilityRole: "button",
|
|
1847
|
-
accessibilityLabel: "Dismiss",
|
|
1848
|
-
onPress: onDismiss,
|
|
1849
|
-
hitSlop: 8,
|
|
1850
|
-
className: "min-h-[24px] min-w-[24px] items-center justify-center",
|
|
1851
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-base text-muted-foreground", children: "\u2715" })
|
|
1852
|
-
}
|
|
1853
|
-
) : null
|
|
1854
|
-
]
|
|
1855
|
-
}
|
|
1856
|
-
);
|
|
1857
|
-
}
|
|
1858
|
-
function NativeSearchBar({
|
|
1859
|
-
value,
|
|
1860
|
-
onChange,
|
|
1861
|
-
onSubmit,
|
|
1862
|
-
placeholder = "Search",
|
|
1863
|
-
placeholderTextColor,
|
|
1864
|
-
onVoicePress,
|
|
1865
|
-
showCancel = true,
|
|
1866
|
-
cancelLabel = "Cancel",
|
|
1867
|
-
className,
|
|
1868
|
-
testID
|
|
1869
|
-
}) {
|
|
1870
|
-
const [focused, setFocused] = useState(false);
|
|
1871
|
-
const inputRef = useRef(null);
|
|
1872
|
-
return /* @__PURE__ */ jsxs(
|
|
1873
|
-
View,
|
|
1874
|
-
{
|
|
1875
|
-
testID: testID ?? "native-search-bar",
|
|
1876
|
-
className: cn("flex-row items-center gap-2", className),
|
|
1877
|
-
children: [
|
|
1878
|
-
/* @__PURE__ */ jsxs(View, { className: "flex-1 flex-row items-center rounded-md border border-input bg-background px-3", children: [
|
|
1879
|
-
/* @__PURE__ */ jsx(Text, { accessibilityElementsHidden: true, className: "text-sm text-muted-foreground", children: "\u{1F50D}" }),
|
|
1880
|
-
/* @__PURE__ */ jsx(
|
|
1881
|
-
TextInput,
|
|
1882
|
-
{
|
|
1883
|
-
ref: inputRef,
|
|
1884
|
-
testID: testID ? `${testID}-input` : "search-input",
|
|
1885
|
-
value,
|
|
1886
|
-
onChangeText: onChange,
|
|
1887
|
-
onFocus: () => setFocused(true),
|
|
1888
|
-
onBlur: () => setFocused(false),
|
|
1889
|
-
onSubmitEditing: () => onSubmit?.(value),
|
|
1890
|
-
placeholder,
|
|
1891
|
-
placeholderTextColor,
|
|
1892
|
-
accessibilityLabel: placeholder,
|
|
1893
|
-
returnKeyType: "search",
|
|
1894
|
-
autoCorrect: false,
|
|
1895
|
-
autoCapitalize: "none",
|
|
1896
|
-
clearButtonMode: "never",
|
|
1897
|
-
className: "ml-2 min-h-[44px] flex-1 text-base text-foreground"
|
|
1898
|
-
}
|
|
1899
|
-
),
|
|
1900
|
-
value.length > 0 ? /* @__PURE__ */ jsx(
|
|
1901
|
-
Pressable,
|
|
1902
|
-
{
|
|
1903
|
-
testID: testID ? `${testID}-clear` : "search-clear",
|
|
1904
|
-
accessibilityRole: "button",
|
|
1905
|
-
accessibilityLabel: "Clear search",
|
|
1906
|
-
hitSlop: 8,
|
|
1907
|
-
onPress: () => onChange(""),
|
|
1908
|
-
className: "ml-1 min-h-[24px] min-w-[24px] items-center justify-center",
|
|
1909
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-sm text-muted-foreground", children: "\u2715" })
|
|
1910
|
-
}
|
|
1911
|
-
) : null,
|
|
1912
|
-
onVoicePress ? /* @__PURE__ */ jsx(
|
|
1913
|
-
Pressable,
|
|
1914
|
-
{
|
|
1915
|
-
testID: testID ? `${testID}-voice` : "search-voice",
|
|
1916
|
-
accessibilityRole: "button",
|
|
1917
|
-
accessibilityLabel: "Voice search",
|
|
1918
|
-
hitSlop: 8,
|
|
1919
|
-
onPress: onVoicePress,
|
|
1920
|
-
className: "ml-2 min-h-[24px] min-w-[24px] items-center justify-center",
|
|
1921
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-sm text-muted-foreground", children: "\u{1F3A4}" })
|
|
1922
|
-
}
|
|
1923
|
-
) : null
|
|
1924
|
-
] }),
|
|
1925
|
-
showCancel && focused ? /* @__PURE__ */ jsx(
|
|
1926
|
-
Pressable,
|
|
1927
|
-
{
|
|
1928
|
-
testID: testID ? `${testID}-cancel` : "search-cancel",
|
|
1929
|
-
accessibilityRole: "button",
|
|
1930
|
-
accessibilityLabel: cancelLabel,
|
|
1931
|
-
onPress: () => {
|
|
1932
|
-
onChange("");
|
|
1933
|
-
inputRef.current?.blur();
|
|
1934
|
-
setFocused(false);
|
|
1935
|
-
},
|
|
1936
|
-
className: "min-h-[44px] items-center justify-center px-2",
|
|
1937
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-base text-primary", children: cancelLabel })
|
|
1938
|
-
}
|
|
1939
|
-
) : null
|
|
1940
|
-
]
|
|
1941
|
-
}
|
|
1942
|
-
);
|
|
1943
|
-
}
|
|
1944
|
-
var FILL = { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 };
|
|
1945
|
-
function NativeAvatar({
|
|
1946
|
-
className,
|
|
1947
|
-
src,
|
|
1948
|
-
alt,
|
|
1949
|
-
fallback,
|
|
1950
|
-
size = 40,
|
|
1951
|
-
placeholder,
|
|
1952
|
-
recyclingKey,
|
|
1953
|
-
testID
|
|
1954
|
-
}) {
|
|
1955
|
-
const { image: ExpoImage } = useGenesisModules();
|
|
1956
|
-
const reducedMotion = useReducedMotion();
|
|
1957
|
-
const [failedSrc, setFailedSrc] = useState(null);
|
|
1958
|
-
const [loadedSrc, setLoadedSrc] = useState(null);
|
|
1959
|
-
const showImage = !!src && failedSrc !== src;
|
|
1960
|
-
const loaded = !!src && loadedSrc === src;
|
|
1961
|
-
const imageProps = {
|
|
1962
|
-
accessible: false,
|
|
1963
|
-
onError: () => setFailedSrc(src ?? null),
|
|
1964
|
-
onLoad: () => setLoadedSrc(src ?? null)
|
|
1965
|
-
};
|
|
1966
|
-
return /* @__PURE__ */ jsxs(
|
|
1967
|
-
View,
|
|
1968
|
-
{
|
|
1969
|
-
className: cn(
|
|
1970
|
-
"items-center justify-center overflow-hidden rounded-full bg-muted",
|
|
1971
|
-
className
|
|
1972
|
-
),
|
|
1973
|
-
style: [{ width: size, height: size }],
|
|
1974
|
-
accessible: true,
|
|
1975
|
-
accessibilityRole: "image",
|
|
1976
|
-
accessibilityLabel: alt || fallback || "Avatar",
|
|
1977
|
-
testID,
|
|
1978
|
-
children: [
|
|
1979
|
-
!showImage || !loaded ? /* @__PURE__ */ jsx(
|
|
1980
|
-
Text,
|
|
1981
|
-
{
|
|
1982
|
-
className: "text-sm font-medium text-muted-foreground",
|
|
1983
|
-
accessibilityElementsHidden: true,
|
|
1984
|
-
importantForAccessibility: "no",
|
|
1985
|
-
style: {
|
|
1986
|
-
fontSize: Math.round(size * 0.4),
|
|
1987
|
-
lineHeight: Math.round(size * 0.5)
|
|
1988
|
-
},
|
|
1989
|
-
children: fallback || "?"
|
|
1990
|
-
}
|
|
1991
|
-
) : null,
|
|
1992
|
-
showImage ? ExpoImage ? /* @__PURE__ */ jsx(
|
|
1993
|
-
ExpoImage,
|
|
1994
|
-
{
|
|
1995
|
-
...imageProps,
|
|
1996
|
-
testID: testID ? `${testID}-image` : void 0,
|
|
1997
|
-
source: { uri: src },
|
|
1998
|
-
style: FILL,
|
|
1999
|
-
contentFit: "cover",
|
|
2000
|
-
cachePolicy: "memory-disk",
|
|
2001
|
-
placeholder,
|
|
2002
|
-
placeholderContentFit: "cover",
|
|
2003
|
-
transition: reducedMotion ? null : 150,
|
|
2004
|
-
recyclingKey: recyclingKey ?? src
|
|
2005
|
-
}
|
|
2006
|
-
) : /* @__PURE__ */ jsx(
|
|
2007
|
-
Image,
|
|
2008
|
-
{
|
|
2009
|
-
...imageProps,
|
|
2010
|
-
testID: testID ? `${testID}-image` : void 0,
|
|
2011
|
-
source: { uri: src },
|
|
2012
|
-
style: FILL,
|
|
2013
|
-
resizeMode: "cover"
|
|
2014
|
-
}
|
|
2015
|
-
) : null
|
|
2016
|
-
]
|
|
2017
|
-
}
|
|
2018
|
-
);
|
|
2019
|
-
}
|
|
2020
1337
|
function NativeProgress({
|
|
2021
1338
|
className,
|
|
2022
1339
|
value = 0,
|
|
@@ -2588,58 +1905,7 @@ function Grid({
|
|
|
2588
1905
|
Array.from({ length: cols - row.length }).map((_, padIndex) => /* @__PURE__ */ jsx(View, { className: "flex-1" }, `pad-${padIndex}`))
|
|
2589
1906
|
] }, `row-${rowIndex}`)) });
|
|
2590
1907
|
}
|
|
2591
|
-
var FILL2 = { position: "absolute", top: 0, right: 0, bottom: 0, left: 0 };
|
|
2592
|
-
function NativeImage({
|
|
2593
|
-
src,
|
|
2594
|
-
alt,
|
|
2595
|
-
className,
|
|
2596
|
-
width,
|
|
2597
|
-
height,
|
|
2598
|
-
contentFit = "cover",
|
|
2599
|
-
placeholder,
|
|
2600
|
-
recyclingKey,
|
|
2601
|
-
priority,
|
|
2602
|
-
testID
|
|
2603
|
-
}) {
|
|
2604
|
-
const { image: ExpoImage } = useGenesisModules();
|
|
2605
|
-
const reducedMotion = useReducedMotion();
|
|
2606
|
-
const a11y = alt ? { accessible: true, accessibilityRole: "image", accessibilityLabel: alt } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
2607
|
-
return /* @__PURE__ */ jsx(
|
|
2608
|
-
View,
|
|
2609
|
-
{
|
|
2610
|
-
...a11y,
|
|
2611
|
-
testID,
|
|
2612
|
-
className: cn("overflow-hidden bg-muted", className),
|
|
2613
|
-
style: width !== void 0 || height !== void 0 ? { width, height } : void 0,
|
|
2614
|
-
children: ExpoImage ? /* @__PURE__ */ jsx(
|
|
2615
|
-
ExpoImage,
|
|
2616
|
-
{
|
|
2617
|
-
testID: testID ? `${testID}-image` : void 0,
|
|
2618
|
-
accessible: false,
|
|
2619
|
-
source: { uri: src },
|
|
2620
|
-
style: FILL2,
|
|
2621
|
-
contentFit,
|
|
2622
|
-
cachePolicy: "memory-disk",
|
|
2623
|
-
placeholder,
|
|
2624
|
-
placeholderContentFit: contentFit,
|
|
2625
|
-
transition: reducedMotion ? null : 150,
|
|
2626
|
-
recyclingKey: recyclingKey ?? src,
|
|
2627
|
-
priority
|
|
2628
|
-
}
|
|
2629
|
-
) : /* @__PURE__ */ jsx(
|
|
2630
|
-
Image,
|
|
2631
|
-
{
|
|
2632
|
-
testID: testID ? `${testID}-image` : void 0,
|
|
2633
|
-
accessible: false,
|
|
2634
|
-
source: { uri: src },
|
|
2635
|
-
style: FILL2,
|
|
2636
|
-
resizeMode: contentFit
|
|
2637
|
-
}
|
|
2638
|
-
)
|
|
2639
|
-
}
|
|
2640
|
-
);
|
|
2641
|
-
}
|
|
2642
1908
|
|
|
2643
|
-
export { Box, FULL_SCREEN_DARK, Grid, Inline, NativeAccordion, NativeAccordionContent, NativeAccordionItem, NativeAccordionTrigger,
|
|
2644
|
-
//# sourceMappingURL=chunk-
|
|
2645
|
-
//# sourceMappingURL=chunk-
|
|
1909
|
+
export { Box, FULL_SCREEN_DARK, Grid, Inline, NativeAccordion, NativeAccordionContent, NativeAccordionItem, NativeAccordionTrigger, NativeChip, NativeChipGroup, NativeCombobox, NativeDialog, NativeDialogContent, NativeDialogDescription, NativeDialogFooter, NativeDialogHeader, NativeDialogTitle, NativeDrawer, NativeDropdownMenu, NativeDropdownMenuContent, NativeDropdownMenuItem, NativeDropdownMenuTrigger, NativeFullScreenModal, NativeGlassSurface, NativeHeaderCard, NativeNumberInput, NativePagination, NativePopover, NativePopoverContent, NativePopoverTrigger, NativeProgress, NativeRadioGroup, NativeRadioGroupItem, NativeRangeSlider, NativeSlider, NativeStepper, NativeTabs, NativeTabsContent, NativeTabsList, NativeTabsTrigger, NativeToastProvider, NativeToggle, NativeTooltip, NativeTooltipContent, NativeTooltipTrigger, Stack, spaceScale, spacingClass, toggleVariants, useLiquidGlass, useReduceTransparency, useToast };
|
|
1910
|
+
//# sourceMappingURL=chunk-7HWS2JGX.js.map
|
|
1911
|
+
//# sourceMappingURL=chunk-7HWS2JGX.js.map
|