@marktiderman/genesis-ui-native 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +4 -1
  2. package/dist/{chunk-KH2RVAI5.js → chunk-DHONOH6K.js} +24 -210
  3. package/dist/chunk-DHONOH6K.js.map +1 -0
  4. package/dist/{chunk-O4BMDV7I.js → chunk-FGIIBON3.js} +333 -21
  5. package/dist/chunk-FGIIBON3.js.map +1 -0
  6. package/dist/{chunk-YWDDDYDI.js → chunk-FOJJB6AB.js} +2 -2
  7. package/dist/{chunk-YWDDDYDI.js.map → chunk-FOJJB6AB.js.map} +1 -1
  8. package/dist/{chunk-IXC3LO2K.js → chunk-JZ7RAGDQ.js} +44 -36
  9. package/dist/chunk-JZ7RAGDQ.js.map +1 -0
  10. package/dist/{chunk-RTYO24SC.js → chunk-PWS2HLDE.js} +63 -31
  11. package/dist/chunk-PWS2HLDE.js.map +1 -0
  12. package/dist/{chunk-3KFUS7O6.js → chunk-PWYMRUAK.js} +43 -30
  13. package/dist/chunk-PWYMRUAK.js.map +1 -0
  14. package/dist/{chunk-GBNIBHSU.js → chunk-T7FEVT62.js} +53 -12
  15. package/dist/chunk-T7FEVT62.js.map +1 -0
  16. package/dist/{chunk-7NDKIIOT.js → chunk-UZCJDMGE.js} +353 -19
  17. package/dist/chunk-UZCJDMGE.js.map +1 -0
  18. package/dist/components/index.d.ts +229 -23
  19. package/dist/components/index.js +5 -6
  20. package/dist/data/index.d.ts +2 -1
  21. package/dist/data/index.js +7 -12
  22. package/dist/data/index.js.map +1 -1
  23. package/dist/hooks/index.d.ts +7 -3
  24. package/dist/hooks/index.js +2 -3
  25. package/dist/icons/lucide.d.ts +1 -1
  26. package/dist/icons/lucide.js +13 -3
  27. package/dist/icons/lucide.js.map +1 -1
  28. package/dist/{inbox-page-B7_Oi2fS.d.ts → inbox-page-BGqR_cBs.d.ts} +4 -1
  29. package/dist/index.d.ts +4 -4
  30. package/dist/index.js +8 -9
  31. package/dist/layouts/index.d.ts +12 -3
  32. package/dist/layouts/index.js +5 -6
  33. package/dist/{native-modules-DEJJQhDx.d.ts → native-modules-CeAaO2Dh.d.ts} +26 -2
  34. package/package.json +49 -1
  35. package/src/__tests__/native-modules-lists.test.tsx +1 -0
  36. package/src/components/__tests__/bulk-bar.test.tsx +36 -0
  37. package/src/components/__tests__/button-haptic.test.tsx +22 -0
  38. package/src/components/__tests__/composer-bar.test.tsx +116 -1
  39. package/src/components/__tests__/gallery-grid.test.tsx +2 -2
  40. package/src/components/__tests__/library-round-5.test.tsx +121 -0
  41. package/src/components/__tests__/share-sheet.test.tsx +47 -0
  42. package/src/components/__tests__/swipe-row-context-menu.test.tsx +215 -0
  43. package/src/components/__tests__/tab-bar.test.tsx +43 -0
  44. package/src/components/__tests__/thread-list.test.tsx +137 -0
  45. package/src/components/__tests__/tier-badge.test.tsx +57 -0
  46. package/src/components/__tests__/whats-new-sheet.test.tsx +29 -0
  47. package/src/components/bulk-bar.tsx +91 -0
  48. package/src/components/button.tsx +74 -35
  49. package/src/components/choice-card.tsx +104 -0
  50. package/src/components/composer-bar.tsx +20 -19
  51. package/src/components/context-menu.tsx +101 -0
  52. package/src/components/gallery-grid.tsx +10 -4
  53. package/src/components/index.ts +18 -1
  54. package/src/components/inline-alert.tsx +36 -1
  55. package/src/components/input.tsx +3 -0
  56. package/src/components/progress.tsx +24 -2
  57. package/src/components/rating.tsx +35 -16
  58. package/src/components/share-sheet.tsx +127 -0
  59. package/src/components/sheet.tsx +9 -1
  60. package/src/components/swipe-row.tsx +74 -0
  61. package/src/components/tab-bar.tsx +133 -0
  62. package/src/components/tabs.tsx +2 -0
  63. package/src/components/text.tsx +3 -0
  64. package/src/components/textarea.tsx +3 -0
  65. package/src/components/thread-list.tsx +48 -23
  66. package/src/components/tier-badge.tsx +74 -0
  67. package/src/components/whats-new-sheet.tsx +89 -0
  68. package/src/data/resource-view/NativeRecordView.tsx +3 -8
  69. package/src/data/resource-view/use-native-resource-view.ts +2 -2
  70. package/src/hooks/index.ts +1 -1
  71. package/src/hooks/use-theme-roles.ts +3 -0
  72. package/src/icon-names.ts +12 -2
  73. package/src/icons/lucide.ts +27 -7
  74. package/src/layouts/__tests__/inbox-page.test.tsx +26 -7
  75. package/src/layouts/__tests__/thread-page.test.tsx +89 -2
  76. package/src/layouts/inbox-page.tsx +28 -12
  77. package/src/layouts/thread-page.tsx +69 -8
  78. package/src/native-modules.tsx +16 -0
  79. package/dist/chunk-3KFUS7O6.js.map +0 -1
  80. package/dist/chunk-7NDKIIOT.js.map +0 -1
  81. package/dist/chunk-CAI7LGN6.js +0 -39
  82. package/dist/chunk-CAI7LGN6.js.map +0 -1
  83. package/dist/chunk-GBNIBHSU.js.map +0 -1
  84. package/dist/chunk-IXC3LO2K.js.map +0 -1
  85. package/dist/chunk-KH2RVAI5.js.map +0 -1
  86. package/dist/chunk-O4BMDV7I.js.map +0 -1
  87. package/dist/chunk-RTYO24SC.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/text.tsx","../src/components/button.tsx","../src/components/sheet.tsx","../src/components/empty-state.tsx","../src/icon-names.ts","../src/components/icon.tsx","../src/components/list-item.tsx","../src/components/section-list.tsx","../src/components/refresh-control.tsx","../src/components/badge.tsx","../src/components/input.tsx","../src/components/skeleton.tsx","../src/components/loading-state.tsx","../src/components/context-menu.tsx","../src/components/swipe-row.tsx"],"names":["RNText","cva","jsx","jsxs","Pressable","View","Text","Platform","Fragment","useEffect","useRef","Animated","ActivityIndicator"],"mappings":";;;;;;;;;;AAUA,IAAM,YAAA,GAAe,IAAI,iBAAA,EAAmB;AAAA,EAC1C,QAAA,EAAU;AAAA,IACR,MAAA,EAAQ;AAAA,MACN,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,IA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kBAAA,EAAoB,QAAA,CAAS,MAAA,GAAS,KAAA,CAAM,QAAQ,CAAA,GAAI,MAAA;AAAA,MAEvD;AAAA;AAAA,GACH;AAEJ","file":"chunk-FGIIBON3.js","sourcesContent":["/**\n * Text — typography primitive with semantic presets (h1, h2, body, caption, etc.).\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type { ComponentRef, Ref } from \"react\";\nimport { Text as RNText, type TextProps } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst textVariants = cva(\"text-foreground\", {\n variants: {\n preset: {\n h1: \"text-3xl font-bold leading-9\",\n h2: \"text-2xl font-bold leading-8\",\n h3: \"text-xl font-semibold leading-7\",\n h4: \"text-lg font-semibold leading-7\",\n body: \"text-base font-normal leading-6\",\n \"body-sm\": \"text-sm font-normal leading-5\",\n caption: \"text-xs font-normal leading-4\",\n label: \"text-sm font-medium leading-5\",\n },\n },\n defaultVariants: {\n preset: \"body\",\n },\n});\n\n// `className` is declared explicitly here — not inherited from react-native's\n// `TextProps` via NativeWind's global augmentation, which does not resolve across\n// the RN / nativewind / react-native-css-interop version matrix. Mirrors every\n// other ui-native primitive (Button, Tooltip, ChipGroup, …); the implementation\n// already consumes `className` below.\nexport interface NativeTextProps\n extends TextProps,\n VariantProps<typeof textVariants> {\n /** NativeWind utility class string applied to the underlying Text. */\n className?: string;\n /** The underlying Text (React 19 passes `ref` as a prop). */\n ref?: Ref<ComponentRef<typeof RNText>> | undefined;\n}\n\n/**\n * Allowed `preset` values on {@link NativeText}. Re-exported as a named type\n * so consumer brand packages can build preset-driven typography APIs without\n * having to reach into `NativeTextProps['preset']` themselves.\n *\n * Example (consumer):\n * ```ts\n * import type { TextPreset } from \"@marktiderman/genesis-ui-native\";\n * function Heading({ as }: { as: TextPreset }) { ... }\n * ```\n */\nexport type TextPreset = NonNullable<NativeTextProps[\"preset\"]>;\n\nfunction NativeText({\n className,\n preset,\n children,\n ...props\n}: NativeTextProps) {\n return (\n <RNText\n className={cn(textVariants({ preset }), className)}\n {...props}\n >\n {children}\n </RNText>\n );\n}\n\nexport { NativeText, textVariants };\n","/**\n * Button — primary touch target. Variants: default, secondary, outline, ghost, destructive,\n * gradient (the brand's `gradients.primary` from the nearest `GenesisThemeProvider`, else the\n * primary).\n * It answers a touch with `usePressFeedback`: what's inside shrinks a little while held (or dims\n * under Reduce Motion), the same as every Genesis pressable. The background stays still. Layout\n * classes in `className` (`justify-start`, `gap-3`, `flex-col`) apply to what's inside.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type { ComponentRef, Ref } from \"react\";\nimport { ActivityIndicator, Animated, Pressable, Text, View, type AccessibilityState, type StyleProp, type ViewStyle } from \"react-native\";\nimport { brandGradientCss, useOptionalTheme } from \"@marktiderman/genesis-design-system\";\nimport type { HapticKind } from \"../hooks/use-haptics\";\nimport { usePressFeedback } from \"../hooks/use-press-feedback\";\nimport { cn } from \"../utils\";\n\nconst buttonVariants = cva(\n \"flex-row items-center justify-center rounded-md\",\n {\n variants: {\n variant: {\n default: \"bg-primary\",\n secondary: \"bg-secondary\",\n outline: \"border border-input bg-transparent\",\n ghost: \"bg-transparent\",\n destructive: \"bg-destructive\",\n gradient: \"bg-primary\",\n },\n size: {\n sm: \"h-9 px-3 gap-1.5\",\n md: \"h-10 px-4 gap-2\",\n lg: \"h-11 px-8 gap-2\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nconst buttonTextVariants = cva(\"font-medium text-center\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n outline: \"text-foreground\",\n ghost: \"text-foreground\",\n destructive: \"text-destructive-foreground\",\n gradient: \"text-primary-foreground\",\n },\n size: {\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\n/** How what's inside is laid out: the same gap per size as the button's own. */\nconst contentVariants = cva(\"flex-row items-center justify-center\", {\n variants: { size: { sm: \"gap-1.5\", md: \"gap-2\", lg: \"gap-2\" } },\n defaultVariants: { size: \"md\" },\n});\n\n/** A caller's classes that lay out the button's content, which now sits a level inside it. */\nconst contentClasses = (className: string | undefined) =>\n className\n ?.split(/\\s+/)\n .filter((c) => /^(flex-(row|col)|justify-|items-|gap-)/.test(c))\n .join(\" \");\n\nexport interface NativeButtonProps\n extends VariantProps<typeof buttonVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n onPress?: () => void;\n disabled?: boolean;\n loading?: boolean;\n testID?: string;\n /** What a screen reader says, when the text alone isn't enough (\"Vote for Dark mode\"). Default: the text. */\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /** Merged with the button's own `disabled` and `busy`: `{ selected: true }` for a vote cast, a filter on. */\n accessibilityState?: AccessibilityState;\n /**\n * A haptic through `GenesisModules.haptics` (`light` for a vote, `success` for a save): it plays\n * when the press counts, except `select`, which ticks on press-in as `usePressFeedback` does. Default none.\n */\n haptic?: HapticKind | undefined;\n /** Styles for the pressable, after the classes: colors or sizes from a theme object. */\n style?: StyleProp<ViewStyle> | undefined;\n /** The pressable (React 19 passes `ref` as a prop). */\n ref?: Ref<ComponentRef<typeof View>> | undefined;\n}\n\nfunction NativeButton({\n className,\n textClassName,\n variant,\n size,\n children,\n onPress,\n disabled,\n loading,\n accessibilityState,\n haptic,\n style,\n ...props\n}: NativeButtonProps) {\n const isDisabled = disabled || loading;\n const theme = useOptionalTheme();\n // React Native 0.80+ paints a CSS gradient as `experimental_backgroundImage`; older versions\n // ignore it and the `bg-primary` underneath shows.\n const gradient = variant === \"gradient\" && theme ? brandGradientCss(theme.brand) : undefined;\n const gradientStyle = gradient ? ({ experimental_backgroundImage: gradient } as ViewStyle) : undefined;\n const feedback = usePressFeedback({ haptic: onPress ? (haptic ?? false) : false, disabled: Boolean(isDisabled) });\n const press = onPress\n ? () => {\n feedback.confirm();\n onPress();\n }\n : undefined;\n\n return (\n <Pressable\n className={cn(\n buttonVariants({ variant, size }),\n isDisabled && \"opacity-50\",\n className\n )}\n onPress={press}\n onPressIn={feedback.onPressIn}\n onPressOut={feedback.onPressOut}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ ...accessibilityState, disabled: isDisabled, busy: loading ?? accessibilityState?.busy }}\n {...props}\n // The brand gradient under the caller's own style, not replaced by it.\n style={gradientStyle ? (style ? [gradientStyle, style] : gradientStyle) : style}\n >\n {/* Inside the Pressable, which keeps the button's size and classes: a wrapper would lose a `flex-1`. */}\n <Animated.View style={[{ flexGrow: 1 }, feedback.style]}>\n <View className={cn(contentVariants({ size }), contentClasses(className))}>\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={\n variant === \"outline\" || variant === \"ghost\"\n ? undefined\n : \"white\"\n }\n />\n ) : null}\n {typeof children === \"string\" ? (\n <Text\n className={cn(\n buttonTextVariants({ variant, size }),\n textClassName\n )}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </View>\n </Animated.View>\n </Pressable>\n );\n}\n\nexport { NativeButton, buttonVariants, buttonTextVariants };\n","/**\n * Sheet / BottomSheet — modal that slides up from the bottom.\n *\n * Use for non-blocking selections, filters, and short flows that benefit\n * from preserving screen context. For blocking confirmations, use\n * <NativeDialog>. For full-screen flows, use a navigation route.\n *\n * By default this is React Native's own `Modal`, which needs nothing mounted\n * above it: the system page sheet on iOS (swipe down to close) and a bottom\n * panel over a scrim on Android (back button or a tap on the scrim closes\n * it). Content gets its own safe area (`useSafeAreaInsets` inside the sheet\n * is the sheet's), and the bottom inset is padded. Put scrolling content in\n * `NativeSheetScrollView`. The sheet doesn't move above the keyboard.\n *\n * `@gorhom/bottom-sheet` (snap points, drag between heights) is used only\n * when the app opts in by mounting `<NativeSheetProvider bottomSheet={…}>`\n * (or passing `bottomSheet` to `GenesisNativeApp`), never because the\n * library happens to be installed: it throws on open unless its\n * `BottomSheetModalProvider` is mounted, and it needs gesture-handler's\n * `GestureHandlerRootView` at the root and Reanimated set up.\n * `snapPoints` and `initialSnapIndex` apply only to that path.\n *\n * A short menu or form passes `fitContent`: the sheet is as tall as what is in it.\n *\n * A sheet that is a screen of its own (a link can open it) belongs in the\n * router instead: an expo-router screen with `presentation: \"formSheet\"` and\n * `sheetAllowedDetents` (e.g. `[0.5, 1]`) is the system sheet with detents.\n *\n * @stability Beta\n */\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n type ComponentType,\n type ReactNode,\n} from \"react\";\nimport { AccessibilityInfo, Dimensions, KeyboardAvoidingView, Modal, Platform, Pressable, ScrollView, View, type ScrollViewProps, type ViewStyle } from \"react-native\";\nimport { SafeAreaProvider, useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\n\nexport interface NativeSheetProps {\n /** Controlled visibility. */\n open: boolean;\n /** Fired when the user dismisses the sheet (backdrop, swipe down, Android back). Set `open` false in it. */\n onOpenChange: (open: boolean) => void;\n /** Snap points, with `@gorhom/bottom-sheet` only (see `NativeSheetProvider`). e.g. [\"25%\", \"50%\", \"90%\"]. */\n snapPoints?: (string | number)[];\n /** Index of initial snap point, with `@gorhom/bottom-sheet` only. Default 0. */\n initialSnapIndex?: number;\n /** Keep the sheet open when the user taps the backdrop, swipes it down or presses Android back. Default false. */\n disableBackdropDismiss?: boolean;\n /**\n * As tall as its content (up to 90% of the screen) instead of the full page sheet, for a short\n * menu or form. On iOS this is a bottom panel over a scrim, like Android's (a tap on the scrim\n * or the VoiceOver escape gesture closes it; it doesn't follow a swipe down), and it moves above\n * the keyboard. Under `NativeSheetProvider` the library sizes it (`enableDynamicSizing`) and\n * `snapPoints` is ignored. Default false.\n */\n fitContent?: boolean;\n /** The sheet has finished going, where the platform says so (iOS's modal, the library): another modal can present now. */\n onDismissed?: () => void;\n children: ReactNode;\n testID?: string;\n}\n\ntype AnyComponent = ComponentType<Record<string, unknown>>;\n\n/**\n * The parts of `@gorhom/bottom-sheet` (v5) the sheet uses. Pass the whole\n * module: `import * as BottomSheet from \"@gorhom/bottom-sheet\"`.\n */\nexport interface NativeSheetLibrary {\n BottomSheetModal: unknown;\n BottomSheetView: unknown;\n BottomSheetBackdrop: unknown;\n BottomSheetModalProvider: unknown;\n /** Used by `NativeSheetScrollView` when present. */\n BottomSheetScrollView?: unknown;\n}\n\nconst REQUIRED_EXPORTS = [\"BottomSheetModal\", \"BottomSheetView\", \"BottomSheetBackdrop\", \"BottomSheetModalProvider\"] as const;\n\nconst SheetLibraryContext = createContext<NativeSheetLibrary | null>(null);\n\nexport interface NativeSheetProviderProps {\n /**\n * `@gorhom/bottom-sheet` v5 (`import * as BottomSheet from \"@gorhom/bottom-sheet\"`).\n * Read once. The app must also wrap its root in gesture-handler's\n * `GestureHandlerRootView` and set Reanimated up, as the library requires.\n * Sheet content renders in the library's portal, inside this provider:\n * mount it below the providers sheets read (data, session, navigation).\n */\n bottomSheet: NativeSheetLibrary;\n children: ReactNode;\n}\n\n/**\n * Opts every `NativeSheet` below it into `@gorhom/bottom-sheet` and mounts\n * the library's `BottomSheetModalProvider`. A module missing any export the\n * sheet needs is reported with `console.error` and ignored, so sheets fall\n * back to the native modal instead of crashing on open.\n *\n * @stability Beta\n */\nexport function NativeSheetProvider({ bottomSheet, children }: NativeSheetProviderProps) {\n // Frozen: a different module later would remount everything below the provider.\n const [library] = useState(() => (isSheetLibrary(bottomSheet) ? bottomSheet : null));\n const [problem] = useState(() => (library ? null : invalidLibraryMessage(bottomSheet)));\n useEffect(() => {\n if (problem) console.error(problem);\n }, [problem]);\n if (!library) return <>{children}</>;\n const Provider = library.BottomSheetModalProvider as ComponentType<{ children: ReactNode }>;\n return (\n <SheetLibraryContext.Provider value={library}>\n <Provider>{children}</Provider>\n </SheetLibraryContext.Provider>\n );\n}\n\nfunction isSheetLibrary(value: unknown): value is NativeSheetLibrary {\n if (!value || typeof value !== \"object\") return false;\n const mod = value as Record<string, unknown>;\n return REQUIRED_EXPORTS.every((name) => mod[name] != null);\n}\n\nfunction invalidLibraryMessage(value: unknown): string {\n const mod = (value && typeof value === \"object\" ? value : {}) as Record<string, unknown>;\n const missing = REQUIRED_EXPORTS.filter((name) => mod[name] == null);\n return (\n `NativeSheetProvider: \\`bottomSheet\\` is missing ${missing.join(\", \")}, so sheets use the native modal. ` +\n 'Pass the whole module: `import * as BottomSheet from \"@gorhom/bottom-sheet\"`.'\n );\n}\n\n/** @stability Beta */\nexport function NativeSheet(props: NativeSheetProps) {\n const library = useContext(SheetLibraryContext);\n if (library) return <LibrarySheet library={library} {...props} />;\n return <ModalSheet {...props} />;\n}\n\n/**\n * A `ScrollView` for sheet content: the library's `BottomSheetScrollView`\n * under `NativeSheetProvider` (so scrolling and dragging the sheet don't\n * fight), React Native's otherwise. Sized to its content until it reaches\n * the sheet's height.\n *\n * @stability Beta\n */\nexport function NativeSheetScrollView({ style, ...props }: ScrollViewProps) {\n const library = useContext(SheetLibraryContext);\n const Scroll = (library?.BottomSheetScrollView as ComponentType<ScrollViewProps> | undefined) ?? ScrollView;\n const own: ViewStyle = { flexGrow: 0 };\n return <Scroll style={[own, ...(Array.isArray(style) ? style : style ? [style] : [])]} {...props} />;\n}\n\ntype SheetHandle = { present: () => void; dismiss: () => void };\n\nfunction LibrarySheet({\n library,\n open,\n onOpenChange,\n snapPoints = [\"50%\", \"90%\"],\n initialSnapIndex = 0,\n disableBackdropDismiss = false,\n fitContent = false,\n onDismissed,\n testID,\n children,\n}: NativeSheetProps & { library: NativeSheetLibrary }) {\n const sheet = useRef<SheetHandle | null>(null);\n // What the app asked for last, read when the library reports a dismiss: a dismiss\n // that finishes after the app reopened the sheet is not the user closing it.\n const wanted = useRef(open);\n const onOpenChangeRef = useRef(onOpenChange);\n onOpenChangeRef.current = onOpenChange;\n const onDismissedRef = useRef(onDismissed);\n onDismissedRef.current = onDismissed;\n\n // Child refs are attached before this runs, so the first render presents too.\n useEffect(() => {\n wanted.current = open;\n if (open) sheet.current?.present();\n else sheet.current?.dismiss();\n }, [open]);\n\n const BottomSheetModal = library.BottomSheetModal as AnyComponent;\n const BottomSheetView = library.BottomSheetView as AnyComponent;\n const BottomSheetBackdrop = library.BottomSheetBackdrop as AnyComponent;\n\n const onDismiss = useCallback(() => {\n if (wanted.current) {\n wanted.current = false;\n onOpenChangeRef.current(false);\n }\n onDismissedRef.current?.();\n }, []);\n const backdrop = useCallback(\n (p: Record<string, unknown>) => (\n <BottomSheetBackdrop\n {...p}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n pressBehavior={disableBackdropDismiss ? \"none\" : \"close\"}\n />\n ),\n [BottomSheetBackdrop, disableBackdropDismiss],\n );\n\n return (\n <BottomSheetModal\n ref={sheet}\n snapPoints={fitContent ? undefined : snapPoints}\n index={fitContent ? 0 : initialSnapIndex}\n // v5 sizes to the content by default and adds that as a snap point, which would shift the\n // indexes: only a sheet that fits its content asks for it, and then it is the only one.\n enableDynamicSizing={fitContent}\n // Long content would otherwise grow the sheet to the full height, under the status bar.\n {...(fitContent ? { maxDynamicContentSize: Math.round(Dimensions.get(\"window\").height * 0.9) } : {})}\n onDismiss={onDismiss}\n enablePanDownToClose={!disableBackdropDismiss}\n backdropComponent={backdrop}\n >\n <BottomSheetView testID={testID ?? \"native-sheet\"}>{children}</BottomSheetView>\n </BottomSheetModal>\n );\n}\n\n/**\n * Whether Reduce Motion is on, or `null` until the system has answered: a\n * sheet mounted open waits for it, since the presentation animation is\n * chosen when the sheet is presented.\n */\nfunction useReduceMotionAnswer(): boolean | null {\n const [reduced, setReduced] = useState<boolean | null>(null);\n useEffect(() => {\n let mounted = true;\n AccessibilityInfo.isReduceMotionEnabled().then(\n (value) => mounted && setReduced(value),\n () => mounted && setReduced(false),\n );\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", (value: boolean) => setReduced(value));\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n return reduced;\n}\n\n/**\n * React Native's `Modal`, which needs no provider. iOS: the system page\n * sheet (`presentationStyle=\"pageSheet\"`), following the finger when swiped\n * down (`allowSwipeDismissal`); with `disableBackdropDismiss` a swipe only\n * asks and the sheet springs back. Android: a transparent modal with a scrim\n * and a panel at the bottom, drawn under the system bars. `fitContent` on iOS: the same bottom\n * panel, kept above the keyboard.\n */\nfunction ModalSheet({ open, onOpenChange, disableBackdropDismiss = false, fitContent = false, onDismissed, testID, children }: NativeSheetProps) {\n const reducedMotion = useReduceMotionAnswer();\n const roles = useThemeRoles();\n const requestClose = () => {\n if (!disableBackdropDismiss) onOpenChange(false);\n };\n const visible = open && reducedMotion !== null;\n const animationType = reducedMotion ? \"none\" : \"slide\";\n const id = testID ?? \"native-sheet\";\n\n const ios = Platform.OS === \"ios\";\n if (ios && !fitContent) {\n return (\n <Modal\n visible={visible}\n animationType={animationType}\n presentationStyle=\"pageSheet\"\n allowSwipeDismissal={!disableBackdropDismiss}\n backdropColor={roles.background}\n onRequestClose={requestClose}\n onDismiss={onDismissed}\n >\n <SafeAreaProvider>\n <SheetBody\n testID={id}\n onAccessibilityEscape={disableBackdropDismiss ? undefined : requestClose}\n style={{ flex: 1, backgroundColor: roles.background }}\n >\n {children}\n </SheetBody>\n </SafeAreaProvider>\n </Modal>\n );\n }\n\n return (\n <Modal\n visible={visible}\n transparent\n animationType={animationType}\n statusBarTranslucent\n navigationBarTranslucent\n onRequestClose={requestClose}\n onDismiss={onDismissed}\n >\n <SafeAreaProvider>\n <KeyboardPanel ios={ios}>\n <Pressable\n testID={`${id}-backdrop`}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n disabled={disableBackdropDismiss}\n importantForAccessibility={disableBackdropDismiss ? \"no-hide-descendants\" : \"auto\"}\n onPress={requestClose}\n style={{ position: \"absolute\", top: 0, right: 0, bottom: 0, left: 0, backgroundColor: \"rgba(0,0,0,0.4)\" }}\n />\n <SheetBody\n testID={id}\n onAccessibilityEscape={disableBackdropDismiss ? undefined : requestClose}\n style={{\n maxHeight: \"90%\",\n borderTopLeftRadius: 28,\n borderTopRightRadius: 28,\n backgroundColor: roles.surface,\n paddingTop: 12,\n }}\n >\n <View\n style={{ alignSelf: \"center\", width: 32, height: 4, borderRadius: 2, marginBottom: 8, backgroundColor: roles.tertiaryLabel }}\n />\n {children}\n </SheetBody>\n </KeyboardPanel>\n </SafeAreaProvider>\n </Modal>\n );\n}\n\n/**\n * The bottom panel's frame: on iOS it moves up with the keyboard, less the home indicator's\n * inset the sheet already pads, so it sits on the keyboard without a gap.\n */\nfunction KeyboardPanel({ ios, children }: { ios: boolean; children: ReactNode }) {\n const insets = useSafeAreaInsets();\n return (\n <KeyboardAvoidingView behavior={ios ? \"padding\" : undefined} keyboardVerticalOffset={ios ? -insets.bottom : 0} style={{ flex: 1, justifyContent: \"flex-end\" }}>\n {children}\n </KeyboardAvoidingView>\n );\n}\n\n/** The sheet's root, padded by the sheet's own bottom inset (the home indicator, the navigation bar). */\nfunction SheetBody({\n testID,\n style,\n onAccessibilityEscape,\n children,\n}: {\n testID: string;\n style: ViewStyle;\n onAccessibilityEscape?: () => void;\n children: ReactNode;\n}) {\n const insets = useSafeAreaInsets();\n return (\n <View testID={testID} accessibilityViewIsModal onAccessibilityEscape={onAccessibilityEscape} style={{ ...style, paddingBottom: insets.bottom }}>\n {children}\n </View>\n );\n}\n","/**\n * EmptyState — what to show when a list / screen has no data.\n *\n * Three semantic variants drive default messaging:\n * - \"first-run\": user has never had data here. Optimistic.\n * - \"no-results\": user filtered/searched and got nothing. Suggest reset.\n * - \"error\": fetching failed. Suggest retry.\n *\n * The variant only sets sensible defaults for `title` and tone — pass\n * your own `title`, `body`, `primaryAction`, `secondaryAction`, etc. to\n * override. Mirrors the @marktiderman/genesis-ui web `<EmptyState>` API where\n * possible (illustration vs icon slot, primary/secondary actions).\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport type NativeEmptyStateVariant = \"first-run\" | \"no-results\" | \"error\";\n\n/**\n * Action descriptor for primary/secondary CTAs. Either pass a structured\n * object (renders a Pressable button via the consumer's button slot) or\n * pass an arbitrary node via `action` for maximum flexibility.\n */\nexport interface NativeEmptyStateAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface NativeEmptyStateProps {\n /** Variant drives default tone + default title. Default \"first-run\". */\n variant?: NativeEmptyStateVariant;\n /** Headline. Falls back to a variant-specific default. */\n title?: string;\n /** Body copy shown below the title. (Alias: `description`.) */\n body?: string;\n /**\n * @deprecated Prefer `body`. `description` remains for back-compat with\n * the original C3 API; both are accepted but `body` wins if both passed.\n */\n description?: string;\n /** Optional illustration (artwork node) above the title. */\n illustration?: React.ReactNode;\n /** Optional icon node above the title (use either icon or illustration). */\n icon?: React.ReactNode;\n /**\n * Primary CTA. When provided, the consumer is responsible for rendering\n * the button itself (we accept a node, not a label) so brand + token\n * styling is honored. The web API takes a `{label, onPress}` descriptor;\n * on native, prefer to pass a `<NativeButton>` directly to avoid\n * cross-package coupling.\n */\n primaryAction?: React.ReactNode;\n /** Secondary CTA, rendered below the primary. */\n secondaryAction?: React.ReactNode;\n /**\n * Free-form action slot. Equivalent to `primaryAction`; accepted for\n * back-compat with the C3 API. If both `action` and `primaryAction` are\n * passed, `primaryAction` wins.\n */\n action?: React.ReactNode;\n /**\n * Developer-facing error details. Only rendered when __DEV__ is true at\n * runtime (we infer by reading `process.env.NODE_ENV !== \"production\"`).\n */\n details?: string;\n className?: string;\n testID?: string;\n}\n\nconst defaults: Record<NativeEmptyStateVariant, { title: string; tone: string }> = {\n \"first-run\": { title: \"Nothing here yet\", tone: \"text-muted-foreground\" },\n \"no-results\": { title: \"No results\", tone: \"text-muted-foreground\" },\n error: { title: \"Something went wrong\", tone: \"text-destructive\" },\n};\n\nexport function NativeEmptyState({\n variant = \"first-run\",\n title,\n body,\n description,\n illustration,\n icon,\n primaryAction,\n secondaryAction,\n action,\n details,\n className,\n testID,\n}: NativeEmptyStateProps) {\n const meta = defaults[variant];\n const resolvedBody = body ?? description;\n const resolvedPrimary = primaryAction ?? action;\n // Read NODE_ENV defensively — some bundlers don't define `process` at\n // runtime (e.g., RN classic), so we guard via globalThis. The `details`\n // slot is dev-only; we explicitly enumerate non-production values so an\n // undefined NODE_ENV doesn't accidentally leak diagnostic strings.\n const proc = (globalThis as { process?: { env?: { NODE_ENV?: string } } })\n .process;\n const nodeEnv = proc?.env?.NODE_ENV;\n const isDev = nodeEnv === \"development\" || nodeEnv === \"test\";\n\n return (\n <View\n testID={testID ?? `empty-state-${variant}`}\n accessibilityRole=\"summary\"\n className={cn(\n \"items-center justify-center gap-3 px-8 py-12\",\n className\n )}\n >\n {illustration ? <View accessibilityElementsHidden>{illustration}</View> : null}\n {icon && !illustration ? (\n <View accessibilityElementsHidden>{icon}</View>\n ) : null}\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className={cn(\n \"text-center text-lg font-semibold\",\n variant === \"error\" ? \"text-destructive\" : \"text-foreground\"\n )}\n >\n {title ?? meta.title}\n </Text>\n {resolvedBody ? (\n <Text\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"max-w-sm text-center text-sm\", meta.tone)}\n >\n {resolvedBody}\n </Text>\n ) : null}\n {resolvedPrimary ? (\n <View\n testID={testID ? `${testID}-primary-action` : undefined}\n className=\"mt-2\"\n >\n {resolvedPrimary}\n </View>\n ) : null}\n {secondaryAction ? (\n <View\n testID={testID ? `${testID}-secondary-action` : undefined}\n className=\"mt-1\"\n >\n {secondaryAction}\n </View>\n ) : null}\n {details && isDev ? (\n <Text\n testID={testID ? `${testID}-details` : undefined}\n className=\"mt-2 max-w-sm text-center text-xs text-muted-foreground\"\n >\n {details}\n </Text>\n ) : null}\n </View>\n );\n}\n","/**\n * The semantic icon names Genesis components ask for, and the SF Symbol each\n * one draws on iOS. Components say \"settings\" or \"bell\", never a library's\n * own name; `lucideIcons` (`/icons/lucide`) maps the same names for Android,\n * web and the SF Symbol fallback.\n *\n * @stability Beta\n */\nexport const SF_SYMBOLS = {\n aperture: \"camera.aperture\",\n \"arrow-left\": \"arrow.left\",\n \"arrow-up\": \"arrow.up\",\n bell: \"bell\",\n calendar: \"calendar\",\n camera: \"camera\",\n \"camera-flip\": \"arrow.triangle.2.circlepath.camera\",\n check: \"checkmark\",\n \"chevron-down\": \"chevron.down\",\n \"chevron-left\": \"chevron.left\",\n \"chevron-right\": \"chevron.right\",\n \"chevron-up\": \"chevron.up\",\n clapperboard: \"movieclapper\",\n clock: \"clock\",\n close: \"xmark\",\n compose: \"square.and.pencil\",\n copy: \"doc.on.doc\",\n download: \"square.and.arrow.down\",\n edit: \"pencil\",\n error: \"xmark.circle\",\n expand: \"arrow.up.left.and.arrow.down.right\",\n \"external-link\": \"arrow.up.right.square\",\n eye: \"eye\",\n file: \"doc\",\n filter: \"line.3.horizontal.decrease\",\n \"folder-plus\": \"folder.badge.plus\",\n grid: \"square.grid.2x2\",\n grip: \"line.3.horizontal\",\n heart: \"heart\",\n home: \"house\",\n image: \"photo\",\n info: \"info.circle\",\n link: \"link\",\n list: \"list.bullet\",\n lock: \"lock\",\n \"log-out\": \"rectangle.portrait.and.arrow.right\",\n mail: \"envelope\",\n maximize: \"arrow.up.left.and.arrow.down.right\",\n menu: \"line.3.horizontal\",\n message: \"bubble.left\",\n mic: \"mic\",\n minus: \"minus\",\n more: \"ellipsis\",\n paperclip: \"paperclip\",\n pause: \"pause.fill\",\n pin: \"pin\",\n play: \"play.fill\",\n plus: \"plus\",\n radio: \"dot.radiowaves.left.and.right\",\n redo: \"arrow.uturn.forward\",\n refresh: \"arrow.clockwise\",\n reply: \"arrowshape.turn.up.left\",\n search: \"magnifyingglass\",\n settings: \"gearshape\",\n \"settings-2\": \"slider.horizontal.3\",\n share: \"square.and.arrow.up\",\n smile: \"face.smiling\",\n sort: \"arrow.up.arrow.down\",\n star: \"star\",\n stop: \"stop.fill\",\n success: \"checkmark.circle\",\n table: \"tablecells\",\n trash: \"trash\",\n undo: \"arrow.uturn.backward\",\n upload: \"tray.and.arrow.up\",\n user: \"person\",\n video: \"video\",\n volume: \"speaker.wave.2.fill\",\n \"volume-off\": \"speaker.slash.fill\",\n warning: \"exclamationmark.triangle\",\n} as const;\n\n/** A semantic icon name: what the icon is for. */\nexport type NativeIconName = keyof typeof SF_SYMBOLS;\n\n/** Every semantic icon name. */\nexport const NATIVE_ICON_NAMES = Object.keys(SF_SYMBOLS) as NativeIconName[];\n","/**\n * NativeIcon — an icon by what it is for (\"settings\", \"bell\"), not by a\n * library's name. On iOS it draws the SF Symbol (expo-symbols' `SymbolView`,\n * passed as `modules.symbol`); on Android and web, and as the SF Symbol's\n * fallback, it draws the icon set given as `modules.icons` (`lucideIcons`\n * from `@marktiderman/genesis-ui-native/icons/lucide`). With neither, it\n * keeps the icon's space empty and warns once in development.\n *\n * Decorative by default (hidden from screen readers). Give `label` when the\n * icon carries meaning on its own, such as an icon-only button's content.\n *\n * @stability Beta\n */\nimport { Platform, View, type ColorValue } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { SF_SYMBOLS, type NativeIconName } from \"../icon-names\";\nimport { useGenesisModules } from \"../native-modules\";\n\nexport interface NativeIconProps {\n name: NativeIconName;\n /** Points. Default 20. */\n size?: number;\n /** Default the theme's label color. */\n color?: ColorValue;\n /** iOS SF Symbol weight. */\n weight?: \"ultraLight\" | \"thin\" | \"light\" | \"regular\" | \"medium\" | \"semibold\" | \"bold\" | \"heavy\" | \"black\";\n /** Read by screen readers. Without it the icon is decorative and hidden from them. */\n label?: string;\n testID?: string;\n}\n\ndeclare const __DEV__: boolean | undefined;\nconst warned = new Set<string>();\n\nfunction warnOnce(name: string) {\n if (typeof __DEV__ === \"undefined\" || !__DEV__ || warned.has(name)) return;\n warned.add(name);\n console.warn(\n `[genesis] NativeIcon \"${name}\" has nothing to draw with: pass modules.icons (lucideIcons from \"@marktiderman/genesis-ui-native/icons/lucide\") and, for SF Symbols on iOS, modules.symbol (SymbolView from \"expo-symbols\") to GenesisModulesProvider.`,\n );\n}\n\nexport function NativeIcon({ name, size = 20, color, weight, label, testID }: NativeIconProps) {\n const { symbol: SymbolView, icons } = useGenesisModules();\n const roles = useThemeRoles();\n const tint = color ?? roles.label;\n const a11y = label\n ? { accessible: true, accessibilityRole: \"image\" as const, accessibilityLabel: label }\n : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: \"no-hide-descendants\" as const };\n const Fallback = icons?.[name];\n const fallback = Fallback ? <Fallback size={size} color={tint} testID={testID ? `${testID}-fallback` : undefined} /> : null;\n\n if (Platform.OS === \"ios\" && SymbolView) {\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size }}>\n <SymbolView name={SF_SYMBOLS[name]} size={size} tintColor={tint} weight={weight} fallback={fallback} style={{ width: size, height: size }} />\n </View>\n );\n }\n if (!fallback) warnOnce(name);\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size, alignItems: \"center\", justifyContent: \"center\" }}>\n {fallback}\n </View>\n );\n}\n","/**\n * ListItem — recurring row in a list (settings, contacts, results).\n *\n * Slots: leading (avatar / icon), title, subtitle, trailing\n * (chevron / accessory / action). Supports pressable variants with\n * automatic divider rendering between adjacent items via a wrapper\n * pattern (see <NativeListItemDivider>).\n *\n * For platform-default chevrons, pass `showChevron`; the chevron uses\n * the muted-foreground token.\n *\n * @stability Beta\n */\nimport { Platform, Pressable, Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { NativeIcon } from \"./icon\";\n\nexport interface NativeListItemProps {\n title: string;\n subtitle?: string;\n /** Slot rendered to the left of the title (avatar / icon). */\n leading?: React.ReactNode;\n /** Slot rendered to the right of the title (badge / accessory). */\n trailing?: React.ReactNode;\n /** When true, renders a chevron-right at the end. */\n showChevron?: boolean;\n /** When provided, the row becomes pressable. */\n onPress?: () => void;\n disabled?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NativeListItem({\n title,\n subtitle,\n leading,\n trailing,\n showChevron,\n onPress,\n disabled,\n className,\n testID,\n}: NativeListItemProps) {\n const inner = (\n <>\n {leading ? <View className=\"mr-3\">{leading}</View> : null}\n <View className=\"flex-1\">\n <Text className=\"text-base text-foreground\" numberOfLines={1}>\n {title}\n </Text>\n {subtitle ? (\n <Text\n className=\"mt-0.5 text-xs text-muted-foreground\"\n numberOfLines={2}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n {trailing ? <View className=\"ml-3\">{trailing}</View> : null}\n {showChevron ? <Chevron /> : null}\n </>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"native-list-item\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n disabled && \"opacity-50\",\n className\n )}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View\n testID={testID ?? \"native-list-item\"}\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n className\n )}\n >\n {inner}\n </View>\n );\n}\n\n/**\n * The drill-in chevron: an SF Symbol on iOS or the app's icon set\n * (`modules.symbol` / `modules.icons`) when given, else a text \"›\".\n */\nfunction Chevron() {\n const { symbol, icons } = useGenesisModules();\n const roles = useThemeRoles();\n if ((Platform.OS === \"ios\" && symbol) || icons?.[\"chevron-right\"]) {\n return (\n <View className=\"ml-2\">\n <NativeIcon name=\"chevron-right\" size={14} weight=\"semibold\" color={roles.tertiaryLabel} testID=\"native-list-item-chevron\" />\n </View>\n );\n }\n return (\n <Text\n accessibilityElementsHidden\n className=\"ml-2 text-base text-muted-foreground\"\n >\n ›\n </Text>\n );\n}\n\nexport function NativeListItemDivider({ className }: { className?: string }) {\n return <View className={cn(\"h-px bg-border\", className)} />;\n}\n","/**\n * SectionList header pattern — opinionated header style for\n * react-native SectionList rows.\n *\n * The full SectionList API stays with React Native; Genesis ships the\n * header component so consumers can pass it as `renderSectionHeader`\n * and get a consistent visual: muted background, uppercase tracking,\n * sticky-friendly padding.\n *\n * Pattern:\n *\n * <SectionList\n * sections={...}\n * renderItem={({ item }) => <NativeListItem title={item.label} />}\n * renderSectionHeader={({ section }) => (\n * <NativeSectionListHeader title={section.title} />\n * )}\n * />\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeSectionListHeaderProps {\n title: string;\n /** Optional trailing content (e.g., a count badge). */\n trailing?: React.ReactNode;\n className?: string;\n testID?: string;\n}\n\nexport function NativeSectionListHeader({\n title,\n trailing,\n className,\n testID,\n}: NativeSectionListHeaderProps) {\n return (\n <View\n testID={testID ?? \"native-section-header\"}\n accessibilityRole=\"header\"\n className={cn(\n \"flex-row items-center justify-between border-b border-border bg-muted px-4 py-2\",\n className\n )}\n >\n <Text className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {title}\n </Text>\n {trailing}\n </View>\n );\n}\n","/**\n * RefreshControl wrapper — token-aware tint over RN's RefreshControl.\n *\n * Use as the `refreshControl` prop on ScrollView / FlatList / SectionList.\n * The tint defaults to the theme's `tint` role; consumers can override\n * per-call. We re-export RN's\n * RefreshControl shape so the API mirrors what consumers already know.\n *\n * @stability Beta\n */\nimport { RefreshControl } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\n\nexport interface NativeRefreshControlProps {\n refreshing: boolean;\n onRefresh: () => void;\n /** Hex / RGB color override. Falls back to the theme primary. */\n tintColor?: string;\n /** Title shown under the iOS spinner. */\n title?: string;\n /** Color of the iOS title text. */\n titleColor?: string;\n /** Android colors prop (an array of progress colors). */\n colors?: string[];\n /** Android progress background. */\n progressBackgroundColor?: string;\n testID?: string;\n}\n\n/**\n * Pull to refresh, tinted with the theme's `tint` role. Works under any Genesis root.\n */\n// The tint comes from `useThemeRoles`, not `useGenesisTheme` from `providers/native`: that is\n// another context, which the native app shell's `GenesisThemeProvider` never mounts, so it threw there.\nexport function NativeRefreshControl({ tintColor, colors, testID, ...rest }: NativeRefreshControlProps) {\n const tint = useThemeRoles().tint;\n const androidTint = typeof tint === \"string\" ? [tint] : undefined;\n return <RefreshControl {...rest} tintColor={tintColor ?? (tint as string)} colors={colors ?? androidTint} testID={testID ?? \"native-refresh-control\"} />;\n}\n","/**\n * Badge — compact status / count / category tag.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst badgeVariants = cva(\n \"flex-row items-center self-start rounded-full border px-2.5 py-0.5\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary\",\n secondary: \"border-transparent bg-secondary\",\n destructive: \"border-transparent bg-destructive\",\n outline: \"border-border bg-transparent\",\n success: \"border-transparent bg-success/15\",\n warning: \"border-transparent bg-warning/15\",\n info: \"border-transparent bg-info/15\",\n muted: \"border-transparent bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst badgeTextVariants = cva(\"text-xs font-medium\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n destructive: \"text-destructive-foreground\",\n outline: \"text-foreground\",\n // AA-safe status text on the /15 tint. The bare status token\n // (text-success ~2.2:1) fails WCAG AA. The `-dark` stop is optional in\n // the brand schema (only `status.*.DEFAULT` is required) AND regresses\n // dark mode — a dark shade on the dark-surface tint drops to ~1.7–2.6:1.\n // Instead use the semantic Tailwind ramp (always present, brand-\n // independent, same hues as the Genesis status tokens) with a `dark:`\n // stop. Measured: light /15 tint emerald-700 4.76 / amber-800 6.32 /\n // blue-700 5.64; dark-surface tint emerald-300 ≥8.2 / amber-200 ≥10.8 /\n // blue-300 ≥8.2 — AA in both modes across the static preset and the\n // themeFromBrand() runtime dark map.\n success: \"text-emerald-700 dark:text-emerald-300\",\n warning: \"text-amber-800 dark:text-amber-200\",\n info: \"text-blue-700 dark:text-blue-300\",\n muted: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\nexport interface NativeBadgeProps\n extends VariantProps<typeof badgeVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n accessibilityLabel?: string;\n testID?: string;\n}\n\nfunction NativeBadge({\n className,\n textClassName,\n variant,\n children,\n ...props\n}: NativeBadgeProps) {\n return (\n <View className={cn(badgeVariants({ variant }), className)} accessibilityRole=\"text\" {...props}>\n {typeof children === \"string\" ? (\n <Text\n className={cn(badgeTextVariants({ variant }), textClassName)}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </View>\n );\n}\n\nexport { NativeBadge, badgeVariants, badgeTextVariants };\n","/**\n * Input — single-line text field.\n *\n * @stability Stable\n */\nimport type { ComponentRef, Ref } from \"react\";\nimport { Text, TextInput, type TextInputProps, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeInputProps extends TextInputProps {\n className?: string;\n inputClassName?: string;\n label?: string;\n error?: string;\n /** The underlying TextInput (React 19 passes `ref` as a prop). */\n ref?: Ref<ComponentRef<typeof TextInput>> | undefined;\n}\n\nfunction NativeInput({\n className,\n inputClassName,\n label,\n error,\n editable = true,\n placeholderTextColor,\n ...props\n}: NativeInputProps) {\n return (\n <View className={cn(\"gap-1.5\", className)}>\n {label ? (\n <Text className=\"text-sm font-medium text-foreground\">\n {label}\n </Text>\n ) : null}\n <TextInput\n className={cn(\n \"h-10 rounded-md border border-input bg-background px-3 text-base text-foreground\",\n !editable && \"opacity-50\",\n error && \"border-destructive\",\n inputClassName\n )}\n editable={editable}\n placeholderTextColor={placeholderTextColor ?? nativeColors.neutral[400]}\n accessibilityLabel={label}\n {...props}\n />\n {error ? (\n <Text className=\"text-sm text-destructive\">{error}</Text>\n ) : null}\n </View>\n );\n}\n\nexport { NativeInput };\n","/**\n * Skeleton — loading placeholder block.\n *\n * Pulses with Reanimated 4 when the app passes it (`modules.reanimated` on\n * `GenesisModulesProvider`), else with React Native's Animated. While Reduce\n * Motion is on it holds still at a legible opacity.\n *\n * @stability Stable\n */\nimport { useEffect, useRef } from \"react\";\nimport { Animated, Easing } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { useMotion } from \"../hooks/use-motion\";\nimport { useGenesisModules, type GenesisReanimatedModule } from \"../native-modules\";\n\nexport interface NativeSkeletonProps {\n className?: string;\n /**\n * Width of the skeleton. Use className for NativeWind sizing instead\n * when possible (e.g. className=\"w-24 h-4\").\n */\n width?: number;\n height?: number;\n /** Shorthand that sets both width and height (useful for circle skeletons). */\n size?: number;\n circle?: boolean;\n testID?: string;\n}\n\nconst LOW = 0.3;\nconst HIGH = 1;\n// Held still under Reduce Motion (visual-regression flow\n// `screenshot-reduced-motion.yaml`; Apple HIG / WCAG 2.3.3).\nconst STILL = 0.6;\n\nfunction sizeStyles({ width, height, size }: NativeSkeletonProps): Array<{ width?: number; height?: number }> {\n const w = width ?? size;\n const h = height ?? size;\n const styles: Array<{ width?: number; height?: number }> = [];\n if (w !== undefined) styles.push({ width: w });\n if (h !== undefined) styles.push({ height: h });\n return styles;\n}\n\nfunction skeletonClass({ className, circle }: NativeSkeletonProps) {\n return cn(\"rounded-md bg-muted\", circle && \"rounded-full\", className);\n}\n\nfunction NativeSkeleton(props: NativeSkeletonProps) {\n const { reanimated } = useGenesisModules();\n return reanimated ? <ReanimatedSkeleton {...props} reanimated={reanimated} /> : <AnimatedSkeleton {...props} />;\n}\n\nfunction ReanimatedSkeleton({ reanimated: R, ...props }: NativeSkeletonProps & { reanimated: GenesisReanimatedModule }) {\n // One pulse cycle from the shared motion tokens; under Reduce Motion it holds still (a zero-length repeat would flash).\n const motion = useMotion();\n const reduceMotion = motion.reduced;\n const PULSE_MS = motion.duration.pulse;\n const opacity = R.useSharedValue(LOW);\n useEffect(() => {\n R.cancelAnimation(opacity);\n if (reduceMotion) {\n opacity.value = STILL;\n return undefined;\n }\n opacity.value = LOW;\n opacity.value = R.withRepeat(R.withTiming(HIGH, { duration: PULSE_MS, easing: R.Easing.inOut(R.Easing.ease) }), -1, true);\n return () => R.cancelAnimation(opacity);\n // `R` and `opacity` are stable for the component's life.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reduceMotion]);\n const animatedStyle = R.useAnimatedStyle(() => {\n \"worklet\";\n return { opacity: opacity.value };\n });\n const AnimatedView = R.default.View;\n return (\n <AnimatedView\n className={skeletonClass(props)}\n style={[animatedStyle, ...sizeStyles(props)]}\n testID={props.testID}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n />\n );\n}\n\nfunction AnimatedSkeleton(props: NativeSkeletonProps) {\n const opacity = useRef(new Animated.Value(LOW)).current;\n // One pulse cycle from the shared motion tokens; under Reduce Motion it holds still (a zero-length repeat would flash).\n const motion = useMotion();\n const reduceMotion = motion.reduced;\n const PULSE_MS = motion.duration.pulse;\n\n useEffect(() => {\n if (reduceMotion) {\n opacity.setValue(STILL);\n return;\n }\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, {\n toValue: HIGH,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: LOW,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n ])\n );\n animation.start();\n return () => animation.stop();\n }, [opacity, reduceMotion]);\n\n return (\n <Animated.View\n className={skeletonClass(props)}\n style={[{ opacity }, ...sizeStyles(props)] as any[]}\n testID={props.testID}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n />\n );\n}\n\nexport { NativeSkeleton };\n","/**\n * LoadingState — a centred spinner for a screen (or part of one) that is\n * waiting: a redirect while the session loads, the first fetch of a page.\n *\n * Use it instead of a hand-rolled `<View><ActivityIndicator /></View>`: the\n * spinner takes the theme tint, screen readers hear one \"Loading\" progress\n * bar (or your `label`), and the full-screen form sits inside the safe area\n * on the screen background. For content-shaped placeholders (a list about to\n * appear) use `NativeSkeleton`; for known progress use `NativeProgress`.\n *\n * if (!session) return <NativeLoadingState />; // whole screen\n * <NativeLoadingState fullScreen={false} label=\"Loading more\" size=\"small\" />\n *\n * `ScreenContainer loading` renders the inline form in place of its body.\n *\n * @stability Beta\n */\nimport { ActivityIndicator, View, type ColorValue } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeText } from \"./text\";\n\nexport type NativeLoadingStateEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface NativeLoadingStateProps {\n /** Text shown under the spinner. It is also what screen readers announce. */\n label?: string;\n /** What screen readers announce when no `label` is shown. Default `\"Loading\"`. */\n accessibilityLabel?: string;\n /** Spinner size. Default `\"large\"`. */\n size?: \"small\" | \"large\";\n /**\n * `true` (default): fill the screen on the theme background, inside the\n * safe area. `false`: a padded, centred block that fills its parent, for a\n * screen body, a section or a list footer.\n */\n fullScreen?: boolean;\n /** Safe-area edges when `fullScreen`. Default all four. */\n safeAreaEdges?: NativeLoadingStateEdge[];\n /** Spinner color. Defaults to the theme tint. */\n color?: ColorValue;\n className?: string;\n /** testID on the root; the spinner is `${testID}-spinner`, the label `${testID}-label`. Default `\"loading-state\"`. */\n testID?: string;\n}\n\nconst ALL_EDGES: NativeLoadingStateEdge[] = [\"top\", \"bottom\", \"left\", \"right\"];\n\nexport function NativeLoadingState({\n label,\n accessibilityLabel,\n size = \"large\",\n fullScreen = true,\n safeAreaEdges = ALL_EDGES,\n color,\n className,\n testID = \"loading-state\",\n}: NativeLoadingStateProps) {\n const roles = useThemeRoles();\n const spoken = label ?? accessibilityLabel ?? \"Loading\";\n\n const content = (\n <View\n testID={fullScreen ? `${testID}-content` : testID}\n className={cn(\"items-center justify-center gap-3 px-4 py-8\", !fullScreen && \"flex-grow\", !fullScreen && className)}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={spoken}\n accessibilityState={{ busy: true }}\n >\n <ActivityIndicator testID={`${testID}-spinner`} size={size} color={(color ?? roles.tint) as string} />\n {label ? (\n <NativeText testID={`${testID}-label`} preset=\"body-sm\" className=\"text-muted-foreground text-center\">\n {label}\n </NativeText>\n ) : null}\n </View>\n );\n\n if (!fullScreen) return content;\n\n return (\n <SafeAreaView\n testID={testID}\n edges={safeAreaEdges}\n className={cn(\"flex-1 items-center justify-center bg-background\", className)}\n >\n {content}\n </SafeAreaView>\n );\n}\n","/**\n * NativeContextMenu — what a long press opens: a short list of actions in a\n * sheet that fits them, with Cancel, instead of the system `Alert`. It's the\n * same on iOS and Android, a row of its own for each action (44pt, a destructive\n * one in the theme's `destructive`), and opening it taps `medium`.\n *\n * Controlled, like `NativeSheet`: keep `open` in your screen and set it from\n * `onLongPress`. Offer the same actions as accessibility actions on the\n * pressable too (`accessibilityActions`), since VoiceOver doesn't long press.\n *\n * An action runs once, and once the sheet has gone: iOS won't present an alert\n * or another modal over one that's still dismissing.\n *\n * @stability Beta\n */\nimport { useEffect, useRef } from \"react\";\nimport { Platform, Pressable, View } from \"react-native\";\nimport { useHaptics } from \"../hooks/use-haptics\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeSheet } from \"./sheet\";\nimport { NativeText } from \"./text\";\n\nexport interface NativeContextMenuAction {\n id: string;\n label: string;\n onPress: () => void;\n destructive?: boolean;\n}\n\nexport interface NativeContextMenuProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n actions: readonly NativeContextMenuAction[];\n /** Over the actions: what they act on. */\n title?: string;\n cancelLabel?: string;\n testID?: string;\n}\n\n/** If iOS never says the sheet has gone (Modal's `onDismiss` can be skipped), run the action after this. */\nconst IOS_DISMISS_FALLBACK_MS = 600;\n\nexport function NativeContextMenu({ open, onOpenChange, actions, title, cancelLabel = \"Cancel\", testID = \"context-menu\" }: NativeContextMenuProps) {\n const colors = useThemeRoles();\n const play = useHaptics();\n const opened = useRef(false);\n // What was tapped, until the sheet has gone. Taken once: a second tap, or the fallback after onDismiss, finds nothing.\n const tapped = useRef<(() => void) | null>(null);\n const ran = useRef(false);\n const fallback = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => {\n if (open && !opened.current) {\n play(\"medium\");\n ran.current = false;\n }\n opened.current = open;\n }, [open, play]);\n\n const runTapped = () => {\n if (fallback.current) clearTimeout(fallback.current);\n fallback.current = null;\n const action = tapped.current;\n tapped.current = null;\n action?.();\n };\n const run = (action: NativeContextMenuAction) => {\n if (ran.current) return;\n ran.current = true;\n tapped.current = action.onPress;\n onOpenChange(false);\n if (Platform.OS === \"ios\") fallback.current = setTimeout(runTapped, IOS_DISMISS_FALLBACK_MS);\n else runTapped();\n };\n\n return (\n <NativeSheet open={open} onOpenChange={onOpenChange} fitContent onDismissed={runTapped} testID={testID}>\n <View style={{ paddingHorizontal: 16, paddingBottom: 8 }}>\n {title ? (\n <NativeText testID={`${testID}-title`} accessibilityRole=\"header\" numberOfLines={2} style={{ paddingVertical: 8, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18, textAlign: \"center\" }}>\n {title}\n </NativeText>\n ) : null}\n {actions.map((action) => (\n <Pressable\n key={action.id}\n testID={`${testID}-action-${action.id}`}\n accessibilityRole=\"button\"\n accessibilityLabel={action.label}\n onPress={() => run(action)}\n style={{ minHeight: 48, alignItems: \"center\", justifyContent: \"center\" }}\n >\n <NativeText style={{ color: action.destructive ? colors.destructive : colors.tint, fontSize: 17, lineHeight: 22 }}>{action.label}</NativeText>\n </Pressable>\n ))}\n <Pressable testID={`${testID}-cancel`} accessibilityRole=\"button\" accessibilityLabel={cancelLabel} onPress={() => onOpenChange(false)} style={{ minHeight: 48, alignItems: \"center\", justifyContent: \"center\" }}>\n <NativeText style={{ color: colors.label, fontSize: 17, lineHeight: 22, fontWeight: \"600\" }}>{cancelLabel}</NativeText>\n </Pressable>\n </View>\n </NativeSheet>\n );\n}\n","/**\n * NativeSwipeRow — a row with actions behind a swipe: Archive to one side,\n * Delete to the other (each action's `side`, trailing by default).\n *\n * The gesture is the app's `GenesisModules.swipeable` (react-native-gesture-\n * handler's `ReanimatedSwipeable`, an optional peer). Without it, the row draws\n * as it is, so an action must always be reachable another way too: `InboxPage`\n * puts them in the accessibility actions and on long press. The buttons behind\n * the row are hidden from VoiceOver for that reason (a screen reader doesn't\n * swipe), and a swipe that opens taps `medium` through `useHaptics`.\n *\n * @stability Beta\n */\nimport { useRef, type ReactNode } from \"react\";\nimport { Pressable, View } from \"react-native\";\nimport type { InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\nimport { useHaptics } from \"../hooks/use-haptics\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { NativeText } from \"./text\";\n\nexport interface NativeSwipeRowProps {\n actions: readonly InboxSwipeAction[];\n children?: ReactNode;\n testID?: string;\n}\n\n/** A button's width behind the row: room for a short label. */\nconst ACTION_WIDTH = 80;\n\nexport function NativeSwipeRow({ actions, children, testID = \"swipe-row\" }: NativeSwipeRowProps) {\n const { swipeable: Swipeable } = useGenesisModules();\n const colors = useThemeRoles();\n const play = useHaptics();\n const swipe = useRef<{ close?: () => void } | null>(null);\n if (!Swipeable || actions.length === 0) return <>{children}</>;\n\n const leading = actions.filter((a) => a.side === \"leading\");\n const trailing = actions.filter((a) => a.side !== \"leading\");\n const group = (list: readonly InboxSwipeAction[]) => () => (\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={{ flexDirection: \"row\" }}>\n {list.map((action) => (\n <Pressable\n key={action.id}\n testID={`${testID}-action-${action.id}`}\n onPress={() => {\n swipe.current?.close?.();\n action.onPress();\n }}\n style={{ width: ACTION_WIDTH, alignItems: \"center\", justifyContent: \"center\", backgroundColor: action.destructive ? colors.destructive : colors.tint }}\n >\n <NativeText className={action.destructive ? \"text-destructive-foreground\" : \"text-primary-foreground\"} preset=\"label\">\n {action.label}\n </NativeText>\n </Pressable>\n ))}\n </View>\n );\n\n return (\n <Swipeable\n ref={swipe}\n testID={testID}\n friction={2}\n overshootLeft={false}\n overshootRight={false}\n onSwipeableWillOpen={() => play(\"medium\")}\n renderLeftActions={leading.length ? group(leading) : undefined}\n renderRightActions={trailing.length ? group(trailing) : undefined}\n >\n {children}\n </Swipeable>\n );\n}\n"]}
