@marktiderman/genesis-ui-native 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YJV5MMZX.js → chunk-7HWS2JGX.js} +7 -741
- package/dist/chunk-7HWS2JGX.js.map +1 -0
- package/dist/{chunk-IDHW2NOP.js → chunk-C6Q5ZAVT.js} +232 -6
- package/dist/chunk-C6Q5ZAVT.js.map +1 -0
- package/dist/{chunk-YI7XVY2D.js → chunk-ON7WP4T6.js} +13 -479
- package/dist/chunk-ON7WP4T6.js.map +1 -0
- package/dist/chunk-PO3MK6IY.js +1231 -0
- package/dist/chunk-PO3MK6IY.js.map +1 -0
- package/dist/chunk-SXCG2REG.js +479 -0
- package/dist/chunk-SXCG2REG.js.map +1 -0
- package/dist/components/index.d.ts +10 -3
- package/dist/components/index.js +3 -4
- package/dist/data/index.d.ts +482 -4
- package/dist/data/index.js +1480 -17
- package/dist/data/index.js.map +1 -1
- package/dist/inbox-page-DZUR-PJ1.d.ts +199 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -5
- package/dist/layouts/index.d.ts +4 -195
- package/dist/layouts/index.js +3 -3
- package/package.json +2 -2
- package/src/components/__tests__/button-a11y.test.tsx +17 -0
- package/src/components/button.tsx +8 -2
- package/src/components/image.tsx +5 -0
- package/src/data/NativeDetailPanel.tsx +8 -1
- package/src/data/index.ts +1 -0
- package/src/data/resource-view/NativeResourceFormSheet.tsx +305 -0
- package/src/data/resource-view/NativeResourceView.tsx +536 -0
- package/src/data/resource-view/NativeResourceWorkspace.tsx +657 -0
- package/src/data/resource-view/__tests__/native-resource-view.test.tsx +977 -0
- package/src/data/resource-view/__tests__/native-resource-workspace.test.tsx +356 -0
- package/src/data/resource-view/display.tsx +259 -0
- package/src/data/resource-view/index.ts +61 -0
- package/src/data/resource-view/mapping.ts +333 -0
- package/src/data/resource-view/messages.ts +121 -0
- package/src/data/resource-view/use-native-resource-view.ts +309 -0
- package/dist/chunk-EFXCJ5AN.js +0 -234
- package/dist/chunk-EFXCJ5AN.js.map +0 -1
- package/dist/chunk-FIITITXO.js +0 -492
- package/dist/chunk-FIITITXO.js.map +0 -1
- package/dist/chunk-IDHW2NOP.js.map +0 -1
- package/dist/chunk-YI7XVY2D.js.map +0 -1
- package/dist/chunk-YJV5MMZX.js.map +0 -1
|
@@ -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","DefaultEmpty","SafeAreaView","createElement","KeyboardAvoidingView","ScrollView","Pressable","Text","useState","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,K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e,EAAE,OAAA,EAAS,KAAA,GAAQ,wBAAwB,IAAA,EAAM,QAAA,EAAU,OAAA,GAAU,IAAA,EAAK,EAAqD;AAC5J,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AACrB,EAAA,OAAO,EAAE,EAAA,EAAI,QAAA,EAAU,KAAA,EAAO,IAAA,EAAM,SAAS,QAAA,EAAS;AACxD","file":"chunk-ON7WP4T6.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`, 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\"\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\">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 stays above the keyboard, attachments, a read receipt, and\n * \"load earlier\" paging.\n *\n * Generic: a support ticket with staff replies, a direct message, a comment\n * thread. Mine are on the trailing side in the tint, theirs on the leading\n * side on `surface`, over the `groupedBackground` page (SettingsPage's iOS\n * palette).\n *\n * Keyboard: with `KeyboardScrollProvider` (the native app shell's\n * `keyboardScroll`, react-native-keyboard-controller's\n * `KeyboardAwareScrollView`), the messages and the composer scroll together\n * and the composer is kept above the keyboard. Without it, a\n * `KeyboardAvoidingView` does the same on iOS. Either way the thread stays\n * scrolled to the newest message as it grows.\n *\n * Read-only: pass `composer={null}` (a closed ticket, a viewer) and an\n * optional `closedNotice`.\n *\n * Slots: `message`, `attachment`, `readReceipt`, `composer`,\n * `composerAccessory` (beside the input: attach a screenshot), `header`\n * (above the messages: what the thread is about), `earlier` and `empty`.\n *\n * @stability Beta\n */\nimport { createElement, useEffect, useRef, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { ActivityIndicator, Image, KeyboardAvoidingView, Platform, Pressable, ScrollView, TextInput, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeText } from \"../components/text\";\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\nimport { useKeyboardScroll } from \"./keyboard\";\n\nexport interface ThreadAttachment {\n id: string;\n /** An image URI (a signed URL, a file:// path). */\n uri: string;\n width?: number;\n height?: number;\n accessibilityLabel?: string;\n onPress?: () => void;\n}\n\nexport interface ThreadMessage {\n id: string;\n body: string;\n /** Sent by the person using the app: trailing side, tint. */\n mine: boolean;\n /** Shown over theirs (\"Support\"); never over mine. */\n authorName?: string;\n timestamp: string | Date;\n /** An optimistic message: `sending`, then `sent`, or `failed` with `onRetry`. */\n status?: \"sending\" | \"sent\" | \"failed\";\n onRetry?: () => void;\n attachments?: ThreadAttachment[];\n}\n\nexport interface ThreadComposer {\n value: string;\n onChangeText: (text: string) => void;\n onSend: () => void;\n /** A send is in flight: the button spins and won't send twice. */\n sending?: boolean;\n placeholder?: string;\n sendLabel?: string;\n /** Turns the send button off (besides an empty or blank value). */\n disabled?: boolean;\n maxLength?: number;\n}\n\n/** What the default parts say. */\nexport interface ThreadLabels {\n /** Who \"mine\" is, to VoiceOver. */\n you: string;\n sending: string;\n notSent: string;\n retryHint: string;\n}\n\nconst DEFAULT_LABELS: ThreadLabels = { you: \"You\", sending: \"Sending\", notSent: \"Not sent. Tap to retry.\", retryHint: \"Double tap to send again\" };\n\nexport type ThreadPageSlotMap = {\n message: ThreadMessage & { testID: string; timeLabel: string; showReadReceipt: boolean; labels: ThreadLabels };\n attachment: ThreadAttachment & { testID: string; mine: boolean };\n readReceipt: { label: string; testID: string };\n /** `accessory` is the `composerAccessory` slot, already rendered. */\n composer: ThreadComposer & { testID: string; accessory?: ReactNode };\n composerAccessory: { testID: string };\n header: { testID: string };\n earlier: { loading: boolean; onPress: () => void; label: string; testID: string };\n empty: { title: string; body: string; 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 messages (what the thread is about). 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: shows a \"load earlier\" button at the top. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\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\nfunction defaultTime(date: Date): string {\n return date.toLocaleString(undefined, { month: \"short\", day: \"numeric\", hour: \"numeric\", minute: \"2-digit\" });\n}\n\n/** The newest of my messages the other side has read, or null. */\nexport function readReceiptFor(messages: readonly ThreadMessage[], readAt: string | Date | null | undefined): string | null {\n if (!readAt) return null;\n const read = toDate(readAt).getTime();\n for (let i = messages.length - 1; i >= 0; i--) {\n const m = messages[i]!;\n if (m.mine && m.status !== \"sending\" && m.status !== \"failed\" && toDate(m.timestamp).getTime() <= read) return m.id;\n }\n return null;\n}\n\ninterface ScrollLike {\n scrollToEnd?: (options?: { animated?: boolean }) => void;\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 emptyTitle,\n emptyBody,\n formatTime = defaultTime,\n labels: labelOverrides,\n slots = {},\n slotProps = {},\n testID = \"thread-page\",\n}: ThreadPageProps) {\n const colors = useThemeRoles();\n const KeyboardScroll = useKeyboardScroll();\n const scrollRef = useRef<ScrollLike | null>(null);\n const receiptFor = readReceiptFor(messages, readAt);\n const labels: ThreadLabels = { ...DEFAULT_LABELS, ...labelOverrides };\n const newest = messages[messages.length - 1]?.id;\n\n // Keep the newest message in view when one arrives (or is sent).\n useEffect(() => {\n scrollRef.current?.scrollToEnd?.({ animated: true });\n }, [newest]);\n\n const body = (\n <View style={{ flexGrow: 1 }}>\n {header ?? renderSlot(Nothing, slots.header, { testID: `${testID}-header` }, slotProps.header)}\n {hasEarlier && onLoadEarlier\n ? renderSlot(\n DefaultEarlier,\n slots.earlier,\n { loading: loadingEarlier, onPress: onLoadEarlier, label: earlierLabel, testID: `${testID}-earlier` },\n slotProps.earlier,\n )\n : null}\n <View testID={`${testID}-messages`} accessibilityRole=\"list\" style={{ flexGrow: 1, justifyContent: \"flex-end\", paddingHorizontal: 12, paddingVertical: 8, gap: 6 }}>\n {messages.length === 0\n ? renderSlot(\n DefaultEmpty,\n slots.empty,\n { title: emptyTitle ?? \"No messages yet\", body: emptyBody ?? \"Write the first one below.\", testID: `${testID}-empty` },\n slotProps.empty,\n )\n : messages.map((message) => (\n <View key={message.id}>\n {renderSlot(\n DefaultMessage,\n slots.message,\n {\n ...message,\n testID: `${testID}-message-${message.id}`,\n timeLabel: formatTime(toDate(message.timestamp)),\n showReadReceipt: message.id === receiptFor,\n labels,\n },\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 </View>\n </View>\n );\n\n const footer = composer ? (\n renderSlot(\n DefaultComposer,\n slots.composer,\n {\n ...composer,\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 page = { flex: 1, backgroundColor: colors.groupedBackground };\n const onContentSizeChange = () => scrollRef.current?.scrollToEnd?.({ animated: false });\n\n if (KeyboardScroll) {\n // The composer scrolls with the messages, so the keyboard-aware view keeps it (the focused input) above the keyboard.\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={page}>\n {createElement(\n KeyboardScroll as never,\n {\n ref: scrollRef,\n testID: `${testID}-keyboard`,\n keyboardShouldPersistTaps: \"handled\",\n contentInsetAdjustmentBehavior: \"automatic\",\n contentContainerStyle: { flexGrow: 1 },\n bottomOffset: 8,\n onContentSizeChange,\n } as never,\n body,\n footer,\n )}\n </SafeAreaView>\n );\n }\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={page}>\n <KeyboardAvoidingView testID={`${testID}-kav`} style={{ flex: 1 }} behavior={Platform.OS === \"ios\" ? \"padding\" : undefined} keyboardVerticalOffset={Platform.OS === \"ios\" ? 100 : 0}>\n <ScrollView\n ref={scrollRef as never}\n testID={`${testID}-scroll`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ flexGrow: 1 }}\n onContentSizeChange={onContentSizeChange}\n >\n {body}\n </ScrollView>\n {footer}\n </KeyboardAvoidingView>\n </SafeAreaView>\n );\n}\n\nfunction Nothing(_props: { testID: string }) {\n return null;\n}\n\nfunction DefaultEarlier({ loading, onPress, label, testID }: ThreadPageSlotMap[\"earlier\"]) {\n return (\n <View style={{ alignItems: \"center\", paddingTop: 8 }}>\n <NativeButton variant=\"ghost\" size=\"sm\" onPress={onPress} loading={loading} testID={testID}>\n {label}\n </NativeButton>\n </View>\n );\n}\n\nfunction DefaultEmpty({ title, body, testID }: ThreadPageSlotMap[\"empty\"]) {\n return <NativeEmptyState variant=\"first-run\" title={title} body={body} testID={testID} />;\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\nfunction DefaultMessage(message: ThreadPageSlotMap[\"message\"]) {\n const colors = useThemeRoles();\n const failed = message.status === \"failed\";\n const { labels } = message;\n const label = [message.mine ? labels.you : (message.authorName ?? \"\"), message.body, message.timeLabel, failed ? labels.notSent : message.status === \"sending\" ? labels.sending : null]\n .filter(Boolean)\n .join(\", \");\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 accessibilityLabel={label}\n accessibilityHint={failed && message.onRetry ? labels.retryHint : undefined}\n onPress={failed ? message.onRetry : undefined}\n style={{\n maxWidth: \"80%\",\n paddingHorizontal: 14,\n paddingVertical: 8,\n borderRadius: 18,\n backgroundColor: message.mine ? colors.tint : colors.surface,\n opacity: message.status === \"sending\" ? 0.6 : 1,\n }}\n >\n <NativeText className={message.mine ? \"text-primary-foreground\" : undefined} style={message.mine ? MINE_TEXT : { ...MINE_TEXT, color: colors.label }}>\n {message.body}\n </NativeText>\n </Pressable>\n <NativeText\n testID={`${message.testID}-time`}\n style={{ marginTop: 2, marginHorizontal: 12, color: failed ? colors.destructive : colors.tertiaryLabel, fontSize: 11, lineHeight: 14 }}\n >\n {failed ? labels.notSent : message.timeLabel}\n </NativeText>\n </View>\n );\n}\n\nfunction DefaultAttachment({ uri, width, height, accessibilityLabel, onPress, testID }: ThreadPageSlotMap[\"attachment\"]) {\n const ratio = width && height ? width / height : 0.6;\n const w = 140;\n return (\n <Pressable testID={testID} accessibilityRole=\"image\" accessibilityLabel={accessibilityLabel ?? \"Attachment\"} onPress={onPress} disabled={!onPress}>\n <Image source={{ uri }} style={{ width: w, height: Math.round(w / ratio), borderRadius: 12 }} resizeMode=\"cover\" />\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({\n value,\n onChangeText,\n onSend,\n sending = false,\n placeholder = \"Message\",\n sendLabel = \"Send\",\n disabled = false,\n maxLength,\n testID,\n accessory,\n}: ThreadPageSlotMap[\"composer\"]) {\n const colors = useThemeRoles();\n const blank = !value.trim();\n return (\n <View\n testID={testID}\n style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 8, paddingHorizontal: 12, paddingTop: 8, paddingBottom: 8, backgroundColor: colors.groupedBackground }}\n >\n {accessory}\n <TextInput\n testID={`${testID}-input`}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={placeholder}\n multiline\n maxLength={maxLength}\n editable={!sending}\n style={{\n flex: 1,\n minHeight: 36,\n maxHeight: 120,\n paddingHorizontal: 14,\n paddingTop: 8,\n paddingBottom: 8,\n borderRadius: 18,\n fontSize: 17,\n color: colors.label as string,\n backgroundColor: colors.surface,\n }}\n />\n {sending ? (\n <View style={{ height: 36, justifyContent: \"center\", paddingHorizontal: 8 }}>\n <ActivityIndicator testID={`${testID}-sending`} accessibilityLabel=\"Sending\" />\n </View>\n ) : (\n <NativeButton size=\"sm\" onPress={onSend} disabled={disabled || blank} testID={`${testID}-send`}>\n {sendLabel}\n </NativeButton>\n )}\n </View>\n );\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\">{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"]}
|