@marktiderman/genesis-ui-native 3.9.0 → 3.10.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/README.md +1 -1
- package/dist/{chunk-T7FEVT62.js → chunk-EAHK7D7N.js} +9 -9
- package/dist/chunk-EAHK7D7N.js.map +1 -0
- package/dist/{chunk-PWYMRUAK.js → chunk-GGH3ZQNO.js} +6 -6
- package/dist/chunk-GGH3ZQNO.js.map +1 -0
- package/dist/{chunk-UZCJDMGE.js → chunk-IWWXERKQ.js} +17 -16
- package/dist/chunk-IWWXERKQ.js.map +1 -0
- package/dist/{chunk-PWS2HLDE.js → chunk-PMS2V46D.js} +2 -2
- package/dist/{chunk-PWS2HLDE.js.map → chunk-PMS2V46D.js.map} +1 -1
- package/dist/{chunk-JZ7RAGDQ.js → chunk-SG7LYX7Z.js} +4 -4
- package/dist/{chunk-JZ7RAGDQ.js.map → chunk-SG7LYX7Z.js.map} +1 -1
- package/dist/{chunk-FGIIBON3.js → chunk-VEWSY4TZ.js} +3 -3
- package/dist/{chunk-FGIIBON3.js.map → chunk-VEWSY4TZ.js.map} +1 -1
- package/dist/{chunk-DHONOH6K.js → chunk-ZUR4PK77.js} +9 -8
- package/dist/chunk-ZUR4PK77.js.map +1 -0
- package/dist/components/index.d.ts +12 -4
- package/dist/components/index.js +5 -5
- package/dist/data/index.js +8 -8
- package/dist/data/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/layouts/index.js +5 -5
- package/dist/{native-modules-CeAaO2Dh.d.ts → native-modules-Bkm1jHO-.d.ts} +2 -0
- package/package.json +3 -3
- package/src/__tests__/fake-modules.tsx +1 -0
- package/src/__tests__/native-modules.test.tsx +39 -0
- package/src/components/__tests__/gallery-grid.test.tsx +20 -0
- package/src/components/__tests__/lightbox.test.tsx +16 -0
- package/src/components/chip-group.tsx +1 -1
- package/src/components/gallery-grid.tsx +1 -1
- package/src/components/image.tsx +15 -4
- package/src/components/inline-alert.tsx +1 -1
- package/src/components/lightbox-zoom.tsx +8 -6
- package/src/components/lightbox.tsx +2 -1
- package/src/components/search-bar.tsx +1 -1
- package/src/components/stepper.tsx +1 -1
- package/src/components/tab-bar.tsx +2 -2
- package/src/data/resource-view/NativeLinkPicker.tsx +1 -1
- package/src/data/resource-view/NativeRecordView.tsx +1 -1
- package/src/data/resource-view/NativeResourceFormSheet.tsx +1 -1
- package/src/data/resource-view/display.tsx +1 -1
- package/src/layouts/__tests__/settings-page-native-look.test.tsx +1 -1
- package/src/layouts/auth.tsx +1 -1
- package/src/layouts/inbox-page.tsx +1 -1
- package/src/layouts/nav-bar.tsx +1 -1
- package/src/layouts/notifications-page.tsx +1 -1
- package/src/layouts/settings-page.tsx +2 -2
- package/src/native-modules.tsx +2 -1
- package/dist/chunk-DHONOH6K.js.map +0 -1
- package/dist/chunk-PWYMRUAK.js.map +0 -1
- package/dist/chunk-T7FEVT62.js.map +0 -1
- package/dist/chunk-UZCJDMGE.js.map +0 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ import { lucideIcons } from "@marktiderman/genesis-ui-native/icons/lucide";
|
|
|
31
31
|
| `modules.` | Package (`npx expo install …`) | Used by | Without it |
|
|
32
32
|
| --- | --- | --- | --- |
|
|
33
33
|
| `list` | `@shopify/flash-list` v2 (New Architecture only) | `NativeResourcePage`, `NotificationsPage` (sections become one list with sticky headers) | `FlatList` / `SectionList` |
|
|
34
|
-
| `image` | `expo-image` | `NativeAvatar`, `NativeImage`: memory and disk cache, `placeholder` (blurhash / thumbhash), `recyclingKey` (the URL by default) so recycled rows never flash the last picture, no cross-fade under Reduce Motion | React Native `Image` |
|
|
34
|
+
| `image` | `expo-image` | `NativeAvatar`, `NativeImage`: memory and disk cache, `placeholder` (blurhash / thumbhash), `recyclingKey` (the URL by default) so recycled rows never flash the last picture, `NativeImage`'s `cacheKey` (a stable key for a signed URL that rotates; also a gallery item's `cacheKey` in `NativeGalleryGrid` and `NativeLightbox`), no cross-fade under Reduce Motion | React Native `Image` |
|
|
35
35
|
| `reanimated` | `react-native-reanimated` 4 (`import * as`) | `NativeToastProvider`, `NativeDrawer`, `NativeSkeleton`; all of them stay still under Reduce Motion | React Native `Animated` |
|
|
36
36
|
| `glass` | `expo-glass-effect` (`import * as`) | `NativeGlassSurface`: default toasts, the update banner, popovers and dropdown menus, as iOS 26 Liquid Glass | the solid surface |
|
|
37
37
|
| `symbol` | `expo-symbols` | `NativeIcon` on iOS (SF Symbols), and the drill-in chevron of `NativeListItem` | `icons` |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NativeThreadList, NativeComposerBar } from './chunk-
|
|
2
|
-
import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-
|
|
3
|
-
import { NativeText, NativeListItem, NativeButton, NativeSectionListHeader, NativeEmptyState, NativeInput, NativeIcon } from './chunk-
|
|
4
|
-
import { useThemeRoles, sentBubbleColor, useGenesisModules, useThemeMode } from './chunk-
|
|
1
|
+
import { NativeThreadList, NativeComposerBar } from './chunk-SG7LYX7Z.js';
|
|
2
|
+
import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-GGH3ZQNO.js';
|
|
3
|
+
import { NativeText, NativeListItem, NativeButton, NativeSectionListHeader, NativeEmptyState, NativeInput, NativeIcon } from './chunk-VEWSY4TZ.js';
|
|
4
|
+
import { useThemeRoles, sentBubbleColor, useGenesisModules, useThemeMode } from './chunk-PMS2V46D.js';
|
|
5
5
|
import { cn } from './chunk-OHZD7KRO.js';
|
|
6
6
|
import { createContext, memo, Fragment, useState, useMemo, createElement, useContext, useCallback, useRef, useEffect } from 'react';
|
|
7
7
|
import { renderSlot } from '@marktiderman/genesis-core/slots';
|
|
@@ -127,7 +127,7 @@ function DefaultSectionHeader({ title, testID }) {
|
|
|
127
127
|
{
|
|
128
128
|
testID,
|
|
129
129
|
accessibilityRole: "header",
|
|
130
|
-
className: "px-4 pb-2 pt-4 text-primary",
|
|
130
|
+
className: "px-4 pb-2 pt-4 text-primary-text",
|
|
131
131
|
style: { fontSize: 14, lineHeight: 20, fontWeight: "500" },
|
|
132
132
|
children: title
|
|
133
133
|
}
|
|
@@ -335,7 +335,7 @@ function getNotificationsPageStackOptions(props) {
|
|
|
335
335
|
onPress: onMarkAllRead,
|
|
336
336
|
hitSlop: 8,
|
|
337
337
|
className: "min-h-[44px] justify-center px-3",
|
|
338
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-base text-primary", children: "Mark all read" })
|
|
338
|
+
children: /* @__PURE__ */ jsx(Text, { className: "text-base text-primary-text", children: "Mark all read" })
|
|
339
339
|
}
|
|
340
340
|
) : void 0);
|
|
341
341
|
return composeHeaderOptions({
|
|
@@ -1064,7 +1064,7 @@ function ForgotPasswordLink({
|
|
|
1064
1064
|
onPress,
|
|
1065
1065
|
hitSlop: 8,
|
|
1066
1066
|
className: "self-end",
|
|
1067
|
-
children: /* @__PURE__ */ jsx(Text, { className: "text-sm font-medium text-primary", children: label })
|
|
1067
|
+
children: /* @__PURE__ */ jsx(Text, { className: "text-sm font-medium text-primary-text", children: label })
|
|
1068
1068
|
}
|
|
1069
1069
|
);
|
|
1070
1070
|
}
|
|
@@ -1190,5 +1190,5 @@ function googleProvider({ onPress, label = "Continue with Google", icon, disable
|
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
1192
1192
|
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NotificationsPage, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, useKeyboardScroll, useKeyboardToolbar };
|
|
1193
|
-
//# sourceMappingURL=chunk-
|
|
1194
|
-
//# sourceMappingURL=chunk-
|
|
1193
|
+
//# sourceMappingURL=chunk-EAHK7D7N.js.map
|
|
1194
|
+
//# sourceMappingURL=chunk-EAHK7D7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/layouts/settings-page.tsx","../src/layouts/keyboard.tsx","../src/layouts/settings-sub-page.tsx","../src/layouts/notifications-page.tsx","../src/layouts/thread-page.tsx","../src/layouts/auth.tsx","../src/layouts/auth-screen.tsx","../src/layouts/apple-sign-in.tsx","../src/layouts/google-sign-in.tsx"],"names":["Fragment","jsx","jsxs","View","Platform","useContext","useMemo","useCallback","renderSlot","DefaultSectionHeader","DefaultRow","NO_SLOTS","useState","KeyboardAvoidingView","SafeAreaView","DefaultEmpty","Pressable","DefaultMessage","Text","useRef"],"mappings":";;;;;;;;;;;;;AAiIO,SAAS,4BACd,KAAA,EACyB;AACzB,EAAA,OAAO,oBAAA,CAAqB;AAAA,IAC1B,WAAA,EAAa,MAAM,WAAA,IAAe,UAAA;AAAA,IAClC,KAAA,EAAO,MAAM,KAAA,IAAS,IAAA;AAAA,IACtB,kBAAA,EAAoB,MAAM,kBAAA,IAAsB,OAAA;AAAA,IAChD,YAAY,KAAA,CAAM,UAAA;AAAA,IAClB,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,eAAe,KAAA,CAAM;AAAA,GACtB,CAAA;AACH;AAEO,SAAS,YAAA,CAAa;AAAA,EAC3B,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA,GAAS,eAAA;AAAA,EACT,QAAA;AAAA,EACA,QAAQ,EAAC;AAAA,EACT,YAAY;AACd,CAAA,EAAsB;AAIpB,EAAA,MAAM,SAAS,aAAA,EAAc;AAC7B,EAAA,MAAM,KAAA,GAAQ,SAAS,EAAA,KAAO,KAAA;AAE9B,EAAA,uBACE,IAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,M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AAU,KAAA,EAAO,IAAA,EAAM,SAAS,QAAA,EAAS;AACxD","file":"chunk-EAHK7D7N.js","sourcesContent":["/**\n * SettingsPage — top-level settings layout.\n *\n * Composes `<ScreenContainer scroll>` underneath, renders a sectioned\n * `ListItem` list, and surfaces an optional dangerous-action footer\n * (e.g., \"Sign out\", \"Delete account\") in destructive tone.\n *\n * Why ship a layout: every consumer rebuilds this list with the same\n * three pieces (sections → rows → footer). Genesis ships the assembly so\n * consumers compose, not rebuild.\n *\n * Layer-3 customization: pass `headerTitle`, `headerLeft`, `headerRight`,\n * `large`, `scrollEdgeBehavior`, OR a direct `headerOptions={...}`\n * passthrough. The composed options are rendered via the consumer's own\n * `<Stack.Screen options={...}>` — see `getStackScreenOptions()` helper.\n *\n * Colors come from theme roles (`useThemeRoles`). On iOS it is the Settings\n * app's inset grouped style: the page is `systemGroupedBackground`, each\n * section a rounded group of cells on `secondarySystemGroupedBackground` with\n * hairline `separator` lines between cells, inset from the leading edge to\n * the cell text; the header is an uppercase footnote in `secondaryLabel`\n * above the group and the footnote sits under it in the same color. On\n * Android, cells are full width and the header is a Material subheader in the\n * theme's primary color. Neither platform draws a band or a rule behind a\n * header. Cell content itself is `NativeListItem`'s.\n *\n * Slots: replace or drop one part without leaving the layout. `slots`\n * swaps a part (`sectionHeader`, `row`, `footnote`, `dangerousActions`) for\n * your component, which receives exactly the props the default would;\n * `slotProps` feeds the default more props; `null` drops the part.\n *\n * Escape hatch: drop down to `<ScreenContainer>` if the layout structure\n * doesn't fit.\n *\n * @stability Beta\n */\nimport { Fragment, useState, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { Platform, StyleSheet, View } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeListItem } from \"../components/list-item\";\nimport { NativeText } from \"../components/text\";\nimport { NativeButton } from \"../components/button\";\nimport { cn } from \"../utils\";\nimport {\n ScreenContainer,\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\n\nexport interface SettingsPageRow {\n /** Stable id for keying. */\n id: string;\n title: string;\n subtitle?: string;\n /** Leading slot (icon, avatar, etc.). */\n leading?: ReactNode;\n /** Trailing slot (badge, switch, version string, etc.). */\n trailing?: ReactNode;\n /** When true, renders a chevron at the row end (drill-in affordance). */\n showChevron?: boolean;\n /** Press handler — required for chevron rows. */\n onPress?: () => void;\n /** Disable the row (greyed + non-pressable). */\n disabled?: boolean;\n /** testID override for the row. Falls back to `settings-row-<id>`. */\n testID?: string;\n}\n\nexport interface SettingsPageSection {\n /** Stable id for keying. */\n id: string;\n /** Optional uppercase section header. Pass `null` to skip the header for an unlabeled section. */\n title?: string;\n /** Optional caption rendered under the rows (compliance text, hint, etc.). */\n footnote?: string;\n /** Rows in render order. */\n rows: SettingsPageRow[];\n /**\n * Content rendered inside the section's group, after the rows: a part that\n * a pattern built on SettingsPage lets you replace (a block's slot), kept\n * under the same header, in the same group and above the same footnote.\n */\n children?: ReactNode;\n}\n\n/** A destructive-tone action in the footer, e.g. \"Sign out\". */\nexport interface SettingsPageDangerousAction {\n label: string;\n onPress: () => void;\n /** When true, renders with extra emphasis. Default `false`. */\n emphasized?: boolean;\n testID?: string;\n}\n\n/** The parts of a {@link SettingsPage} that `slots` and `slotProps` reach, with the props each receives. */\nexport type SettingsPageSlotMap = {\n sectionHeader: { title: string; testID: string };\n row: SettingsPageRow & { testID: string; isLast: boolean };\n footnote: { text: string };\n dangerousActions: { actions: SettingsPageDangerousAction[]; testID: string };\n};\n\nexport interface SettingsPageProps extends ScreenHeaderProps {\n /** Sectioned content. Order is preserved. */\n sections: SettingsPageSection[];\n /**\n * Optional dangerous-action row(s) shown after the last section in a\n * destructive-tone footer. Typical: \"Sign out\", \"Delete account\".\n */\n dangerousActions?: SettingsPageDangerousAction[];\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<SettingsPageSlotMap>;\n /** More props for a default part, merged over what the layout passes. */\n slotProps?: SlotPropsFor<SettingsPageSlotMap>;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"settings-page\"`. */\n testID?: string;\n /** Pass-through children rendered ABOVE the first section (e.g., a profile card). */\n children?: ReactNode;\n}\n\n/**\n * Convenience helper for callers that want to wire `<Stack.Screen options={...}>`\n * without re-importing composeHeaderOptions. Defaults `large: true` and\n * `scrollEdgeBehavior: \"match\"` to match the Apple HIG large-title settings\n * pattern out of the box.\n */\nexport function getSettingsPageStackOptions(\n props: ScreenHeaderProps & { headerTitle?: string },\n): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Settings\",\n large: props.large ?? true,\n scrollEdgeBehavior: props.scrollEdgeBehavior ?? \"match\",\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\nexport function SettingsPage({\n sections,\n dangerousActions,\n className,\n testID = \"settings-page\",\n children,\n slots = {},\n slotProps = {},\n}: SettingsPageProps) {\n // Note: header props (headerTitle, headerLeft, headerRight, etc.) are\n // accepted on the type for API ergonomics but consumed by\n // getSettingsPageStackOptions() at the consumer's <Stack.Screen> level.\n const colors = useThemeRoles();\n const inset = Platform.OS === \"ios\";\n\n return (\n <ScreenContainer\n scroll\n safeAreaEdges={[\"left\", \"right\", \"bottom\"]}\n testID={testID}\n contentClassName=\"pb-8\"\n className={className}\n style={{ backgroundColor: colors.groupedBackground }}\n >\n {children ? <View className=\"px-4 pt-2\">{children}</View> : null}\n\n {sections.map((section) => (\n <View\n key={section.id}\n testID={`${testID}-section-${section.id}`}\n className=\"mt-6\"\n >\n {section.title\n ? renderSlot(\n DefaultSectionHeader,\n slots.sectionHeader,\n { title: section.title, testID: `${testID}-section-${section.id}-header` },\n slotProps.sectionHeader,\n )\n : null}\n <View\n testID={`${testID}-section-${section.id}-group`}\n className={inset ? \"overflow-hidden\" : \"border-y\"}\n style={[\n { backgroundColor: colors.surface, borderColor: colors.separator },\n inset ? { marginHorizontal: IOS_GROUP_MARGIN, borderRadius: iosGroupRadius() } : null,\n ]}\n >\n {section.rows.map((row, rowIndex) => (\n <Fragment key={row.id}>\n {renderSlot(\n DefaultRow,\n slots.row,\n { ...row, testID: row.testID ?? `${testID}-row-${row.id}`, isLast: rowIndex === section.rows.length - 1 },\n slotProps.row,\n )}\n </Fragment>\n ))}\n {section.children}\n </View>\n {section.footnote\n ? renderSlot(DefaultFootnote, slots.footnote, { text: section.footnote }, slotProps.footnote)\n : null}\n </View>\n ))}\n\n {dangerousActions && dangerousActions.length > 0\n ? renderSlot(\n DefaultDangerousActions,\n slots.dangerousActions,\n {\n actions: dangerousActions.map((action) => ({ ...action, testID: action.testID ?? `${testID}-danger-${slug(action.label)}` })),\n testID: `${testID}-dangerous-actions`,\n },\n slotProps.dangerousActions,\n )\n : null}\n </ScreenContainer>\n );\n}\n\n/** UIKit's inset grouped margin on a phone, in points. */\nconst IOS_GROUP_MARGIN = 16;\n\n/** UIKit's inset grouped corner radius: 10pt through iOS 18, 26pt from iOS 26. */\nfunction iosGroupRadius(): number {\n return Number.parseFloat(String(Platform.Version)) >= 26 ? 26 : 10;\n}\n\n/** From iOS 26 a separator also stops short of the trailing edge. */\nfunction iosTrailingSeparatorInset(): boolean {\n return Platform.OS === \"ios\" && Number.parseFloat(String(Platform.Version)) >= 26;\n}\n\n/**\n * iOS: the Settings app's inset grouped header, an uppercase footnote in\n * `secondaryLabel` on the page background. It sits over the group (same\n * margin) and is padded like a cell (`px-4`), so it lines up with the cell\n * text. Android: a Material list subheader in the brand's primary color\n * (`text-primary-text`, which follows the app's theme). Neither draws a band or a\n * rule. iOS reads uppercased text as written in capitals, so the label is the\n * title as written, and VoiceOver doesn't spell short words out.\n */\nfunction DefaultSectionHeader({ title, testID }: SettingsPageSlotMap[\"sectionHeader\"]) {\n const colors = useThemeRoles();\n if (Platform.OS === \"ios\") {\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n accessibilityLabel={title}\n dynamicTypeRamp=\"footnote\"\n className=\"px-4 pb-1.5 pt-2\"\n style={{\n marginHorizontal: IOS_GROUP_MARGIN,\n color: colors.secondaryLabel,\n fontSize: 13,\n lineHeight: 18,\n textTransform: \"uppercase\",\n }}\n >\n {title}\n </NativeText>\n );\n }\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n className=\"px-4 pb-2 pt-4 text-primary-text\"\n style={{ fontSize: 14, lineHeight: 20, fontWeight: \"500\" }}\n >\n {title}\n </NativeText>\n );\n}\n\nfunction DefaultRow({ isLast, id: _id, leading, ...row }: SettingsPageSlotMap[\"row\"]) {\n const colors = useThemeRoles();\n // A separator starts at the cell text: the same `px-4` (and `mr-3` past a\n // leading icon, measured once it lays out) as `NativeListItem`, so it lines\n // up whatever the NativeWind rem is. A row lays out start to end, so this\n // follows right-to-left layouts too.\n const [leadingWidth, setLeadingWidth] = useState(0);\n return (\n <>\n <NativeListItem\n testID={row.testID}\n // The cell wrapper carries the surface color from theme roles.\n className=\"bg-transparent\"\n title={row.title}\n subtitle={row.subtitle}\n leading={\n leading ? (\n <View onLayout={(event) => setLeadingWidth(event.nativeEvent.layout.width)}>{leading}</View>\n ) : undefined\n }\n trailing={row.trailing}\n showChevron={row.showChevron}\n onPress={row.onPress}\n disabled={row.disabled}\n />\n {isLast ? null : (\n <View\n testID={`${row.testID}-separator`}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n className=\"flex-row\"\n style={{ height: StyleSheet.hairlineWidth }}\n >\n <View className=\"w-4\" />\n {leading ? <View className=\"mr-3\" style={{ width: leadingWidth }} /> : null}\n <View testID={`${row.testID}-separator-line`} className=\"flex-1\" style={{ backgroundColor: colors.separator }} />\n {iosTrailingSeparatorInset() ? <View className=\"w-4\" /> : null}\n </View>\n )}\n </>\n );\n}\n\nfunction DefaultFootnote({ text }: SettingsPageSlotMap[\"footnote\"]) {\n const colors = useThemeRoles();\n if (Platform.OS === \"ios\") {\n return (\n <NativeText\n dynamicTypeRamp=\"footnote\"\n className=\"px-4 pt-1.5\"\n style={{ marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18 }}\n >\n {text}\n </NativeText>\n );\n }\n return (\n <NativeText preset=\"body-sm\" className=\"px-4 pt-2\" style={{ color: colors.secondaryLabel }}>\n {text}\n </NativeText>\n );\n}\n\nfunction DefaultDangerousActions({ actions, testID }: SettingsPageSlotMap[\"dangerousActions\"]) {\n return (\n <View testID={testID} className={cn(\"mt-8 gap-2 px-4\")}>\n {actions.map((action) => (\n <NativeButton\n key={action.label}\n testID={action.testID}\n variant={action.emphasized ? \"destructive\" : \"outline\"}\n onPress={action.onPress}\n >\n {action.label}\n </NativeButton>\n ))}\n </View>\n );\n}\n\nfunction slug(s: string): string {\n return s\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-|-$/g, \"\");\n}\n","/**\n * Keyboard-aware scrolling for form screens. Expo recommends\n * react-native-keyboard-controller's `KeyboardAwareScrollView` over\n * `KeyboardAvoidingView` for real apps; it is an optional peer here, so an app\n * that has it passes it once:\n *\n * import { KeyboardAwareScrollView, KeyboardProvider, KeyboardToolbar } from \"react-native-keyboard-controller\";\n * <KeyboardProvider>\n * <KeyboardScrollProvider component={KeyboardAwareScrollView} toolbar={KeyboardToolbar}>…</KeyboardScrollProvider>\n * </KeyboardProvider>\n *\n * `KeyboardAwareScrollView` does nothing without react-native-keyboard-controller's\n * `KeyboardProvider` above it, mounted once at the root. (The native app\n * shell does both, with `keyboardProvider` and `keyboardScroll`.) Without a\n * scroll view here, form screens fall back to `KeyboardAvoidingView`.\n *\n * `toolbar` (optional, `KeyboardToolbar`) adds the previous / next / done bar\n * above the keyboard on Genesis's multi-field form layouts (`AuthScreen`,\n * `SettingsSubPage`). It needs `component` too: the bar sits beside the\n * keyboard-aware scroll view. Without it, nothing changes.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\n/** The props Genesis passes to a keyboard-aware scroll view. */\nexport interface KeyboardScrollProps {\n children?: ReactNode;\n testID?: string;\n keyboardShouldPersistTaps?: \"always\" | \"never\" | \"handled\";\n contentContainerStyle?: ViewStyle;\n /** iOS: inset content under a translucent or large-title header, as `ScreenContainer` does. */\n contentInsetAdjustmentBehavior?: \"automatic\" | \"scrollableAxes\" | \"never\" | \"always\";\n /** Extra space between the focused input and the keyboard. */\n bottomOffset?: number;\n}\n\n/**\n * The props Genesis may pass to a keyboard toolbar, all optional and all\n * `KeyboardToolbar`'s own: a settings form passes none (previous / next /\n * done), a one-question form (forms-native's `FormFocus`) hides the arrows\n * and makes Done its Next or Send. To theme it, pass a wrapper defined at\n * module scope that renders it with your props and forwards these.\n */\nexport interface KeyboardToolbarProps {\n /** Show the previous / next arrows. `KeyboardToolbar`'s default is true. */\n showArrows?: boolean;\n /** The done button's label. */\n doneText?: ReactNode;\n /** Called when done is pressed. The keyboard closes too, unless the callback calls `event.preventDefault()`. */\n onDoneCallback?: (event: { preventDefault(): void }) => void;\n}\n\n/**\n * Height of react-native-keyboard-controller's `KeyboardToolbar`, kept clear\n * above the focused input. Mirrors `KEYBOARD_TOOLBAR_HEIGHT` in the library's\n * `src/components/KeyboardToolbar/constants.ts` (1.22): move them together.\n */\nexport const KEYBOARD_TOOLBAR_HEIGHT = 42;\n\ninterface KeyboardScrollValue {\n component: ComponentType<KeyboardScrollProps>;\n toolbar: ComponentType<KeyboardToolbarProps> | null;\n}\n\nconst KeyboardScrollContext = createContext<KeyboardScrollValue | null>(null);\n\nexport function KeyboardScrollProvider({\n component,\n toolbar,\n children,\n}: {\n component: ComponentType<KeyboardScrollProps>;\n /** `KeyboardToolbar` from react-native-keyboard-controller: previous / next / done above the keyboard. */\n toolbar?: ComponentType<KeyboardToolbarProps>;\n children: ReactNode;\n}) {\n const value = useMemo(() => ({ component, toolbar: toolbar ?? null }), [component, toolbar]);\n return createElement(KeyboardScrollContext.Provider, { value }, children);\n}\n\n/** The app's keyboard-aware scroll view, or null when none was provided. */\nexport function useKeyboardScroll(): ComponentType<KeyboardScrollProps> | null {\n return useContext(KeyboardScrollContext)?.component ?? null;\n}\n\n/** The app's keyboard toolbar, or null when none was provided (or no scroll view to go with it). */\nexport function useKeyboardToolbar(): ComponentType<KeyboardToolbarProps> | null {\n return useContext(KeyboardScrollContext)?.toolbar ?? null;\n}\n","/**\n * SettingsSubPage — drill-in detail layout.\n *\n * Composes a KeyboardAvoidingView + scroll + dirty-form leave warning +\n * optimistic-save pattern. The save action is surfaced in the nav bar via\n * a `<NavBarSaveButton>` rendered through `headerRight`.\n *\n * Why ship: the recurring shape is \"form fields + nav-bar Save + leave\n * guard\"; consumers re-implement this every time. Genesis ships the\n * shape so consumers focus on the form fields themselves.\n *\n * Layer-3 customization: pass `headerTitle`, `headerLeft`, OR a direct\n * `headerOptions={...}`. Use `getSettingsSubPageStackOptions()` to get a\n * `<Stack.Screen options={...}>` object (with the save button wired via\n * `headerRight`).\n *\n * @stability Beta\n */\nimport { useCallback, type ReactNode } from \"react\";\nimport { Alert, KeyboardAvoidingView, Platform, View } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { KEYBOARD_TOOLBAR_HEIGHT, useKeyboardScroll, useKeyboardToolbar } from \"./keyboard\";\nimport {\n ScreenContainer,\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\nimport { NavBarSaveButton } from \"./nav-bar\";\n\nexport interface SettingsSubPageProps extends ScreenHeaderProps {\n /** Form / detail body content. Pass any node tree. */\n children: ReactNode;\n /**\n * When true, the Save button is enabled and the back-confirm guard\n * fires when the user tries to leave. Mark `true` whenever the form\n * has unsaved changes.\n */\n dirty?: boolean;\n /** When true, the Save button shows a busy indicator and is non-pressable. */\n saving?: boolean;\n /** Save handler. Required to render a Save button in the nav bar. */\n onSave?: () => void | Promise<void>;\n /**\n * Confirm-leave hook. Implementations should integrate with the\n * navigator's `beforeRemove` listener (React Navigation) — Genesis\n * provides a default `Alert` confirm helper via `confirmDiscardChanges()`.\n * Pass null to opt OUT of the leave guard.\n */\n onConfirmLeave?: ((proceed: () => void) => void) | null;\n /** Save button label. Default `\"Save\"`. */\n saveLabel?: string;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"settings-sub-page\"`. */\n testID?: string;\n}\n\n/**\n * Default leave-guard helper. Pops a native Alert with Discard / Keep\n * Editing buttons; calls `proceed()` only if the user opts to discard.\n *\n * <SettingsSubPage onConfirmLeave={confirmDiscardChanges} ... />\n */\nexport function confirmDiscardChanges(proceed: () => void): void {\n Alert.alert(\n \"Discard changes?\",\n \"You have unsaved changes. Leave this screen and lose them?\",\n [\n { text: \"Keep editing\", style: \"cancel\" },\n {\n text: \"Discard\",\n style: \"destructive\",\n onPress: () => proceed(),\n },\n ],\n );\n}\n\n/**\n * Compose `<Stack.Screen options={...}>` for a SettingsSubPage. Wires\n * the nav-bar Save button via `headerRight` automatically when `onSave`\n * is passed.\n */\nexport function getSettingsSubPageStackOptions(props: {\n headerTitle?: string;\n dirty?: boolean;\n saving?: boolean;\n onSave?: () => void | Promise<void>;\n saveLabel?: string;\n large?: boolean;\n scrollEdgeBehavior?: ScreenHeaderProps[\"scrollEdgeBehavior\"];\n headerLeft?: ScreenHeaderProps[\"headerLeft\"];\n headerRight?: ScreenHeaderProps[\"headerRight\"];\n headerOptions?: ScreenHeaderProps[\"headerOptions\"];\n}): Record<string, unknown> {\n const {\n headerTitle,\n dirty,\n saving,\n onSave,\n saveLabel = \"Save\",\n large = false,\n scrollEdgeBehavior,\n headerLeft,\n headerRight,\n headerOptions,\n } = props;\n\n // Auto-wire headerRight with save button if not overridden.\n const resolvedHeaderRight =\n headerRight ??\n (onSave\n ? () => (\n <NavBarSaveButton\n label={saveLabel}\n onPress={() => {\n void onSave();\n }}\n disabled={!dirty}\n loading={saving}\n />\n )\n : undefined);\n\n return composeHeaderOptions({\n headerTitle,\n headerLeft,\n headerRight: resolvedHeaderRight,\n large,\n scrollEdgeBehavior,\n headerOptions,\n });\n}\n\nexport function SettingsSubPage({\n children,\n onConfirmLeave,\n className,\n testID = \"settings-sub-page\",\n}: SettingsSubPageProps) {\n // Note: dirty / saving / onSave / saveLabel / screen header props are\n // consumed by getSettingsSubPageStackOptions() at the consumer level —\n // SettingsSubPage itself is intentionally minimal so the same component\n // works for both pure form pages AND screens with Stack.Screen options\n // wired separately. We only render the body chrome here.\n //\n // The actual `beforeRemove` wire-up lives at the consumer's navigator\n // level — they call `useNavigation().addListener('beforeRemove', ...)`\n // and inside the callback they invoke `props.onConfirmLeave(proceed)`.\n // We expose `confirmDiscardChanges()` as the canonical helper so\n // consumers get the leave-guard semantics for free.\n const _onConfirmLeave = useCallback(\n (proceed: () => void) => {\n if (onConfirmLeave === null) {\n proceed();\n return;\n }\n const fn = onConfirmLeave ?? confirmDiscardChanges;\n fn(proceed);\n },\n [onConfirmLeave],\n );\n void _onConfirmLeave;\n\n const KeyboardScroll = useKeyboardScroll();\n const KeyboardToolbar = useKeyboardToolbar();\n if (KeyboardScroll) {\n // No bottom edge here: the toolbar sticks to the keyboard from the container's bottom, so a\n // bottom inset (the home indicator, or a tab bar's height) would float it that far above the\n // keyboard, and leave it showing above the tab bar with the keyboard closed. The scroll view's\n // automatic content inset keeps the last field clear of the bottom instead.\n return (\n <ScreenContainer safeAreaEdges={[\"left\", \"right\"]} testID={testID}>\n <KeyboardScroll\n testID={`${testID}-keyboard`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n bottomOffset={KeyboardToolbar ? 24 + KEYBOARD_TOOLBAR_HEIGHT : 24}\n >\n {/* Same padding and className as the fallback path, so `className` overrides it the same way. */}\n <View className={cn(\"p-4\", className)}>\n <View testID={`${testID}-form`} className=\"gap-4\">\n {children}\n </View>\n </View>\n </KeyboardScroll>\n {KeyboardToolbar ? <KeyboardToolbar /> : null}\n </ScreenContainer>\n );\n }\n return (\n <KeyboardAvoidingView\n testID={`${testID}-kav`}\n style={{ flex: 1 }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n >\n <ScreenContainer\n scroll\n safeAreaEdges={[\"left\", \"right\", \"bottom\"]}\n testID={testID}\n contentClassName={cn(\"p-4\", className)}\n keyboardShouldPersistTaps=\"handled\"\n >\n <View testID={`${testID}-form`} className=\"gap-4\">\n {children}\n </View>\n </ScreenContainer>\n </KeyboardAvoidingView>\n );\n}\n","/**\n * NotificationsPage — feed-style notifications list.\n *\n * Composes:\n * - SectionList grouped by relative date (Today / Yesterday / Earlier)\n * - Pull-to-refresh\n * - Empty state slot (auto-rendered when `items` is empty)\n * - Mark-all-read action surfaced via `headerRight` helper\n * - Per-row \"mark read\" action exposed via the consumer's row press\n * (swipe-to-mark-read is documented as Maestro / E2E only because it\n * requires gesture-handler — consumers wire it via their own row\n * wrapper; this layout exposes the unread state via row props).\n *\n * Slots: replace or drop (`null`) `sectionHeader`, `row` or `empty`\n * through `slots`; feed a default part through `slotProps`.\n *\n * Header customization: `headerTitle`, `headerLeft`, `headerRight`,\n * `headerOptions`. Use `getNotificationsPageStackOptions()` to wire a\n * \"Mark all read\" action via `headerRight` automatically.\n *\n * @stability Beta\n */\nimport { useCallback, useContext, useMemo, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport {\n Platform,\n Pressable,\n RefreshControl,\n ScrollView,\n SectionList,\n Text,\n View,\n} from \"react-native\";\nimport { SafeAreaInsetsContext, SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeSectionListHeader } from \"../components/section-list\";\nimport { NativeListItem } from \"../components/list-item\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { cn } from \"../utils\";\nimport { useGenesisModules } from \"../native-modules\";\nimport {\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\n\nexport interface NotificationItem {\n /** Stable id. */\n id: string;\n /** Headline text. */\n title: string;\n /** Optional secondary line. */\n body?: string;\n /** ISO date string OR Date instance. Used for grouping. */\n timestamp: string | Date;\n /** Read flag. Unread rows render with emphasis (a leading dot). */\n unread?: boolean;\n /** Optional press handler — typically opens the related screen. */\n onPress?: () => void;\n /** Optional leading slot (avatar / icon). */\n leading?: ReactNode;\n /** testID override. Falls back to `notifications-row-<id>`. */\n testID?: string;\n}\n\n/** The parts of a {@link NotificationsPage} that `slots` and `slotProps` reach. */\nexport type NotificationsPageSlotMap = {\n sectionHeader: { title: string };\n row: NotificationItem & { testID: string };\n empty: { title: string; body: string; testID: string };\n};\n\nexport interface NotificationsPageProps extends ScreenHeaderProps {\n /** Notification items. Empty array → empty state. */\n items: NotificationItem[];\n /** When true, the SectionList shows the refresh spinner. */\n refreshing?: boolean;\n /** Pull-to-refresh handler. */\n onRefresh?: () => void | Promise<void>;\n /** Mark-all-read handler. When provided, exposes a header action. */\n onMarkAllRead?: () => void;\n /** Override the auto-rendered empty state. Prefer `slots.empty`. */\n emptyState?: ReactNode;\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<NotificationsPageSlotMap>;\n /** More props for a default part, merged over what the layout passes. */\n slotProps?: SlotPropsFor<NotificationsPageSlotMap>;\n /** Optional override of the empty-state title. */\n emptyTitle?: string;\n /** Optional override of the empty-state body copy. */\n emptyBody?: string;\n /**\n * Where a section header sticks, in points from the top of the list. Under a large-title header\n * (`getNotificationsPageStackOptions`' default) the list runs under the native header (iOS\n * insets its rows, and the title collapses as it scrolls), so a header stuck at 0 would sit\n * under the status bar. Default on iOS: under the collapsed navigation bar of an iPhone in\n * portrait (`defaultStickyHeaderOffset`); elsewhere 0. Pass 0 when the list starts below an\n * opaque header (a standard one before iOS 26), the safe area's top with no header, and your own\n * value on iPad (a 50 pt bar) or in landscape (32 pt).\n */\n stickyHeaderOffset?: number;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"notifications-page\"`. */\n testID?: string;\n}\n\n/**\n * Compose `<Stack.Screen options={...}>` for a NotificationsPage. Wires\n * a \"Mark all read\" action via `headerRight` when `onMarkAllRead` is\n * passed.\n */\nexport function getNotificationsPageStackOptions(props: {\n headerTitle?: string;\n onMarkAllRead?: () => void;\n large?: boolean;\n scrollEdgeBehavior?: ScreenHeaderProps[\"scrollEdgeBehavior\"];\n headerLeft?: ScreenHeaderProps[\"headerLeft\"];\n headerRight?: ScreenHeaderProps[\"headerRight\"];\n headerOptions?: ScreenHeaderProps[\"headerOptions\"];\n}): Record<string, unknown> {\n const {\n headerTitle,\n onMarkAllRead,\n large,\n scrollEdgeBehavior,\n headerLeft,\n headerRight,\n headerOptions,\n } = props;\n\n const resolvedHeaderRight =\n headerRight ??\n (onMarkAllRead\n ? () => (\n <Pressable\n testID=\"notifications-mark-all-read\"\n accessibilityRole=\"button\"\n accessibilityLabel=\"Mark all read\"\n onPress={onMarkAllRead}\n hitSlop={8}\n className=\"min-h-[44px] justify-center px-3\"\n >\n <Text className=\"text-base text-primary-text\">Mark all read</Text>\n </Pressable>\n )\n : undefined);\n\n return composeHeaderOptions({\n headerTitle: headerTitle ?? \"Notifications\",\n headerLeft,\n headerRight: resolvedHeaderRight,\n large: large ?? true,\n scrollEdgeBehavior: scrollEdgeBehavior ?? \"match\",\n headerOptions,\n });\n}\n\n// Returns a stable section title for a timestamp. Computes against the\n// caller's local clock for consistency with the rest of the app.\nfunction bucketFor(ts: string | Date, now = new Date()): string {\n const d = typeof ts === \"string\" ? new Date(ts) : ts;\n const startOfDay = (date: Date) => {\n const x = new Date(date);\n x.setHours(0, 0, 0, 0);\n return x.getTime();\n };\n const today = startOfDay(now);\n const yesterday = today - 24 * 60 * 60 * 1000;\n const day = startOfDay(d);\n if (day === today) return \"Today\";\n if (day === yesterday) return \"Yesterday\";\n return \"Earlier\";\n}\n\ninterface Section {\n title: string;\n data: NotificationItem[];\n}\n\nfunction groupByDate(items: NotificationItem[], now = new Date()): Section[] {\n const map = new Map<string, NotificationItem[]>();\n // Iterate in input order so stable sort within bucket.\n for (const item of items) {\n const bucket = bucketFor(item.timestamp, now);\n const arr = map.get(bucket) ?? [];\n arr.push(item);\n map.set(bucket, arr);\n }\n // Stable section order: Today / Yesterday / Earlier.\n const order = [\"Today\", \"Yesterday\", \"Earlier\"];\n return order\n .filter((title) => map.has(title))\n .map((title) => ({\n title,\n data: map.get(title) ?? [],\n }));\n}\n\ntype FlatRow = { kind: \"header\"; title: string } | { kind: \"item\"; item: NotificationItem; last: boolean };\n\nfunction flattenSections(sections: Section[]): { rows: FlatRow[]; headerIndices: number[] } {\n const rows: FlatRow[] = [];\n const headerIndices: number[] = [];\n for (const section of sections) {\n headerIndices.push(rows.length);\n rows.push({ kind: \"header\", title: section.title });\n section.data.forEach((item, i) => rows.push({ kind: \"item\", item, last: i === section.data.length - 1 }));\n }\n return { rows, headerIndices };\n}\n\nfunction flatRowKey(row: FlatRow) {\n return row.kind === \"header\" ? `header:${row.title}` : row.item.id;\n}\n\n/** A row with its separator and the section's last row differ in height: separate recycling pools. */\nfunction flatRowType(row: FlatRow) {\n return row.kind === \"header\" ? \"header\" : row.last ? \"item-last\" : \"item\";\n}\n\nconst NO_SLOTS = {};\n\n/**\n * The height of iOS's compact navigation bar, below the status bar: 44 pt up to iOS 18, 54 pt\n * from iOS 26 (measured on an iOS 26 simulator, the collapsed large-title bar of a native stack).\n */\nexport function iosCompactNavigationBarHeight(version: number | string): number {\n const major = typeof version === \"number\" ? version : parseInt(version, 10);\n return Number.isFinite(major) && major >= 26 ? 54 : 44;\n}\n\n/**\n * Where a list's section headers stick by default: on iOS, the bottom of the collapsed\n * navigation bar (the safe area's top plus the compact bar), since the list runs under the\n * header; elsewhere 0 (the header sits above the list).\n */\nexport function defaultStickyHeaderOffset(os: string, version: number | string, safeAreaTop: number): number {\n return os === \"ios\" ? safeAreaTop + iosCompactNavigationBarHeight(version) : 0;\n}\n\n// Expose internal helpers for unit tests via a side-channel export.\nexport const __test = { bucketFor, groupByDate, flattenSections };\n\nexport function NotificationsPage({\n items,\n refreshing,\n onRefresh,\n emptyState,\n emptyTitle,\n emptyBody,\n className,\n testID = \"notifications-page\",\n slots = NO_SLOTS,\n slotProps = NO_SLOTS,\n stickyHeaderOffset,\n}: NotificationsPageProps) {\n // The context, not useSafeAreaInsets(): before a provider has measured (tests, the first frame) it is null, not a throw.\n const safeTop = useContext(SafeAreaInsetsContext)?.top ?? 0;\n const stickAt = stickyHeaderOffset ?? defaultStickyHeaderOffset(Platform.OS, Platform.Version, safeTop);\n // Note: header props (headerTitle, headerLeft, headerRight, large,\n // scrollEdgeBehavior, headerOptions) are accepted on the type for API\n // ergonomics but consumed by getNotificationsPageStackOptions() at the\n // consumer's <Stack.Screen> level — not by this component.\n\n const sections = useMemo(() => groupByDate(items), [items]);\n // FlashList v2 (`modules.list`) has no SectionList: the sections become one\n // flat list whose header rows stick (FlashList's own section-list recipe).\n const { list: FlashList } = useGenesisModules();\n const flat = useMemo(() => flattenSections(sections), [sections]);\n // Stable, so a parent re-render doesn't re-render every visible cell.\n const renderFlatRow = useCallback(\n ({ item: row }: { item: FlatRow }) =>\n row.kind === \"header\" ? (\n renderSlot(DefaultSectionHeader, slots.sectionHeader, { title: row.title }, slotProps.sectionHeader)\n ) : (\n <>\n {renderSlot(DefaultRow, slots.row, { ...row.item, testID: row.item.testID ?? `${testID}-row-${row.item.id}` }, slotProps.row)}\n {row.last ? null : <RowSeparator />}\n </>\n ),\n [slots, slotProps, testID],\n );\n\n if (items.length === 0) {\n // A scroll view, like the lists below: iOS insets only scroll views for the large-title\n // header and the tab bar, so a plain view would sit under the header (and the Dynamic Island).\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <ScrollView\n testID={`${testID}-empty-scroll`}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ flexGrow: 1, justifyContent: \"center\" }}\n refreshControl={\n onRefresh ? (\n <RefreshControl testID={`${testID}-refresh`} refreshing={!!refreshing} onRefresh={onRefresh} />\n ) : undefined\n }\n >\n {emptyState ??\n renderSlot(\n DefaultEmpty,\n slots.empty,\n {\n title: emptyTitle ?? \"No notifications\",\n body: emptyBody ?? \"When you get a notification, it'll show up here.\",\n testID: `${testID}-empty`,\n },\n slotProps.empty,\n )}\n </ScrollView>\n </SafeAreaView>\n );\n }\n\n if (FlashList) {\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <FlashList\n testID={`${testID}-list`}\n data={flat.rows}\n keyExtractor={flatRowKey}\n getItemType={flatRowType}\n stickyHeaderIndices={flat.headerIndices}\n // Under the native header, not under the status bar.\n stickyHeaderConfig={{ offset: stickAt }}\n renderItem={renderFlatRow}\n refreshing={onRefresh ? !!refreshing : undefined}\n onRefresh={onRefresh ? () => void onRefresh() : undefined}\n contentContainerStyle={{ paddingBottom: 28 }}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <SectionList<NotificationItem, Section>\n testID={`${testID}-list`}\n sections={sections}\n keyExtractor={(item) => item.id}\n renderSectionHeader={({ section }) =>\n renderSlot(DefaultSectionHeader, slots.sectionHeader, { title: section.title }, slotProps.sectionHeader)\n }\n renderItem={({ item }) =>\n renderSlot(DefaultRow, slots.row, { ...item, testID: item.testID ?? `${testID}-row-${item.id}` }, slotProps.row)\n }\n ItemSeparatorComponent={RowSeparator}\n // React Native's sticky headers pin to the very top of the list, which is under the native\n // header on iOS, with no offset to move them down: with one, the headers scroll with\n // their rows instead. (FlashList, `modules.list`, sticks them under the header.)\n stickySectionHeadersEnabled={stickAt === 0}\n refreshControl={\n onRefresh ? (\n <RefreshControl\n testID={`${testID}-refresh`}\n refreshing={!!refreshing}\n onRefresh={onRefresh}\n />\n ) : undefined\n }\n contentContainerClassName=\"pb-8\"\n />\n </SafeAreaView>\n );\n}\n\nfunction RowSeparator() {\n return <View className=\"h-px bg-border ml-4\" />;\n}\n\nfunction DefaultSectionHeader({ title }: NotificationsPageSlotMap[\"sectionHeader\"]) {\n return <NativeSectionListHeader title={title} />;\n}\n\nfunction DefaultRow(item: NotificationsPageSlotMap[\"row\"]) {\n return (\n <NativeListItem\n testID={item.testID}\n title={item.title}\n subtitle={item.body}\n leading={item.leading ?? <UnreadDot unread={!!item.unread} testID={`${item.testID}-unread`} />}\n onPress={item.onPress}\n />\n );\n}\n\nfunction DefaultEmpty({ title, body, testID }: NotificationsPageSlotMap[\"empty\"]) {\n return <NativeEmptyState variant=\"first-run\" title={title} body={body} testID={testID} />;\n}\n\nfunction UnreadDot({\n unread,\n testID,\n}: {\n unread: boolean;\n testID?: string;\n}) {\n if (!unread) {\n return <View className=\"h-2 w-2\" testID={testID} />;\n }\n return (\n <View\n testID={testID}\n accessibilityLabel=\"Unread\"\n className=\"h-2 w-2 rounded-full bg-primary\"\n />\n );\n}\n","/**\n * ThreadPage — one conversation: messages oldest first, a composer at the\n * bottom that follows the keyboard, attachments, a read receipt, earlier\n * pages, going to a message, and the first unread.\n *\n * Generic: a support ticket with staff replies, a help desk thread with\n * internal notes, a direct message, a comment thread. Mine are on the\n * trailing side in the tint, theirs on the leading side on `surface`, over the\n * `groupedBackground` page (SettingsPage's iOS palette). Events (\"Sam was\n * assigned\") are centred, muted lines between them.\n *\n * Built from the messaging atoms, so an app can take this whole or build its\n * own from the same parts: `NativeThreadList` (bottom-anchored, holds its\n * place while earlier messages load, follows the newest only at the bottom)\n * and `NativeComposerBar` (grows as you type, modes with a tone, 44pt send).\n *\n * Keyboard: the page sits in `GenesisModules.keyboardAvoidingView`\n * (react-native-keyboard-controller's, `translate-with-padding`: the composer\n * follows the keyboard frame by frame) when the app passed it, else React\n * Native's `KeyboardAvoidingView` (`padding` on iOS, `height` on Android, so\n * under edge-to-edge the composer still clears the keyboard). Dragging the\n * list down dismisses the keyboard (interactively on iOS). The app's\n * `KeyboardScrollProvider` no longer applies here, since a virtualized list\n * can't live in a scroll view: an app that passes it but not\n * `keyboardAvoidingView` gets a development warning saying so.\n *\n * Data: rows arrive as props and the page never fetches. A row's send state\n * is data (`sending`, `pending`, `paused`, `failed`, `conflict`) with\n * `onRetry` / `onDiscard`, whatever feeds it (an outbox, an offline queue).\n * Ids must stay the same across refreshes (a cache, then the server).\n *\n * Read-only: pass `composer={null}` (a closed ticket, a viewer) and an\n * optional `closedNotice`.\n *\n * `loading` shows a skeleton instead of the empty state; `updating` a quiet\n * line while fresher rows arrive.\n *\n * Slots: `message`, `event`, `attachment`, `readReceipt`, `unreadDivider`,\n * `composer`, `composerAccessory` (beside the input: attach a screenshot),\n * `headerRegion` (pinned above the list: a ticket's status and assignee),\n * `header` (scrolls above the first message: what the thread is about),\n * `earlier` and `empty`.\n *\n * @stability Beta\n */\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type ComponentType, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { AccessibilityInfo, Image, KeyboardAvoidingView, Linking, Platform, Pressable, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { sentBubbleColor, useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { useKeyboardScroll } from \"./keyboard\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeIcon } from \"../components/icon\";\nimport { NativeText } from \"../components/text\";\nimport { NativeComposerBar, type ComposerMode } from \"../components/composer-bar\";\nimport { NativeThreadList, type NativeThreadListHandle, type ThreadRowInfo } from \"../components/thread-list\";\nimport {\n DEFAULT_THREAD_LABELS,\n formatMessageTime,\n readReceiptFor,\n type ThreadAttachment,\n type ThreadComposer,\n type ThreadLabels,\n type ThreadMessage,\n} from \"@marktiderman/genesis-core/conversation\";\n\nconst announce = (text: string) => (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(text);\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\n\n// The conversation contract is genesis-core's, shared with genesis-ui's ThreadPage.\nexport type { MessageTone, ThreadAttachment, ThreadComposer, ThreadLabels, ThreadMessage, ThreadMessageStatus } from \"@marktiderman/genesis-core/conversation\";\nexport { readReceiptFor } from \"@marktiderman/genesis-core/conversation\";\n\nexport type ThreadPageSlotMap = {\n message: ThreadMessage & { testID: string; timeLabel: string; showReadReceipt: boolean; labels: ThreadLabels; /** A jump just landed here (two seconds). */ highlighted: boolean };\n event: ThreadMessage & { testID: string; timeLabel: string };\n attachment: ThreadAttachment & { testID: string; mine: boolean };\n readReceipt: { label: string; testID: string };\n unreadDivider: { label: string; testID: string };\n /** `accessory` is the `composerAccessory` slot, already rendered. */\n composer: ThreadComposer & { testID: string; accessory?: ReactNode };\n composerAccessory: { testID: string };\n /** Pinned above the list: a ticket's status, assignee and priority, and \"more\". */\n headerRegion: { testID: string };\n header: { testID: string };\n earlier: { loading: boolean; onPress: () => void; label: string; testID: string };\n empty: { title: string; body: string; actionLabel?: string | undefined; onAction?: (() => void) | undefined; testID: string };\n};\n\nexport interface ThreadPageProps extends ScreenHeaderProps {\n /** Oldest first. */\n messages: ThreadMessage[];\n /** `null`: read-only, no composer. */\n composer: ThreadComposer | null;\n /** Shown instead of the composer when it is `null` (\"This conversation is closed\"). */\n closedNotice?: string;\n /** Above the first message, scrolling with them. Prefer `slots.header` for a component. */\n header?: ReactNode;\n /**\n * When the other side last read the thread. My newest message sent before\n * it shows the read receipt.\n */\n readAt?: string | Date | null;\n readLabel?: string;\n /** There are older messages: they load near the top, and a \"load earlier\" button shows. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\n /** The first message the reader hasn't seen: a \"New messages\" divider above it. */\n firstUnreadId?: string | null;\n /** Go to this message (a search result, a pinned one), loading with `onLoadUntil` until it's here. */\n jumpTo?: string | null;\n /** Load earlier pages until the message is held; resolve false when it can't be found. */\n onLoadUntil?: (id: string) => Promise<boolean>;\n /** A `jumpTo` message couldn't be found (the list goes back to the newest). Default: VoiceOver says `labels.messageGone`. */\n onJumpFailed?: (id: string) => void;\n /** The first page is loading: a skeleton instead of the empty state, and a jump waits for it. */\n loading?: boolean;\n /** The read failed and there are no messages: the empty slot shows `errorTitle` / `errorBody` instead. */\n error?: boolean;\n errorTitle?: string;\n errorBody?: string;\n /** A \"Try again\" button with `error`. */\n onRetry?: () => void;\n retryLabel?: string;\n /** Fresher rows are on their way (the cache showed first): a quiet \"Updating…\" line under the header region, announced once. */\n updating?: boolean;\n /**\n * For the keyboard. With the keyboard-controller module the page finds its own place on screen\n * (`automaticOffset`) and this is extra space (default 0); with React Native's, it's where the\n * page starts below the window's top (default 100 on iOS: a standard header).\n */\n keyboardVerticalOffset?: number;\n emptyTitle?: string;\n emptyBody?: string;\n formatTime?: (date: Date) => string;\n /** The words the defaults say, for translating. */\n labels?: Partial<ThreadLabels>;\n slots?: Slots<ThreadPageSlotMap>;\n slotProps?: SlotPropsFor<ThreadPageSlotMap>;\n /** testID on the root. Default `\"thread-page\"`. */\n testID?: string;\n}\n\n/** `<Stack.Screen options>` for a ThreadPage: a standard (not large) title, like Messages. */\nexport function getThreadPageStackOptions(props: ScreenHeaderProps & { headerTitle?: string }): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Conversation\",\n large: props.large ?? false,\n scrollEdgeBehavior: props.scrollEdgeBehavior,\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\nconst toDate = (value: string | Date) => (typeof value === \"string\" ? new Date(value) : value);\n\n\n\nconst NO_SLOTS: Slots<ThreadPageSlotMap> = {};\nconst NO_SLOT_PROPS: SlotPropsFor<ThreadPageSlotMap> = {};\nconst messageKey = (m: ThreadMessage) => m.id;\nconst messageJumpId = (m: ThreadMessage) => m.jumpId ?? m.id;\nconst messageType = (m: ThreadMessage) => (m.kind === \"event\" ? \"event\" : m.mine ? \"mine\" : \"theirs\");\n\ndeclare const __DEV__: boolean | undefined;\ndeclare const process: { env: Record<string, string | undefined> } | undefined;\nlet warnedNoKeyboardModule = false;\n/** Development-only: the app has keyboard-controller (it passed a keyboard scroll view) but not its KeyboardAvoidingView. */\nfunction warnNoKeyboardModule() {\n const dev = typeof __DEV__ !== \"undefined\" ? __DEV__ : typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\";\n if (!dev || warnedNoKeyboardModule) return;\n warnedNoKeyboardModule = true;\n // genesis-allow-console: a development-only setup warning, like AuthScreen's\n console.warn(\n \"[genesis] ThreadPage: react-native-keyboard-controller is set up (keyboardScroll) but GenesisModules.keyboardAvoidingView isn't, so the composer falls back to React Native's KeyboardAvoidingView. Pass keyboard-controller's KeyboardAvoidingView as `keyboardAvoidingView` in your Genesis modules.\",\n );\n}\n\nexport function ThreadPage({\n messages,\n composer,\n closedNotice,\n header,\n readAt,\n readLabel = \"Read\",\n hasEarlier = false,\n onLoadEarlier,\n loadingEarlier = false,\n earlierLabel = \"Load earlier messages\",\n firstUnreadId,\n jumpTo,\n onLoadUntil,\n onJumpFailed,\n loading = false,\n error = false,\n errorTitle = \"Couldn't load this conversation\",\n errorBody = \"Check your connection and try again.\",\n onRetry,\n retryLabel = \"Try again\",\n updating = false,\n keyboardVerticalOffset,\n emptyTitle,\n emptyBody,\n formatTime = formatMessageTime,\n labels: labelOverrides,\n slots = NO_SLOTS,\n slotProps = NO_SLOT_PROPS,\n testID = \"thread-page\",\n}: ThreadPageProps) {\n const colors = useThemeRoles();\n const genesis = useGenesisModules();\n const listRef = useRef<NativeThreadListHandle | null>(null);\n const [atBottom, setAtBottom] = useState(true);\n const receiptFor = readReceiptFor(messages, readAt);\n // Kept stable across renders (typing in the composer) unless the words change, so rows don't re-render.\n const labelsKey = labelOverrides ? JSON.stringify(labelOverrides) : \"\";\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const labels: ThreadLabels = useMemo(() => ({ ...DEFAULT_THREAD_LABELS, ...labelOverrides }), [labelsKey]);\n const keyboardScroll = useKeyboardScroll();\n useEffect(() => {\n if (keyboardScroll && !genesis.keyboardAvoidingView) warnNoKeyboardModule();\n }, [keyboardScroll, genesis.keyboardAvoidingView]);\n\n // \"Updating…\" on iOS too (a live region is Android-only).\n useEffect(() => {\n if (updating && Platform.OS === \"ios\") announce(labels.updating);\n // labels.updating is read when updating turns on.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [updating]);\n\n const renderRow = useCallback(\n (message: ThreadMessage, { highlighted }: ThreadRowInfo) => {\n const timeLabel = formatTime(toDate(message.timestamp));\n const divider =\n message.id === firstUnreadId\n ? renderSlot(DefaultUnreadDivider, slots.unreadDivider, { label: labels.newMessages, testID: `${testID}-unread` }, slotProps.unreadDivider)\n : null;\n if (message.kind === \"event\") {\n return (\n <View style={{ paddingVertical: 3 }}>\n {divider}\n {renderSlot(DefaultEvent, slots.event, { ...message, testID: `${testID}-event-${message.id}`, timeLabel }, slotProps.event)}\n </View>\n );\n }\n return (\n <View style={{ paddingVertical: 3 }}>\n {divider}\n {renderSlot(\n DefaultMessage,\n slots.message,\n { ...message, testID: `${testID}-message-${message.id}`, timeLabel, showReadReceipt: message.id === receiptFor, labels, highlighted },\n slotProps.message,\n )}\n {message.attachments?.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 6, justifyContent: message.mine ? \"flex-end\" : \"flex-start\", marginTop: 4 }}>\n {message.attachments.map((attachment) => (\n <View key={attachment.id}>\n {renderSlot(\n DefaultAttachment,\n slots.attachment,\n { ...attachment, mine: message.mine, testID: `${testID}-attachment-${attachment.id}` },\n slotProps.attachment,\n )}\n </View>\n ))}\n </View>\n ) : null}\n {message.id === receiptFor\n ? renderSlot(DefaultReadReceipt, slots.readReceipt, { label: readLabel, testID: `${testID}-read-receipt` }, slotProps.readReceipt)\n : null}\n </View>\n );\n },\n [firstUnreadId, formatTime, receiptFor, readLabel, slots, slotProps, testID, labels],\n );\n\n const send = composer\n ? () => {\n composer.onSend();\n // What you send is what you look at next, wherever the list was.\n listRef.current?.scrollToEnd({ animated: true });\n }\n : undefined;\n\n const footer = composer ? (\n renderSlot(\n DefaultComposer,\n slots.composer,\n {\n ...composer,\n sendingLabel: composer.sendingLabel ?? labels.sending,\n onSend: send!,\n testID: `${testID}-composer`,\n accessory: renderSlot(Nothing, slots.composerAccessory, { testID: `${testID}-composer-accessory` }, slotProps.composerAccessory),\n },\n slotProps.composer,\n )\n ) : closedNotice ? (\n <NativeText testID={`${testID}-closed`} style={{ textAlign: \"center\", padding: 16, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18 }}>\n {closedNotice}\n </NativeText>\n ) : null;\n\n const listHeader = header ?? renderSlot(Nothing, slots.header, { testID: `${testID}-header` }, slotProps.header);\n\n const KeyboardAvoiding = (genesis.keyboardAvoidingView ?? KeyboardAvoidingView) as ComponentType<Record<string, unknown>>;\n const keyboardProps = genesis.keyboardAvoidingView\n ? { behavior: \"translate-with-padding\", automaticOffset: true, keyboardVerticalOffset: keyboardVerticalOffset ?? 0 }\n : { behavior: Platform.OS === \"ios\" ? \"padding\" : \"height\", keyboardVerticalOffset: keyboardVerticalOffset ?? (Platform.OS === \"ios\" ? 100 : 0) };\n\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n {/* Pinned above the keyboard-avoiding view, so it doesn't move with the keyboard. */}\n {renderSlot(Nothing, slots.headerRegion, { testID: `${testID}-header-region` }, slotProps.headerRegion)}\n {updating ? (\n <View testID={`${testID}-updating`} accessibilityLiveRegion=\"polite\" accessible accessibilityLabel={labels.updating}>\n <NativeText style={{ textAlign: \"center\", paddingVertical: 4, color: colors.tertiaryLabel, fontSize: 12, lineHeight: 16 }}>{labels.updating}</NativeText>\n </View>\n ) : null}\n <KeyboardAvoiding testID={`${testID}-keyboard`} style={{ flex: 1 }} {...keyboardProps}>\n <View style={{ flex: 1 }}>\n <NativeThreadList<ThreadMessage>\n ref={listRef}\n testID={`${testID}-messages`}\n data={messages}\n keyExtractor={messageKey}\n getItemType={messageType}\n renderItem={renderRow}\n loading={loading}\n hasEarlier={hasEarlier}\n onLoadEarlier={onLoadEarlier}\n loadingEarlier={loadingEarlier}\n earlierLabel={earlierLabel}\n renderEarlier={(p) => renderSlot(DefaultEarlierButton, slots.earlier, { ...p, testID: `${testID}-earlier` }, slotProps.earlier)}\n jumpTo={jumpTo}\n jumpId={messageJumpId}\n onLoadUntil={onLoadUntil}\n jumpAnnouncement={(m) => [m.mine ? labels.you : m.authorName, m.body].filter(Boolean).join(\", \")}\n onJumpFailed={onJumpFailed ?? (() => announce(labels.messageGone))}\n onAtBottomChange={setAtBottom}\n header={listHeader}\n empty={renderSlot(\n DefaultEmpty,\n slots.empty,\n error\n ? { title: errorTitle, body: errorBody, actionLabel: onRetry ? retryLabel : undefined, onAction: onRetry, testID: `${testID}-error` }\n : { title: emptyTitle ?? \"No messages yet\", body: emptyBody ?? \"Write the first one below.\", testID: `${testID}-empty` },\n slotProps.empty,\n )}\n />\n {!atBottom && messages.length > 0 ? (\n <Pressable\n testID={`${testID}-jump-latest`}\n accessibilityRole=\"button\"\n accessibilityLabel={labels.jumpToLatest}\n onPress={() => listRef.current?.scrollToEnd({ animated: true })}\n style={{ position: \"absolute\", bottom: 8, alignSelf: \"center\", minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16, borderRadius: 22, backgroundColor: colors.surface }}\n >\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {labels.jumpToLatest}\n </NativeText>\n </Pressable>\n ) : null}\n </View>\n {footer}\n </KeyboardAvoiding>\n </SafeAreaView>\n );\n}\n\nfunction Nothing(_props: { testID: string }) {\n return null;\n}\n\nfunction DefaultEarlierButton({ loading, onPress, label, testID }: ThreadPageSlotMap[\"earlier\"]) {\n const colors = useThemeRoles();\n return (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} accessibilityState={{ busy: loading }} onPress={onPress} disabled={loading} style={{ minHeight: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n );\n}\n\nfunction DefaultEmpty({ title, body, actionLabel, onAction, testID }: ThreadPageSlotMap[\"empty\"]) {\n return (\n <NativeEmptyState\n variant=\"first-run\"\n title={title}\n body={body}\n testID={testID}\n primaryAction={\n actionLabel && onAction ? (\n <NativeButton onPress={onAction} testID={`${testID}-action`}>\n {actionLabel}\n </NativeButton>\n ) : undefined\n }\n />\n );\n}\n\nfunction DefaultUnreadDivider({ label, testID }: ThreadPageSlotMap[\"unreadDivider\"]) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessible accessibilityRole=\"header\" accessibilityLabel={label} style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, paddingVertical: 8 }}>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n <NativeText style={{ color: colors.tint, fontSize: 12, lineHeight: 16 }}>{label}</NativeText>\n <View style={{ flex: 1, height: 1, backgroundColor: colors.tint }} />\n </View>\n );\n}\n\nfunction DefaultEvent({ body, timeLabel, testID }: ThreadPageSlotMap[\"event\"]) {\n const colors = useThemeRoles();\n return (\n <View testID={testID} accessible accessibilityLabel={`${body}, ${timeLabel}`} style={{ alignSelf: \"center\", paddingHorizontal: 12, paddingVertical: 4, borderRadius: 12, backgroundColor: colors.fill }}>\n <NativeText style={{ color: colors.secondaryLabel, fontSize: 12, lineHeight: 16, textAlign: \"center\" }}>{body}</NativeText>\n </View>\n );\n}\n\n// No `color` key on mine: an undefined color in the style would override the class's.\nconst MINE_TEXT = { fontSize: 17, lineHeight: 22 } as const;\n\n/** What a message's state says under it, or null when it's sent. */\nfunction stateLabel(message: ThreadPageSlotMap[\"message\"]): string | null {\n const { labels } = message;\n switch (message.status) {\n case \"sending\":\n return labels.sending;\n case \"pending\":\n return labels.pending;\n case \"paused\":\n return labels.paused;\n case \"failed\":\n return labels.notSent;\n case \"conflict\":\n return labels.conflict;\n default:\n return null;\n }\n}\n\nconst DefaultMessage = memo(function DefaultMessage(message: ThreadPageSlotMap[\"message\"]) {\n const colors = useThemeRoles();\n const { labels } = message;\n const broken = message.status === \"failed\" || message.status === \"conflict\";\n const waiting = message.status === \"sending\" || message.status === \"pending\" || message.status === \"paused\";\n const internal = message.tone === \"internal\";\n const state = stateLabel(message);\n const label = [message.mine ? labels.you : (message.authorName ?? \"\"), internal ? labels.internal : null, message.body, message.timeLabel, state].filter(Boolean).join(\", \");\n // Discard is offered for a message that hasn't gone: not while it's sending (it may already be on the server).\n const canDiscard = Boolean(message.onDiscard) && (broken || message.status === \"pending\" || message.status === \"paused\");\n const actions = [\n ...(broken && message.onRetry ? [{ name: \"activate\", label: labels.retryHint }] : []),\n ...(canDiscard ? [{ name: \"discard\", label: labels.discard }] : []),\n ];\n return (\n <View style={{ alignItems: message.mine ? \"flex-end\" : \"flex-start\" }}>\n {!message.mine && message.authorName ? (\n <NativeText style={{ marginLeft: 12, marginBottom: 2, color: colors.secondaryLabel, fontSize: 12, lineHeight: 16 }}>{message.authorName}</NativeText>\n ) : null}\n <Pressable\n testID={message.testID}\n accessible\n accessibilityRole={broken && message.onRetry ? \"button\" : undefined}\n accessibilityLabel={label}\n accessibilityHint={broken && message.onRetry ? labels.retryHint : undefined}\n accessibilityActions={actions.length ? actions : undefined}\n onAccessibilityAction={(e) => {\n if (e.nativeEvent.actionName === \"discard\" && canDiscard) message.onDiscard?.();\n else if (e.nativeEvent.actionName === \"activate\" && broken) message.onRetry?.();\n }}\n onPress={broken ? message.onRetry : undefined}\n style={{\n maxWidth: \"80%\",\n paddingHorizontal: 14,\n paddingVertical: 8,\n borderRadius: 18,\n backgroundColor: internal ? colors.surface : message.mine ? sentBubbleColor(colors) : colors.surface,\n borderWidth: internal || message.highlighted ? 2 : 0,\n borderColor: internal ? colors.warning : colors.tint,\n opacity: waiting ? 0.6 : 1,\n }}\n >\n <NativeText className={message.mine && !internal ? \"text-primary-foreground\" : undefined} style={message.mine && !internal ? MINE_TEXT : { ...MINE_TEXT, color: colors.label }}>\n {message.body}\n </NativeText>\n </Pressable>\n <View style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, marginTop: 2, marginHorizontal: 12 }}>\n <NativeText testID={`${message.testID}-time`} style={{ color: broken ? colors.destructive : colors.tertiaryLabel, fontSize: 11, lineHeight: 14 }}>\n {state ?? message.timeLabel}\n </NativeText>\n {canDiscard ? (\n <Pressable testID={`${message.testID}-discard`} accessibilityRole=\"button\" accessibilityLabel={labels.discard} onPress={message.onDiscard} hitSlop={{ top: 15, bottom: 15, left: 12, right: 12 }}>\n <NativeText style={{ color: colors.secondaryLabel, fontSize: 11, lineHeight: 14 }}>{labels.discard}</NativeText>\n </Pressable>\n ) : null}\n </View>\n </View>\n );\n});\n\n/** What a file attachment may open: the web, and a file on this phone only when you sent it. */\nconst OPENABLE = /^https?:/i;\nconst OPENABLE_IF_MINE = /^(file|content):/i;\n\nfunction FileAttachment({ uri, name, accessibilityLabel, onPress, mine, testID }: ThreadPageSlotMap[\"attachment\"]) {\n const colors = useThemeRoles();\n const label = name ?? accessibilityLabel ?? \"Attachment\";\n const open = onPress ?? (OPENABLE.test(uri) || (mine && OPENABLE_IF_MINE.test(uri)) ? () => void Linking.openURL(uri).catch(() => undefined) : undefined);\n return (\n <Pressable\n testID={testID}\n accessibilityRole={open ? \"link\" : undefined}\n accessibilityLabel={accessibilityLabel ?? label}\n onPress={open}\n disabled={!open}\n style={{ flexDirection: \"row\", alignItems: \"center\", gap: 8, minHeight: 44, maxWidth: 240, paddingHorizontal: 12, borderRadius: 12, backgroundColor: mine ? colors.fill : colors.surface }}\n >\n <NativeIcon name=\"file\" size={18} color={colors.secondaryLabel} />\n <NativeText numberOfLines={1} style={{ flexShrink: 1, color: colors.label, fontSize: 15, lineHeight: 20 }}>\n {label}\n </NativeText>\n </Pressable>\n );\n}\n\nfunction DefaultAttachment(attachment: ThreadPageSlotMap[\"attachment\"]) {\n return attachment.kind === \"file\" ? <FileAttachment {...attachment} /> : <ImageAttachment {...attachment} />;\n}\n\nfunction ImageAttachment({ id, uri, width, height, accessibilityLabel, onPress, testID }: ThreadPageSlotMap[\"attachment\"]) {\n const { image: ExpoImage } = useGenesisModules();\n const ratio = width && height ? width / height : 0.6;\n const w = 140;\n const style = { width: w, height: Math.round(w / ratio), borderRadius: 12 };\n return (\n <Pressable testID={testID} accessibilityRole=\"image\" accessibilityLabel={accessibilityLabel ?? \"Attachment\"} onPress={onPress} disabled={!onPress}>\n {/* A recycled row (FlashList) must not show the last row's picture while this one loads. */}\n {ExpoImage ? (\n <ExpoImage source={{ uri }} style={style} contentFit=\"cover\" recyclingKey={id} />\n ) : (\n <Image key={uri} source={{ uri }} style={style} resizeMode=\"cover\" />\n )}\n </Pressable>\n );\n}\n\nfunction DefaultReadReceipt({ label, testID }: ThreadPageSlotMap[\"readReceipt\"]) {\n const colors = useThemeRoles();\n return (\n <NativeText testID={testID} style={{ alignSelf: \"flex-end\", marginHorizontal: 12, color: colors.secondaryLabel, fontSize: 11, lineHeight: 14 }}>\n {label}\n </NativeText>\n );\n}\n\nfunction DefaultComposer({ accessory, testID, ...composer }: ThreadPageSlotMap[\"composer\"]) {\n return <NativeComposerBar {...composer} leading={accessory} testID={testID} />;\n}\n","/**\n * Auth primitive group (PRD-07 simplification #3).\n *\n * Auth flows are the most consumer-divergent screen in any app. Instead\n * of shipping a god-component with a sea of variants, Genesis ships\n * three small primitives that consumers compose on a regular `<View>`:\n *\n * - <AuthBranding> — slot for branded logo + headline + subhead\n * - <SocialAuthRow> — provider buttons (Apple / Google / GitHub / …)\n * - <AuthForm> — email + password (or magic link) + submit\n *\n * Composition lives in `apps/<consumer>/...` — see\n * `standards/usage-doctrine.md` § Auth composition for worked examples.\n *\n * @stability Beta\n */\nimport { Fragment, useCallback, useRef, useState, type ReactNode } from \"react\";\nimport { Pressable, Text, View } from \"react-native\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeInput } from \"../components/input\";\nimport { NativeText } from \"../components/text\";\nimport { cn } from \"../utils\";\n\n// ---------------------------------------------------------------------------\n// AuthBranding — branding slot above the form\n// ---------------------------------------------------------------------------\n\nexport interface AuthBrandingProps {\n /** Brand mark (logo node). */\n logo?: ReactNode;\n /** Headline text. Renders as h1. */\n headline?: string;\n /** Subhead under the headline. Renders as muted body. */\n subhead?: string;\n /** Override the root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function AuthBranding({\n logo,\n headline,\n subhead,\n className,\n testID = \"auth-branding\",\n}: AuthBrandingProps) {\n return (\n <View\n testID={testID}\n accessibilityRole=\"header\"\n className={cn(\"items-center gap-3 pb-8\", className)}\n >\n {logo ? (\n <View testID={`${testID}-logo`} className=\"mb-2\">\n {logo}\n </View>\n ) : null}\n {headline ? (\n <NativeText\n preset=\"h1\"\n testID={`${testID}-headline`}\n className=\"text-center\"\n >\n {headline}\n </NativeText>\n ) : null}\n {subhead ? (\n <NativeText\n preset=\"body\"\n testID={`${testID}-subhead`}\n className=\"text-center text-muted-foreground\"\n >\n {subhead}\n </NativeText>\n ) : null}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// SocialAuthRow — provider buttons\n// ---------------------------------------------------------------------------\n\nexport type SocialAuthProvider = {\n /** Stable id used as React key + testID suffix. */\n id: string;\n /** Visible label, e.g., \"Continue with Apple\". */\n label: string;\n /** Optional leading icon node. */\n icon?: ReactNode;\n /** Press handler. */\n onPress: () => void | Promise<void>;\n /** When true, the button is disabled (e.g., loading). */\n disabled?: boolean;\n /**\n * Draw the provider's own button instead of the default outline button,\n * for a provider whose brand rules require theirs (Apple: see\n * `appleProvider`). Receives the testID the default would use.\n */\n render?: (props: { testID: string; disabled?: boolean }) => ReactNode;\n};\n\nexport interface SocialAuthRowProps {\n providers: SocialAuthProvider[];\n /**\n * Optional separator label rendered between social row and the form\n * below (e.g., \"or\"). Pass `null` to suppress. Default `\"or\"`.\n */\n separator?: string | null;\n /** Override root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function SocialAuthRow({\n providers,\n separator = \"or\",\n className,\n testID = \"social-auth-row\",\n}: SocialAuthRowProps) {\n if (providers.length === 0) return null;\n return (\n <View testID={testID} className={cn(\"gap-3\", className)}>\n <View className=\"gap-2\">\n {providers.map((p) =>\n p.render ? (\n <Fragment key={p.id}>{p.render({ testID: `${testID}-${p.id}`, disabled: p.disabled })}</Fragment>\n ) : (\n <NativeButton\n key={p.id}\n testID={`${testID}-${p.id}`}\n variant=\"outline\"\n disabled={p.disabled}\n onPress={() => {\n void p.onPress();\n }}\n >\n <View className=\"flex-row items-center gap-2\">\n {p.icon}\n <Text className=\"text-sm font-medium text-foreground\">\n {p.label}\n </Text>\n </View>\n </NativeButton>\n ),\n )}\n </View>\n {separator !== null && separator !== undefined ? (\n <View\n testID={`${testID}-separator`}\n className=\"my-2 flex-row items-center gap-3\"\n accessibilityElementsHidden\n >\n <View className=\"h-px flex-1 bg-border\" />\n <Text className=\"text-xs uppercase tracking-wider text-muted-foreground\">\n {separator}\n </Text>\n <View className=\"h-px flex-1 bg-border\" />\n </View>\n ) : null}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AuthForm — email + password (or magic link) + submit\n// ---------------------------------------------------------------------------\n\nexport interface AuthFormValues {\n email: string;\n /** Empty string when `mode === \"magic-link\"`. */\n password: string;\n}\n\nexport interface AuthFormProps {\n /**\n * `\"password\"` (default) renders email + password.\n * `\"magic-link\"` renders email only and the submit button label\n * defaults to \"Send magic link\".\n */\n mode?: \"password\" | \"magic-link\";\n /** Submit handler. Receives the current form values. */\n onSubmit: (values: AuthFormValues) => void | Promise<void>;\n /**\n * Optional validation slot — return `null` to allow submission, or a\n * string error message to block. Called on every submit.\n */\n validate?: (values: AuthFormValues) => string | null;\n /** Override the submit button label. */\n submitLabel?: string;\n /** When true, submit button is disabled and shows a busy indicator. */\n loading?: boolean;\n /**\n * Top-level error (set by the consumer after a server-side rejection,\n * e.g., \"Invalid credentials\"). Shown above the submit button.\n */\n errorMessage?: string;\n /** Initial email. Useful for \"log in as <user>\" deep links. */\n initialEmail?: string;\n /** Slot rendered AFTER the inputs but BEFORE the submit (e.g., \"Forgot password\" link). */\n belowFields?: ReactNode;\n /** Override root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function AuthForm({\n mode = \"password\",\n onSubmit,\n validate,\n submitLabel,\n loading,\n errorMessage,\n initialEmail = \"\",\n belowFields,\n className,\n testID = \"auth-form\",\n}: AuthFormProps) {\n const [email, setEmail] = useState(initialEmail);\n const [password, setPassword] = useState(\"\");\n const [localError, setLocalError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n const passwordRef = useRef<{ focus(): void } | null>(null);\n\n const isMagic = mode === \"magic-link\";\n const resolvedSubmitLabel =\n submitLabel ?? (isMagic ? \"Send magic link\" : \"Sign in\");\n\n const handleSubmit = useCallback(async () => {\n // Guard against double-tap and stacked submits — the user's onSubmit\n // is async, so we own a local `submitting` flag in addition to the\n // parent-controlled `loading` prop.\n if (submitting || loading) return;\n\n setLocalError(null);\n const values: AuthFormValues = {\n email: email.trim(),\n password: isMagic ? \"\" : password,\n };\n if (validate) {\n const err = validate(values);\n if (err) {\n setLocalError(err);\n return;\n }\n }\n if (!values.email) {\n setLocalError(\"Email is required\");\n return;\n }\n if (!isMagic && !values.password) {\n setLocalError(\"Password is required\");\n return;\n }\n\n // Await the consumer's onSubmit so we surface unhandled rejections\n // as a local error string instead of dropping them on the floor.\n setSubmitting(true);\n try {\n await onSubmit(values);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n setLocalError(message);\n } finally {\n setSubmitting(false);\n }\n }, [email, password, isMagic, validate, onSubmit, submitting, loading]);\n\n const visibleError = errorMessage ?? localError ?? null;\n\n return (\n <View testID={testID} className={cn(\"gap-3\", className)}>\n <View className=\"gap-1\">\n <Text className=\"text-sm font-medium text-foreground\">Email</Text>\n <NativeInput\n testID={`${testID}-email`}\n accessibilityLabel=\"Email\"\n value={email}\n onChangeText={setEmail}\n placeholder=\"you@example.com\"\n autoCapitalize=\"none\"\n autoCorrect={false}\n keyboardType=\"email-address\"\n textContentType=\"emailAddress\"\n autoComplete=\"email\"\n returnKeyType={isMagic ? \"send\" : \"next\"}\n editable={!loading && !submitting}\n // Magic-link mode: the email field is the last input, so return\n // submits. Password mode: React Native doesn't move focus by\n // itself, so return focuses the password field and keeps the\n // keyboard open.\n submitBehavior={isMagic ? \"blurAndSubmit\" : \"submit\"}\n onSubmitEditing={isMagic ? handleSubmit : () => passwordRef.current?.focus()}\n />\n </View>\n\n {isMagic ? null : (\n <View className=\"gap-1\">\n <Text className=\"text-sm font-medium text-foreground\">Password</Text>\n <NativeInput\n ref={passwordRef}\n testID={`${testID}-password`}\n accessibilityLabel=\"Password\"\n value={password}\n onChangeText={setPassword}\n placeholder=\"••••••••\"\n secureTextEntry\n textContentType=\"password\"\n autoComplete=\"current-password\"\n autoCapitalize=\"none\"\n autoCorrect={false}\n returnKeyType=\"send\"\n editable={!loading && !submitting}\n onSubmitEditing={handleSubmit}\n />\n </View>\n )}\n\n {belowFields}\n\n {visibleError ? (\n <Text\n testID={`${testID}-error`}\n accessibilityRole=\"alert\"\n className=\"text-sm text-destructive\"\n >\n {visibleError}\n </Text>\n ) : null}\n\n <NativeButton\n testID={`${testID}-submit`}\n onPress={() => {\n void handleSubmit();\n }}\n loading={loading || submitting}\n disabled={loading || submitting}\n >\n {resolvedSubmitLabel}\n </NativeButton>\n </View>\n );\n}\n\n// Convenience: a \"Forgot password?\" link consumers can drop into the\n// `belowFields` slot. Kept as a simple Pressable so it inherits brand\n// tokens via the consumer's tailwind config.\nexport function ForgotPasswordLink({\n onPress,\n label = \"Forgot password?\",\n testID = \"auth-forgot-password\",\n}: {\n onPress: () => void;\n label?: string;\n testID?: string;\n}) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"link\"\n accessibilityLabel={label}\n onPress={onPress}\n hitSlop={8}\n className=\"self-end\"\n >\n <Text className=\"text-sm font-medium text-primary-text\">{label}</Text>\n </Pressable>\n );\n}\n","/**\n * AuthScreen — a whole sign-in screen: branding, social providers, the\n * email form with a \"Forgot password?\" link, and a footer (terms, a\n * sign-up link). It assembles the auth primitives (`AuthBranding`,\n * `SocialAuthRow`, `AuthForm`, `ForgotPasswordLink`) so an app passes\n * props instead of composing them.\n *\n * The form stays above the keyboard on small phones: with the app's\n * `KeyboardScrollProvider` (react-native-keyboard-controller), else with\n * `KeyboardAvoidingView`. With the provider's `toolbar` (`KeyboardToolbar`),\n * a previous / next / done bar rides above the keyboard. In development, on\n * iOS, it warns when a third-party provider is offered without Sign in with\n * Apple (App Store Review Guideline 4.8 rejects that). `appleProvider()`\n * adds Apple's own button in one line.\n *\n * Slots: replace or drop (`null`) `branding`, `social`, `form` or `footer`;\n * `slotProps` feeds a default part. Composing the primitives yourself is\n * still the escape hatch.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport { KeyboardAvoidingView, Platform, View } from \"react-native\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport {\n AuthBranding,\n AuthForm,\n ForgotPasswordLink,\n SocialAuthRow,\n type AuthBrandingProps,\n type AuthFormProps,\n type SocialAuthProvider,\n} from \"./auth\";\nimport { ScreenContainer } from \"./screen-container\";\nimport { KEYBOARD_TOOLBAR_HEIGHT, useKeyboardScroll, useKeyboardToolbar } from \"./keyboard\";\n\n/** The parts of an {@link AuthScreen} that `slots` and `slotProps` reach. */\nexport type AuthScreenSlotMap = {\n branding: AuthBrandingProps;\n social: { providers: SocialAuthProvider[]; testID: string };\n form: AuthFormProps;\n footer: { children: ReactNode; testID: string };\n};\n\nexport interface AuthScreenProps {\n /** Logo, headline and subhead above everything else. */\n branding?: AuthBrandingProps;\n /**\n * Sign-in providers (Apple, Google…). None: no social row. A `null` or\n * `false` entry is skipped, so a platform-only provider such as\n * `appleProvider(...)` (null off iOS) goes in the list as is.\n */\n providers?: Array<SocialAuthProvider | null | false | undefined>;\n /** The email form. */\n form: AuthFormProps;\n /** Adds a \"Forgot password?\" link below the fields (password mode only). */\n onForgotPassword?: () => void;\n /** Below the form: terms, a sign-up link. */\n footer?: ReactNode;\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<AuthScreenSlotMap>;\n /** More props for a default part, merged over what the screen passes. */\n slotProps?: SlotPropsFor<AuthScreenSlotMap>;\n /** testID on the root container. Default `\"auth-screen\"`. */\n testID?: string;\n}\n\nexport function AuthScreen({\n branding,\n providers: givenProviders,\n form,\n onForgotPassword,\n footer,\n slots = {},\n slotProps = {},\n testID = \"auth-screen\",\n}: AuthScreenProps) {\n const providers = givenProviders?.filter((p): p is SocialAuthProvider => !!p);\n warnIfNoAppleSignIn(providers);\n const forgot =\n onForgotPassword && (form.mode ?? \"password\") === \"password\" ? <ForgotPasswordLink onPress={onForgotPassword} /> : null;\n const formProps: AuthFormProps = { ...form, belowFields: form.belowFields ?? forgot, testID: form.testID ?? `${testID}-form` };\n const KeyboardScroll = useKeyboardScroll();\n const KeyboardToolbar = useKeyboardToolbar();\n const content = (\n <>\n {branding ? renderSlot(AuthBranding, slots.branding, { ...branding, testID: branding.testID ?? `${testID}-branding` }, slotProps.branding) : null}\n {providers?.length\n ? renderSlot(DefaultSocial, slots.social, { providers, testID: `${testID}-social` }, slotProps.social)\n : null}\n {renderSlot(AuthForm, slots.form, formProps, slotProps.form)}\n {footer ? renderSlot(DefaultFooter, slots.footer, { children: footer, testID: `${testID}-footer` }, slotProps.footer) : null}\n </>\n );\n if (KeyboardScroll) {\n return (\n <ScreenContainer testID={testID}>\n <KeyboardScroll\n testID={`${testID}-keyboard`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n bottomOffset={KeyboardToolbar ? 24 + KEYBOARD_TOOLBAR_HEIGHT : 24}\n contentContainerStyle={{ flexGrow: 1, justifyContent: \"center\", gap: 24, paddingHorizontal: 24, paddingVertical: 32 }}\n >\n {content}\n </KeyboardScroll>\n {KeyboardToolbar ? <KeyboardToolbar /> : null}\n </ScreenContainer>\n );\n }\n return (\n <KeyboardAvoidingView testID={`${testID}-kav`} style={{ flex: 1 }} behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}>\n <ScreenContainer scroll keyboardShouldPersistTaps=\"handled\" testID={testID} contentClassName=\"flex-grow justify-center gap-6 px-6 py-8\">\n {content}\n </ScreenContainer>\n </KeyboardAvoidingView>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\ndeclare const process: { env: Record<string, string | undefined> } | undefined;\nconst warnedNoApple = new Set<string>();\n\n/** Development-only: App Store Review Guideline 4.8 requires Sign in with Apple alongside third-party sign-in. */\nfunction warnIfNoAppleSignIn(providers: SocialAuthProvider[] | undefined) {\n const dev = typeof __DEV__ !== \"undefined\" ? __DEV__ : typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\";\n if (!dev || Platform.OS !== \"ios\" || !providers?.length) return;\n if (providers.some((p) => p.id === \"apple\")) return;\n const ids = providers.map((p) => p.id).join(\",\");\n if (warnedNoApple.has(ids)) return;\n warnedNoApple.add(ids);\n console.warn(\n `[genesis] AuthScreen offers ${providers.map((p) => p.label).join(\", \")} on iOS without Sign in with Apple. App Store Review Guideline 4.8 requires it; add appleProvider({ apple: AppleAuthentication, onPress }) (or any provider with id \"apple\"). If you did, expo-apple-authentication wasn't passed in.`,\n );\n}\n\nfunction DefaultSocial({ providers, testID }: AuthScreenSlotMap[\"social\"]) {\n return <SocialAuthRow providers={providers} testID={testID} />;\n}\n\nfunction DefaultFooter({ children, testID }: AuthScreenSlotMap[\"footer\"]) {\n return (\n <View testID={testID} className=\"items-center\">\n {children}\n </View>\n );\n}\n","/**\n * Sign in with Apple for `AuthScreen` / `SocialAuthRow`, drawn with Apple's\n * own `AppleAuthenticationButton` (Apple's Human Interface Guidelines require\n * its button; a look-alike gets an app rejected). Nothing here imports\n * `expo-apple-authentication`: pass the module in.\n *\n * ```tsx\n * import * as AppleAuthentication from \"expo-apple-authentication\";\n *\n * <AuthScreen providers={[appleProvider({ apple: AppleAuthentication, onPress: signIn }), google]} … />\n * ```\n *\n * `appleProvider` returns `null` off iOS or without the module, and\n * `AuthScreen` skips a `null` provider, so the same line works everywhere.\n *\n * @stability Beta\n */\nimport { useRef, useState, type ComponentType } from \"react\";\nimport { Platform, View, type ViewStyle } from \"react-native\";\nimport { useThemeMode } from \"../hooks/use-theme-mode\";\nimport type { SocialAuthProvider } from \"./auth\";\n\n/** The parts of `expo-apple-authentication` the button uses. Pass the module itself. */\nexport interface AppleButtonModuleLike {\n AppleAuthenticationButton: ComponentType<{\n buttonType: number;\n buttonStyle: number;\n cornerRadius?: number;\n onPress: () => void;\n // The style the button is given, typed as the module types it: with `unknown` here the real\n // module's button (which takes a ViewStyle) wasn't assignable under strictFunctionTypes.\n style?: ViewStyle;\n testID?: string;\n accessibilityState?: { disabled?: boolean; busy?: boolean };\n }>;\n AppleAuthenticationButtonType: { SIGN_IN: number; CONTINUE: number; SIGN_UP: number };\n AppleAuthenticationButtonStyle: { BLACK: number; WHITE: number; WHITE_OUTLINE: number };\n}\n\nexport interface AppleSignInButtonProps {\n /** `expo-apple-authentication`. */\n apple: AppleButtonModuleLike;\n /** Usually `() => signInWithApple(supabase, AppleAuthentication, { digest })` from `@marktiderman/genesis-supabase/native`. */\n onPress: () => void | Promise<void>;\n /** Apple's wording: \"Sign in with Apple\", \"Continue with Apple\" (default) or \"Sign up with Apple\". */\n type?: \"sign-in\" | \"continue\" | \"sign-up\";\n /** `\"auto\"` (default): black in light mode, white in dark, as Apple recommends. */\n appearance?: \"auto\" | \"black\" | \"white\" | \"white-outline\";\n /** Default 10, to sit with Genesis buttons. */\n cornerRadius?: number;\n /** Default 44, the recommended touch target (Apple's HIG minimum for this button is 30pt). */\n height?: number;\n /** Dims the button and ignores presses. It is also ignored on its own while an `onPress` promise is pending, so a second tap can't open a second sheet. */\n disabled?: boolean;\n testID?: string;\n}\n\n/** Apple's branded button, full width. Renders nothing off iOS. */\nexport function AppleSignInButton({\n apple,\n onPress,\n type = \"continue\",\n appearance = \"auto\",\n cornerRadius = 10,\n height = 44,\n disabled,\n testID = \"apple-sign-in\",\n}: AppleSignInButtonProps) {\n const mode = useThemeMode();\n // A ref, not only state: two taps in the same frame both see the old state.\n const pending = useRef(false);\n const [busy, setBusy] = useState(false);\n if (Platform.OS !== \"ios\") return null;\n const press = async () => {\n if (disabled || pending.current) return;\n pending.current = true;\n setBusy(true);\n try {\n await onPress();\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n const inactive = !!disabled || busy;\n const { AppleAuthenticationButton, AppleAuthenticationButtonType: Type, AppleAuthenticationButtonStyle: Style } = apple;\n const buttonType = type === \"sign-in\" ? Type.SIGN_IN : type === \"sign-up\" ? Type.SIGN_UP : Type.CONTINUE;\n const resolved = appearance === \"auto\" ? (mode === \"dark\" ? \"white\" : \"black\") : appearance;\n const buttonStyle = resolved === \"white\" ? Style.WHITE : resolved === \"white-outline\" ? Style.WHITE_OUTLINE : Style.BLACK;\n return (\n <View testID={`${testID}-container`} pointerEvents={inactive ? \"none\" : \"auto\"} style={disabled ? { opacity: 0.5 } : undefined}>\n <AppleAuthenticationButton\n testID={testID}\n buttonType={buttonType}\n buttonStyle={buttonStyle}\n cornerRadius={cornerRadius}\n style={{ width: \"100%\", height }}\n accessibilityState={{ disabled: inactive, busy }}\n onPress={() => {\n void press();\n }}\n />\n </View>\n );\n}\n\nexport interface AppleProviderOptions extends Omit<AppleSignInButtonProps, \"apple\" | \"testID\"> {\n /** `expo-apple-authentication`, or `undefined` where it isn't installed. */\n apple: AppleButtonModuleLike | null | undefined;\n /**\n * The provider's `label`, used only by `AuthScreen`'s dev warning and a\n * custom `social` slot. Apple's button draws and announces its own localized\n * text. Default follows `type`: \"Continue with Apple\", \"Sign in with Apple\"\n * or \"Sign up with Apple\".\n */\n label?: string;\n}\n\nconst APPLE_LABELS = { continue: \"Continue with Apple\", \"sign-in\": \"Sign in with Apple\", \"sign-up\": \"Sign up with Apple\" } as const;\n\n/**\n * A `SocialAuthProvider` (id `\"apple\"`) that draws Apple's button, for\n * `AuthScreen`'s `providers`. `null` off iOS or without the module.\n *\n * @stability Beta\n */\nexport function appleProvider({ apple, label, ...button }: AppleProviderOptions): SocialAuthProvider | null {\n if (Platform.OS !== \"ios\" || !apple) return null;\n return {\n id: \"apple\",\n label: label ?? APPLE_LABELS[button.type ?? \"continue\"],\n onPress: button.onPress,\n disabled: button.disabled,\n render: ({ testID, disabled }) => <AppleSignInButton apple={apple} {...button} disabled={disabled} testID={testID} />,\n };\n}\n","/**\n * Google sign-in for `AuthScreen` / `SocialAuthRow`: the provider entry,\n * drawn as the row's outline button. Nothing here imports\n * `@react-native-google-signin/google-signin`; sign in with\n * `signInWithGoogle` from `@marktiderman/genesis-supabase/native`.\n *\n * ```tsx\n * <AuthScreen providers={[appleProvider({ apple, onPress: onApple }), googleProvider({ onPress: onGoogle })]} … />\n * ```\n *\n * Google's branding guidelines want its \"G\" mark on the button: pass it as\n * `icon` (Genesis ships no Google artwork). On iOS, offer Sign in with Apple\n * too (App Store Review Guideline 4.8); `AuthScreen` warns in development\n * when it's missing.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport type { SocialAuthProvider } from \"./auth\";\n\nexport interface GoogleProviderOptions {\n /** Usually `() => signInWithGoogle(supabase, GoogleOneTapSignIn, { digest })`. */\n onPress: () => void | Promise<void>;\n /** Default \"Continue with Google\", Google's own wording. */\n label?: string;\n /** Google's \"G\" mark, as the app draws it. */\n icon?: ReactNode;\n disabled?: boolean;\n /** `false` (or `null`) gives `null`, so a switched-off provider goes in the list as is. Default true. */\n enabled?: boolean | null;\n}\n\n/**\n * A `SocialAuthProvider` (id `\"google\"`) for `AuthScreen`'s `providers`, or\n * `null` when `enabled` is false.\n *\n * @stability Beta\n */\nexport function googleProvider({ onPress, label = \"Continue with Google\", icon, disabled, enabled = true }: GoogleProviderOptions): SocialAuthProvider | null {\n if (!enabled) return null;\n return { id: \"google\", label, icon, onPress, disabled };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativeLoadingState, NativeRefreshControl, NativeSwipeRow, NativeContextMenu, NativeText, NativeBadge, NativeEmptyState, NativeButton } from './chunk-
|
|
2
|
-
import { useThemeMode, useThemeRoles } from './chunk-
|
|
1
|
+
import { NativeLoadingState, NativeRefreshControl, NativeSwipeRow, NativeContextMenu, NativeText, NativeBadge, NativeEmptyState, NativeButton } from './chunk-VEWSY4TZ.js';
|
|
2
|
+
import { useThemeMode, useThemeRoles } from './chunk-PMS2V46D.js';
|
|
3
3
|
import { cn } from './chunk-OHZD7KRO.js';
|
|
4
4
|
import { View, ScrollView, StatusBar, Pressable, Text, TextInput, FlatList, Platform, Alert, StyleSheet } from 'react-native';
|
|
5
5
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
@@ -129,7 +129,7 @@ function NavBarSaveButton({
|
|
|
129
129
|
{
|
|
130
130
|
className: cn(
|
|
131
131
|
"text-base font-semibold",
|
|
132
|
-
destructive ? "text-destructive" : "text-primary",
|
|
132
|
+
destructive ? "text-destructive" : "text-primary-text",
|
|
133
133
|
isDisabled && "opacity-40"
|
|
134
134
|
),
|
|
135
135
|
children: loading ? "\u2026" : label
|
|
@@ -366,7 +366,7 @@ function SectionTitle({ title, testID }) {
|
|
|
366
366
|
{
|
|
367
367
|
testID,
|
|
368
368
|
accessibilityRole: "header",
|
|
369
|
-
className: ios ? "px-4 pb-1.5 pt-2" : "px-4 pb-2 pt-4 text-primary",
|
|
369
|
+
className: ios ? "px-4 pb-1.5 pt-2" : "px-4 pb-2 pt-4 text-primary-text",
|
|
370
370
|
style: ios ? { marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18, textTransform: "uppercase" } : { fontSize: 14, lineHeight: 20, fontWeight: "500" },
|
|
371
371
|
children: title
|
|
372
372
|
}
|
|
@@ -485,5 +485,5 @@ function DefaultEmpty({ title, body, actionLabel, onAction, testID }) {
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
export { InboxPage, NavBarSaveButton, NavBarSearchBar, NavBarTitle, ScreenContainer, composeHeaderOptions, getInboxPageStackOptions, showInboxActions };
|
|
488
|
-
//# sourceMappingURL=chunk-
|
|
489
|
-
//# sourceMappingURL=chunk-
|
|
488
|
+
//# sourceMappingURL=chunk-GGH3ZQNO.js.map
|
|
489
|
+
//# sourceMappingURL=chunk-GGH3ZQNO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/layouts/screen-container.tsx","../src/layouts/nav-bar.tsx","../src/layouts/inbox-page.tsx"],"names":["jsx","jsxs","View","SafeAreaView","ScrollView","Pressable"],"mappings":";;;;;;;;;;;;AAkIO,SAAS,qBACd,KAAA,EACyB;AACzB,EAAA,MAAM;AAAA,IACJ,WAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAA;AAAA,IACA,kBAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,OAAgC,EAAC;AACvC,EAAA,IAAI,WAAA,KAAgB,MAAA,EAAW,IAAA,CAAK,KAAA,GAAQ,WAAA;AAC5C,EAAA,IAAI,UAAA,OAAiB,UAAA,GAAa,UAAA;AAClC,EAAA,IAAI,WAAA,OAAkB,WAAA,GAAc,WAAA;AACpC,EAAA,IAAI,KAAA,EAAO;AAET,IAAA,IAAA,CAAK,gBAAA,GAAmB,IAAA;AACxB,IAAA,IAAI,uBAAuB,aAAA,EAAe;AACxC,MAAA,IAAA,CAAK,iBAAA,GAAoB,IAAA;AAAA,IAC3B,CAAA,MAAA,IAAW,uBAAuB,QAAA,EAAU;AAC1C,MAAA,IAAA,CAAK,6BAAA,GAAgC,IAAA;AAAA,IACvC;AAAA,EACF;AAEA,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,MAAA,CAAO,MAAA,CAAO,MAAM,aAAa,CAAA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AAE,KAAA,EAAO,EAAA,EAAI,QAAQ,EAAA,EAAI,YAAA,EAAc,CAAA,EAAG,eAAA,EAAiB,OAAgB,EAAG,CAAA;AACpH;AAEA,SAAS,aAAA,CAAc,EAAE,WAAA,EAAa,MAAA,EAAO,EAA+B;AAC1E,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,uBACEF,GAAAA,CAAC,kBAAA,EAAA,EAAmB,UAAA,EAAY,KAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,kBAAA,EAAmB,cAAA,EAAe,SAAA,EAAU,MAAA,EAAO,MAAA,EAAgB,CAAA;AAE3H;AAEA,SAAS,aAAa,EAAE,KAAA,EAAO,MAAM,WAAA,EAAa,QAAA,EAAU,QAAO,EAA8B;AAC/F,EAAA,uBACEA,GAAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,WAAA;AAAA,MACR,KAAA;AAAA,MACA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,aAAA,EACE,WAAA,IAAe,QAAA,mBACbA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,QAAA,EAAU,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,OAAA,CAAA,EAC/C,uBACH,CAAA,GACE;AAAA;AAAA,GAER;AAEJ","file":"chunk-GGH3ZQNO.js","sourcesContent":["/**\n * ScreenContainer — Layer-2 page primitive.\n *\n * Wires the chrome every layout needs without imposing layout structure:\n * - Safe-area edges (configurable via `safeAreaEdges`)\n * - StatusBar style (light / dark / auto)\n * - Scroll vs static body\n * - Tokens-aware background (`bg-background`)\n * - A loading state (`loading`): a centred `NativeLoadingState` in place of the body\n * - Pull to refresh (`onRefresh` + `refreshing`): a theme-tinted `NativeRefreshControl`\n *\n * Header customization is delegated: pass `headerLeft`, `headerRight`,\n * `large`, `scrollEdgeBehavior`, `safeAreaEdges`, plus any direct\n * `headerOptions` passthrough to `<Stack.Screen options={...} />`. We\n * **do not** render the navigation header ourselves — Expo Router /\n * React Navigation render the platform-native header. Consumer either:\n *\n * (a) Wraps the screen in `<ScreenContainer>` and ALSO declares\n * `<Stack.Screen options={headerOptionsFromProps(props)} />` at the\n * top of the screen (we export a helper `composeHeaderOptions` for\n * this), OR\n * (b) Imports `<NavBarTitle>` / `<NavBarSearchBar>` / `<NavBarSaveButton>`\n * sub-primitives and threads them through `headerLeft` / `headerRight`\n * options manually.\n *\n * The Layer-3/4 layouts (SettingsPage, etc.) compose ScreenContainer + a\n * helper that wires Stack.Screen so consumers get the 3-line ergonomics.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport { ScrollView, StatusBar, View, type ViewStyle } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeMode } from \"../hooks/use-theme-mode\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\n\nexport type SafeAreaEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport type ScrollEdgeBehavior = \"match\" | \"transparent\" | \"opaque\";\n\nexport interface ScreenContainerProps {\n /** Screen body. Pass any node tree. */\n children: ReactNode;\n /** When `true`, the body is wrapped in a vertical ScrollView. Default `false`. */\n scroll?: boolean;\n /**\n * SafeAreaView edges. Defaults to `[\"left\", \"right\"]` — top/bottom are\n * normally handled by the navigation header / tab bar.\n */\n safeAreaEdges?: SafeAreaEdge[];\n /**\n * StatusBar appearance. `\"auto\"` follows the resolved theme mode.\n */\n statusBar?: \"light\" | \"dark\" | \"auto\" | \"hidden\";\n /**\n * Force light or dark theme on this screen regardless of OS preference.\n * Default `\"system\"` (follow OS).\n */\n themeMode?: \"light\" | \"dark\" | \"system\";\n /** Override root container className. */\n className?: string;\n /** Override inner content container className (the ScrollView's contentContainerClassName when scroll=true). */\n contentClassName?: string;\n /**\n * `keyboardShouldPersistTaps` for the inner ScrollView. Default `\"handled\"`.\n * Only used when `scroll` is true.\n */\n keyboardShouldPersistTaps?: \"always\" | \"never\" | \"handled\";\n /**\n * When `true`, a centred `NativeLoadingState` (theme-tinted spinner,\n * announced as loading) replaces the body, inside the same safe area and\n * background. Use it for redirect and first-load screens: the body is\n * unmounted while it's on, so a form underneath loses its state. Default `false`.\n */\n loading?: boolean;\n /** Text under the spinner while `loading`, and what screen readers announce: pass translated text. */\n loadingLabel?: string;\n /**\n * Pull to refresh: a theme-tinted `NativeRefreshControl` on the body, as InboxPage and\n * NotificationsPage have. Pulling needs a scroll view, so passing it makes the body scroll\n * (as `scroll`). Off unless passed. Never with a list child (FlatList, SectionList,\n * NativeResourceView, InboxPage): a list inside a ScrollView loses virtualization, and those\n * lists have their own pull to refresh.\n */\n onRefresh?: () => void | Promise<void>;\n /** The refresh spinner shows while `true`: pass your query's refetching state. Default `false`. */\n refreshing?: boolean;\n /** Style on the root, e.g. a theme-role background color. */\n style?: ViewStyle;\n /** testID on the root container. */\n testID?: string;\n}\n\n/**\n * Layer-3 named-prop slots that layouts can accept and forward to\n * `composeHeaderOptions()` for `<Stack.Screen options={...}>`.\n */\nexport interface ScreenHeaderProps {\n /** Custom header title. Falls back to `<Stack.Screen name>` mapping. */\n headerTitle?: string;\n /** Custom node rendered on the left of the nav bar. */\n headerLeft?: () => ReactNode;\n /** Custom node rendered on the right of the nav bar. */\n headerRight?: () => ReactNode;\n /** When true, iOS uses large-title mode + scroll-edge appearance. */\n large?: boolean;\n /** iOS scroll-edge behavior. `\"match\"` collapses, `\"transparent\"` always transparent, `\"opaque\"` always opaque. */\n scrollEdgeBehavior?: ScrollEdgeBehavior;\n /** Direct passthrough merged INTO the resolved options object. Wins over named props. */\n headerOptions?: Record<string, unknown>;\n}\n\n/**\n * Compose a `<Stack.Screen options={...}>` object from Layer-3 named\n * props + a direct `headerOptions` passthrough. Layouts call this and\n * pass the result to `<Stack.Screen>` so the host's expo-router stack\n * renders a platform-native large title / scroll-edge appearance.\n *\n * Usage (in a layout primitive):\n *\n * const opts = composeHeaderOptions({\n * headerTitle: \"Settings\",\n * large: true,\n * scrollEdgeBehavior: \"match\",\n * headerOptions: rest.headerOptions,\n * });\n * return <><Stack.Screen options={opts} /><ScreenContainer>...</ScreenContainer></>;\n */\nexport function composeHeaderOptions(\n props: ScreenHeaderProps,\n): Record<string, unknown> {\n const {\n headerTitle,\n headerLeft,\n headerRight,\n large,\n scrollEdgeBehavior,\n headerOptions,\n } = props;\n\n const opts: Record<string, unknown> = {};\n if (headerTitle !== undefined) opts.title = headerTitle;\n if (headerLeft) opts.headerLeft = headerLeft;\n if (headerRight) opts.headerRight = headerRight;\n if (large) {\n // iOS large-title mode. Android falls back to standard.\n opts.headerLargeTitle = true;\n if (scrollEdgeBehavior === \"transparent\") {\n opts.headerTransparent = true;\n } else if (scrollEdgeBehavior === \"opaque\") {\n opts.headerLargeTitleShadowVisible = true;\n }\n }\n // Direct passthrough wins.\n if (headerOptions) {\n Object.assign(opts, headerOptions);\n }\n return opts;\n}\n\nconst DEFAULT_EDGES: SafeAreaEdge[] = [\"left\", \"right\"];\n\n// A see-through Android status bar. React Native 0.88 dropped both props from StatusBar's types\n// (Android is always edge to edge there, so they do nothing); earlier versions still need them.\n// Spread untyped so the screen compiles against either.\nconst TRANSLUCENT_ANDROID_BAR: Record<string, unknown> = { translucent: true, backgroundColor: \"transparent\" };\n\n/**\n * Resolve the StatusBar bar style from the user's `statusBar` setting +\n * the resolved theme mode. `\"auto\"` follows theme; explicit overrides\n * win; anything else falls back to `\"default\"`.\n */\nfunction resolveBarStyle(\n statusBar: \"light\" | \"dark\" | \"auto\" | \"hidden\",\n resolvedMode: \"light\" | \"dark\",\n): \"default\" | \"light-content\" | \"dark-content\" {\n if (statusBar === \"auto\") {\n return resolvedMode === \"dark\" ? \"light-content\" : \"dark-content\";\n }\n if (statusBar === \"light\") return \"light-content\";\n if (statusBar === \"dark\") return \"dark-content\";\n return \"default\";\n}\n\nexport function ScreenContainer({\n children,\n scroll = false,\n safeAreaEdges = DEFAULT_EDGES,\n statusBar = \"auto\",\n themeMode = \"system\",\n className,\n contentClassName,\n keyboardShouldPersistTaps = \"handled\",\n loading = false,\n loadingLabel,\n onRefresh,\n refreshing = false,\n style,\n testID,\n}: ScreenContainerProps) {\n const osMode = useThemeMode();\n const resolvedMode = themeMode === \"system\" ? osMode : themeMode;\n const barStyle = resolveBarStyle(statusBar, resolvedMode);\n\n const body = loading ? (\n <View testID={testID ? `${testID}-body` : undefined} className={cn(\"flex-1\", contentClassName)}>\n <NativeLoadingState fullScreen={false} label={loadingLabel} testID={`${testID ?? \"screen-container\"}-loading`} />\n </View>\n ) : scroll || onRefresh ? (\n <ScrollView\n testID={testID ? `${testID}-scroll` : undefined}\n refreshControl={\n onRefresh ? (\n <NativeRefreshControl testID={`${testID ?? \"screen-container\"}-refresh`} refreshing={refreshing} onRefresh={() => void onRefresh()} />\n ) : undefined\n }\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerClassName={cn(\"flex-grow\", contentClassName)}\n >\n {children}\n </ScrollView>\n ) : (\n <View\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"flex-1\", contentClassName)}\n >\n {children}\n </View>\n );\n\n return (\n <SafeAreaView\n testID={testID ?? \"screen-container\"}\n edges={safeAreaEdges}\n className={cn(\"flex-1 bg-background\", className)}\n style={style}\n >\n {statusBar !== \"hidden\" ? (\n <StatusBar\n barStyle={\n barStyle as\n | \"default\"\n | \"light-content\"\n | \"dark-content\"\n }\n {...TRANSLUCENT_ANDROID_BAR}\n />\n ) : (\n <StatusBar hidden />\n )}\n {body}\n </SafeAreaView>\n );\n}\n","/**\n * Nav-bar sub-primitives — escape hatches for `<Stack.Screen>` `headerLeft`,\n * `headerRight`, and custom title view.\n *\n * Use these when the named-prop slots on a layout aren't enough — e.g.,\n * a screen needs a save button on the right that's wired to dirty-state,\n * or a search bar replaces the title on a results screen.\n *\n * Pass directly into `headerLeft={() => <NavBarSearchBar ... />}` or\n * compose into a custom `headerTitle={() => <NavBarTitle ... />}` slot.\n *\n * @stability Beta\n */\nimport { Pressable, Text, TextInput, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\n// ---------------------------------------------------------------------------\n// NavBarSaveButton\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSaveButtonProps {\n /** Press handler. Disabled when not provided OR when `disabled`/`loading`. */\n onPress?: () => void;\n /** Visible label. Default `\"Save\"`. */\n label?: string;\n /** When true, the button is muted and not pressable. Use this for clean / pristine forms. */\n disabled?: boolean;\n /** When true, label switches to a busy indicator and presses are blocked. */\n loading?: boolean;\n /** When true, render label in destructive tone. */\n destructive?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarSaveButton({\n onPress,\n label = \"Save\",\n disabled,\n loading,\n destructive,\n className,\n testID,\n}: NavBarSaveButtonProps) {\n const isDisabled = !!disabled || !!loading || !onPress;\n return (\n <Pressable\n testID={testID ?? \"nav-bar-save-button\"}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled: isDisabled, busy: !!loading }}\n onPress={isDisabled ? undefined : onPress}\n disabled={isDisabled}\n className={cn(\"min-h-[44px] justify-center px-3\", className)}\n hitSlop={8}\n >\n <Text\n className={cn(\n \"text-base font-semibold\",\n destructive ? \"text-destructive\" : \"text-primary-text\",\n isDisabled && \"opacity-40\"\n )}\n >\n {loading ? \"…\" : label}\n </Text>\n </Pressable>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarTitle\n// ---------------------------------------------------------------------------\n\nexport interface NavBarTitleProps {\n /** Title text. */\n title: string;\n /** Optional smaller subtitle line under the title. */\n subtitle?: string;\n /** Optional press handler — turns the title row into a tap target (e.g., reveal a picker). */\n onPress?: () => void;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarTitle({\n title,\n subtitle,\n onPress,\n className,\n testID,\n}: NavBarTitleProps) {\n const inner = (\n <View className={cn(\"items-center justify-center\", className)}>\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className=\"text-base font-semibold text-foreground\"\n numberOfLines={1}\n >\n {title}\n </Text>\n {subtitle ? (\n <Text\n testID={testID ? `${testID}-subtitle` : undefined}\n className=\"text-xs text-muted-foreground\"\n numberOfLines={1}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"nav-bar-title\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n onPress={onPress}\n hitSlop={8}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View testID={testID ?? \"nav-bar-title\"} accessibilityRole=\"header\">\n {inner}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarSearchBar\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSearchBarProps {\n value: string;\n onChangeText: (next: string) => void;\n placeholder?: string;\n /** Called when the user submits the search (return key). */\n onSubmit?: () => void;\n /** Render a clear (X) button when value is non-empty. Default true. */\n clearable?: boolean;\n className?: string;\n testID?: string;\n}\n\n/**\n * Inline search input meant to occupy the title slot on a search results\n * screen. For a sticky search-below-the-header pattern, prefer the\n * standalone <NativeSearchBar> primitive.\n */\nexport function NavBarSearchBar({\n value,\n onChangeText,\n placeholder = \"Search\",\n onSubmit,\n clearable = true,\n className,\n testID,\n}: NavBarSearchBarProps) {\n return (\n <View\n testID={testID ?? \"nav-bar-search\"}\n className={cn(\n \"min-h-[36px] flex-row items-center rounded-full bg-muted px-3\",\n className\n )}\n >\n <TextInput\n testID={testID ? `${testID}-input` : undefined}\n accessibilityLabel={placeholder}\n value={value}\n onChangeText={onChangeText}\n onSubmitEditing={onSubmit}\n placeholder={placeholder}\n placeholderTextColor={nativeColors.neutral[400]}\n returnKeyType=\"search\"\n autoCorrect={false}\n autoCapitalize=\"none\"\n clearButtonMode={clearable ? \"while-editing\" : \"never\"}\n className=\"flex-1 text-base text-foreground\"\n />\n {clearable && value.length > 0 ? (\n <Pressable\n testID={testID ? `${testID}-clear` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear search\"\n onPress={() => onChangeText(\"\")}\n hitSlop={8}\n className=\"ml-2 px-1\"\n >\n <Text className=\"text-base text-muted-foreground\">×</Text>\n </Pressable>\n ) : null}\n </View>\n );\n}\n","/**\n * InboxPage — a list of conversations or tickets: unread state, a time, a\n * preview line, swipe actions, pull to refresh, paging and an empty state.\n *\n * Generic: the rows are whatever the app has (support reports, direct\n * messages, an idea board). Data and actions come in as props; the layout\n * draws them the platform's way. On iOS it is the Settings app's inset\n * grouped style, like `SettingsPage`: the page is `groupedBackground`, the\n * rows one rounded group on `surface` with hairline separators that start at\n * the text. On Android rows are full width.\n *\n * Swipe actions: each row's `swipeActions` are always reachable without a\n * gesture library, as VoiceOver / TalkBack custom actions and on long press\n * (`NativeContextMenu`). The swipe itself is `NativeSwipeRow`, once the app\n * passes `GenesisModules.swipeable` (`ReanimatedSwipeable` from\n * react-native-gesture-handler, an optional peer), with each action's `side`.\n * The `swipeable` slot takes your own wrapper instead; it receives the actions\n * and the row.\n *\n * Rows: `avatar` puts a picture of who it is between the unread dot and the\n * text (an unread count shows at the end of the row, as in Mail); `leading`\n * replaces the dot.\n *\n * Slots: `row`, `swipeable`, `header` (above the group), `footer` (below it,\n * the paging spinner by default) and `empty`. `slots` swaps a part for your\n * component (same props), `slotProps` feeds the default more props, `null`\n * drops it.\n *\n * Header: `getInboxPageStackOptions()` for `<Stack.Screen options>`.\n *\n * @stability Beta\n */\nimport { createContext, Fragment, useContext, useState, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { Alert, FlatList, Platform, Pressable, ScrollView, StyleSheet, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeText } from \"../components/text\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeBadge } from \"../components/badge\";\nimport { NativeContextMenu } from \"../components/context-menu\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\nimport { NativeSwipeRow } from \"../components/swipe-row\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\nimport { formatInboxTime, type InboxItem, type InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\n\n// The conversation contract is genesis-core's, shared with genesis-ui's InboxPage.\nexport type { InboxItem, InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\nexport { formatInboxTime } from \"@marktiderman/genesis-core/conversation\";\n\n/** The parts `slots` and `slotProps` reach, with the props each receives. */\nexport type InboxPageSlotMap = {\n row: InboxItem & { testID: string; isFirst: boolean; isLast: boolean; timeLabel: string | null };\n swipeable: { actions: InboxSwipeAction[]; testID: string; children?: ReactNode };\n header: { testID: string };\n footer: { loadingMore: boolean; testID: string };\n empty: { title: string; body: string; actionLabel?: string; onAction?: () => void; testID: string };\n};\n\nexport interface InboxPageProps extends ScreenHeaderProps {\n /** Newest first, as they should show. Empty → the empty state. */\n items: InboxItem[];\n refreshing?: boolean;\n onRefresh?: () => void | Promise<void>;\n /** Called near the end of the list, to load the next page. */\n onEndReached?: () => void;\n /** A next page is loading: the default footer shows a spinner. */\n loadingMore?: boolean;\n /** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */\n header?: ReactNode;\n /** An optional title over the group, in the Settings header style. */\n sectionTitle?: string;\n emptyTitle?: string;\n emptyBody?: string;\n /** The first page is loading: a spinner instead of the empty state. */\n loading?: boolean;\n /** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */\n error?: boolean;\n errorTitle?: string;\n errorBody?: string;\n /** A button in the empty state (\"Send feedback\"). */\n emptyActionLabel?: string;\n onEmptyAction?: () => void;\n /** How a row's time reads. Default: the time today, \"Yesterday\", the weekday this week, else the date. */\n formatTime?: (date: Date, now: Date) => string;\n /** The clock, for tests. */\n now?: () => Date;\n slots?: Slots<InboxPageSlotMap>;\n slotProps?: SlotPropsFor<InboxPageSlotMap>;\n /** testID on the root. Default `\"inbox-page\"`. */\n testID?: string;\n}\n\n/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */\nexport function getInboxPageStackOptions(props: ScreenHeaderProps & { headerTitle?: string }): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Inbox\",\n large: props.large ?? true,\n scrollEdgeBehavior: props.scrollEdgeBehavior ?? \"match\",\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\n/** Opens the page's one actions menu for a row. */\nconst OpenRowMenu = createContext<(row: InboxPageSlotMap[\"row\"]) => void>(() => undefined);\n\n/** The row's leading padding, the unread dot's column, an avatar's default size and its gap to the text. */\nconst ROW_PADDING = 16;\nconst LEADING_WIDTH = 18;\nconst DEFAULT_AVATAR = 40;\nconst AVATAR_GAP = 12;\n\n/** UIKit's inset grouped margin on a phone, in points (as SettingsPage). */\nconst IOS_GROUP_MARGIN = 16;\n\nfunction iosGroupRadius(): number {\n return Number.parseFloat(String(Platform.Version)) >= 26 ? 26 : 10;\n}\n\nexport function InboxPage({\n items,\n refreshing,\n onRefresh,\n onEndReached,\n loadingMore = false,\n header,\n sectionTitle,\n emptyTitle,\n emptyBody,\n emptyActionLabel,\n onEmptyAction,\n loading = false,\n error = false,\n errorTitle,\n errorBody,\n formatTime = formatInboxTime,\n now = () => new Date(),\n slots = {},\n slotProps = {},\n testID = \"inbox-page\",\n}: InboxPageProps) {\n const colors = useThemeRoles();\n const clock = now();\n // One menu for the page: its row stays set while the sheet goes, so its words don't vanish first.\n const [menuRow, setMenuRow] = useState<InboxPageSlotMap[\"row\"] | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n const rows: InboxPageSlotMap[\"row\"][] = items.map((item, index) => ({\n ...item,\n testID: item.testID ?? `${testID}-row-${item.id}`,\n isFirst: index === 0,\n isLast: index === items.length - 1,\n timeLabel: item.timestamp ? formatTime(typeof item.timestamp === \"string\" ? new Date(item.timestamp) : item.timestamp, clock) : null,\n }));\n\n const headerNode = (\n <View>\n {header ?? renderSlot(EmptyPart, slots.header, { testID: `${testID}-header` }, slotProps.header)}\n {sectionTitle ? <SectionTitle title={sectionTitle} testID={`${testID}-section-title`} /> : null}\n </View>\n );\n\n const refreshControl = onRefresh ? <NativeRefreshControl testID={`${testID}-refresh`} refreshing={!!refreshing} onRefresh={() => void onRefresh()} /> : undefined;\n\n if (items.length === 0) {\n // A scroll view, not a plain view: under a large-title (or translucent) header only a\n // scroll view's automatic content inset moves the content below the header, and pull to\n // refresh needs one too.\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <ScrollView\n testID={`${testID}-empty-scroll`}\n contentInsetAdjustmentBehavior=\"automatic\"\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={{ flexGrow: 1, paddingTop: 8, paddingBottom: 32 }}\n refreshControl={refreshControl}\n >\n {headerNode}\n {loading ? (\n <NativeLoadingState fullScreen={false} testID={`${testID}-loading`} />\n ) : (\n renderSlot(\n DefaultEmpty,\n slots.empty,\n error\n ? {\n title: errorTitle ?? \"Couldn't load this\",\n body: errorBody ?? \"Check your connection, then pull to refresh.\",\n actionLabel: onRefresh ? \"Try again\" : undefined,\n onAction: onRefresh ? () => void onRefresh() : undefined,\n testID: `${testID}-error`,\n }\n : {\n title: emptyTitle ?? \"Nothing here yet\",\n body: emptyBody ?? \"When there's something new, it shows up here.\",\n actionLabel: emptyActionLabel,\n onAction: onEmptyAction,\n testID: `${testID}-empty`,\n },\n slotProps.empty,\n )\n )}\n </ScrollView>\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <OpenRowMenu.Provider\n value={(row) => {\n setMenuRow(row);\n setMenuOpen(true);\n }}\n >\n <FlatList\n testID={`${testID}-list`}\n data={rows}\n keyExtractor={(row) => row.id}\n contentInsetAdjustmentBehavior=\"automatic\"\n // The header can hold a text field (the idea board's \"Suggest\"): its button's first tap\n // must press it, not only close the keyboard.\n keyboardShouldPersistTaps=\"handled\"\n ListHeaderComponent={headerNode}\n ListFooterComponent={renderSlot(DefaultFooter, slots.footer, { loadingMore, testID: `${testID}-footer` }, slotProps.footer)}\n contentContainerStyle={{ paddingTop: 8, paddingBottom: 32 }}\n onEndReached={onEndReached}\n onEndReachedThreshold={0.5}\n refreshControl={refreshControl}\n renderItem={({ item: row }) => {\n const content = renderSlot(DefaultRow, slots.row, row, slotProps.row);\n const actions = row.swipeActions ?? [];\n return (\n <Fragment>\n {actions.length && slots.swipeable !== null\n ? renderSlot(NativeSwipeRow, slots.swipeable, { actions, testID: `${row.testID}-swipe`, children: content }, slotProps.swipeable)\n : content}\n </Fragment>\n );\n }}\n />\n </OpenRowMenu.Provider>\n {menuRow ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} title={menuRow.title} actions={menuRow.swipeActions ?? []} testID={`${testID}-menu`} /> : null}\n </SafeAreaView>\n );\n}\n\nfunction EmptyPart(_props: InboxPageSlotMap[\"header\"]) {\n return null;\n}\n\nfunction SectionTitle({ title, testID }: { title: string; testID: string }) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n className={ios ? \"px-4 pb-1.5 pt-2\" : \"px-4 pb-2 pt-4 text-primary-text\"}\n style={\n ios\n ? { marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18, textTransform: \"uppercase\" }\n : { fontSize: 14, lineHeight: 20, fontWeight: \"500\" }\n }\n >\n {title}\n </NativeText>\n );\n}\n\n/**\n * Opens a row's actions as the system alert. `InboxPage` now opens `NativeContextMenu`; `NativeResourceView`\n * still uses this.\n */\nexport function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel = \"Cancel\"): void {\n Alert.alert(title, undefined, [\n ...actions.map((a) => ({ text: a.label, style: a.destructive ? (\"destructive\" as const) : (\"default\" as const), onPress: a.onPress })),\n { text: cancelLabel, style: \"cancel\" as const },\n ]);\n}\n\nfunction DefaultRow(row: InboxPageSlotMap[\"row\"]) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n const [pressed, setPressed] = useState(false);\n const openMenu = useContext(OpenRowMenu);\n const actions = row.swipeActions ?? [];\n const radius = iosGroupRadius();\n const unreadLabel = row.unreadCount && row.unreadCount > 0 ? `${row.unreadCount} unread` : row.unread ? \"Unread\" : null;\n const label = [unreadLabel, row.avatar ? row.avatarLabel : null, row.title, row.timeLabel, row.preview, row.meta].filter(Boolean).join(\", \");\n // The separator starts at the text: the row's padding, the dot's column, and the avatar when there is one.\n const [avatarWidth, setAvatarWidth] = useState(0);\n const separatorInset = ROW_PADDING + LEADING_WIDTH + (row.avatar ? (avatarWidth || DEFAULT_AVATAR) + AVATAR_GAP : 0);\n return (\n <View\n testID={`${row.testID}-cell`}\n style={[\n { backgroundColor: colors.surface },\n ios\n ? {\n marginHorizontal: IOS_GROUP_MARGIN,\n borderTopLeftRadius: row.isFirst ? radius : 0,\n borderTopRightRadius: row.isFirst ? radius : 0,\n borderBottomLeftRadius: row.isLast ? radius : 0,\n borderBottomRightRadius: row.isLast ? radius : 0,\n overflow: \"hidden\",\n }\n : null,\n ]}\n >\n <Pressable\n testID={row.testID}\n accessibilityRole={row.onPress ? \"button\" : undefined}\n accessibilityLabel={label}\n accessibilityState={row.selected ? { selected: true } : undefined}\n accessibilityActions={actions.map((a) => ({ name: a.id, label: a.label }))}\n onAccessibilityAction={(event) => actions.find((a) => a.id === event.nativeEvent.actionName)?.onPress()}\n onPress={row.onPress}\n onLongPress={actions.length ? () => openMenu(row) : undefined}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n style={{ flexDirection: \"row\", alignItems: \"center\", paddingHorizontal: ROW_PADDING, paddingVertical: 11, minHeight: 60, backgroundColor: (pressed && row.onPress) || row.selected ? colors.fill : undefined }}\n >\n <View style={{ width: LEADING_WIDTH, alignItems: \"flex-start\" }}>\n {row.leading ?? (row.unreadCount && row.unreadCount > 0 ? null : <UnreadDot unread={!!row.unread} testID={`${row.testID}-unread`} color={colors.tint} />)}\n </View>\n {row.avatar ? (\n <View\n testID={`${row.testID}-avatar`}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n onLayout={(e) => setAvatarWidth(Math.round(e.nativeEvent.layout.width))}\n style={{ marginRight: AVATAR_GAP }}\n >\n {row.avatar}\n </View>\n ) : null}\n <View style={{ flex: 1, minWidth: 0 }}>\n <View style={{ flexDirection: \"row\", alignItems: \"baseline\" }}>\n <NativeText\n numberOfLines={1}\n style={{ flex: 1, color: colors.label, fontSize: 17, lineHeight: 22, fontWeight: row.unread || (row.unreadCount ?? 0) > 0 ? \"600\" : \"400\" }}\n >\n {row.title}\n </NativeText>\n {row.timeLabel ? (\n <NativeText testID={`${row.testID}-time`} style={{ marginLeft: 8, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.timeLabel}\n </NativeText>\n ) : null}\n </View>\n {row.preview ? (\n <NativeText numberOfLines={2} style={{ marginTop: 2, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.preview}\n </NativeText>\n ) : null}\n {row.meta ? (\n <NativeText testID={`${row.testID}-meta`} style={{ marginTop: 4, color: colors.tertiaryLabel, fontSize: 13, lineHeight: 18 }}>\n {row.meta}\n </NativeText>\n ) : null}\n </View>\n {row.unreadCount && row.unreadCount > 0 ? (\n <View style={{ marginLeft: 8 }}>\n <NativeBadge testID={`${row.testID}-count`}>{String(row.unreadCount)}</NativeBadge>\n </View>\n ) : null}\n {row.trailing ? <View style={{ marginLeft: 8 }}>{row.trailing}</View> : row.onPress ? <Chevron color={colors.tertiaryLabel} /> : null}\n </Pressable>\n {row.isLast ? null : (\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={{ flexDirection: \"row\", height: StyleSheet.hairlineWidth }}>\n <View testID={`${row.testID}-separator-inset`} style={{ width: separatorInset }} />\n <View testID={`${row.testID}-separator-line`} style={{ flex: 1, backgroundColor: colors.separator }} />\n </View>\n )}\n </View>\n );\n}\n\nfunction Chevron({ color }: { color: unknown }) {\n return (\n <NativeText accessibilityElementsHidden importantForAccessibility=\"no\" style={{ marginLeft: 8, color: color as string, fontSize: 20, lineHeight: 22 }}>\n ›\n </NativeText>\n );\n}\n\nfunction UnreadDot({ unread, testID, color }: { unread: boolean; testID: string; color: unknown }) {\n if (!unread) return <View testID={testID} style={{ width: 10, height: 10 }} />;\n return <View testID={testID} style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: color as string }} />;\n}\n\nfunction DefaultFooter({ loadingMore, testID }: InboxPageSlotMap[\"footer\"]) {\n if (!loadingMore) return null;\n return (\n <NativeLoadingState fullScreen={false} size=\"small\" accessibilityLabel=\"Loading more\" className=\"py-4\" testID={testID} />\n );\n}\n\nfunction DefaultEmpty({ title, body, actionLabel, onAction, testID }: InboxPageSlotMap[\"empty\"]) {\n return (\n <NativeEmptyState\n variant=\"first-run\"\n title={title}\n body={body}\n testID={testID}\n primaryAction={\n actionLabel && onAction ? (\n <NativeButton onPress={onAction} testID={`${testID}-action`}>\n {actionLabel}\n </NativeButton>\n ) : undefined\n }\n />\n );\n}\n"]}
|