@@ -21,5 +21,5 @@ function useGenesisExtension(key) {
21
21
  }
22
22
 
23
23
  export { BrandExtensionsProvider, useGenesisExtension };
24
- //# sourceMappingURL=chunk-YWDDDYDI.js.map
25
- //# sourceMappingURL=chunk-YWDDDYDI.js.map
24
+ //# sourceMappingURL=chunk-FOJJB6AB.js.map
25
+ //# sourceMappingURL=chunk-FOJJB6AB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/use-genesis-extension.ts"],"names":[],"mappings":";;;;AAkDA,IAAM,sBAAA,GAAyB,aAAA;AAAA,EAC7B;AACF,CAAA;AAOO,SAAS,uBAAA,CAAwB;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,OAAO,aAAA;AAAA,IACL,sBAAA,CAAuB,QAAA;AAAA,IACvB,EAAE,KAAA,EAAM;AAAA,IACR;AAAA,GACF;AACF;AAOO,SAAS,oBACd,GAAA,EACgC;AAChC,EAAA,MAAM,GAAA,GAAM,WAAW,sBAAsB,CAAA;AAC7C,EAAA,OAAO,MAAM,GAAG,CAAA;AAClB","file":"chunk-YWDDDYDI.js","sourcesContent":["/**\n * useGenesisExtension — read a brand-package `extensions[<key>]` token scale.\n *\n * Brand packages declare domain-specific token categories under the\n * `extensions` slot of the canonical schema (PRD-07 D8 design decision).\n * Genesis primitives don't read these — only consumer composites do — so\n * this hook is the canonical accessor.\n *\n * Resolution order:\n * 1. `BrandExtensionsContext` value (set via <BrandExtensionsProvider>)\n * 2. `undefined` — the extension key isn't declared\n *\n * Consumers wire the provider once at app root; calls anywhere downstream\n * read by key.\n *\n * <BrandExtensionsProvider value={brand.extensions}>\n * <App />\n * </BrandExtensionsProvider>\n *\n * const moodTokens = useGenesisExtension(\"mood\");\n * // moodTokens?.[500] etc. — shape is consumer-defined\n *\n * Type contract: the canonical `BrandExtensions` interface lives in\n * `@marktiderman/genesis-design-system` (declaration-merging surface). At\n * runtime, consumers may pass a partially-populated object whose keys\n * match their own augmented `BrandExtensions`. We intentionally accept\n * `Partial<BrandExtensions>` here so the provider works with brand\n * packages that haven't declared extensions yet (a common case in newly\n * scaffolded apps).\n *\n * @stability Beta\n */\nimport {\n createContext,\n createElement,\n useContext,\n type ReactNode,\n} from \"react\";\nimport type { BrandExtensions } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Runtime shape passed to `<BrandExtensionsProvider>`. Consumers augment\n * the canonical `BrandExtensions` interface (in design-system) via TS\n * declaration merging; the provider accepts the resulting record.\n *\n * `Partial<>` so brand packages that have no extensions can still wrap\n * their app in the provider without TS errors.\n */\nexport type BrandExtensionsValue = Partial<BrandExtensions>;\n\nconst BrandExtensionsContext = createContext<BrandExtensionsValue | undefined>(\n undefined,\n);\n\nexport interface BrandExtensionsProviderProps {\n value?: BrandExtensionsValue;\n children: ReactNode;\n}\n\nexport function BrandExtensionsProvider({\n value,\n children,\n}: BrandExtensionsProviderProps) {\n return createElement(\n BrandExtensionsContext.Provider,\n { value },\n children,\n );\n}\n\n/**\n * Read an extension scale by key. Returns `undefined` when the provider\n * isn't mounted OR when the key isn't declared on the brand. The return\n * type follows the consumer's augmented `BrandExtensions[K]`.\n */\nexport function useGenesisExtension<K extends keyof BrandExtensions>(\n key: K,\n): BrandExtensions[K] | undefined {\n const ctx = useContext(BrandExtensionsContext);\n return ctx?.[key];\n}\n"]}
1
+ {"version":3,"sources":["../src/hooks/use-genesis-extension.ts"],"names":[],"mappings":";;;;AAkDA,IAAM,sBAAA,GAAyB,aAAA;AAAA,EAC7B;AACF,CAAA;AAOO,SAAS,uBAAA,CAAwB;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,OAAO,aAAA;AAAA,IACL,sBAAA,CAAuB,QAAA;AAAA,IACvB,EAAE,KAAA,EAAM;AAAA,IACR;AAAA,GACF;AACF;AAOO,SAAS,oBACd,GAAA,EACgC;AAChC,EAAA,MAAM,GAAA,GAAM,WAAW,sBAAsB,CAAA;AAC7C,EAAA,OAAO,MAAM,GAAG,CAAA;AAClB","file":"chunk-FOJJB6AB.js","sourcesContent":["/**\n * useGenesisExtension — read a brand-package `extensions[<key>]` token scale.\n *\n * Brand packages declare domain-specific token categories under the\n * `extensions` slot of the canonical schema (PRD-07 D8 design decision).\n * Genesis primitives don't read these — only consumer composites do — so\n * this hook is the canonical accessor.\n *\n * Resolution order:\n * 1. `BrandExtensionsContext` value (set via <BrandExtensionsProvider>)\n * 2. `undefined` — the extension key isn't declared\n *\n * Consumers wire the provider once at app root; calls anywhere downstream\n * read by key.\n *\n * <BrandExtensionsProvider value={brand.extensions}>\n * <App />\n * </BrandExtensionsProvider>\n *\n * const moodTokens = useGenesisExtension(\"mood\");\n * // moodTokens?.[500] etc. — shape is consumer-defined\n *\n * Type contract: the canonical `BrandExtensions` interface lives in\n * `@marktiderman/genesis-design-system` (declaration-merging surface). At\n * runtime, consumers may pass a partially-populated object whose keys\n * match their own augmented `BrandExtensions`. We intentionally accept\n * `Partial<BrandExtensions>` here so the provider works with brand\n * packages that haven't declared extensions yet (a common case in newly\n * scaffolded apps).\n *\n * @stability Beta\n */\nimport {\n createContext,\n createElement,\n useContext,\n type ReactNode,\n} from \"react\";\nimport type { BrandExtensions } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Runtime shape passed to `<BrandExtensionsProvider>`. Consumers augment\n * the canonical `BrandExtensions` interface (in design-system) via TS\n * declaration merging; the provider accepts the resulting record.\n *\n * `Partial<>` so brand packages that have no extensions can still wrap\n * their app in the provider without TS errors.\n */\nexport type BrandExtensionsValue = Partial<BrandExtensions>;\n\nconst BrandExtensionsContext = createContext<BrandExtensionsValue | undefined>(\n undefined,\n);\n\nexport interface BrandExtensionsProviderProps {\n value?: BrandExtensionsValue;\n children: ReactNode;\n}\n\nexport function BrandExtensionsProvider({\n value,\n children,\n}: BrandExtensionsProviderProps) {\n return createElement(\n BrandExtensionsContext.Provider,\n { value },\n children,\n );\n}\n\n/**\n * Read an extension scale by key. Returns `undefined` when the provider\n * isn't mounted OR when the key isn't declared on the brand. The return\n * type follows the consumer's augmented `BrandExtensions[K]`.\n */\nexport function useGenesisExtension<K extends keyof BrandExtensions>(\n key: K,\n): BrandExtensions[K] | undefined {\n const ctx = useContext(BrandExtensionsContext);\n return ctx?.[key];\n}\n"]}
@@ -1,8 +1,7 @@
1
- import { NativeSkeleton, NativeText, NativeIcon } from './chunk-O4BMDV7I.js';
2
- import { usePressFeedback } from './chunk-CAI7LGN6.js';
3
- import { useGenesisModules, useReducedMotion, useThemeRoles } from './chunk-RTYO24SC.js';
1
+ import { NativeSkeleton, NativeText, NativeIcon, NativeContextMenu } from './chunk-FGIIBON3.js';
2
+ import { useGenesisModules, useReducedMotion, useThemeRoles, usePressFeedback } from './chunk-PWS2HLDE.js';
4
3
  import { forwardRef, useState, useRef, useEffect, useCallback, useImperativeHandle, useMemo } from 'react';
