@marktiderman/genesis-ui-native 2.5.0 → 2.6.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-IDHW2NOP.js → chunk-3S5XVER4.js} +231 -6
- package/dist/chunk-3S5XVER4.js.map +1 -0
- package/dist/chunk-56QLEHHV.js +1231 -0
- package/dist/chunk-56QLEHHV.js.map +1 -0
- package/dist/chunk-6JBNSW4D.js +479 -0
- package/dist/chunk-6JBNSW4D.js.map +1 -0
- package/dist/{chunk-YJV5MMZX.js → chunk-KZEIF4YI.js} +7 -741
- package/dist/chunk-KZEIF4YI.js.map +1 -0
- package/dist/{chunk-YI7XVY2D.js → chunk-VMSIKSU2.js} +13 -479
- package/dist/chunk-VMSIKSU2.js.map +1 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -4
- package/dist/data/index.d.ts +382 -4
- package/dist/data/index.js +1067 -19
- 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/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 +528 -0
- package/src/data/resource-view/__tests__/native-resource-view.test.tsx +870 -0
- package/src/data/resource-view/display.tsx +256 -0
- package/src/data/resource-view/index.ts +50 -0
- package/src/data/resource-view/mapping.ts +326 -0
- package/src/data/resource-view/messages.ts +121 -0
- package/src/data/resource-view/use-native-resource-view.ts +307 -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
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
|
|
4
|
+
import { ViewStyle } from 'react-native';
|
|
5
|
+
|
|
6
|
+
type SafeAreaEdge = "top" | "bottom" | "left" | "right";
|
|
7
|
+
type ScrollEdgeBehavior = "match" | "transparent" | "opaque";
|
|
8
|
+
interface ScreenContainerProps {
|
|
9
|
+
/** Screen body. Pass any node tree. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** When `true`, the body is wrapped in a vertical ScrollView. Default `false`. */
|
|
12
|
+
scroll?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* SafeAreaView edges. Defaults to `["left", "right"]` — top/bottom are
|
|
15
|
+
* normally handled by the navigation header / tab bar.
|
|
16
|
+
*/
|
|
17
|
+
safeAreaEdges?: SafeAreaEdge[];
|
|
18
|
+
/**
|
|
19
|
+
* StatusBar appearance. `"auto"` follows the resolved theme mode.
|
|
20
|
+
*/
|
|
21
|
+
statusBar?: "light" | "dark" | "auto" | "hidden";
|
|
22
|
+
/**
|
|
23
|
+
* Force light or dark theme on this screen regardless of OS preference.
|
|
24
|
+
* Default `"system"` (follow OS).
|
|
25
|
+
*/
|
|
26
|
+
themeMode?: "light" | "dark" | "system";
|
|
27
|
+
/** Override root container className. */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Override inner content container className (the ScrollView's contentContainerClassName when scroll=true). */
|
|
30
|
+
contentClassName?: string;
|
|
31
|
+
/**
|
|
32
|
+
* `keyboardShouldPersistTaps` for the inner ScrollView. Default `"handled"`.
|
|
33
|
+
* Only used when `scroll` is true.
|
|
34
|
+
*/
|
|
35
|
+
keyboardShouldPersistTaps?: "always" | "never" | "handled";
|
|
36
|
+
/**
|
|
37
|
+
* When `true`, a centred `NativeLoadingState` (theme-tinted spinner,
|
|
38
|
+
* announced as loading) replaces the body, inside the same safe area and
|
|
39
|
+
* background. Use it for redirect and first-load screens: the body is
|
|
40
|
+
* unmounted while it's on, so a form underneath loses its state. Default `false`.
|
|
41
|
+
*/
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/** Text under the spinner while `loading`, and what screen readers announce: pass translated text. */
|
|
44
|
+
loadingLabel?: string;
|
|
45
|
+
/** Style on the root, e.g. a theme-role background color. */
|
|
46
|
+
style?: ViewStyle;
|
|
47
|
+
/** testID on the root container. */
|
|
48
|
+
testID?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Layer-3 named-prop slots that layouts can accept and forward to
|
|
52
|
+
* `composeHeaderOptions()` for `<Stack.Screen options={...}>`.
|
|
53
|
+
*/
|
|
54
|
+
interface ScreenHeaderProps {
|
|
55
|
+
/** Custom header title. Falls back to `<Stack.Screen name>` mapping. */
|
|
56
|
+
headerTitle?: string;
|
|
57
|
+
/** Custom node rendered on the left of the nav bar. */
|
|
58
|
+
headerLeft?: () => ReactNode;
|
|
59
|
+
/** Custom node rendered on the right of the nav bar. */
|
|
60
|
+
headerRight?: () => ReactNode;
|
|
61
|
+
/** When true, iOS uses large-title mode + scroll-edge appearance. */
|
|
62
|
+
large?: boolean;
|
|
63
|
+
/** iOS scroll-edge behavior. `"match"` collapses, `"transparent"` always transparent, `"opaque"` always opaque. */
|
|
64
|
+
scrollEdgeBehavior?: ScrollEdgeBehavior;
|
|
65
|
+
/** Direct passthrough merged INTO the resolved options object. Wins over named props. */
|
|
66
|
+
headerOptions?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Compose a `<Stack.Screen options={...}>` object from Layer-3 named
|
|
70
|
+
* props + a direct `headerOptions` passthrough. Layouts call this and
|
|
71
|
+
* pass the result to `<Stack.Screen>` so the host's expo-router stack
|
|
72
|
+
* renders a platform-native large title / scroll-edge appearance.
|
|
73
|
+
*
|
|
74
|
+
* Usage (in a layout primitive):
|
|
75
|
+
*
|
|
76
|
+
* const opts = composeHeaderOptions({
|
|
77
|
+
* headerTitle: "Settings",
|
|
78
|
+
* large: true,
|
|
79
|
+
* scrollEdgeBehavior: "match",
|
|
80
|
+
* headerOptions: rest.headerOptions,
|
|
81
|
+
* });
|
|
82
|
+
* return <><Stack.Screen options={opts} /><ScreenContainer>...</ScreenContainer></>;
|
|
83
|
+
*/
|
|
84
|
+
declare function composeHeaderOptions(props: ScreenHeaderProps): Record<string, unknown>;
|
|
85
|
+
declare function ScreenContainer({ children, scroll, safeAreaEdges, statusBar, themeMode, className, contentClassName, keyboardShouldPersistTaps, loading, loadingLabel, style, testID, }: ScreenContainerProps): react.JSX.Element;
|
|
86
|
+
|
|
87
|
+
/** An action on a row: swipe, long press, or an accessibility action. */
|
|
88
|
+
interface InboxSwipeAction {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
onPress: () => void;
|
|
92
|
+
/** Destructive tone (delete, leave). */
|
|
93
|
+
destructive?: boolean;
|
|
94
|
+
}
|
|
95
|
+
interface InboxItem {
|
|
96
|
+
/** Stable id for keying. */
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
99
|
+
/** The latest message or a summary, at most two lines. */
|
|
100
|
+
preview?: string;
|
|
101
|
+
/** When it last changed. Shown as a short time or date. */
|
|
102
|
+
timestamp?: string | Date;
|
|
103
|
+
/** Something new the person hasn't read: a dot, and the title in bold. */
|
|
104
|
+
unread?: boolean;
|
|
105
|
+
/** How many unread messages; shown as a count instead of the dot when above 0. */
|
|
106
|
+
unreadCount?: number;
|
|
107
|
+
/** A short status shown under the preview ("In progress", "12 votes"). */
|
|
108
|
+
meta?: string;
|
|
109
|
+
/** Replaces the unread dot (an icon). For a picture of who it is, use `avatar`, which keeps the dot. */
|
|
110
|
+
leading?: ReactNode;
|
|
111
|
+
/**
|
|
112
|
+
* A picture of who or what it is (a `NativeAvatar`, about 40pt), between the
|
|
113
|
+
* unread dot and the text. The separator then starts at the text. It is hidden
|
|
114
|
+
* from screen readers; when it shows someone `title` doesn't name, say who in
|
|
115
|
+
* `avatarLabel`.
|
|
116
|
+
*/
|
|
117
|
+
avatar?: ReactNode;
|
|
118
|
+
/** Who the avatar shows, read before the title, when `title` doesn't name them. */
|
|
119
|
+
avatarLabel?: string;
|
|
120
|
+
/** Shown at the end of the row (a vote button, a badge). Replaces the chevron. */
|
|
121
|
+
trailing?: ReactNode;
|
|
122
|
+
/** Opens the conversation. Rows with `onPress` show a chevron unless `trailing` is set. */
|
|
123
|
+
onPress?: () => void;
|
|
124
|
+
swipeActions?: InboxSwipeAction[];
|
|
125
|
+
/** testID override. Default `<page testID>-row-<id>`. */
|
|
126
|
+
testID?: string;
|
|
127
|
+
}
|
|
128
|
+
/** The parts `slots` and `slotProps` reach, with the props each receives. */
|
|
129
|
+
type InboxPageSlotMap = {
|
|
130
|
+
row: InboxItem & {
|
|
131
|
+
testID: string;
|
|
132
|
+
isFirst: boolean;
|
|
133
|
+
isLast: boolean;
|
|
134
|
+
timeLabel: string | null;
|
|
135
|
+
};
|
|
136
|
+
swipeable: {
|
|
137
|
+
actions: InboxSwipeAction[];
|
|
138
|
+
testID: string;
|
|
139
|
+
children?: ReactNode;
|
|
140
|
+
};
|
|
141
|
+
header: {
|
|
142
|
+
testID: string;
|
|
143
|
+
};
|
|
144
|
+
footer: {
|
|
145
|
+
loadingMore: boolean;
|
|
146
|
+
testID: string;
|
|
147
|
+
};
|
|
148
|
+
empty: {
|
|
149
|
+
title: string;
|
|
150
|
+
body: string;
|
|
151
|
+
actionLabel?: string;
|
|
152
|
+
onAction?: () => void;
|
|
153
|
+
testID: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
interface InboxPageProps extends ScreenHeaderProps {
|
|
157
|
+
/** Newest first, as they should show. Empty → the empty state. */
|
|
158
|
+
items: InboxItem[];
|
|
159
|
+
refreshing?: boolean;
|
|
160
|
+
onRefresh?: () => void | Promise<void>;
|
|
161
|
+
/** Called near the end of the list, to load the next page. */
|
|
162
|
+
onEndReached?: () => void;
|
|
163
|
+
/** A next page is loading: the default footer shows a spinner. */
|
|
164
|
+
loadingMore?: boolean;
|
|
165
|
+
/** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */
|
|
166
|
+
header?: ReactNode;
|
|
167
|
+
/** An optional title over the group, in the Settings header style. */
|
|
168
|
+
sectionTitle?: string;
|
|
169
|
+
emptyTitle?: string;
|
|
170
|
+
emptyBody?: string;
|
|
171
|
+
/** The first page is loading: a spinner instead of the empty state. */
|
|
172
|
+
loading?: boolean;
|
|
173
|
+
/** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */
|
|
174
|
+
error?: boolean;
|
|
175
|
+
errorTitle?: string;
|
|
176
|
+
errorBody?: string;
|
|
177
|
+
/** A button in the empty state ("Send feedback"). */
|
|
178
|
+
emptyActionLabel?: string;
|
|
179
|
+
onEmptyAction?: () => void;
|
|
180
|
+
/** How a row's time reads. Default: the time today, "Yesterday", the weekday this week, else the date. */
|
|
181
|
+
formatTime?: (date: Date, now: Date) => string;
|
|
182
|
+
/** The clock, for tests. */
|
|
183
|
+
now?: () => Date;
|
|
184
|
+
slots?: Slots<InboxPageSlotMap>;
|
|
185
|
+
slotProps?: SlotPropsFor<InboxPageSlotMap>;
|
|
186
|
+
/** testID on the root. Default `"inbox-page"`. */
|
|
187
|
+
testID?: string;
|
|
188
|
+
}
|
|
189
|
+
/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */
|
|
190
|
+
declare function getInboxPageStackOptions(props: ScreenHeaderProps & {
|
|
191
|
+
headerTitle?: string;
|
|
192
|
+
}): Record<string, unknown>;
|
|
193
|
+
/** The default row time: `9:41`, `Yesterday`, `Monday`, then a short date. */
|
|
194
|
+
declare function formatInboxTime(date: Date, now: Date): string;
|
|
195
|
+
declare function InboxPage({ items, refreshing, onRefresh, onEndReached, loadingMore, header, sectionTitle, emptyTitle, emptyBody, emptyActionLabel, onEmptyAction, loading, error, errorTitle, errorBody, formatTime, now, slots, slotProps, testID, }: InboxPageProps): react.JSX.Element;
|
|
196
|
+
/** Opens a row's actions as a menu (long press). */
|
|
197
|
+
declare function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel?: string): void;
|
|
198
|
+
|
|
199
|
+
export { type InboxItem as I, type SafeAreaEdge as S, InboxPage as a, type InboxPageProps as b, type InboxPageSlotMap as c, type InboxSwipeAction as d, ScreenContainer as e, type ScreenContainerProps as f, type ScreenHeaderProps as g, type ScrollEdgeBehavior as h, composeHeaderOptions as i, formatInboxTime as j, getInboxPageStackOptions as k, showInboxActions as s };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { Box, BoxBackground, BoxProps, FULL_SCREEN_DARK, FlexAlign, FlexJustify, Grid, GridProps, Inline, InlineProps, NativeAccordion, NativeAccordionContent, NativeAccordionContentProps, NativeAccordionItem, NativeAccordionItemProps, NativeAccordionProps, NativeAccordionTrigger, NativeAccordionTriggerProps, NativeAccordionType, NativeAlert, NativeAlertDescription, NativeAlertDescriptionProps, NativeAlertProps, NativeAlertTitle, NativeAlertTitleProps, NativeAvatar, NativeAvatarProps, NativeBadge, NativeBadgeProps, NativeBanner, NativeBannerProps, NativeButton, NativeButtonProps, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, NativeCardProps, NativeCardTitle, NativeCardTitleProps, NativeCheckbox, NativeCheckboxProps, NativeChip, NativeChipGroup, NativeChipGroupMode, NativeChipGroupProps, NativeChipProps, NativeCombobox, NativeComboboxOption, NativeComboboxProps, NativeDatePicker, NativeDatePickerProps, NativeDialog, NativeDialogContent, NativeDialogContentProps, NativeDialogDescription, NativeDialogDescriptionProps, NativeDialogFooter, NativeDialogFooterProps, NativeDialogHeader, NativeDialogHeaderProps, NativeDialogProps, NativeDialogTitle, NativeDialogTitleProps, NativeDrawer, NativeDrawerProps, NativeDropdownMenu, NativeDropdownMenuContent, NativeDropdownMenuContentProps, NativeDropdownMenuItem, NativeDropdownMenuItemProps, NativeDropdownMenuProps, NativeDropdownMenuTrigger, NativeDropdownMenuTriggerProps, NativeEmptyState, NativeEmptyStateProps, NativeEmptyStateVariant, NativeFullScreenModal, NativeFullScreenModalProps, NativeGlassSurface, NativeGlassSurfaceProps, NativeHeaderCard, NativeHeaderCardProps, NativeIcon, NativeIconProps, NativeImage, NativeImageProps, NativeInlineAlert, NativeInlineAlertProps, NativeInlineAlertVariant, NativeInput, NativeInputProps, NativeLabel, NativeLabelProps, NativeListItem, NativeListItemDivider, NativeListItemProps, NativeLoadingState, NativeLoadingStateEdge, NativeLoadingStateProps, NativeNumberInput, NativeNumberInputProps, NativePagination, NativePaginationProps, NativePopover, NativePopoverContent, NativePopoverContentProps, NativePopoverProps, NativePopoverTrigger, NativePopoverTriggerProps, NativeProgress, NativeProgressProps, NativeRadioGroup, NativeRadioGroupItem, NativeRadioGroupItemProps, NativeRadioGroupProps, NativeRangeSlider, NativeRangeSliderProps, NativeRefreshControl, NativeRefreshControlProps, NativeSearchBar, NativeSearchBarProps, NativeSectionListHeader, NativeSectionListHeaderProps, NativeSegmentedControl, NativeSegmentedControlOption, NativeSegmentedControlProps, NativeSelect, NativeSelectContent, NativeSelectContentProps, NativeSelectItem, NativeSelectItemProps, NativeSelectProps, NativeSelectTrigger, NativeSelectTriggerProps, NativeSeparator, NativeSeparatorProps, NativeSheet, NativeSheetLibrary, NativeSheetProps, NativeSheetProvider, NativeSheetProviderProps, NativeSheetScrollView, NativeSkeleton, NativeSkeletonProps, NativeSlider, NativeSliderProps, NativeStepper, NativeStepperProps, NativeStepperStep, NativeSwitch, NativeSwitchProps, NativeTabs, NativeTabsContent, NativeTabsContentProps, NativeTabsList, NativeTabsListProps, NativeTabsProps, NativeTabsTrigger, NativeTabsTriggerProps, NativeText, NativeTextProps, NativeTextarea, NativeTextareaProps, NativeTimePicker, NativeTimePickerProps, NativeToastOptions, NativeToastProvider, NativeToastProviderProps, NativeToastVariant, NativeToggle, NativeToggleProps, NativeTooltip, NativeTooltipContent, NativeTooltipContentProps, NativeTooltipProps, NativeTooltipTrigger, NativeTooltipTriggerProps, SpaceToken, SpacingPrefix, Stack, StackProps, TextPreset, alertVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, spaceScale, spacingClass, textVariants, toggleVariants, useLiquidGlass, useReduceTransparency, useToast } from './components/index.js';
|
|
2
2
|
export { G as GenesisDatePickerComponent, a as GenesisDatePickerProps, b as GenesisGlassModule, c as GenesisIconComponent, d as GenesisIconSet, e as GenesisImageComponent, f as GenesisImageProps, g as GenesisListComponent, h as GenesisListProps, i as GenesisModules, j as GenesisModulesProvider, k as GenesisModulesProviderProps, l as GenesisReanimatedModule, m as GenesisSymbolComponent, n as GenesisSymbolProps, N as NATIVE_ICON_NAMES, o as NativeIconName, S as SF_SYMBOLS, u as useGenesisModules } from './native-modules-_Q5vIbd5.js';
|
|
3
3
|
export { BrandExtensionsProvider, BrandExtensionsProviderProps, BrandExtensionsValue, ThemeMode, ThemeRoleColors, UseThemeRolesOptions, useGenesisExtension, useReducedMotion, useThemeMode, useThemeRoles } from './hooks/index.js';
|
|
4
|
-
export {
|
|
4
|
+
export { I as InboxItem, a as InboxPage, b as InboxPageProps, c as InboxPageSlotMap, d as InboxSwipeAction, S as SafeAreaEdge, e as ScreenContainer, f as ScreenContainerProps, g as ScreenHeaderProps, h as ScrollEdgeBehavior, i as composeHeaderOptions, j as formatInboxTime, k as getInboxPageStackOptions, s as showInboxActions } from './inbox-page-DZUR-PJ1.js';
|
|
5
|
+
export { AppleButtonModuleLike, AppleProviderOptions, AppleSignInButton, AppleSignInButtonProps, AuthBranding, AuthBrandingProps, AuthForm, AuthFormProps, AuthFormValues, AuthScreen, AuthScreenProps, AuthScreenSlotMap, ForgotPasswordLink, GoogleProviderOptions, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProps, KeyboardScrollProvider, KeyboardToolbarProps, NavBarSaveButton, NavBarSaveButtonProps, NavBarSearchBar, NavBarSearchBarProps, NavBarTitle, NavBarTitleProps, NotificationItem, NotificationsPage, NotificationsPageProps, NotificationsPageSlotMap, SettingsPage, SettingsPageDangerousAction, SettingsPageProps, SettingsPageRow, SettingsPageSection, SettingsPageSlotMap, SettingsSubPage, SettingsSubPageProps, SocialAuthProvider, SocialAuthRow, SocialAuthRowProps, ThreadAttachment, ThreadComposer, ThreadLabels, ThreadMessage, ThreadPage, ThreadPageProps, ThreadPageSlotMap, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar } from './layouts/index.js';
|
|
5
6
|
export { cn } from './utils.js';
|
|
6
7
|
import 'react';
|
|
7
8
|
import 'class-variance-authority/types';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Box, FULL_SCREEN_DARK, Grid, Inline, NativeAccordion, NativeAccordionContent, NativeAccordionItem, NativeAccordionTrigger,
|
|
2
|
-
export { NativeAlert, NativeAlertDescription, NativeAlertTitle, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, NativeCardTitle, NativeCheckbox, NativeLabel, NativeSelect, NativeSelectContent, NativeSelectItem, NativeSelectTrigger, NativeSeparator, NativeSkeleton, NativeSwitch, NativeTextarea, alertVariants } from './chunk-
|
|
1
|
+
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 } from './chunk-KZEIF4YI.js';
|
|
2
|
+
export { NativeAlert, NativeAlertDescription, NativeAlertTitle, NativeAvatar, NativeBanner, NativeCard, NativeCardContent, NativeCardDescription, NativeCardFooter, NativeCardHeader, NativeCardTitle, NativeCheckbox, NativeDatePicker, NativeImage, NativeInlineAlert, NativeLabel, NativeSearchBar, NativeSegmentedControl, NativeSelect, NativeSelectContent, NativeSelectItem, NativeSelectTrigger, NativeSeparator, NativeSheet, NativeSheetProvider, NativeSheetScrollView, NativeSkeleton, NativeSwitch, NativeTextarea, NativeTimePicker, alertVariants } from './chunk-56QLEHHV.js';
|
|
3
3
|
export { BrandExtensionsProvider, useGenesisExtension } from './chunk-D5RKSPMH.js';
|
|
4
4
|
export { useReducedMotion } from './chunk-7PCWEY6R.js';
|
|
5
|
-
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink,
|
|
6
|
-
export {
|
|
7
|
-
export { GenesisModulesProvider, NativeBadge, NativeButton, NativeInput, NativeText, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, textVariants, useGenesisModules } from './chunk-
|
|
5
|
+
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NotificationsPage, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar } from './chunk-VMSIKSU2.js';
|
|
6
|
+
export { InboxPage, NavBarSaveButton, NavBarSearchBar, NavBarTitle, ScreenContainer, composeHeaderOptions, formatInboxTime, getInboxPageStackOptions, showInboxActions } from './chunk-6JBNSW4D.js';
|
|
7
|
+
export { GenesisModulesProvider, NATIVE_ICON_NAMES, NativeBadge, NativeButton, NativeEmptyState, NativeIcon, NativeInput, NativeListItem, NativeListItemDivider, NativeLoadingState, NativeRefreshControl, NativeSectionListHeader, NativeText, SF_SYMBOLS, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, textVariants, useGenesisModules } from './chunk-3S5XVER4.js';
|
|
8
8
|
export { useThemeMode, useThemeRoles } from './chunk-Z3AQYVUA.js';
|
|
9
9
|
export { cn } from './chunk-OHZD7KRO.js';
|
|
10
10
|
import './chunk-DGUM43GV.js';
|
package/dist/layouts/index.d.ts
CHANGED
|
@@ -1,88 +1,9 @@
|
|
|
1
|
+
import { g as ScreenHeaderProps } from '../inbox-page-DZUR-PJ1.js';
|
|
2
|
+
export { I as InboxItem, a as InboxPage, b as InboxPageProps, c as InboxPageSlotMap, d as InboxSwipeAction, S as SafeAreaEdge, e as ScreenContainer, f as ScreenContainerProps, h as ScrollEdgeBehavior, i as composeHeaderOptions, j as formatInboxTime, k as getInboxPageStackOptions, s as showInboxActions } from '../inbox-page-DZUR-PJ1.js';
|
|
1
3
|
import * as react from 'react';
|
|
2
4
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { ViewStyle } from 'react-native';
|
|
4
5
|
import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
|
|
5
|
-
|
|
6
|
-
type SafeAreaEdge = "top" | "bottom" | "left" | "right";
|
|
7
|
-
type ScrollEdgeBehavior = "match" | "transparent" | "opaque";
|
|
8
|
-
interface ScreenContainerProps {
|
|
9
|
-
/** Screen body. Pass any node tree. */
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
/** When `true`, the body is wrapped in a vertical ScrollView. Default `false`. */
|
|
12
|
-
scroll?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* SafeAreaView edges. Defaults to `["left", "right"]` — top/bottom are
|
|
15
|
-
* normally handled by the navigation header / tab bar.
|
|
16
|
-
*/
|
|
17
|
-
safeAreaEdges?: SafeAreaEdge[];
|
|
18
|
-
/**
|
|
19
|
-
* StatusBar appearance. `"auto"` follows the resolved theme mode.
|
|
20
|
-
*/
|
|
21
|
-
statusBar?: "light" | "dark" | "auto" | "hidden";
|
|
22
|
-
/**
|
|
23
|
-
* Force light or dark theme on this screen regardless of OS preference.
|
|
24
|
-
* Default `"system"` (follow OS).
|
|
25
|
-
*/
|
|
26
|
-
themeMode?: "light" | "dark" | "system";
|
|
27
|
-
/** Override root container className. */
|
|
28
|
-
className?: string;
|
|
29
|
-
/** Override inner content container className (the ScrollView's contentContainerClassName when scroll=true). */
|
|
30
|
-
contentClassName?: string;
|
|
31
|
-
/**
|
|
32
|
-
* `keyboardShouldPersistTaps` for the inner ScrollView. Default `"handled"`.
|
|
33
|
-
* Only used when `scroll` is true.
|
|
34
|
-
*/
|
|
35
|
-
keyboardShouldPersistTaps?: "always" | "never" | "handled";
|
|
36
|
-
/**
|
|
37
|
-
* When `true`, a centred `NativeLoadingState` (theme-tinted spinner,
|
|
38
|
-
* announced as loading) replaces the body, inside the same safe area and
|
|
39
|
-
* background. Use it for redirect and first-load screens: the body is
|
|
40
|
-
* unmounted while it's on, so a form underneath loses its state. Default `false`.
|
|
41
|
-
*/
|
|
42
|
-
loading?: boolean;
|
|
43
|
-
/** Text under the spinner while `loading`, and what screen readers announce: pass translated text. */
|
|
44
|
-
loadingLabel?: string;
|
|
45
|
-
/** Style on the root, e.g. a theme-role background color. */
|
|
46
|
-
style?: ViewStyle;
|
|
47
|
-
/** testID on the root container. */
|
|
48
|
-
testID?: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Layer-3 named-prop slots that layouts can accept and forward to
|
|
52
|
-
* `composeHeaderOptions()` for `<Stack.Screen options={...}>`.
|
|
53
|
-
*/
|
|
54
|
-
interface ScreenHeaderProps {
|
|
55
|
-
/** Custom header title. Falls back to `<Stack.Screen name>` mapping. */
|
|
56
|
-
headerTitle?: string;
|
|
57
|
-
/** Custom node rendered on the left of the nav bar. */
|
|
58
|
-
headerLeft?: () => ReactNode;
|
|
59
|
-
/** Custom node rendered on the right of the nav bar. */
|
|
60
|
-
headerRight?: () => ReactNode;
|
|
61
|
-
/** When true, iOS uses large-title mode + scroll-edge appearance. */
|
|
62
|
-
large?: boolean;
|
|
63
|
-
/** iOS scroll-edge behavior. `"match"` collapses, `"transparent"` always transparent, `"opaque"` always opaque. */
|
|
64
|
-
scrollEdgeBehavior?: ScrollEdgeBehavior;
|
|
65
|
-
/** Direct passthrough merged INTO the resolved options object. Wins over named props. */
|
|
66
|
-
headerOptions?: Record<string, unknown>;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Compose a `<Stack.Screen options={...}>` object from Layer-3 named
|
|
70
|
-
* props + a direct `headerOptions` passthrough. Layouts call this and
|
|
71
|
-
* pass the result to `<Stack.Screen>` so the host's expo-router stack
|
|
72
|
-
* renders a platform-native large title / scroll-edge appearance.
|
|
73
|
-
*
|
|
74
|
-
* Usage (in a layout primitive):
|
|
75
|
-
*
|
|
76
|
-
* const opts = composeHeaderOptions({
|
|
77
|
-
* headerTitle: "Settings",
|
|
78
|
-
* large: true,
|
|
79
|
-
* scrollEdgeBehavior: "match",
|
|
80
|
-
* headerOptions: rest.headerOptions,
|
|
81
|
-
* });
|
|
82
|
-
* return <><Stack.Screen options={opts} /><ScreenContainer>...</ScreenContainer></>;
|
|
83
|
-
*/
|
|
84
|
-
declare function composeHeaderOptions(props: ScreenHeaderProps): Record<string, unknown>;
|
|
85
|
-
declare function ScreenContainer({ children, scroll, safeAreaEdges, statusBar, themeMode, className, contentClassName, keyboardShouldPersistTaps, loading, loadingLabel, style, testID, }: ScreenContainerProps): react.JSX.Element;
|
|
6
|
+
import { ViewStyle } from 'react-native';
|
|
86
7
|
|
|
87
8
|
interface NavBarSaveButtonProps {
|
|
88
9
|
/** Press handler. Disabled when not provided OR when `disabled`/`loading`. */
|
|
@@ -364,118 +285,6 @@ declare function iosCompactNavigationBarHeight(version: number | string): number
|
|
|
364
285
|
declare function defaultStickyHeaderOffset(os: string, version: number | string, safeAreaTop: number): number;
|
|
365
286
|
declare function NotificationsPage({ items, refreshing, onRefresh, emptyState, emptyTitle, emptyBody, className, testID, slots, slotProps, stickyHeaderOffset, }: NotificationsPageProps): react.JSX.Element;
|
|
366
287
|
|
|
367
|
-
/** An action on a row: swipe, long press, or an accessibility action. */
|
|
368
|
-
interface InboxSwipeAction {
|
|
369
|
-
id: string;
|
|
370
|
-
label: string;
|
|
371
|
-
onPress: () => void;
|
|
372
|
-
/** Destructive tone (delete, leave). */
|
|
373
|
-
destructive?: boolean;
|
|
374
|
-
}
|
|
375
|
-
interface InboxItem {
|
|
376
|
-
/** Stable id for keying. */
|
|
377
|
-
id: string;
|
|
378
|
-
title: string;
|
|
379
|
-
/** The latest message or a summary, at most two lines. */
|
|
380
|
-
preview?: string;
|
|
381
|
-
/** When it last changed. Shown as a short time or date. */
|
|
382
|
-
timestamp?: string | Date;
|
|
383
|
-
/** Something new the person hasn't read: a dot, and the title in bold. */
|
|
384
|
-
unread?: boolean;
|
|
385
|
-
/** How many unread messages; shown as a count instead of the dot when above 0. */
|
|
386
|
-
unreadCount?: number;
|
|
387
|
-
/** A short status shown under the preview ("In progress", "12 votes"). */
|
|
388
|
-
meta?: string;
|
|
389
|
-
/** Replaces the unread dot (an icon). For a picture of who it is, use `avatar`, which keeps the dot. */
|
|
390
|
-
leading?: ReactNode;
|
|
391
|
-
/**
|
|
392
|
-
* A picture of who or what it is (a `NativeAvatar`, about 40pt), between the
|
|
393
|
-
* unread dot and the text. The separator then starts at the text. It is hidden
|
|
394
|
-
* from screen readers; when it shows someone `title` doesn't name, say who in
|
|
395
|
-
* `avatarLabel`.
|
|
396
|
-
*/
|
|
397
|
-
avatar?: ReactNode;
|
|
398
|
-
/** Who the avatar shows, read before the title, when `title` doesn't name them. */
|
|
399
|
-
avatarLabel?: string;
|
|
400
|
-
/** Shown at the end of the row (a vote button, a badge). Replaces the chevron. */
|
|
401
|
-
trailing?: ReactNode;
|
|
402
|
-
/** Opens the conversation. Rows with `onPress` show a chevron unless `trailing` is set. */
|
|
403
|
-
onPress?: () => void;
|
|
404
|
-
swipeActions?: InboxSwipeAction[];
|
|
405
|
-
/** testID override. Default `<page testID>-row-<id>`. */
|
|
406
|
-
testID?: string;
|
|
407
|
-
}
|
|
408
|
-
/** The parts `slots` and `slotProps` reach, with the props each receives. */
|
|
409
|
-
type InboxPageSlotMap = {
|
|
410
|
-
row: InboxItem & {
|
|
411
|
-
testID: string;
|
|
412
|
-
isFirst: boolean;
|
|
413
|
-
isLast: boolean;
|
|
414
|
-
timeLabel: string | null;
|
|
415
|
-
};
|
|
416
|
-
swipeable: {
|
|
417
|
-
actions: InboxSwipeAction[];
|
|
418
|
-
testID: string;
|
|
419
|
-
children?: ReactNode;
|
|
420
|
-
};
|
|
421
|
-
header: {
|
|
422
|
-
testID: string;
|
|
423
|
-
};
|
|
424
|
-
footer: {
|
|
425
|
-
loadingMore: boolean;
|
|
426
|
-
testID: string;
|
|
427
|
-
};
|
|
428
|
-
empty: {
|
|
429
|
-
title: string;
|
|
430
|
-
body: string;
|
|
431
|
-
actionLabel?: string;
|
|
432
|
-
onAction?: () => void;
|
|
433
|
-
testID: string;
|
|
434
|
-
};
|
|
435
|
-
};
|
|
436
|
-
interface InboxPageProps extends ScreenHeaderProps {
|
|
437
|
-
/** Newest first, as they should show. Empty → the empty state. */
|
|
438
|
-
items: InboxItem[];
|
|
439
|
-
refreshing?: boolean;
|
|
440
|
-
onRefresh?: () => void | Promise<void>;
|
|
441
|
-
/** Called near the end of the list, to load the next page. */
|
|
442
|
-
onEndReached?: () => void;
|
|
443
|
-
/** A next page is loading: the default footer shows a spinner. */
|
|
444
|
-
loadingMore?: boolean;
|
|
445
|
-
/** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */
|
|
446
|
-
header?: ReactNode;
|
|
447
|
-
/** An optional title over the group, in the Settings header style. */
|
|
448
|
-
sectionTitle?: string;
|
|
449
|
-
emptyTitle?: string;
|
|
450
|
-
emptyBody?: string;
|
|
451
|
-
/** The first page is loading: a spinner instead of the empty state. */
|
|
452
|
-
loading?: boolean;
|
|
453
|
-
/** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */
|
|
454
|
-
error?: boolean;
|
|
455
|
-
errorTitle?: string;
|
|
456
|
-
errorBody?: string;
|
|
457
|
-
/** A button in the empty state ("Send feedback"). */
|
|
458
|
-
emptyActionLabel?: string;
|
|
459
|
-
onEmptyAction?: () => void;
|
|
460
|
-
/** How a row's time reads. Default: the time today, "Yesterday", the weekday this week, else the date. */
|
|
461
|
-
formatTime?: (date: Date, now: Date) => string;
|
|
462
|
-
/** The clock, for tests. */
|
|
463
|
-
now?: () => Date;
|
|
464
|
-
slots?: Slots<InboxPageSlotMap>;
|
|
465
|
-
slotProps?: SlotPropsFor<InboxPageSlotMap>;
|
|
466
|
-
/** testID on the root. Default `"inbox-page"`. */
|
|
467
|
-
testID?: string;
|
|
468
|
-
}
|
|
469
|
-
/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */
|
|
470
|
-
declare function getInboxPageStackOptions(props: ScreenHeaderProps & {
|
|
471
|
-
headerTitle?: string;
|
|
472
|
-
}): Record<string, unknown>;
|
|
473
|
-
/** The default row time: `9:41`, `Yesterday`, `Monday`, then a short date. */
|
|
474
|
-
declare function formatInboxTime(date: Date, now: Date): string;
|
|
475
|
-
declare function InboxPage({ items, refreshing, onRefresh, onEndReached, loadingMore, header, sectionTitle, emptyTitle, emptyBody, emptyActionLabel, onEmptyAction, loading, error, errorTitle, errorBody, formatTime, now, slots, slotProps, testID, }: InboxPageProps): react.JSX.Element;
|
|
476
|
-
/** Opens a row's actions as a menu (long press). */
|
|
477
|
-
declare function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel?: string): void;
|
|
478
|
-
|
|
479
288
|
interface ThreadAttachment {
|
|
480
289
|
id: string;
|
|
481
290
|
/** An image URI (a signed URL, a file:// path). */
|
|
@@ -868,4 +677,4 @@ interface GoogleProviderOptions {
|
|
|
868
677
|
*/
|
|
869
678
|
declare function googleProvider({ onPress, label, icon, disabled, enabled }: GoogleProviderOptions): SocialAuthProvider | null;
|
|
870
679
|
|
|
871
|
-
export { type AppleButtonModuleLike, type AppleProviderOptions, AppleSignInButton, type AppleSignInButtonProps, AuthBranding, type AuthBrandingProps, AuthForm, type AuthFormProps, type AuthFormValues, AuthScreen, type AuthScreenProps, type AuthScreenSlotMap, ForgotPasswordLink, type GoogleProviderOptions,
|
|
680
|
+
export { type AppleButtonModuleLike, type AppleProviderOptions, AppleSignInButton, type AppleSignInButtonProps, AuthBranding, type AuthBrandingProps, AuthForm, type AuthFormProps, type AuthFormValues, AuthScreen, type AuthScreenProps, type AuthScreenSlotMap, ForgotPasswordLink, type GoogleProviderOptions, KEYBOARD_TOOLBAR_HEIGHT, type KeyboardScrollProps, KeyboardScrollProvider, type KeyboardToolbarProps, NavBarSaveButton, type NavBarSaveButtonProps, NavBarSearchBar, type NavBarSearchBarProps, NavBarTitle, type NavBarTitleProps, type NotificationItem, NotificationsPage, type NotificationsPageProps, type NotificationsPageSlotMap, ScreenHeaderProps, SettingsPage, type SettingsPageDangerousAction, type SettingsPageProps, type SettingsPageRow, type SettingsPageSection, type SettingsPageSlotMap, SettingsSubPage, type SettingsSubPageProps, type SocialAuthProvider, SocialAuthRow, type SocialAuthRowProps, type ThreadAttachment, type ThreadComposer, type ThreadLabels, type ThreadMessage, ThreadPage, type ThreadPageProps, type ThreadPageSlotMap, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar };
|
package/dist/layouts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink,
|
|
2
|
-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NotificationsPage, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar } from '../chunk-VMSIKSU2.js';
|
|
2
|
+
export { InboxPage, NavBarSaveButton, NavBarSearchBar, NavBarTitle, ScreenContainer, composeHeaderOptions, formatInboxTime, getInboxPageStackOptions, showInboxActions } from '../chunk-6JBNSW4D.js';
|
|
3
|
+
import '../chunk-3S5XVER4.js';
|
|
4
4
|
import '../chunk-Z3AQYVUA.js';
|
|
5
5
|
import '../chunk-OHZD7KRO.js';
|
|
6
6
|
import '../chunk-DGUM43GV.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marktiderman/genesis-ui-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@expo/ui": ">=58.0.0",
|
|
70
70
|
"@gorhom/bottom-sheet": ">=5.0.0",
|
|
71
71
|
"@hookform/resolvers": "^3.0.0 || ^4.0.0 || ^5.0.0",
|
|
72
|
-
"@marktiderman/genesis-core": "^1.
|
|
72
|
+
"@marktiderman/genesis-core": "^1.13.0",
|
|
73
73
|
"@marktiderman/genesis-design-system": "^1.5.0",
|
|
74
74
|
"@react-native-community/datetimepicker": ">=8.0.0",
|
|
75
75
|
"@shopify/flash-list": ">=2.0.0",
|
package/src/components/image.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export interface NativeImageProps {
|
|
|
32
32
|
recyclingKey?: string;
|
|
33
33
|
/** expo-image only: load order among images. */
|
|
34
34
|
priority?: "low" | "normal" | "high";
|
|
35
|
+
/** The picture couldn't be loaded (draw a fallback). */
|
|
36
|
+
onError?: () => void;
|
|
35
37
|
testID?: string;
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -47,6 +49,7 @@ export function NativeImage({
|
|
|
47
49
|
placeholder,
|
|
48
50
|
recyclingKey,
|
|
49
51
|
priority,
|
|
52
|
+
onError,
|
|
50
53
|
testID,
|
|
51
54
|
}: NativeImageProps) {
|
|
52
55
|
const { image: ExpoImage } = useGenesisModules();
|
|
@@ -74,6 +77,7 @@ export function NativeImage({
|
|
|
74
77
|
transition={reducedMotion ? null : 150}
|
|
75
78
|
recyclingKey={recyclingKey ?? src}
|
|
76
79
|
priority={priority}
|
|
80
|
+
onError={onError}
|
|
77
81
|
/>
|
|
78
82
|
) : (
|
|
79
83
|
<Image
|
|
@@ -82,6 +86,7 @@ export function NativeImage({
|
|
|
82
86
|
source={{ uri: src }}
|
|
83
87
|
style={FILL}
|
|
84
88
|
resizeMode={contentFit}
|
|
89
|
+
onError={onError}
|
|
85
90
|
/>
|
|
86
91
|
)}
|
|
87
92
|
</View>
|
|
@@ -20,6 +20,10 @@ export interface NativeDetailPanelProps<T = Record<string, unknown>> {
|
|
|
20
20
|
fields?: NativeDetailField<T>[];
|
|
21
21
|
onEdit?: (item: T) => void;
|
|
22
22
|
onDelete?: (item: T) => void;
|
|
23
|
+
/** The heading. Wins over `titleField` (e.g. a view's `summary(row).title`). */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Below the fields and actions (e.g. actions with their own wording, or the reason one is refused). */
|
|
26
|
+
footer?: ReactNode;
|
|
23
27
|
children?: ReactNode;
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -31,9 +35,11 @@ function NativeDetailPanel<T extends Record<string, unknown>>({
|
|
|
31
35
|
fields,
|
|
32
36
|
onEdit,
|
|
33
37
|
onDelete,
|
|
38
|
+
title: titleProp,
|
|
39
|
+
footer,
|
|
34
40
|
children,
|
|
35
41
|
}: NativeDetailPanelProps<T>) {
|
|
36
|
-
const title = titleField ? String(item[titleField] ?? "") : undefined;
|
|
42
|
+
const title = titleProp ?? (titleField ? String(item[titleField] ?? "") : undefined);
|
|
37
43
|
const hasActions = onEdit != null || onDelete != null;
|
|
38
44
|
|
|
39
45
|
// Escape hatch — caller provides full content
|
|
@@ -122,6 +128,7 @@ function NativeDetailPanel<T extends Record<string, unknown>>({
|
|
|
122
128
|
) : null}
|
|
123
129
|
</View>
|
|
124
130
|
) : null}
|
|
131
|
+
{footer}
|
|
125
132
|
</ScrollView>
|
|
126
133
|
</SafeAreaView>
|
|
127
134
|
);
|
package/src/data/index.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { NativeDetailPanel, type NativeDetailPanelProps, type NativeDetailField
|
|
|
7
7
|
export { NativeResourceFormFieldRenderer, type NativeResourceFormFieldRendererProps } from "./NativeResourceFormField";
|
|
8
8
|
export { NativeResourceForm, type NativeResourceFormProps } from "./NativeResourceForm";
|
|
9
9
|
export { NativeResourcePage, type NativeResourcePageProps, type NativeCardFieldDef } from "./NativeResourcePage";
|
|
10
|
+
export * from "./resource-view";
|