5
- import { FlatList, View, Platform, AccessibilityInfo, Pressable, Dimensions, TextInput, ActivityIndicator, Animated, Alert } from 'react-native';
4
+ import { FlatList, View, Platform, AccessibilityInfo, Pressable, Dimensions, TextInput, ActivityIndicator, Animated } from 'react-native';
6
5
  import { useThreadJump } from '@marktiderman/genesis-core/conversation';
7
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
7
 
@@ -60,6 +59,7 @@ function NativeThreadListInner(props, ref) {
60
59
  const atBottom = useRef(true);
61
60
  const placed = useRef(!mode.followsByHand);
62
61
  const settlingUntil = useRef(0);
62
+ const moveId = useRef(0);
63
63
  const timers = useRef(/* @__PURE__ */ new Set());
64
64
  const later = useCallback((fn, ms) => {
65
65
  const t = setTimeout(() => {
@@ -84,12 +84,13 @@ function NativeThreadListInner(props, ref) {
84
84
  const toBottom = useCallback(
85
85
  (animated) => {
86
86
  settlingUntil.current = Date.now() + SETTLING_MS;
87
+ const move = ++moveId.current;
87
88
  const go = (a) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });
88
89
  requestAnimationFrame(() => {
89
90
  go(animated);
90
91
  placed.current = true;
91
92
  });
92
- if (animated) later(() => go(true), 180);
93
+ if (animated) later(() => move === moveId.current && go(true), 180);
93
94
  },
94
95
  [later, reducedMotion]
95
96
  );
@@ -106,7 +107,9 @@ function NativeThreadListInner(props, ref) {
106
107
  const jumpTries = useRef(null);
107
108
  const scrollToRow = useCallback(
108
109
  (id) => {
110
+ const move = ++moveId.current;
109
111
  const scroll = () => {
112
+ if (move !== moveId.current) return;
110
113
  const at = indexOf(id);
111
114
  if (at < 0) return;
112
115
  settlingUntil.current = Date.now() + SETTLING_MS;
@@ -119,9 +122,21 @@ function NativeThreadListInner(props, ref) {
119
122
  },
120
123
  [indexOf, later, reducedMotion]
121
124
  );
125
+ const lookForBottom = useCallback(() => {
126
+ if (recheck.current) clearTimeout(recheck.current);
127
+ const look = () => {
128
+ const wait = settlingUntil.current - Date.now();
129
+ if (wait > 0) {
130
+ recheck.current = setTimeout(look, wait + 50);
131
+ return;
132
+ }
133
+ if (!metrics.current || threadNearBottom(metrics.current)) setAtBottom(true);
134
+ };
135
+ recheck.current = setTimeout(look, SETTLING_MS + 50);
136
+ }, [setAtBottom]);
122
137
  const has = useCallback((id) => indexOf(id) >= 0, [indexOf]);
123
138
  const hasNow = useMemo(() => (id) => has(id), [has, data]);
124
- const { highlightedId, jumping } = useThreadJump({
139
+ const { highlightedId, jumping, cancel: cancelJump } = useThreadJump({
125
140
  target: jumpTo,
126
141
  has: hasNow,
127
142
  loading,
@@ -132,16 +147,7 @@ function NativeThreadListInner(props, ref) {
132
147
  placed.current = true;
133
148
  },
134
149
  onLanded: (id) => {
135
- if (recheck.current) clearTimeout(recheck.current);
136
- const look = () => {
137
- const wait = settlingUntil.current - Date.now();
138
- if (wait > 0) {
139
- recheck.current = setTimeout(look, wait + 50);
140
- return;
141
- }
142
- if (metrics.current && threadNearBottom(metrics.current)) setAtBottom(true);
143
- };
144
- recheck.current = setTimeout(look, SETTLING_MS + 50);
150
+ lookForBottom();
145
151
  const at = indexOf(id);
146
152
  const said = at >= 0 ? latest.current.jumpAnnouncement?.(latest.current.data[at]) : void 0;
147
153
  if (said) announce(said);
@@ -176,23 +182,29 @@ function NativeThreadListInner(props, ref) {
176
182
  },
177
183
  [setAtBottom]
178
184
  );
179
- const onScrollBeginDrag = useCallback(() => {
185
+ const readerTookOver = useCallback(() => {
180
186
  settlingUntil.current = 0;
181
- }, []);
187
+ moveId.current += 1;
188
+ jumpTries.current = null;
189
+ cancelJump();
190
+ }, [cancelJump]);
182
191
  const onScrollToIndexFailed = useCallback(
183
192
  ({ index, averageItemLength }) => {
184
- listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });
185
193
  const target = jumpTries.current;
186
- if (!target || target.tries >= 3) return;
194
+ if (!target) return;
195
+ listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });
196
+ if (target.tries >= 3) return;
187
197
  target.tries += 1;
188
198
  later(() => {
199
+ if (jumpTries.current !== target) return;
189
200
  const at = indexOf(target.id);
190
201
  if (at < 0) return;
191
202
  settlingUntil.current = Date.now() + SETTLING_MS;
192
203
  listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });
204
+ lookForBottom();
193
205
  }, 250);
194
206
  },
195
- [indexOf, later, reducedMotion]
207
+ [indexOf, later, lookForBottom, reducedMotion]
196
208
  );
197
209
  const follow = useCallback(() => {
198
210
  if (atBottom.current && !jumping) toBottom(false);
@@ -226,7 +238,7 @@ function NativeThreadListInner(props, ref) {
226
238
  maintainVisibleContentPosition: mode.maintainVisibleContentPosition,
227
239
  scrollEventThrottle: 32,
228
240
  onScroll,
229
- onScrollBeginDrag,
241
+ onScrollBeginDrag: readerTookOver,
230
242
  onScrollToIndexFailed,
231
243
  ...mode.followsByHand ? { onContentSizeChange: follow, onLayout: follow } : {},
232
244
  ListHeaderComponent: listHeader,
@@ -249,13 +261,6 @@ function DefaultLoading() {
249
261
  /* @__PURE__ */ jsx(NativeSkeleton, { width: 240, height: 36, className: "rounded-2xl" })
250
262
  ] });
251
263
  }
252
- function openSendActions(actions, title) {
253
- if (actions.length === 1) return actions[0].onPress();
254
- Alert.alert(title ?? "", void 0, [
255
- ...actions.map((a) => ({ text: a.label, style: a.destructive ? "destructive" : "default", onPress: a.onPress })),
256
- { text: "Cancel", style: "cancel" }
257
- ]);
258
- }
259
264
  var LINE = 22;
260
265
  var PAD_Y = 8;
261
266
  function NativeComposerBar({
@@ -270,12 +275,13 @@ function NativeComposerBar({
270
275
  maxLength,
271
276
  maxLines = 6,
272
277
  modes,
278
+ modesLabel = "Send as",
273
279
  mode,
274
280
  onModeChange,
275
281
  leading,
276
282
  trailing,
277
283
  above,
278
- empty,
284
+ hasContent,
279
285
  idleAction,
280
286
  replaceInput,
281
287
  sendActions,
@@ -290,9 +296,10 @@ function NativeComposerBar({
290
296
  const hasIcon = Boolean(symbol || icons?.["arrow-up"]);
291
297
  const current = modes?.find((m) => m.id === mode) ?? modes?.[0];
292
298
  const internal = current?.tone === "internal";
293
- const blank = empty ?? !value.trim();
299
+ const blank = !(hasContent ?? value.trim().length > 0);
294
300
  const canSend = !blank && !disabled && !sending && editable;
295
301
  const actions = sendActions?.length ? sendActions : null;
302
+ const [menuOpen, setMenuOpen] = useState(false);
296
303
  const idle = idleAction != null && blank && !sending;
297
304
  const sendPress = usePressFeedback({ haptic: "light", scale: 0.9, disabled: !canSend });
298
305
  const fontScale = Dimensions.get("window").fontScale || 1;
@@ -314,7 +321,7 @@ function NativeComposerBar({
314
321
  borderTopColor: colors.warning
315
322
  },
316
323
  children: [
317
- modes && modes.length > 1 ? /* @__PURE__ */ jsx(View, { testID: `${testID}-modes`, accessibilityRole: "tablist", style: { flexDirection: "row", gap: 4 }, children: modes.map((m) => {
324
+ modes && modes.length > 1 ? /* @__PURE__ */ jsx(View, { testID: `${testID}-modes`, accessibilityRole: "tablist", accessibilityLabel: modesLabel, style: { flexDirection: "row", gap: 4 }, children: modes.map((m) => {
318
325
  const on = m.id === current?.id;
319
326
  return /* @__PURE__ */ jsx(
320
327
  Pressable,
@@ -387,7 +394,7 @@ function NativeComposerBar({
387
394
  accessibilityHint: actions ? sendActionsHint : void 0,
388
395
  accessibilityActions: actions && canSend ? actions.map((a) => ({ name: a.id, label: a.label })) : void 0,
389
396
  onAccessibilityAction: actions ? (e) => actions.find((a) => a.id === e.nativeEvent.actionName)?.onPress() : void 0,
390
- onLongPress: actions ? () => openSendActions(actions, sendActionsTitle) : void 0,
397
+ onLongPress: actions ? () => actions.length === 1 ? actions[0].onPress() : setMenuOpen(true) : void 0,
391
398
  disabled: !canSend,
392
399
  onPressIn: sendPress.onPressIn,
393
400
  onPressOut: sendPress.onPressOut,
@@ -399,12 +406,13 @@ function NativeComposerBar({
399
406
  children: hasIcon ? /* @__PURE__ */ jsx(NativeIcon, { name: "arrow-up", size: 20, color: canSend ? colors.background : colors.tertiaryLabel }) : /* @__PURE__ */ jsx(NativeText, { preset: "label", className: canSend ? "text-primary-foreground" : void 0, style: canSend ? void 0 : { color: colors.tertiaryLabel }, children: sendLabel })
400
407
  }
401
408
  ) })
402
- ] })
409
+ ] }),
410
+ actions && actions.length > 1 ? /* @__PURE__ */ jsx(NativeContextMenu, { open: menuOpen, onOpenChange: setMenuOpen, actions, ...sendActionsTitle ? { title: sendActionsTitle } : {}, testID: `${testID}-send-menu` }) : null
403
411
  ]
404
412
  }
405
413
  );
406
414
  }
407
415
 
408
416
  export { NativeComposerBar, NativeThreadList, THREAD_AT_BOTTOM_POINTS, threadListMode, threadNearBottom };
409
- //# sourceMappingURL=chunk-IXC3LO2K.js.map
410
- //# sourceMappingURL=chunk-IXC3LO2K.js.map
417
+ //# sourceMappingURL=chunk-JZ7RAGDQ.js.map
418
+ //# sourceMappingURL=chunk-JZ7RAGDQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/thread-list.tsx","../src/components/composer-bar.tsx"],"names":["useState","useEffect","Platform","AccessibilityInfo","jsxs","View","jsx","Pressable","Fragment"],"mappings":";;;;;;;AAoDA,IAAM,QAAA,GAAW,CAAC,IAAA,KAAkB,iBAAA,CAAyE,2BAA2B,IAAI,CAAA;AAGrI,IAAM,uBAAA,GAA0B;AAGvC,IAAM,WAAA,GAAc,GAAA;AAGb,SAAS,gBAAA,CAAiB,CAAA,EAAkB,KAAA,GAAQ,uBAAA,EAAkC;AAC3F,EAAA,OAAO,CAAA,CAAE,cAAc,CAAA,GAAI,CAAA,CAAE,kBAAkB,MAAA,IAAU,CAAA,CAAE,YAAY,MAAA,GAAS,KAAA;AAClF;AASO,SAAS,cAAA,CACd,KAAA,EACA,aAAA,EACA,cAAA,GAAiB,CAAA,EACoE;AACrF,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,MAAM,SAAA,GAAY,iBAAiB,CAAA,GAAI,IAAA,CAAK,IAAI,CAAA,EAAG,uBAAA,GAA0B,cAAc,CAAA,GAAI,GAAA;AAC/F,IAAA,OAAO;AAAA,MACL,aAAA,EAAe,KAAA;AAAA,MACf,8BAAA,EAAgC,EAAE,wBAAA,EAA0B,IAAA,EAAM,6BAA6B,SAAA,EAAW,yBAAA,EAA2B,CAAC,aAAA;AAAc,KACtJ;AAAA,EACF;AACA,EAAA,OAAO,EAAE,aAAA,EAAe,IAAA,EAAM,gCAAgC,EAAE,kBAAA,EAAoB,GAAE,EAAE;AAC1F;AA2FA,SAAS,qBAAA,CAAyB,OAAiC,GAAA,EAAiD;AAClH,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA,GAAU,KAAA;AAAA,IACV,WAAA;AAAA,IACA,UAAA,GA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AA,EAAO,OAAA,GAAU,MAAA,CAAO,UAAA,GAAa,MAAA,CAAO,eAAe,CAAA,mBAEjGA,GAAAA,CAAC,UAAA,EAAA,EAAW,MAAA,EAAO,OAAA,EAAQ,SAAA,EAAW,OAAA,GAAU,4BAA4B,MAAA,EAAW,KAAA,EAAO,OAAA,GAAU,MAAA,GAAY,EAAE,KAAA,EAAO,MAAA,CAAO,aAAA,IACjI,QAAA,EAAA,SAAA,EACH;AAAA;AAAA,WAEJ,EACF;AAAA,SAAA,EAEJ,CAAA;AAAA,QACC,OAAA,IAAW,OAAA,CAAQ,MAAA,GAAS,CAAA,mBAAIA,IAAC,iBAAA,EAAA,EAAkB,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,WAAA,EAAa,OAAA,EAAmB,GAAI,gBAAA,GAAmB,EAAE,KAAA,EAAO,gBAAA,EAAiB,GAAI,IAAK,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,UAAA,CAAA,EAAc,CAAA,GAAK;AAAA;AAAA;AAAA,GAClN;AAEJ","file":"chunk-JZ7RAGDQ.js","sourcesContent":["/**\n * NativeThreadList — a conversation's list: oldest first, top to bottom (the\n * order VoiceOver reads), that opens at the newest row, follows new rows only\n * while you're at the bottom, keeps your place while earlier rows load at the\n * top, and can go to one row (a search result, the first unread).\n *\n * The atom under ThreadPage, and the one any app builds its own thread from:\n * it renders the rows it's given and never fetches. Earlier pages come from\n * `onLoadEarlier`, a row out of reach from `onLoadUntil(id)`.\n *\n * FlashList v2 (`GenesisModules.list`) when the app passed it: its chat mode\n * (`startRenderingFromBottom`, `autoscrollToBottomThreshold`, the first\n * visible row held when rows prepend). Without it, FlatList, which keeps its\n * place with `maintainVisibleContentPosition` (anchored past the header) and\n * follows the bottom by hand.\n *\n * Not inverted: in an inverted FlashList a new row at index 0 lands under the\n * composer, and VoiceOver reads each day's heading after its messages.\n *\n * Earlier rows load by themselves near the top, and the explicit \"Load\n * earlier\" button stays: VoiceOver can't reach rows a virtualized list hasn't\n * rendered. Going to a row waits for `loading`, loads until it's held,\n * scrolls to it (again after FlashList's own placement on open), highlights\n * it for two seconds and announces it. Reduce Motion scrolls without\n * animating. The reader's touch wins: a drag during a jump ends the list's own\n * scrolling and drops the jump, even one still loading, so nothing snaps back.\n *\n * A row is gone when, once `onLoadUntil` has settled, no row answers to its\n * id. The list knows only its rows: a row that's drawn (a deleted message's\n * tombstone) is there, and whatever isn't drawn isn't, whatever a cache holds.\n *\n * Promoted from genesis-chat's thread and its `useJumpToMessage` (G4); chat\n * moves onto it later.\n *\n * @stability Beta\n */\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, type ComponentType, type ReactElement, type ReactNode } from \"react\";\nimport { AccessibilityInfo, FlatList, Platform, Pressable, View } from \"react-native\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { useReducedMotion } from \"../hooks/use-reduced-motion\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useThreadJump } from \"@marktiderman/genesis-core/conversation\";\nimport { NativeSkeleton } from \"./skeleton\";\nimport { NativeText } from \"./text\";\n\n/** The scroll event fields the list reads. */\ninterface ScrollMetrics {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n}\n\nconst announce = (text: string) => (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(text);\n\n/** Points from the bottom that still count as \"at the bottom\". */\nexport const THREAD_AT_BOTTOM_POINTS = 120;\n\n/** After the list scrolls itself (to the newest, to a row), how long its own scroll events don't count. */\nconst SETTLING_MS = 400;\n\n/** Whether a scroll position is at (or near) the bottom of its content. */\nexport function threadNearBottom(m: ScrollMetrics, slack = THREAD_AT_BOTTOM_POINTS): boolean {\n return m.contentOffset.y + m.layoutMeasurement.height >= m.contentSize.height - slack;\n}\n\n/**\n * How the list is set up. FlashList follows by itself, within\n * `THREAD_AT_BOTTOM_POINTS` of the bottom (its threshold is a fraction of the\n * viewport: a fifth until the viewport's height is known); FlatList keeps its\n * place on prepend, anchored on the first row past the header (index 1: the\n * header is child 0), and the list follows the bottom by hand.\n */\nexport function threadListMode(\n flash: boolean,\n reducedMotion: boolean,\n viewportHeight = 0,\n): { followsByHand: boolean; maintainVisibleContentPosition: Record<string, unknown> } {\n if (flash) {\n const threshold = viewportHeight > 0 ? Math.min(1, THREAD_AT_BOTTOM_POINTS / viewportHeight) : 0.2;\n return {\n followsByHand: false,\n maintainVisibleContentPosition: { startRenderingFromBottom: true, autoscrollToBottomThreshold: threshold, animateAutoScrollToBottom: !reducedMotion },\n };\n }\n return { followsByHand: true, maintainVisibleContentPosition: { minIndexForVisible: 1 } };\n}\n\nexport interface NativeThreadListHandle {\n /** Go to the newest row (after a send: what you send is what you look at next). */\n scrollToEnd: (options?: { animated?: boolean }) => void;\n}\n\n/** What `renderItem` is told about a row besides the row itself. */\nexport interface ThreadRowInfo {\n index: number;\n /** The row a jump just landed on, for two seconds. */\n highlighted: boolean;\n}\n\nexport interface NativeThreadListProps<T> {\n /** Oldest first. */\n data: readonly T[];\n /** A row's id. It must stay the same across refreshes (from a cache to the server), or rows jump. */\n keyExtractor: (row: T) => string;\n renderItem: (row: T, info: ThreadRowInfo) => ReactElement | null;\n /** Rows of different shapes recycle apart (FlashList): \"mine\", \"theirs\", \"event\". */\n getItemType?: (row: T) => string;\n /** The first page is loading: shows `loadingView` (a skeleton by default), and a jump waits. */\n loading?: boolean;\n loadingView?: ReactNode;\n /** There are earlier rows: loads them near the top, and shows the \"Load earlier\" button. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\n /** Replaces the default \"Load earlier\" button. */\n renderEarlier?: (props: { loading: boolean; onPress: () => void; label: string; testID: string }) => ReactNode;\n /** Go to this row, loading earlier pages with `onLoadUntil` until it's here. A new id, or the same one after `null`, goes again. */\n jumpTo?: string | null;\n /**\n * The id `jumpTo` names a row by, when it isn't the row's key: a message keyed by the id the\n * phone gave it (so it keeps its row when the server's copy lands) and gone to by the server's\n * id. `null` for a row that can't be gone to (a day heading). `keyExtractor` by default.\n * Pass a stable function (module scope, or `useCallback`): a new one each render re-renders every row.\n */\n jumpId?: (row: T) => string | null | undefined;\n /** Load earlier pages until the row is held; resolve false when it can't be found. */\n onLoadUntil?: (id: string) => Promise<boolean>;\n /** What VoiceOver says on arriving at `jumpTo`. */\n jumpAnnouncement?: (row: T) => string;\n /** No row answers to this id once `onLoadUntil` has settled, or it failed. The list goes back to the newest row first. */\n onJumpFailed?: (id: string) => void;\n /** Whether the reader is at the bottom, as it changes (to show a \"new messages\" pill, say). */\n onAtBottomChange?: (atBottom: boolean) => void;\n /** Above the first row, before the \"Load earlier\" button: what the thread is about. */\n header?: ReactNode;\n /** Under the last row: who is typing, a \"Sending…\" line. */\n footer?: ReactNode;\n /** Shown instead of the rows when there are none. */\n empty?: ReactNode;\n testID?: string;\n}\n\n/** The FlatList and FlashList v2 props the thread passes. */\ninterface ThreadListComponentProps {\n ref?: unknown;\n data: readonly unknown[];\n renderItem: (info: { item: unknown; index: number }) => ReactElement | null;\n keyExtractor: (row: unknown) => string;\n getItemType?: (row: unknown) => string;\n extraData?: unknown;\n onStartReached?: () => void;\n onStartReachedThreshold?: number;\n ListHeaderComponent?: ReactElement | null;\n ListFooterComponent?: ReactElement | null;\n keyboardShouldPersistTaps?: \"handled\";\n keyboardDismissMode?: \"interactive\" | \"on-drag\";\n contentInsetAdjustmentBehavior?: \"automatic\";\n contentContainerStyle?: Record<string, unknown>;\n maintainVisibleContentPosition?: Record<string, unknown>;\n onScroll?: (e: { nativeEvent: ScrollMetrics }) => void;\n onScrollBeginDrag?: () => void;\n scrollEventThrottle?: number;\n onContentSizeChange?: () => void;\n onLayout?: () => void;\n onScrollToIndexFailed?: (info: { index: number; averageItemLength: number }) => void;\n accessibilityRole?: \"list\";\n testID?: string;\n}\n\ninterface ListRef {\n scrollToEnd?: (o?: { animated?: boolean }) => void;\n scrollToIndex?: (o: { index: number; animated?: boolean; viewPosition?: number }) => void;\n scrollToOffset?: (o: { offset: number; animated?: boolean }) => void;\n}\n\nfunction NativeThreadListInner<T>(props: NativeThreadListProps<T>, ref: React.ForwardedRef<NativeThreadListHandle>) {\n const {\n data,\n keyExtractor,\n renderItem,\n getItemType,\n loading = false,\n loadingView,\n hasEarlier = false,\n onLoadEarlier,\n loadingEarlier = false,\n earlierLabel = \"Load earlier messages\",\n renderEarlier,\n jumpTo,\n jumpId,\n onLoadUntil,\n jumpAnnouncement,\n onJumpFailed,\n onAtBottomChange,\n footer,\n header,\n empty,\n testID = \"thread-list\",\n } = props;\n const genesis = useGenesisModules();\n const reducedMotion = useReducedMotion();\n const List = (genesis.list ?? FlatList) as unknown as ComponentType<ThreadListComponentProps>;\n const [viewport, setViewport] = useState(0);\n const mode = threadListMode(Boolean(genesis.list), reducedMotion, viewport);\n // The last position the list reported, to re-check \"at the bottom\" after it moves itself.\n const metrics = useRef<ScrollMetrics | null>(null);\n const recheck = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (recheck.current) clearTimeout(recheck.current);\n }, []);\n const listRef = useRef<ListRef | null>(null);\n // At the bottom (or not yet scrolled): new rows and a shorter list keep it there.\n const atBottom = useRef(true);\n // FlatList opens at the top and is moved down a frame later: until then the top isn't \"reached\".\n const placed = useRef(!mode.followsByHand);\n // While the list scrolls itself, its own scroll events don't move \"at the bottom\".\n const settlingUntil = useRef(0);\n // Bumped by each move the list starts and by the reader's touch: a queued try from an older move doesn't run.\n const moveId = useRef(0);\n const timers = useRef(new Set<ReturnType<typeof setTimeout>>());\n const later = useCallback((fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n timers.current.delete(t);\n fn();\n }, ms);\n timers.current.add(t);\n }, []);\n useEffect(() => {\n const pending = timers.current;\n return () => pending.forEach(clearTimeout);\n }, []);\n const idOf = jumpId ?? keyExtractor;\n const latest = useRef({ data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange });\n latest.current = { data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange };\n // The row a jump names, by `jumpId` (the key by default).\n const indexOf = useCallback((id: string) => latest.current.data.findIndex((row) => latest.current.idOf(row) === id), []);\n\n const setAtBottom = useCallback((v: boolean) => {\n if (atBottom.current === v) return;\n atBottom.current = v;\n latest.current.onAtBottomChange?.(v);\n }, []);\n\n const toBottom = useCallback(\n (animated: boolean) => {\n settlingUntil.current = Date.now() + SETTLING_MS;\n const move = ++moveId.current;\n const go = (a: boolean) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });\n requestAnimationFrame(() => {\n go(animated);\n placed.current = true;\n });\n // Once more after a new row has its size (FlashList measures it after the first pass).\n if (animated) later(() => move === moveId.current && go(true), 180);\n },\n [later, reducedMotion],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToEnd: (options) => {\n setAtBottom(true);\n toBottom(options?.animated ?? true);\n },\n }),\n [setAtBottom, toBottom],\n );\n\n // Going to a row: by id, so a page loading in between can't send it to the wrong row.\n const jumpTries = useRef<{ id: string; tries: number } | null>(null);\n const scrollToRow = useCallback(\n (id: string) => {\n const move = ++moveId.current;\n const scroll = () => {\n if (move !== moveId.current) return;\n const at = indexOf(id);\n if (at < 0) return;\n // Each try moves the list again: its events don't count until this one settles.\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n };\n jumpTries.current = { id, tries: 0 };\n settlingUntil.current = Date.now() + SETTLING_MS;\n requestAnimationFrame(scroll);\n // Once more after the first layout: on open, FlashList's start-at-the-bottom placement comes after\n // the first frame and would win, leaving the thread at the bottom.\n later(scroll, 250);\n },\n [indexOf, later, reducedMotion],\n );\n // A jump to a row already in view moves nothing, so no scroll event says where the list is: look\n // once its own scrolling has settled (a second try extends that; mid-way it can still read as the\n // bottom). No scroll event yet means the list hasn't moved from where it opens, the bottom.\n const lookForBottom = useCallback(() => {\n if (recheck.current) clearTimeout(recheck.current);\n const look = () => {\n const wait = settlingUntil.current - Date.now();\n if (wait > 0) {\n recheck.current = setTimeout(look, wait + 50);\n return;\n }\n if (!metrics.current || threadNearBottom(metrics.current)) setAtBottom(true);\n };\n recheck.current = setTimeout(look, SETTLING_MS + 50);\n }, [setAtBottom]);\n const has = useCallback((id: string) => indexOf(id) >= 0, [indexOf]);\n // `has` must change when the rows do, so the jump looks again.\n const hasNow = useMemo(() => (id: string) => has(id), [has, data]); // eslint-disable-line react-hooks/exhaustive-deps\n const { highlightedId, jumping, cancel: cancelJump } = useThreadJump({\n target: jumpTo,\n has: hasNow,\n loading,\n loadUntil: onLoadUntil,\n scrollTo: scrollToRow,\n onStart: () => {\n setAtBottom(false);\n placed.current = true;\n },\n onLanded: (id) => {\n lookForBottom();\n const at = indexOf(id);\n const said = at >= 0 ? latest.current.jumpAnnouncement?.(latest.current.data[at]!) : undefined;\n if (said) announce(said);\n },\n onGone: (id) => {\n // Back to where the thread opens: the newest rows.\n setAtBottom(true);\n toBottom(false);\n latest.current.onJumpFailed?.(id);\n },\n });\n\n const loadEarlier = useCallback(() => {\n if (placed.current && !jumping && hasEarlier && !loadingEarlier) onLoadEarlier?.();\n }, [hasEarlier, jumping, loadingEarlier, onLoadEarlier]);\n\n const earlierProps = { loading: loadingEarlier, onPress: () => onLoadEarlier?.(), label: earlierLabel, testID: `${testID}-earlier` };\n const listHeader = (\n <View>\n {header}\n {hasEarlier && onLoadEarlier ? (renderEarlier ? renderEarlier(earlierProps) : <DefaultEarlier {...earlierProps} />) : null}\n </View>\n );\n\n const renderListItem = useCallback(\n ({ item, index }: { item: unknown; index: number }) => renderItem(item as T, { index, highlighted: highlightedId !== null && idOf(item as T) === highlightedId }),\n [highlightedId, idOf, renderItem],\n );\n const listKey = useCallback((row: unknown) => keyExtractor(row as T), [keyExtractor]);\n const listItemType = useMemo(() => (getItemType ? (row: unknown) => getItemType(row as T) : undefined), [getItemType]);\n const onScroll = useCallback(\n (e: { nativeEvent: ScrollMetrics }) => {\n metrics.current = { contentOffset: { y: e.nativeEvent.contentOffset.y }, contentSize: { height: e.nativeEvent.contentSize.height }, layoutMeasurement: { height: e.nativeEvent.layoutMeasurement.height } };\n const height = e.nativeEvent.layoutMeasurement.height;\n setViewport((v) => (Math.abs(v - height) < 1 ? v : height));\n // The list's own scroll (to the newest, to a row) isn't the reader moving. Going to a row starts\n // at the bottom, so its first events say \"at the bottom\": taken, that turned following back on,\n // and FlatList's next layout scrolled to the end, away from the row. After a jump, onLanded\n // looks again once it has settled.\n if (Date.now() < settlingUntil.current) return;\n setAtBottom(threadNearBottom(e.nativeEvent));\n },\n [setAtBottom],\n );\n // The reader's touch ends the list's own scroll: from here their scrolling counts, even mid-jump,\n // the tries still queued don't snap them back, and a jump still loading doesn't land. Only a drag:\n // a fling follows one, and onMomentumScrollBegin isn't promised to be the reader's alone (Android\n // may report a programmatic smooth scroll), which would cancel the list's own retry. VoiceOver's\n // three-finger scroll and a wheel send no drag, so those count once the settling window (400ms) ends.\n const readerTookOver = useCallback(() => {\n settlingUntil.current = 0;\n moveId.current += 1;\n jumpTries.current = null;\n cancelJump();\n }, [cancelJump]);\n const onScrollToIndexFailed = useCallback(\n ({ index, averageItemLength }: { index: number; averageItemLength: number }) => {\n const target = jumpTries.current;\n // The reader took over.\n if (!target) return;\n // FlatList hasn't measured that far up yet: get near it, then try again by id (three times at most).\n listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });\n if (target.tries >= 3) return;\n target.tries += 1;\n later(() => {\n if (jumpTries.current !== target) return;\n const at = indexOf(target.id);\n if (at < 0) return;\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n lookForBottom();\n }, 250);\n },\n [indexOf, later, lookForBottom, reducedMotion],\n );\n const follow = useCallback(() => {\n if (atBottom.current && !jumping) toBottom(false);\n }, [jumping, toBottom]);\n\n if (loading && data.length === 0) {\n return (\n <View testID={`${testID}-loading`} accessible accessibilityLabel=\"Loading\" style={{ flex: 1, justifyContent: \"flex-end\", padding: 16, gap: 10 }}>\n {loadingView ?? <DefaultLoading />}\n </View>\n );\n }\n\n if (data.length === 0 && empty) {\n return (\n <View testID={testID} style={{ flex: 1, justifyContent: \"center\" }}>\n {listHeader}\n {empty}\n </View>\n );\n }\n\n return (\n <List\n ref={listRef}\n testID={testID}\n accessibilityRole=\"list\"\n data={data as readonly unknown[]}\n renderItem={renderListItem}\n keyExtractor={listKey}\n getItemType={listItemType}\n extraData={highlightedId}\n onStartReached={loadEarlier}\n onStartReachedThreshold={0.5}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.select({ ios: \"interactive\" as const, default: \"on-drag\" as const })}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ paddingVertical: 8, paddingHorizontal: 12 }}\n maintainVisibleContentPosition={mode.maintainVisibleContentPosition}\n scrollEventThrottle={32}\n onScroll={onScroll}\n onScrollBeginDrag={readerTookOver}\n onScrollToIndexFailed={onScrollToIndexFailed}\n {...(mode.followsByHand ? { onContentSizeChange: follow, onLayout: follow } : {})}\n ListHeaderComponent={listHeader}\n ListFooterComponent={footer ? <View>{footer}</View> : null}\n />\n );\n}\n\n/** A conversation's list. See the module docs. */\nexport const NativeThreadList = forwardRef(NativeThreadListInner) as <T>(\n props: NativeThreadListProps<T> & { ref?: React.Ref<NativeThreadListHandle> },\n) => ReactElement | null;\n\nfunction DefaultEarlier({ loading, label, onPress, testID }: { loading: boolean; label: string; onPress: () => void; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View style={{ alignItems: \"center\", paddingVertical: 12 }}>\n {loading ? (\n <View testID={`${testID}-loading`} accessible accessibilityLabel={label} accessibilityState={{ busy: true }} style={{ gap: 8, alignItems: \"center\" }}>\n <NativeSkeleton width={180} height={14} />\n <NativeSkeleton width={120} height={14} />\n </View>\n ) : (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16 }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n )}\n </View>\n );\n}\n\nfunction DefaultLoading() {\n return (\n <>\n <NativeSkeleton width={200} height={36} className=\"rounded-2xl\" />\n <View style={{ alignItems: \"flex-end\" }}>\n <NativeSkeleton width={160} height={36} className=\"rounded-2xl\" />\n </View>\n <NativeSkeleton width={240} height={36} className=\"rounded-2xl\" />\n </>\n );\n}\n","/**\n * NativeComposerBar — the bar you write a message in: an input that grows\n * with what you type (up to `maxLines`, then scrolls), a send button, and\n * slots beside and above it. ThreadPage's composer; chat, comments and AI\n * prompts build on it too.\n *\n * - **Modes:** `modes` with a `tone` each (\"Reply\" / \"Internal note\"). The\n * picker sits above the input, and an `internal` tone edges the bar and\n * the input in the theme's `warning` role, so a staff-only note never\n * reads like a reply (the send button keeps the tint: text on `warning`\n * would fail contrast). The row it sends carries the same tone (ThreadPage).\n * - **Slots:** `leading` (attach), `trailing` (beside send: an emoji button),\n * `above` (a reply preview, attachments waiting to send), `idleAction` (in\n * Send's place while there's nothing to send: a hold-to-record mic) and\n * `replaceInput` (instead of `leading` and the input: a recording's\n * waveform). Attachments with no text: pass `hasContent`.\n * - **More ways to send:** `sendActions` (\"Schedule\"). Touch and hold Send:\n * one action runs, several open a menu. Each is also an accessibility\n * action on Send.\n * - **Keyboard:** the bar doesn't move itself. Put it under a keyboard-aware\n * container (ThreadPage does, with `GenesisModules.keyboardAvoidingView`);\n * the list above it dismisses the keyboard interactively on a drag.\n * - **Accessibility:** send and the mode picker are 44pt targets, the input\n * is labelled by its placeholder (and says when it writes an internal\n * note), Sending is announced, and the input stays editable while a\n * message sends (the keyboard stays up).\n *\n * @stability Beta\n */\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { AccessibilityInfo, ActivityIndicator, Animated, Dimensions, Platform, Pressable, TextInput, View } from \"react-native\";\nimport type { ComposerMode } from \"@marktiderman/genesis-core/conversation\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { usePressFeedback } from \"../hooks/use-press-feedback\";\nimport { NativeContextMenu } from \"./context-menu\";\nimport { NativeIcon } from \"./icon\";\nimport { NativeText } from \"./text\";\n\nexport type { ComposerMode, ComposerTone } from \"@marktiderman/genesis-core/conversation\";\n\nexport interface NativeComposerBarProps {\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 /** Turns sending off (besides a blank value). */\n disabled?: boolean;\n placeholder?: string;\n /** Send's label, to VoiceOver. Default \"Send\". */\n sendLabel?: string;\n sendingLabel?: string;\n maxLength?: number;\n /** The input grows to this many lines, then scrolls. Default 6. */\n maxLines?: number;\n /** Ways to send (\"Reply\", \"Internal note\"). Two or more show the picker. */\n modes?: readonly ComposerMode[];\n /** The picker's name, to VoiceOver. Default \"Send as\". */\n modesLabel?: string;\n /** The chosen mode's id. Default the first. */\n mode?: string;\n onModeChange?: (id: string) => void;\n leading?: ReactNode;\n trailing?: ReactNode;\n above?: ReactNode;\n /**\n * Whether there's something to send. By default, a `value` that isn't blank; pass `true` when\n * attachments are waiting and no text is needed, and `false` while `replaceInput` is showing.\n */\n hasContent?: boolean;\n /** Takes Send's place (the same 44pt spot) while there's nothing to send and nothing sending: a hold-to-record mic. */\n idleAction?: ReactNode;\n /** Shown instead of `leading` and the input (a recording in progress). Label it yourself: it's one region to VoiceOver. */\n replaceInput?: ReactNode;\n /** Touch and hold Send for these (one runs straight away; several open a menu). Each is also an accessibility action on Send. */\n sendActions?: readonly ComposerSendAction[];\n /** Title of the menu when there are several `sendActions`. */\n sendActionsTitle?: string;\n /** The hint on Send when it has `sendActions`. Default \"Touch and hold for more options\". */\n sendActionsHint?: string;\n /** Passed to the input (to insert at the cursor, say). */\n onSelectionChange?: (e: { nativeEvent: { selection: { start: number; end: number } } }) => void;\n /**\n * The input takes text (default). When false, Send is off and the input reads as disabled.\n * `idleAction` is the app's, so disable it too.\n */\n editable?: boolean;\n testID?: string;\n}\n\n/** Another way to send (touch and hold Send). */\nexport interface ComposerSendAction {\n id: string;\n label: string;\n onPress: () => void;\n destructive?: boolean;\n}\n\nconst LINE = 22;\nconst PAD_Y = 8;\n\nexport function NativeComposerBar({\n value,\n onChangeText,\n onSend,\n sending = false,\n disabled = false,\n placeholder = \"Message\",\n sendLabel = \"Send\",\n sendingLabel = \"Sending\",\n maxLength,\n maxLines = 6,\n modes,\n modesLabel = \"Send as\",\n mode,\n onModeChange,\n leading,\n trailing,\n above,\n hasContent,\n idleAction,\n replaceInput,\n sendActions,\n sendActionsTitle,\n sendActionsHint = \"Touch and hold for more options\",\n onSelectionChange,\n editable = true,\n testID = \"composer\",\n}: NativeComposerBarProps) {\n const colors = useThemeRoles();\n const { symbol, icons } = useGenesisModules();\n // No icon module: the arrow would draw nothing, so the button says its label.\n const hasIcon = Boolean(symbol || icons?.[\"arrow-up\"]);\n const current = modes?.find((m) => m.id === mode) ?? modes?.[0];\n const internal = current?.tone === \"internal\";\n const blank = !(hasContent ?? value.trim().length > 0);\n const canSend = !blank && !disabled && !sending && editable;\n const actions = sendActions?.length ? sendActions : null;\n const [menuOpen, setMenuOpen] = useState(false);\n const idle = idleAction != null && blank && !sending;\n const sendPress = usePressFeedback({ haptic: \"light\", scale: 0.9, disabled: !canSend });\n // A multiline input grows with its text by itself; this caps it, after which it scrolls.\n // Lines grow with the person's text size (Dynamic Type, Android font scale).\n const fontScale = Dimensions.get(\"window\").fontScale || 1;\n const maxHeight = Math.ceil(LINE * fontScale) * maxLines + PAD_Y * 2;\n // Say \"Sending\" on iOS too (a live region is Android-only).\n useEffect(() => {\n if (sending && Platform.OS === \"ios\") (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(sendingLabel);\n }, [sending, sendingLabel]);\n\n return (\n <View\n testID={testID}\n style={{\n paddingHorizontal: 12,\n paddingTop: 8,\n paddingBottom: 8,\n gap: 6,\n backgroundColor: colors.groupedBackground,\n borderTopWidth: internal ? 2 : 0,\n borderTopColor: colors.warning,\n }}\n >\n {modes && modes.length > 1 ? (\n <View testID={`${testID}-modes`} accessibilityRole=\"tablist\" accessibilityLabel={modesLabel} style={{ flexDirection: \"row\", gap: 4 }}>\n {modes.map((m) => {\n const on = m.id === current?.id;\n return (\n <Pressable\n key={m.id}\n testID={`${testID}-mode-${m.id}`}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: on }}\n accessibilityLabel={m.label}\n onPress={() => onModeChange?.(m.id)}\n style={{\n minHeight: 44,\n justifyContent: \"center\",\n paddingHorizontal: 12,\n borderRadius: 22,\n backgroundColor: on ? colors.fill : \"transparent\",\n borderWidth: m.tone === \"internal\" ? 1 : 0,\n borderColor: colors.warning,\n }}\n >\n <NativeText preset=\"label\" style={{ color: on ? colors.label : colors.secondaryLabel }}>\n {m.label}\n </NativeText>\n </Pressable>\n );\n })}\n </View>\n ) : null}\n {above}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 8 }}>\n {replaceInput != null ? (\n <View style={{ flex: 1, minHeight: 44, justifyContent: \"center\" }}>{replaceInput}</View>\n ) : (\n <>\n {leading}\n <TextInput\n testID={`${testID}-input`}\n value={value}\n onChangeText={onChangeText}\n placeholder={internal ? current!.label : placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={internal ? current!.label : placeholder}\n accessibilityState={editable ? undefined : { disabled: true }}\n editable={editable}\n onSelectionChange={onSelectionChange}\n multiline\n maxLength={maxLength}\n style={{\n flex: 1,\n minHeight: 44,\n maxHeight,\n textAlignVertical: \"center\",\n paddingHorizontal: 14,\n paddingTop: PAD_Y,\n paddingBottom: PAD_Y,\n borderRadius: 22,\n fontSize: 17,\n lineHeight: LINE,\n color: colors.label as string,\n backgroundColor: colors.surface,\n borderWidth: internal ? 1 : 0,\n borderColor: colors.warning,\n opacity: editable ? 1 : 0.6,\n }}\n />\n </>\n )}\n {trailing}\n {idle ? (\n <View testID={`${testID}-idle`} style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n {idleAction}\n </View>\n ) : sending ? (\n <View testID={`${testID}-sending`} accessible accessibilityLabel={sendingLabel} accessibilityLiveRegion=\"polite\" style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <ActivityIndicator />\n </View>\n ) : (\n <Animated.View style={sendPress.style}>\n <Pressable\n testID={`${testID}-send`}\n accessibilityRole=\"button\"\n accessibilityLabel={sendLabel}\n accessibilityState={{ disabled: !canSend }}\n accessibilityHint={actions ? sendActionsHint : undefined}\n accessibilityActions={actions && canSend ? actions.map((a) => ({ name: a.id, label: a.label })) : undefined}\n onAccessibilityAction={actions ? (e) => actions.find((a) => a.id === e.nativeEvent.actionName)?.onPress() : undefined}\n onLongPress={actions ? () => (actions.length === 1 ? actions[0]!.onPress() : setMenuOpen(true)) : undefined}\n disabled={!canSend}\n onPressIn={sendPress.onPressIn}\n onPressOut={sendPress.onPressOut}\n onPress={() => {\n sendPress.confirm();\n onSend();\n }}\n style={{ minWidth: 44, height: 44, paddingHorizontal: hasIcon ? 0 : 14, borderRadius: 22, alignItems: \"center\", justifyContent: \"center\", backgroundColor: canSend ? colors.tint : colors.fill }}\n >\n {hasIcon ? (\n <NativeIcon name=\"arrow-up\" size={20} color={canSend ? colors.background : colors.tertiaryLabel} />\n ) : (\n <NativeText preset=\"label\" className={canSend ? \"text-primary-foreground\" : undefined} style={canSend ? undefined : { color: colors.tertiaryLabel }}>\n {sendLabel}\n </NativeText>\n )}\n </Pressable>\n </Animated.View>\n )}\n </View>\n {actions && actions.length > 1 ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} actions={actions} {...(sendActionsTitle ? { title: sendActionsTitle } : {})} testID={`${testID}-send-menu`} /> : null}\n </View>\n );\n}\n"]}