@marktiderman/genesis-ui-native 3.10.0 → 3.12.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 (82) hide show
  1. package/README.md +69 -0
  2. package/dist/{chunk-ZUR4PK77.js → chunk-47CDRP43.js} +45 -166
  3. package/dist/chunk-47CDRP43.js.map +1 -0
  4. package/dist/{chunk-SG7LYX7Z.js → chunk-BQYT6TH2.js} +14 -6
  5. package/dist/chunk-BQYT6TH2.js.map +1 -0
  6. package/dist/{chunk-EAHK7D7N.js → chunk-C2ARUGT7.js} +146 -42
  7. package/dist/chunk-C2ARUGT7.js.map +1 -0
  8. package/dist/{chunk-VEWSY4TZ.js → chunk-D4UU6KIF.js} +236 -21
  9. package/dist/chunk-D4UU6KIF.js.map +1 -0
  10. package/dist/{chunk-GGH3ZQNO.js → chunk-TUDJDIGC.js} +4 -4
  11. package/dist/{chunk-GGH3ZQNO.js.map → chunk-TUDJDIGC.js.map} +1 -1
  12. package/dist/{chunk-PMS2V46D.js → chunk-VHUUOH46.js} +2 -2
  13. package/dist/{chunk-PMS2V46D.js.map → chunk-VHUUOH46.js.map} +1 -1
  14. package/dist/{chunk-IWWXERKQ.js → chunk-X5CPLUPZ.js} +1236 -136
  15. package/dist/chunk-X5CPLUPZ.js.map +1 -0
  16. package/dist/components/index.d.ts +510 -25
  17. package/dist/components/index.js +5 -5
  18. package/dist/data/index.d.ts +176 -34
  19. package/dist/data/index.js +1312 -985
  20. package/dist/data/index.js.map +1 -1
  21. package/dist/hooks/index.d.ts +2 -2
  22. package/dist/hooks/index.js +1 -1
  23. package/dist/icons/lucide.d.ts +1 -1
  24. package/dist/index.d.ts +6 -3
  25. package/dist/index.js +7 -7
  26. package/dist/layouts/index.d.ts +79 -6
  27. package/dist/layouts/index.js +5 -5
  28. package/dist/{native-modules-Bkm1jHO-.d.ts → native-modules-6JnyeGR-.d.ts} +55 -1
  29. package/package.json +70 -4
  30. package/src/components/__tests__/combobox.test.tsx +20 -0
  31. package/src/components/__tests__/number-input.test.tsx +112 -1
  32. package/src/components/__tests__/parity-controls.test.tsx +366 -0
  33. package/src/components/__tests__/parity-display.test.tsx +295 -0
  34. package/src/components/__tests__/twin-props.test.tsx +114 -0
  35. package/src/components/badge.tsx +3 -0
  36. package/src/components/button-group.tsx +50 -0
  37. package/src/components/calendar.tsx +183 -0
  38. package/src/components/carousel.tsx +175 -0
  39. package/src/components/chart.tsx +268 -0
  40. package/src/components/chip-group.tsx +34 -14
  41. package/src/components/choice-card.tsx +56 -19
  42. package/src/components/combobox.tsx +6 -5
  43. package/src/components/empty-state.tsx +40 -0
  44. package/src/components/flatten-children.ts +13 -0
  45. package/src/components/index.ts +49 -1
  46. package/src/components/inline-alert.tsx +3 -1
  47. package/src/components/input-group.tsx +99 -0
  48. package/src/components/input-otp.tsx +124 -0
  49. package/src/components/input.tsx +40 -12
  50. package/src/components/list-item.tsx +20 -4
  51. package/src/components/number-input.tsx +45 -15
  52. package/src/components/radio-group.tsx +5 -0
  53. package/src/components/resource.tsx +227 -0
  54. package/src/components/settings-row.tsx +194 -0
  55. package/src/components/slider.tsx +3 -9
  56. package/src/components/sortable-list.tsx +287 -0
  57. package/src/components/stat-card.tsx +106 -0
  58. package/src/components/stepper.tsx +4 -2
  59. package/src/components/widget-tile.tsx +66 -0
  60. package/src/components/workspace-switcher.tsx +217 -0
  61. package/src/data/NativeCustomView.tsx +117 -0
  62. package/src/data/NativeFormFields.tsx +312 -0
  63. package/src/data/NativeRecordPeek.tsx +130 -0
  64. package/src/data/NativeResourceFormField.tsx +32 -0
  65. package/src/data/__tests__/parity-data.test.tsx +350 -0
  66. package/src/data/index.ts +13 -0
  67. package/src/data/resource-view/NativeResourceView.tsx +17 -2
  68. package/src/data/resource-view/__tests__/native-resource-gallery.test.tsx +8 -0
  69. package/src/data/resource-view/index.ts +1 -0
  70. package/src/data/resource-view/mapping.ts +4 -4
  71. package/src/layouts/__tests__/keyboard-scroll.test.tsx +58 -2
  72. package/src/layouts/__tests__/notifications-page.test.tsx +12 -0
  73. package/src/layouts/index.ts +13 -0
  74. package/src/layouts/keyboard.tsx +22 -2
  75. package/src/layouts/notifications-page.tsx +13 -35
  76. package/src/layouts/pages.tsx +262 -0
  77. package/src/native-modules.tsx +37 -0
  78. package/dist/chunk-EAHK7D7N.js.map +0 -1
  79. package/dist/chunk-IWWXERKQ.js.map +0 -1
  80. package/dist/chunk-SG7LYX7Z.js.map +0 -1
  81. package/dist/chunk-VEWSY4TZ.js.map +0 -1
  82. package/dist/chunk-ZUR4PK77.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/layouts/screen-container.tsx","../src/layouts/nav-bar.tsx","../src/layouts/inbox-page.tsx"],"names":["jsx","jsxs","View","SafeAreaView","ScrollView","Pressable"],"mappings":";;;;;;;;;;;;AAkIO,SAAS,qBACd,KAAA,EACyB;AACzB,EAAA,MAAM;AAAA,IACJ,WAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAA;AAAA,IACA,kBAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,MAAM,OAAgC,EAAC;AACvC,EAAA,IAAI,WAAA,KAAgB,MAAA,EAAW,IAAA,CAAK,KAAA,GAAQ,WAAA;AAC5C,EAAA,IAAI,UAAA,OAAiB,UAAA,GAAa,UAAA;AAClC,EAAA,IAAI,WAAA,OAAkB,WAAA,GAAc,WAAA;AACpC,EAAA,IAAI,KAAA,EAAO;AAET,IAAA,IAAA,CAAK,gBAAA,GAAmB,IAAA;AACxB,IAAA,IAAI,uBAAuB,aAAA,EAAe;AACxC,MAAA,IAAA,CAAK,iBAAA,GAAoB,IAAA;AAAA,IAC3B,CAAA,MAAA,IAAW,uBAAuB,QAAA,EAAU;AAC1C,MAAA,IAAA,CAAK,6BAAA,GAAgC,IAAA;AAAA,IACvC;AAAA,EACF;AAEA,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,MAAA,CAAO,M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,EAAK,QAAgB,KAAA,EAAO,EAAE,KAAA,EAAO,EAAA,EAAI,QAAQ,EAAA,EAAI,YAAA,EAAc,CAAA,EAAG,eAAA,EAAiB,OAAgB,EAAG,CAAA;AACpH;AAEA,SAAS,aAAA,CAAc,EAAE,WAAA,EAAa,MAAA,EAAO,EAA+B;AAC1E,EAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,EAAA,uBACEF,GAAAA,CAAC,kBAAA,EAAA,EAAmB,UAAA,EAAY,KAAA,EAAO,IAAA,EAAK,OAAA,EAAQ,kBAAA,EAAmB,cAAA,EAAe,SAAA,EAAU,MAAA,EAAO,MAAA,EAAgB,CAAA;AAE3H;AAEA,SAAS,aAAa,EAAE,KAAA,EAAO,MAAM,WAAA,EAAa,QAAA,EAAU,QAAO,EAA8B;AAC/F,EAAA,uBACEA,GAAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,WAAA;AAAA,MACR,KAAA;AAAA,MACA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,aAAA,EACE,WAAA,IAAe,QAAA,mBACbA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,QAAA,EAAU,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,OAAA,CAAA,EAC/C,uBACH,CAAA,GACE;AAAA;AAAA,GAER;AAEJ","file":"chunk-GGH3ZQNO.js","sourcesContent":["/**\n * ScreenContainer — Layer-2 page primitive.\n *\n * Wires the chrome every layout needs without imposing layout structure:\n * - Safe-area edges (configurable via `safeAreaEdges`)\n * - StatusBar style (light / dark / auto)\n * - Scroll vs static body\n * - Tokens-aware background (`bg-background`)\n * - A loading state (`loading`): a centred `NativeLoadingState` in place of the body\n * - Pull to refresh (`onRefresh` + `refreshing`): a theme-tinted `NativeRefreshControl`\n *\n * Header customization is delegated: pass `headerLeft`, `headerRight`,\n * `large`, `scrollEdgeBehavior`, `safeAreaEdges`, plus any direct\n * `headerOptions` passthrough to `<Stack.Screen options={...} />`. We\n * **do not** render the navigation header ourselves — Expo Router /\n * React Navigation render the platform-native header. Consumer either:\n *\n * (a) Wraps the screen in `<ScreenContainer>` and ALSO declares\n * `<Stack.Screen options={headerOptionsFromProps(props)} />` at the\n * top of the screen (we export a helper `composeHeaderOptions` for\n * this), OR\n * (b) Imports `<NavBarTitle>` / `<NavBarSearchBar>` / `<NavBarSaveButton>`\n * sub-primitives and threads them through `headerLeft` / `headerRight`\n * options manually.\n *\n * The Layer-3/4 layouts (SettingsPage, etc.) compose ScreenContainer + a\n * helper that wires Stack.Screen so consumers get the 3-line ergonomics.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport { ScrollView, StatusBar, View, type ViewStyle } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeMode } from \"../hooks/use-theme-mode\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\n\nexport type SafeAreaEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport type ScrollEdgeBehavior = \"match\" | \"transparent\" | \"opaque\";\n\nexport interface ScreenContainerProps {\n /** Screen body. Pass any node tree. */\n children: ReactNode;\n /** When `true`, the body is wrapped in a vertical ScrollView. Default `false`. */\n scroll?: boolean;\n /**\n * SafeAreaView edges. Defaults to `[\"left\", \"right\"]` — top/bottom are\n * normally handled by the navigation header / tab bar.\n */\n safeAreaEdges?: SafeAreaEdge[];\n /**\n * StatusBar appearance. `\"auto\"` follows the resolved theme mode.\n */\n statusBar?: \"light\" | \"dark\" | \"auto\" | \"hidden\";\n /**\n * Force light or dark theme on this screen regardless of OS preference.\n * Default `\"system\"` (follow OS).\n */\n themeMode?: \"light\" | \"dark\" | \"system\";\n /** Override root container className. */\n className?: string;\n /** Override inner content container className (the ScrollView's contentContainerClassName when scroll=true). */\n contentClassName?: string;\n /**\n * `keyboardShouldPersistTaps` for the inner ScrollView. Default `\"handled\"`.\n * Only used when `scroll` is true.\n */\n keyboardShouldPersistTaps?: \"always\" | \"never\" | \"handled\";\n /**\n * When `true`, a centred `NativeLoadingState` (theme-tinted spinner,\n * announced as loading) replaces the body, inside the same safe area and\n * background. Use it for redirect and first-load screens: the body is\n * unmounted while it's on, so a form underneath loses its state. Default `false`.\n */\n loading?: boolean;\n /** Text under the spinner while `loading`, and what screen readers announce: pass translated text. */\n loadingLabel?: string;\n /**\n * Pull to refresh: a theme-tinted `NativeRefreshControl` on the body, as InboxPage and\n * NotificationsPage have. Pulling needs a scroll view, so passing it makes the body scroll\n * (as `scroll`). Off unless passed. Never with a list child (FlatList, SectionList,\n * NativeResourceView, InboxPage): a list inside a ScrollView loses virtualization, and those\n * lists have their own pull to refresh.\n */\n onRefresh?: () => void | Promise<void>;\n /** The refresh spinner shows while `true`: pass your query's refetching state. Default `false`. */\n refreshing?: boolean;\n /** Style on the root, e.g. a theme-role background color. */\n style?: ViewStyle;\n /** testID on the root container. */\n testID?: string;\n}\n\n/**\n * Layer-3 named-prop slots that layouts can accept and forward to\n * `composeHeaderOptions()` for `<Stack.Screen options={...}>`.\n */\nexport interface ScreenHeaderProps {\n /** Custom header title. Falls back to `<Stack.Screen name>` mapping. */\n headerTitle?: string;\n /** Custom node rendered on the left of the nav bar. */\n headerLeft?: () => ReactNode;\n /** Custom node rendered on the right of the nav bar. */\n headerRight?: () => ReactNode;\n /** When true, iOS uses large-title mode + scroll-edge appearance. */\n large?: boolean;\n /** iOS scroll-edge behavior. `\"match\"` collapses, `\"transparent\"` always transparent, `\"opaque\"` always opaque. */\n scrollEdgeBehavior?: ScrollEdgeBehavior;\n /** Direct passthrough merged INTO the resolved options object. Wins over named props. */\n headerOptions?: Record<string, unknown>;\n}\n\n/**\n * Compose a `<Stack.Screen options={...}>` object from Layer-3 named\n * props + a direct `headerOptions` passthrough. Layouts call this and\n * pass the result to `<Stack.Screen>` so the host's expo-router stack\n * renders a platform-native large title / scroll-edge appearance.\n *\n * Usage (in a layout primitive):\n *\n * const opts = composeHeaderOptions({\n * headerTitle: \"Settings\",\n * large: true,\n * scrollEdgeBehavior: \"match\",\n * headerOptions: rest.headerOptions,\n * });\n * return <><Stack.Screen options={opts} /><ScreenContainer>...</ScreenContainer></>;\n */\nexport function composeHeaderOptions(\n props: ScreenHeaderProps,\n): Record<string, unknown> {\n const {\n headerTitle,\n headerLeft,\n headerRight,\n large,\n scrollEdgeBehavior,\n headerOptions,\n } = props;\n\n const opts: Record<string, unknown> = {};\n if (headerTitle !== undefined) opts.title = headerTitle;\n if (headerLeft) opts.headerLeft = headerLeft;\n if (headerRight) opts.headerRight = headerRight;\n if (large) {\n // iOS large-title mode. Android falls back to standard.\n opts.headerLargeTitle = true;\n if (scrollEdgeBehavior === \"transparent\") {\n opts.headerTransparent = true;\n } else if (scrollEdgeBehavior === \"opaque\") {\n opts.headerLargeTitleShadowVisible = true;\n }\n }\n // Direct passthrough wins.\n if (headerOptions) {\n Object.assign(opts, headerOptions);\n }\n return opts;\n}\n\nconst DEFAULT_EDGES: SafeAreaEdge[] = [\"left\", \"right\"];\n\n// A see-through Android status bar. React Native 0.88 dropped both props from StatusBar's types\n// (Android is always edge to edge there, so they do nothing); earlier versions still need them.\n// Spread untyped so the screen compiles against either.\nconst TRANSLUCENT_ANDROID_BAR: Record<string, unknown> = { translucent: true, backgroundColor: \"transparent\" };\n\n/**\n * Resolve the StatusBar bar style from the user's `statusBar` setting +\n * the resolved theme mode. `\"auto\"` follows theme; explicit overrides\n * win; anything else falls back to `\"default\"`.\n */\nfunction resolveBarStyle(\n statusBar: \"light\" | \"dark\" | \"auto\" | \"hidden\",\n resolvedMode: \"light\" | \"dark\",\n): \"default\" | \"light-content\" | \"dark-content\" {\n if (statusBar === \"auto\") {\n return resolvedMode === \"dark\" ? \"light-content\" : \"dark-content\";\n }\n if (statusBar === \"light\") return \"light-content\";\n if (statusBar === \"dark\") return \"dark-content\";\n return \"default\";\n}\n\nexport function ScreenContainer({\n children,\n scroll = false,\n safeAreaEdges = DEFAULT_EDGES,\n statusBar = \"auto\",\n themeMode = \"system\",\n className,\n contentClassName,\n keyboardShouldPersistTaps = \"handled\",\n loading = false,\n loadingLabel,\n onRefresh,\n refreshing = false,\n style,\n testID,\n}: ScreenContainerProps) {\n const osMode = useThemeMode();\n const resolvedMode = themeMode === \"system\" ? osMode : themeMode;\n const barStyle = resolveBarStyle(statusBar, resolvedMode);\n\n const body = loading ? (\n <View testID={testID ? `${testID}-body` : undefined} className={cn(\"flex-1\", contentClassName)}>\n <NativeLoadingState fullScreen={false} label={loadingLabel} testID={`${testID ?? \"screen-container\"}-loading`} />\n </View>\n ) : scroll || onRefresh ? (\n <ScrollView\n testID={testID ? `${testID}-scroll` : undefined}\n refreshControl={\n onRefresh ? (\n <NativeRefreshControl testID={`${testID ?? \"screen-container\"}-refresh`} refreshing={refreshing} onRefresh={() => void onRefresh()} />\n ) : undefined\n }\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerClassName={cn(\"flex-grow\", contentClassName)}\n >\n {children}\n </ScrollView>\n ) : (\n <View\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"flex-1\", contentClassName)}\n >\n {children}\n </View>\n );\n\n return (\n <SafeAreaView\n testID={testID ?? \"screen-container\"}\n edges={safeAreaEdges}\n className={cn(\"flex-1 bg-background\", className)}\n style={style}\n >\n {statusBar !== \"hidden\" ? (\n <StatusBar\n barStyle={\n barStyle as\n | \"default\"\n | \"light-content\"\n | \"dark-content\"\n }\n {...TRANSLUCENT_ANDROID_BAR}\n />\n ) : (\n <StatusBar hidden />\n )}\n {body}\n </SafeAreaView>\n );\n}\n","/**\n * Nav-bar sub-primitives — escape hatches for `<Stack.Screen>` `headerLeft`,\n * `headerRight`, and custom title view.\n *\n * Use these when the named-prop slots on a layout aren't enough — e.g.,\n * a screen needs a save button on the right that's wired to dirty-state,\n * or a search bar replaces the title on a results screen.\n *\n * Pass directly into `headerLeft={() => <NavBarSearchBar ... />}` or\n * compose into a custom `headerTitle={() => <NavBarTitle ... />}` slot.\n *\n * @stability Beta\n */\nimport { Pressable, Text, TextInput, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\n// ---------------------------------------------------------------------------\n// NavBarSaveButton\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSaveButtonProps {\n /** Press handler. Disabled when not provided OR when `disabled`/`loading`. */\n onPress?: () => void;\n /** Visible label. Default `\"Save\"`. */\n label?: string;\n /** When true, the button is muted and not pressable. Use this for clean / pristine forms. */\n disabled?: boolean;\n /** When true, label switches to a busy indicator and presses are blocked. */\n loading?: boolean;\n /** When true, render label in destructive tone. */\n destructive?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarSaveButton({\n onPress,\n label = \"Save\",\n disabled,\n loading,\n destructive,\n className,\n testID,\n}: NavBarSaveButtonProps) {\n const isDisabled = !!disabled || !!loading || !onPress;\n return (\n <Pressable\n testID={testID ?? \"nav-bar-save-button\"}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled: isDisabled, busy: !!loading }}\n onPress={isDisabled ? undefined : onPress}\n disabled={isDisabled}\n className={cn(\"min-h-[44px] justify-center px-3\", className)}\n hitSlop={8}\n >\n <Text\n className={cn(\n \"text-base font-semibold\",\n destructive ? \"text-destructive\" : \"text-primary-text\",\n isDisabled && \"opacity-40\"\n )}\n >\n {loading ? \"…\" : label}\n </Text>\n </Pressable>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarTitle\n// ---------------------------------------------------------------------------\n\nexport interface NavBarTitleProps {\n /** Title text. */\n title: string;\n /** Optional smaller subtitle line under the title. */\n subtitle?: string;\n /** Optional press handler — turns the title row into a tap target (e.g., reveal a picker). */\n onPress?: () => void;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarTitle({\n title,\n subtitle,\n onPress,\n className,\n testID,\n}: NavBarTitleProps) {\n const inner = (\n <View className={cn(\"items-center justify-center\", className)}>\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className=\"text-base font-semibold text-foreground\"\n numberOfLines={1}\n >\n {title}\n </Text>\n {subtitle ? (\n <Text\n testID={testID ? `${testID}-subtitle` : undefined}\n className=\"text-xs text-muted-foreground\"\n numberOfLines={1}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"nav-bar-title\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n onPress={onPress}\n hitSlop={8}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View testID={testID ?? \"nav-bar-title\"} accessibilityRole=\"header\">\n {inner}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarSearchBar\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSearchBarProps {\n value: string;\n onChangeText: (next: string) => void;\n placeholder?: string;\n /** Called when the user submits the search (return key). */\n onSubmit?: () => void;\n /** Render a clear (X) button when value is non-empty. Default true. */\n clearable?: boolean;\n className?: string;\n testID?: string;\n}\n\n/**\n * Inline search input meant to occupy the title slot on a search results\n * screen. For a sticky search-below-the-header pattern, prefer the\n * standalone <NativeSearchBar> primitive.\n */\nexport function NavBarSearchBar({\n value,\n onChangeText,\n placeholder = \"Search\",\n onSubmit,\n clearable = true,\n className,\n testID,\n}: NavBarSearchBarProps) {\n return (\n <View\n testID={testID ?? \"nav-bar-search\"}\n className={cn(\n \"min-h-[36px] flex-row items-center rounded-full bg-muted px-3\",\n className\n )}\n >\n <TextInput\n testID={testID ? `${testID}-input` : undefined}\n accessibilityLabel={placeholder}\n value={value}\n onChangeText={onChangeText}\n onSubmitEditing={onSubmit}\n placeholder={placeholder}\n placeholderTextColor={nativeColors.neutral[400]}\n returnKeyType=\"search\"\n autoCorrect={false}\n autoCapitalize=\"none\"\n clearButtonMode={clearable ? \"while-editing\" : \"never\"}\n className=\"flex-1 text-base text-foreground\"\n />\n {clearable && value.length > 0 ? (\n <Pressable\n testID={testID ? `${testID}-clear` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear search\"\n onPress={() => onChangeText(\"\")}\n hitSlop={8}\n className=\"ml-2 px-1\"\n >\n <Text className=\"text-base text-muted-foreground\">×</Text>\n </Pressable>\n ) : null}\n </View>\n );\n}\n","/**\n * InboxPage — a list of conversations or tickets: unread state, a time, a\n * preview line, swipe actions, pull to refresh, paging and an empty state.\n *\n * Generic: the rows are whatever the app has (support reports, direct\n * messages, an idea board). Data and actions come in as props; the layout\n * draws them the platform's way. On iOS it is the Settings app's inset\n * grouped style, like `SettingsPage`: the page is `groupedBackground`, the\n * rows one rounded group on `surface` with hairline separators that start at\n * the text. On Android rows are full width.\n *\n * Swipe actions: each row's `swipeActions` are always reachable without a\n * gesture library, as VoiceOver / TalkBack custom actions and on long press\n * (`NativeContextMenu`). The swipe itself is `NativeSwipeRow`, once the app\n * passes `GenesisModules.swipeable` (`ReanimatedSwipeable` from\n * react-native-gesture-handler, an optional peer), with each action's `side`.\n * The `swipeable` slot takes your own wrapper instead; it receives the actions\n * and the row.\n *\n * Rows: `avatar` puts a picture of who it is between the unread dot and the\n * text (an unread count shows at the end of the row, as in Mail); `leading`\n * replaces the dot.\n *\n * Slots: `row`, `swipeable`, `header` (above the group), `footer` (below it,\n * the paging spinner by default) and `empty`. `slots` swaps a part for your\n * component (same props), `slotProps` feeds the default more props, `null`\n * drops it.\n *\n * Header: `getInboxPageStackOptions()` for `<Stack.Screen options>`.\n *\n * @stability Beta\n */\nimport { createContext, Fragment, useContext, useState, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { Alert, FlatList, Platform, Pressable, ScrollView, StyleSheet, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeText } from \"../components/text\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeBadge } from \"../components/badge\";\nimport { NativeContextMenu } from \"../components/context-menu\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\nimport { NativeSwipeRow } from \"../components/swipe-row\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\nimport { formatInboxTime, type InboxItem, type InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\n\n// The conversation contract is genesis-core's, shared with genesis-ui's InboxPage.\nexport type { InboxItem, InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\nexport { formatInboxTime } from \"@marktiderman/genesis-core/conversation\";\n\n/** The parts `slots` and `slotProps` reach, with the props each receives. */\nexport type InboxPageSlotMap = {\n row: InboxItem & { testID: string; isFirst: boolean; isLast: boolean; timeLabel: string | null };\n swipeable: { actions: InboxSwipeAction[]; testID: string; children?: ReactNode };\n header: { testID: string };\n footer: { loadingMore: boolean; testID: string };\n empty: { title: string; body: string; actionLabel?: string; onAction?: () => void; testID: string };\n};\n\nexport interface InboxPageProps extends ScreenHeaderProps {\n /** Newest first, as they should show. Empty → the empty state. */\n items: InboxItem[];\n refreshing?: boolean;\n onRefresh?: () => void | Promise<void>;\n /** Called near the end of the list, to load the next page. */\n onEndReached?: () => void;\n /** A next page is loading: the default footer shows a spinner. */\n loadingMore?: boolean;\n /** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */\n header?: ReactNode;\n /** An optional title over the group, in the Settings header style. */\n sectionTitle?: string;\n emptyTitle?: string;\n emptyBody?: string;\n /** The first page is loading: a spinner instead of the empty state. */\n loading?: boolean;\n /** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */\n error?: boolean;\n errorTitle?: string;\n errorBody?: string;\n /** A button in the empty state (\"Send feedback\"). */\n emptyActionLabel?: string;\n onEmptyAction?: () => void;\n /** How a row's time reads. Default: the time today, \"Yesterday\", the weekday this week, else the date. */\n formatTime?: (date: Date, now: Date) => string;\n /** The clock, for tests. */\n now?: () => Date;\n slots?: Slots<InboxPageSlotMap>;\n slotProps?: SlotPropsFor<InboxPageSlotMap>;\n /** testID on the root. Default `\"inbox-page\"`. */\n testID?: string;\n}\n\n/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */\nexport function getInboxPageStackOptions(props: ScreenHeaderProps & { headerTitle?: string }): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Inbox\",\n large: props.large ?? true,\n scrollEdgeBehavior: props.scrollEdgeBehavior ?? \"match\",\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\n/** Opens the page's one actions menu for a row. */\nconst OpenRowMenu = createContext<(row: InboxPageSlotMap[\"row\"]) => void>(() => undefined);\n\n/** The row's leading padding, the unread dot's column, an avatar's default size and its gap to the text. */\nconst ROW_PADDING = 16;\nconst LEADING_WIDTH = 18;\nconst DEFAULT_AVATAR = 40;\nconst AVATAR_GAP = 12;\n\n/** UIKit's inset grouped margin on a phone, in points (as SettingsPage). */\nconst IOS_GROUP_MARGIN = 16;\n\nfunction iosGroupRadius(): number {\n return Number.parseFloat(String(Platform.Version)) >= 26 ? 26 : 10;\n}\n\nexport function InboxPage({\n items,\n refreshing,\n onRefresh,\n onEndReached,\n loadingMore = false,\n header,\n sectionTitle,\n emptyTitle,\n emptyBody,\n emptyActionLabel,\n onEmptyAction,\n loading = false,\n error = false,\n errorTitle,\n errorBody,\n formatTime = formatInboxTime,\n now = () => new Date(),\n slots = {},\n slotProps = {},\n testID = \"inbox-page\",\n}: InboxPageProps) {\n const colors = useThemeRoles();\n const clock = now();\n // One menu for the page: its row stays set while the sheet goes, so its words don't vanish first.\n const [menuRow, setMenuRow] = useState<InboxPageSlotMap[\"row\"] | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n const rows: InboxPageSlotMap[\"row\"][] = items.map((item, index) => ({\n ...item,\n testID: item.testID ?? `${testID}-row-${item.id}`,\n isFirst: index === 0,\n isLast: index === items.length - 1,\n timeLabel: item.timestamp ? formatTime(typeof item.timestamp === \"string\" ? new Date(item.timestamp) : item.timestamp, clock) : null,\n }));\n\n const headerNode = (\n <View>\n {header ?? renderSlot(EmptyPart, slots.header, { testID: `${testID}-header` }, slotProps.header)}\n {sectionTitle ? <SectionTitle title={sectionTitle} testID={`${testID}-section-title`} /> : null}\n </View>\n );\n\n const refreshControl = onRefresh ? <NativeRefreshControl testID={`${testID}-refresh`} refreshing={!!refreshing} onRefresh={() => void onRefresh()} /> : undefined;\n\n if (items.length === 0) {\n // A scroll view, not a plain view: under a large-title (or translucent) header only a\n // scroll view's automatic content inset moves the content below the header, and pull to\n // refresh needs one too.\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <ScrollView\n testID={`${testID}-empty-scroll`}\n contentInsetAdjustmentBehavior=\"automatic\"\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={{ flexGrow: 1, paddingTop: 8, paddingBottom: 32 }}\n refreshControl={refreshControl}\n >\n {headerNode}\n {loading ? (\n <NativeLoadingState fullScreen={false} testID={`${testID}-loading`} />\n ) : (\n renderSlot(\n DefaultEmpty,\n slots.empty,\n error\n ? {\n title: errorTitle ?? \"Couldn't load this\",\n body: errorBody ?? \"Check your connection, then pull to refresh.\",\n actionLabel: onRefresh ? \"Try again\" : undefined,\n onAction: onRefresh ? () => void onRefresh() : undefined,\n testID: `${testID}-error`,\n }\n : {\n title: emptyTitle ?? \"Nothing here yet\",\n body: emptyBody ?? \"When there's something new, it shows up here.\",\n actionLabel: emptyActionLabel,\n onAction: onEmptyAction,\n testID: `${testID}-empty`,\n },\n slotProps.empty,\n )\n )}\n </ScrollView>\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <OpenRowMenu.Provider\n value={(row) => {\n setMenuRow(row);\n setMenuOpen(true);\n }}\n >\n <FlatList\n testID={`${testID}-list`}\n data={rows}\n keyExtractor={(row) => row.id}\n contentInsetAdjustmentBehavior=\"automatic\"\n // The header can hold a text field (the idea board's \"Suggest\"): its button's first tap\n // must press it, not only close the keyboard.\n keyboardShouldPersistTaps=\"handled\"\n ListHeaderComponent={headerNode}\n ListFooterComponent={renderSlot(DefaultFooter, slots.footer, { loadingMore, testID: `${testID}-footer` }, slotProps.footer)}\n contentContainerStyle={{ paddingTop: 8, paddingBottom: 32 }}\n onEndReached={onEndReached}\n onEndReachedThreshold={0.5}\n refreshControl={refreshControl}\n renderItem={({ item: row }) => {\n const content = renderSlot(DefaultRow, slots.row, row, slotProps.row);\n const actions = row.swipeActions ?? [];\n return (\n <Fragment>\n {actions.length && slots.swipeable !== null\n ? renderSlot(NativeSwipeRow, slots.swipeable, { actions, testID: `${row.testID}-swipe`, children: content }, slotProps.swipeable)\n : content}\n </Fragment>\n );\n }}\n />\n </OpenRowMenu.Provider>\n {menuRow ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} title={menuRow.title} actions={menuRow.swipeActions ?? []} testID={`${testID}-menu`} /> : null}\n </SafeAreaView>\n );\n}\n\nfunction EmptyPart(_props: InboxPageSlotMap[\"header\"]) {\n return null;\n}\n\nfunction SectionTitle({ title, testID }: { title: string; testID: string }) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n className={ios ? \"px-4 pb-1.5 pt-2\" : \"px-4 pb-2 pt-4 text-primary-text\"}\n style={\n ios\n ? { marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18, textTransform: \"uppercase\" }\n : { fontSize: 14, lineHeight: 20, fontWeight: \"500\" }\n }\n >\n {title}\n </NativeText>\n );\n}\n\n/**\n * Opens a row's actions as the system alert. `InboxPage` now opens `NativeContextMenu`; `NativeResourceView`\n * still uses this.\n */\nexport function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel = \"Cancel\"): void {\n Alert.alert(title, undefined, [\n ...actions.map((a) => ({ text: a.label, style: a.destructive ? (\"destructive\" as const) : (\"default\" as const), onPress: a.onPress })),\n { text: cancelLabel, style: \"cancel\" as const },\n ]);\n}\n\nfunction DefaultRow(row: InboxPageSlotMap[\"row\"]) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n const [pressed, setPressed] = useState(false);\n const openMenu = useContext(OpenRowMenu);\n const actions = row.swipeActions ?? [];\n const radius = iosGroupRadius();\n const unreadLabel = row.unreadCount && row.unreadCount > 0 ? `${row.unreadCount} unread` : row.unread ? \"Unread\" : null;\n const label = [unreadLabel, row.avatar ? row.avatarLabel : null, row.title, row.timeLabel, row.preview, row.meta].filter(Boolean).join(\", \");\n // The separator starts at the text: the row's padding, the dot's column, and the avatar when there is one.\n const [avatarWidth, setAvatarWidth] = useState(0);\n const separatorInset = ROW_PADDING + LEADING_WIDTH + (row.avatar ? (avatarWidth || DEFAULT_AVATAR) + AVATAR_GAP : 0);\n return (\n <View\n testID={`${row.testID}-cell`}\n style={[\n { backgroundColor: colors.surface },\n ios\n ? {\n marginHorizontal: IOS_GROUP_MARGIN,\n borderTopLeftRadius: row.isFirst ? radius : 0,\n borderTopRightRadius: row.isFirst ? radius : 0,\n borderBottomLeftRadius: row.isLast ? radius : 0,\n borderBottomRightRadius: row.isLast ? radius : 0,\n overflow: \"hidden\",\n }\n : null,\n ]}\n >\n <Pressable\n testID={row.testID}\n accessibilityRole={row.onPress ? \"button\" : undefined}\n accessibilityLabel={label}\n accessibilityState={row.selected ? { selected: true } : undefined}\n accessibilityActions={actions.map((a) => ({ name: a.id, label: a.label }))}\n onAccessibilityAction={(event) => actions.find((a) => a.id === event.nativeEvent.actionName)?.onPress()}\n onPress={row.onPress}\n onLongPress={actions.length ? () => openMenu(row) : undefined}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n style={{ flexDirection: \"row\", alignItems: \"center\", paddingHorizontal: ROW_PADDING, paddingVertical: 11, minHeight: 60, backgroundColor: (pressed && row.onPress) || row.selected ? colors.fill : undefined }}\n >\n <View style={{ width: LEADING_WIDTH, alignItems: \"flex-start\" }}>\n {row.leading ?? (row.unreadCount && row.unreadCount > 0 ? null : <UnreadDot unread={!!row.unread} testID={`${row.testID}-unread`} color={colors.tint} />)}\n </View>\n {row.avatar ? (\n <View\n testID={`${row.testID}-avatar`}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n onLayout={(e) => setAvatarWidth(Math.round(e.nativeEvent.layout.width))}\n style={{ marginRight: AVATAR_GAP }}\n >\n {row.avatar}\n </View>\n ) : null}\n <View style={{ flex: 1, minWidth: 0 }}>\n <View style={{ flexDirection: \"row\", alignItems: \"baseline\" }}>\n <NativeText\n numberOfLines={1}\n style={{ flex: 1, color: colors.label, fontSize: 17, lineHeight: 22, fontWeight: row.unread || (row.unreadCount ?? 0) > 0 ? \"600\" : \"400\" }}\n >\n {row.title}\n </NativeText>\n {row.timeLabel ? (\n <NativeText testID={`${row.testID}-time`} style={{ marginLeft: 8, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.timeLabel}\n </NativeText>\n ) : null}\n </View>\n {row.preview ? (\n <NativeText numberOfLines={2} style={{ marginTop: 2, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.preview}\n </NativeText>\n ) : null}\n {row.meta ? (\n <NativeText testID={`${row.testID}-meta`} style={{ marginTop: 4, color: colors.tertiaryLabel, fontSize: 13, lineHeight: 18 }}>\n {row.meta}\n </NativeText>\n ) : null}\n </View>\n {row.unreadCount && row.unreadCount > 0 ? (\n <View style={{ marginLeft: 8 }}>\n <NativeBadge testID={`${row.testID}-count`}>{String(row.unreadCount)}</NativeBadge>\n </View>\n ) : null}\n {row.trailing ? <View style={{ marginLeft: 8 }}>{row.trailing}</View> : row.onPress ? <Chevron color={colors.tertiaryLabel} /> : null}\n </Pressable>\n {row.isLast ? null : (\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={{ flexDirection: \"row\", height: StyleSheet.hairlineWidth }}>\n <View testID={`${row.testID}-separator-inset`} style={{ width: separatorInset }} />\n <View testID={`${row.testID}-separator-line`} style={{ flex: 1, backgroundColor: colors.separator }} />\n </View>\n )}\n </View>\n );\n}\n\nfunction Chevron({ color }: { color: unknown }) {\n return (\n <NativeText accessibilityElementsHidden importantForAccessibility=\"no\" style={{ marginLeft: 8, color: color as string, fontSize: 20, lineHeight: 22 }}>\n ›\n </NativeText>\n );\n}\n\nfunction UnreadDot({ unread, testID, color }: { unread: boolean; testID: string; color: unknown }) {\n if (!unread) return <View testID={testID} style={{ width: 10, height: 10 }} />;\n return <View testID={testID} style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: color as string }} />;\n}\n\nfunction DefaultFooter({ loadingMore, testID }: InboxPageSlotMap[\"footer\"]) {\n if (!loadingMore) return null;\n return (\n <NativeLoadingState fullScreen={false} size=\"small\" accessibilityLabel=\"Loading more\" className=\"py-4\" testID={testID} />\n );\n}\n\nfunction DefaultEmpty({ title, body, actionLabel, onAction, testID }: InboxPageSlotMap[\"empty\"]) {\n return (\n <NativeEmptyState\n variant=\"first-run\"\n title={title}\n body={body}\n testID={testID}\n primaryAction={\n actionLabel && onAction ? (\n <NativeButton onPress={onAction} testID={`${testID}-action`}>\n {actionLabel}\n </NativeButton>\n ) : undefined\n }\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/layouts/screen-container.tsx","../src/layouts/nav-bar.tsx","../src/layouts/inbox-page.tsx"],"names":["jsx","jsxs","View","SafeAreaView","ScrollView","Pressable"],"mappings":";;;;;;;;;;;;AAkIO,SAAS,qBACd,KAAA,EACyB;AACzB,EAAA,MAAM;AAAA,IACJ,WAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAA;A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AAA,MACA,aAAA,EACE,WAAA,IAAe,QAAA,mBACbA,GAAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAS,QAAA,EAAU,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,OAAA,CAAA,EAC/C,uBACH,CAAA,GACE;AAAA;AAAA,GAER;AAEJ","file":"chunk-TUDJDIGC.js","sourcesContent":["/**\n * ScreenContainer — Layer-2 page primitive.\n *\n * Wires the chrome every layout needs without imposing layout structure:\n * - Safe-area edges (configurable via `safeAreaEdges`)\n * - StatusBar style (light / dark / auto)\n * - Scroll vs static body\n * - Tokens-aware background (`bg-background`)\n * - A loading state (`loading`): a centred `NativeLoadingState` in place of the body\n * - Pull to refresh (`onRefresh` + `refreshing`): a theme-tinted `NativeRefreshControl`\n *\n * Header customization is delegated: pass `headerLeft`, `headerRight`,\n * `large`, `scrollEdgeBehavior`, `safeAreaEdges`, plus any direct\n * `headerOptions` passthrough to `<Stack.Screen options={...} />`. We\n * **do not** render the navigation header ourselves — Expo Router /\n * React Navigation render the platform-native header. Consumer either:\n *\n * (a) Wraps the screen in `<ScreenContainer>` and ALSO declares\n * `<Stack.Screen options={headerOptionsFromProps(props)} />` at the\n * top of the screen (we export a helper `composeHeaderOptions` for\n * this), OR\n * (b) Imports `<NavBarTitle>` / `<NavBarSearchBar>` / `<NavBarSaveButton>`\n * sub-primitives and threads them through `headerLeft` / `headerRight`\n * options manually.\n *\n * The Layer-3/4 layouts (SettingsPage, etc.) compose ScreenContainer + a\n * helper that wires Stack.Screen so consumers get the 3-line ergonomics.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport { ScrollView, StatusBar, View, type ViewStyle } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeMode } from \"../hooks/use-theme-mode\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\n\nexport type SafeAreaEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport type ScrollEdgeBehavior = \"match\" | \"transparent\" | \"opaque\";\n\nexport interface ScreenContainerProps {\n /** Screen body. Pass any node tree. */\n children: ReactNode;\n /** When `true`, the body is wrapped in a vertical ScrollView. Default `false`. */\n scroll?: boolean;\n /**\n * SafeAreaView edges. Defaults to `[\"left\", \"right\"]` — top/bottom are\n * normally handled by the navigation header / tab bar.\n */\n safeAreaEdges?: SafeAreaEdge[];\n /**\n * StatusBar appearance. `\"auto\"` follows the resolved theme mode.\n */\n statusBar?: \"light\" | \"dark\" | \"auto\" | \"hidden\";\n /**\n * Force light or dark theme on this screen regardless of OS preference.\n * Default `\"system\"` (follow OS).\n */\n themeMode?: \"light\" | \"dark\" | \"system\";\n /** Override root container className. */\n className?: string;\n /** Override inner content container className (the ScrollView's contentContainerClassName when scroll=true). */\n contentClassName?: string;\n /**\n * `keyboardShouldPersistTaps` for the inner ScrollView. Default `\"handled\"`.\n * Only used when `scroll` is true.\n */\n keyboardShouldPersistTaps?: \"always\" | \"never\" | \"handled\";\n /**\n * When `true`, a centred `NativeLoadingState` (theme-tinted spinner,\n * announced as loading) replaces the body, inside the same safe area and\n * background. Use it for redirect and first-load screens: the body is\n * unmounted while it's on, so a form underneath loses its state. Default `false`.\n */\n loading?: boolean;\n /** Text under the spinner while `loading`, and what screen readers announce: pass translated text. */\n loadingLabel?: string;\n /**\n * Pull to refresh: a theme-tinted `NativeRefreshControl` on the body, as InboxPage and\n * NotificationsPage have. Pulling needs a scroll view, so passing it makes the body scroll\n * (as `scroll`). Off unless passed. Never with a list child (FlatList, SectionList,\n * NativeResourceView, InboxPage): a list inside a ScrollView loses virtualization, and those\n * lists have their own pull to refresh.\n */\n onRefresh?: () => void | Promise<void>;\n /** The refresh spinner shows while `true`: pass your query's refetching state. Default `false`. */\n refreshing?: boolean;\n /** Style on the root, e.g. a theme-role background color. */\n style?: ViewStyle;\n /** testID on the root container. */\n testID?: string;\n}\n\n/**\n * Layer-3 named-prop slots that layouts can accept and forward to\n * `composeHeaderOptions()` for `<Stack.Screen options={...}>`.\n */\nexport interface ScreenHeaderProps {\n /** Custom header title. Falls back to `<Stack.Screen name>` mapping. */\n headerTitle?: string;\n /** Custom node rendered on the left of the nav bar. */\n headerLeft?: () => ReactNode;\n /** Custom node rendered on the right of the nav bar. */\n headerRight?: () => ReactNode;\n /** When true, iOS uses large-title mode + scroll-edge appearance. */\n large?: boolean;\n /** iOS scroll-edge behavior. `\"match\"` collapses, `\"transparent\"` always transparent, `\"opaque\"` always opaque. */\n scrollEdgeBehavior?: ScrollEdgeBehavior;\n /** Direct passthrough merged INTO the resolved options object. Wins over named props. */\n headerOptions?: Record<string, unknown>;\n}\n\n/**\n * Compose a `<Stack.Screen options={...}>` object from Layer-3 named\n * props + a direct `headerOptions` passthrough. Layouts call this and\n * pass the result to `<Stack.Screen>` so the host's expo-router stack\n * renders a platform-native large title / scroll-edge appearance.\n *\n * Usage (in a layout primitive):\n *\n * const opts = composeHeaderOptions({\n * headerTitle: \"Settings\",\n * large: true,\n * scrollEdgeBehavior: \"match\",\n * headerOptions: rest.headerOptions,\n * });\n * return <><Stack.Screen options={opts} /><ScreenContainer>...</ScreenContainer></>;\n */\nexport function composeHeaderOptions(\n props: ScreenHeaderProps,\n): Record<string, unknown> {\n const {\n headerTitle,\n headerLeft,\n headerRight,\n large,\n scrollEdgeBehavior,\n headerOptions,\n } = props;\n\n const opts: Record<string, unknown> = {};\n if (headerTitle !== undefined) opts.title = headerTitle;\n if (headerLeft) opts.headerLeft = headerLeft;\n if (headerRight) opts.headerRight = headerRight;\n if (large) {\n // iOS large-title mode. Android falls back to standard.\n opts.headerLargeTitle = true;\n if (scrollEdgeBehavior === \"transparent\") {\n opts.headerTransparent = true;\n } else if (scrollEdgeBehavior === \"opaque\") {\n opts.headerLargeTitleShadowVisible = true;\n }\n }\n // Direct passthrough wins.\n if (headerOptions) {\n Object.assign(opts, headerOptions);\n }\n return opts;\n}\n\nconst DEFAULT_EDGES: SafeAreaEdge[] = [\"left\", \"right\"];\n\n// A see-through Android status bar. React Native 0.88 dropped both props from StatusBar's types\n// (Android is always edge to edge there, so they do nothing); earlier versions still need them.\n// Spread untyped so the screen compiles against either.\nconst TRANSLUCENT_ANDROID_BAR: Record<string, unknown> = { translucent: true, backgroundColor: \"transparent\" };\n\n/**\n * Resolve the StatusBar bar style from the user's `statusBar` setting +\n * the resolved theme mode. `\"auto\"` follows theme; explicit overrides\n * win; anything else falls back to `\"default\"`.\n */\nfunction resolveBarStyle(\n statusBar: \"light\" | \"dark\" | \"auto\" | \"hidden\",\n resolvedMode: \"light\" | \"dark\",\n): \"default\" | \"light-content\" | \"dark-content\" {\n if (statusBar === \"auto\") {\n return resolvedMode === \"dark\" ? \"light-content\" : \"dark-content\";\n }\n if (statusBar === \"light\") return \"light-content\";\n if (statusBar === \"dark\") return \"dark-content\";\n return \"default\";\n}\n\nexport function ScreenContainer({\n children,\n scroll = false,\n safeAreaEdges = DEFAULT_EDGES,\n statusBar = \"auto\",\n themeMode = \"system\",\n className,\n contentClassName,\n keyboardShouldPersistTaps = \"handled\",\n loading = false,\n loadingLabel,\n onRefresh,\n refreshing = false,\n style,\n testID,\n}: ScreenContainerProps) {\n const osMode = useThemeMode();\n const resolvedMode = themeMode === \"system\" ? osMode : themeMode;\n const barStyle = resolveBarStyle(statusBar, resolvedMode);\n\n const body = loading ? (\n <View testID={testID ? `${testID}-body` : undefined} className={cn(\"flex-1\", contentClassName)}>\n <NativeLoadingState fullScreen={false} label={loadingLabel} testID={`${testID ?? \"screen-container\"}-loading`} />\n </View>\n ) : scroll || onRefresh ? (\n <ScrollView\n testID={testID ? `${testID}-scroll` : undefined}\n refreshControl={\n onRefresh ? (\n <NativeRefreshControl testID={`${testID ?? \"screen-container\"}-refresh`} refreshing={refreshing} onRefresh={() => void onRefresh()} />\n ) : undefined\n }\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerClassName={cn(\"flex-grow\", contentClassName)}\n >\n {children}\n </ScrollView>\n ) : (\n <View\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"flex-1\", contentClassName)}\n >\n {children}\n </View>\n );\n\n return (\n <SafeAreaView\n testID={testID ?? \"screen-container\"}\n edges={safeAreaEdges}\n className={cn(\"flex-1 bg-background\", className)}\n style={style}\n >\n {statusBar !== \"hidden\" ? (\n <StatusBar\n barStyle={\n barStyle as\n | \"default\"\n | \"light-content\"\n | \"dark-content\"\n }\n {...TRANSLUCENT_ANDROID_BAR}\n />\n ) : (\n <StatusBar hidden />\n )}\n {body}\n </SafeAreaView>\n );\n}\n","/**\n * Nav-bar sub-primitives — escape hatches for `<Stack.Screen>` `headerLeft`,\n * `headerRight`, and custom title view.\n *\n * Use these when the named-prop slots on a layout aren't enough — e.g.,\n * a screen needs a save button on the right that's wired to dirty-state,\n * or a search bar replaces the title on a results screen.\n *\n * Pass directly into `headerLeft={() => <NavBarSearchBar ... />}` or\n * compose into a custom `headerTitle={() => <NavBarTitle ... />}` slot.\n *\n * @stability Beta\n */\nimport { Pressable, Text, TextInput, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\n// ---------------------------------------------------------------------------\n// NavBarSaveButton\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSaveButtonProps {\n /** Press handler. Disabled when not provided OR when `disabled`/`loading`. */\n onPress?: () => void;\n /** Visible label. Default `\"Save\"`. */\n label?: string;\n /** When true, the button is muted and not pressable. Use this for clean / pristine forms. */\n disabled?: boolean;\n /** When true, label switches to a busy indicator and presses are blocked. */\n loading?: boolean;\n /** When true, render label in destructive tone. */\n destructive?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarSaveButton({\n onPress,\n label = \"Save\",\n disabled,\n loading,\n destructive,\n className,\n testID,\n}: NavBarSaveButtonProps) {\n const isDisabled = !!disabled || !!loading || !onPress;\n return (\n <Pressable\n testID={testID ?? \"nav-bar-save-button\"}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled: isDisabled, busy: !!loading }}\n onPress={isDisabled ? undefined : onPress}\n disabled={isDisabled}\n className={cn(\"min-h-[44px] justify-center px-3\", className)}\n hitSlop={8}\n >\n <Text\n className={cn(\n \"text-base font-semibold\",\n destructive ? \"text-destructive\" : \"text-primary-text\",\n isDisabled && \"opacity-40\"\n )}\n >\n {loading ? \"…\" : label}\n </Text>\n </Pressable>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarTitle\n// ---------------------------------------------------------------------------\n\nexport interface NavBarTitleProps {\n /** Title text. */\n title: string;\n /** Optional smaller subtitle line under the title. */\n subtitle?: string;\n /** Optional press handler — turns the title row into a tap target (e.g., reveal a picker). */\n onPress?: () => void;\n className?: string;\n testID?: string;\n}\n\nexport function NavBarTitle({\n title,\n subtitle,\n onPress,\n className,\n testID,\n}: NavBarTitleProps) {\n const inner = (\n <View className={cn(\"items-center justify-center\", className)}>\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className=\"text-base font-semibold text-foreground\"\n numberOfLines={1}\n >\n {title}\n </Text>\n {subtitle ? (\n <Text\n testID={testID ? `${testID}-subtitle` : undefined}\n className=\"text-xs text-muted-foreground\"\n numberOfLines={1}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"nav-bar-title\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n onPress={onPress}\n hitSlop={8}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View testID={testID ?? \"nav-bar-title\"} accessibilityRole=\"header\">\n {inner}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// NavBarSearchBar\n// ---------------------------------------------------------------------------\n\nexport interface NavBarSearchBarProps {\n value: string;\n onChangeText: (next: string) => void;\n placeholder?: string;\n /** Called when the user submits the search (return key). */\n onSubmit?: () => void;\n /** Render a clear (X) button when value is non-empty. Default true. */\n clearable?: boolean;\n className?: string;\n testID?: string;\n}\n\n/**\n * Inline search input meant to occupy the title slot on a search results\n * screen. For a sticky search-below-the-header pattern, prefer the\n * standalone <NativeSearchBar> primitive.\n */\nexport function NavBarSearchBar({\n value,\n onChangeText,\n placeholder = \"Search\",\n onSubmit,\n clearable = true,\n className,\n testID,\n}: NavBarSearchBarProps) {\n return (\n <View\n testID={testID ?? \"nav-bar-search\"}\n className={cn(\n \"min-h-[36px] flex-row items-center rounded-full bg-muted px-3\",\n className\n )}\n >\n <TextInput\n testID={testID ? `${testID}-input` : undefined}\n accessibilityLabel={placeholder}\n value={value}\n onChangeText={onChangeText}\n onSubmitEditing={onSubmit}\n placeholder={placeholder}\n placeholderTextColor={nativeColors.neutral[400]}\n returnKeyType=\"search\"\n autoCorrect={false}\n autoCapitalize=\"none\"\n clearButtonMode={clearable ? \"while-editing\" : \"never\"}\n className=\"flex-1 text-base text-foreground\"\n />\n {clearable && value.length > 0 ? (\n <Pressable\n testID={testID ? `${testID}-clear` : undefined}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear search\"\n onPress={() => onChangeText(\"\")}\n hitSlop={8}\n className=\"ml-2 px-1\"\n >\n <Text className=\"text-base text-muted-foreground\">×</Text>\n </Pressable>\n ) : null}\n </View>\n );\n}\n","/**\n * InboxPage — a list of conversations or tickets: unread state, a time, a\n * preview line, swipe actions, pull to refresh, paging and an empty state.\n *\n * Generic: the rows are whatever the app has (support reports, direct\n * messages, an idea board). Data and actions come in as props; the layout\n * draws them the platform's way. On iOS it is the Settings app's inset\n * grouped style, like `SettingsPage`: the page is `groupedBackground`, the\n * rows one rounded group on `surface` with hairline separators that start at\n * the text. On Android rows are full width.\n *\n * Swipe actions: each row's `swipeActions` are always reachable without a\n * gesture library, as VoiceOver / TalkBack custom actions and on long press\n * (`NativeContextMenu`). The swipe itself is `NativeSwipeRow`, once the app\n * passes `GenesisModules.swipeable` (`ReanimatedSwipeable` from\n * react-native-gesture-handler, an optional peer), with each action's `side`.\n * The `swipeable` slot takes your own wrapper instead; it receives the actions\n * and the row.\n *\n * Rows: `avatar` puts a picture of who it is between the unread dot and the\n * text (an unread count shows at the end of the row, as in Mail); `leading`\n * replaces the dot.\n *\n * Slots: `row`, `swipeable`, `header` (above the group), `footer` (below it,\n * the paging spinner by default) and `empty`. `slots` swaps a part for your\n * component (same props), `slotProps` feeds the default more props, `null`\n * drops it.\n *\n * Header: `getInboxPageStackOptions()` for `<Stack.Screen options>`.\n *\n * @stability Beta\n */\nimport { createContext, Fragment, useContext, useState, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { Alert, FlatList, Platform, Pressable, ScrollView, StyleSheet, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeText } from \"../components/text\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeBadge } from \"../components/badge\";\nimport { NativeContextMenu } from \"../components/context-menu\";\nimport { NativeRefreshControl } from \"../components/refresh-control\";\nimport { NativeSwipeRow } from \"../components/swipe-row\";\nimport { NativeLoadingState } from \"../components/loading-state\";\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\nimport { formatInboxTime, type InboxItem, type InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\n\n// The conversation contract is genesis-core's, shared with genesis-ui's InboxPage.\nexport type { InboxItem, InboxSwipeAction } from \"@marktiderman/genesis-core/conversation\";\nexport { formatInboxTime } from \"@marktiderman/genesis-core/conversation\";\n\n/** The parts `slots` and `slotProps` reach, with the props each receives. */\nexport type InboxPageSlotMap = {\n row: InboxItem & { testID: string; isFirst: boolean; isLast: boolean; timeLabel: string | null };\n swipeable: { actions: InboxSwipeAction[]; testID: string; children?: ReactNode };\n header: { testID: string };\n footer: { loadingMore: boolean; testID: string };\n empty: { title: string; body: string; actionLabel?: string; onAction?: () => void; testID: string };\n};\n\nexport interface InboxPageProps extends ScreenHeaderProps {\n /** Newest first, as they should show. Empty → the empty state. */\n items: InboxItem[];\n refreshing?: boolean;\n onRefresh?: () => void | Promise<void>;\n /** Called near the end of the list, to load the next page. */\n onEndReached?: () => void;\n /** A next page is loading: the default footer shows a spinner. */\n loadingMore?: boolean;\n /** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */\n header?: ReactNode;\n /** An optional title over the group, in the Settings header style. */\n sectionTitle?: string;\n emptyTitle?: string;\n emptyBody?: string;\n /** The first page is loading: a spinner instead of the empty state. */\n loading?: boolean;\n /** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */\n error?: boolean;\n errorTitle?: string;\n errorBody?: string;\n /** A button in the empty state (\"Send feedback\"). */\n emptyActionLabel?: string;\n onEmptyAction?: () => void;\n /** How a row's time reads. Default: the time today, \"Yesterday\", the weekday this week, else the date. */\n formatTime?: (date: Date, now: Date) => string;\n /** The clock, for tests. */\n now?: () => Date;\n slots?: Slots<InboxPageSlotMap>;\n slotProps?: SlotPropsFor<InboxPageSlotMap>;\n /** testID on the root. Default `\"inbox-page\"`. */\n testID?: string;\n}\n\n/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */\nexport function getInboxPageStackOptions(props: ScreenHeaderProps & { headerTitle?: string }): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Inbox\",\n large: props.large ?? true,\n scrollEdgeBehavior: props.scrollEdgeBehavior ?? \"match\",\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\n/** Opens the page's one actions menu for a row. */\nconst OpenRowMenu = createContext<(row: InboxPageSlotMap[\"row\"]) => void>(() => undefined);\n\n/** The row's leading padding, the unread dot's column, an avatar's default size and its gap to the text. */\nconst ROW_PADDING = 16;\nconst LEADING_WIDTH = 18;\nconst DEFAULT_AVATAR = 40;\nconst AVATAR_GAP = 12;\n\n/** UIKit's inset grouped margin on a phone, in points (as SettingsPage). */\nconst IOS_GROUP_MARGIN = 16;\n\nfunction iosGroupRadius(): number {\n return Number.parseFloat(String(Platform.Version)) >= 26 ? 26 : 10;\n}\n\nexport function InboxPage({\n items,\n refreshing,\n onRefresh,\n onEndReached,\n loadingMore = false,\n header,\n sectionTitle,\n emptyTitle,\n emptyBody,\n emptyActionLabel,\n onEmptyAction,\n loading = false,\n error = false,\n errorTitle,\n errorBody,\n formatTime = formatInboxTime,\n now = () => new Date(),\n slots = {},\n slotProps = {},\n testID = \"inbox-page\",\n}: InboxPageProps) {\n const colors = useThemeRoles();\n const clock = now();\n // One menu for the page: its row stays set while the sheet goes, so its words don't vanish first.\n const [menuRow, setMenuRow] = useState<InboxPageSlotMap[\"row\"] | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n const rows: InboxPageSlotMap[\"row\"][] = items.map((item, index) => ({\n ...item,\n testID: item.testID ?? `${testID}-row-${item.id}`,\n isFirst: index === 0,\n isLast: index === items.length - 1,\n timeLabel: item.timestamp ? formatTime(typeof item.timestamp === \"string\" ? new Date(item.timestamp) : item.timestamp, clock) : null,\n }));\n\n const headerNode = (\n <View>\n {header ?? renderSlot(EmptyPart, slots.header, { testID: `${testID}-header` }, slotProps.header)}\n {sectionTitle ? <SectionTitle title={sectionTitle} testID={`${testID}-section-title`} /> : null}\n </View>\n );\n\n const refreshControl = onRefresh ? <NativeRefreshControl testID={`${testID}-refresh`} refreshing={!!refreshing} onRefresh={() => void onRefresh()} /> : undefined;\n\n if (items.length === 0) {\n // A scroll view, not a plain view: under a large-title (or translucent) header only a\n // scroll view's automatic content inset moves the content below the header, and pull to\n // refresh needs one too.\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <ScrollView\n testID={`${testID}-empty-scroll`}\n contentInsetAdjustmentBehavior=\"automatic\"\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={{ flexGrow: 1, paddingTop: 8, paddingBottom: 32 }}\n refreshControl={refreshControl}\n >\n {headerNode}\n {loading ? (\n <NativeLoadingState fullScreen={false} testID={`${testID}-loading`} />\n ) : (\n renderSlot(\n DefaultEmpty,\n slots.empty,\n error\n ? {\n title: errorTitle ?? \"Couldn't load this\",\n body: errorBody ?? \"Check your connection, then pull to refresh.\",\n actionLabel: onRefresh ? \"Try again\" : undefined,\n onAction: onRefresh ? () => void onRefresh() : undefined,\n testID: `${testID}-error`,\n }\n : {\n title: emptyTitle ?? \"Nothing here yet\",\n body: emptyBody ?? \"When there's something new, it shows up here.\",\n actionLabel: emptyActionLabel,\n onAction: onEmptyAction,\n testID: `${testID}-empty`,\n },\n slotProps.empty,\n )\n )}\n </ScrollView>\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={{ flex: 1, backgroundColor: colors.groupedBackground }}>\n <OpenRowMenu.Provider\n value={(row) => {\n setMenuRow(row);\n setMenuOpen(true);\n }}\n >\n <FlatList\n testID={`${testID}-list`}\n data={rows}\n keyExtractor={(row) => row.id}\n contentInsetAdjustmentBehavior=\"automatic\"\n // The header can hold a text field (the idea board's \"Suggest\"): its button's first tap\n // must press it, not only close the keyboard.\n keyboardShouldPersistTaps=\"handled\"\n ListHeaderComponent={headerNode}\n ListFooterComponent={renderSlot(DefaultFooter, slots.footer, { loadingMore, testID: `${testID}-footer` }, slotProps.footer)}\n contentContainerStyle={{ paddingTop: 8, paddingBottom: 32 }}\n onEndReached={onEndReached}\n onEndReachedThreshold={0.5}\n refreshControl={refreshControl}\n renderItem={({ item: row }) => {\n const content = renderSlot(DefaultRow, slots.row, row, slotProps.row);\n const actions = row.swipeActions ?? [];\n return (\n <Fragment>\n {actions.length && slots.swipeable !== null\n ? renderSlot(NativeSwipeRow, slots.swipeable, { actions, testID: `${row.testID}-swipe`, children: content }, slotProps.swipeable)\n : content}\n </Fragment>\n );\n }}\n />\n </OpenRowMenu.Provider>\n {menuRow ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} title={menuRow.title} actions={menuRow.swipeActions ?? []} testID={`${testID}-menu`} /> : null}\n </SafeAreaView>\n );\n}\n\nfunction EmptyPart(_props: InboxPageSlotMap[\"header\"]) {\n return null;\n}\n\nfunction SectionTitle({ title, testID }: { title: string; testID: string }) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n className={ios ? \"px-4 pb-1.5 pt-2\" : \"px-4 pb-2 pt-4 text-primary-text\"}\n style={\n ios\n ? { marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18, textTransform: \"uppercase\" }\n : { fontSize: 14, lineHeight: 20, fontWeight: \"500\" }\n }\n >\n {title}\n </NativeText>\n );\n}\n\n/**\n * Opens a row's actions as the system alert. `InboxPage` now opens `NativeContextMenu`; `NativeResourceView`\n * still uses this.\n */\nexport function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel = \"Cancel\"): void {\n Alert.alert(title, undefined, [\n ...actions.map((a) => ({ text: a.label, style: a.destructive ? (\"destructive\" as const) : (\"default\" as const), onPress: a.onPress })),\n { text: cancelLabel, style: \"cancel\" as const },\n ]);\n}\n\nfunction DefaultRow(row: InboxPageSlotMap[\"row\"]) {\n const colors = useThemeRoles();\n const ios = Platform.OS === \"ios\";\n const [pressed, setPressed] = useState(false);\n const openMenu = useContext(OpenRowMenu);\n const actions = row.swipeActions ?? [];\n const radius = iosGroupRadius();\n const unreadLabel = row.unreadCount && row.unreadCount > 0 ? `${row.unreadCount} unread` : row.unread ? \"Unread\" : null;\n const label = [unreadLabel, row.avatar ? row.avatarLabel : null, row.title, row.timeLabel, row.preview, row.meta].filter(Boolean).join(\", \");\n // The separator starts at the text: the row's padding, the dot's column, and the avatar when there is one.\n const [avatarWidth, setAvatarWidth] = useState(0);\n const separatorInset = ROW_PADDING + LEADING_WIDTH + (row.avatar ? (avatarWidth || DEFAULT_AVATAR) + AVATAR_GAP : 0);\n return (\n <View\n testID={`${row.testID}-cell`}\n style={[\n { backgroundColor: colors.surface },\n ios\n ? {\n marginHorizontal: IOS_GROUP_MARGIN,\n borderTopLeftRadius: row.isFirst ? radius : 0,\n borderTopRightRadius: row.isFirst ? radius : 0,\n borderBottomLeftRadius: row.isLast ? radius : 0,\n borderBottomRightRadius: row.isLast ? radius : 0,\n overflow: \"hidden\",\n }\n : null,\n ]}\n >\n <Pressable\n testID={row.testID}\n accessibilityRole={row.onPress ? \"button\" : undefined}\n accessibilityLabel={label}\n accessibilityState={row.selected ? { selected: true } : undefined}\n accessibilityActions={actions.map((a) => ({ name: a.id, label: a.label }))}\n onAccessibilityAction={(event) => actions.find((a) => a.id === event.nativeEvent.actionName)?.onPress()}\n onPress={row.onPress}\n onLongPress={actions.length ? () => openMenu(row) : undefined}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n style={{ flexDirection: \"row\", alignItems: \"center\", paddingHorizontal: ROW_PADDING, paddingVertical: 11, minHeight: 60, backgroundColor: (pressed && row.onPress) || row.selected ? colors.fill : undefined }}\n >\n <View style={{ width: LEADING_WIDTH, alignItems: \"flex-start\" }}>\n {row.leading ?? (row.unreadCount && row.unreadCount > 0 ? null : <UnreadDot unread={!!row.unread} testID={`${row.testID}-unread`} color={colors.tint} />)}\n </View>\n {row.avatar ? (\n <View\n testID={`${row.testID}-avatar`}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n onLayout={(e) => setAvatarWidth(Math.round(e.nativeEvent.layout.width))}\n style={{ marginRight: AVATAR_GAP }}\n >\n {row.avatar}\n </View>\n ) : null}\n <View style={{ flex: 1, minWidth: 0 }}>\n <View style={{ flexDirection: \"row\", alignItems: \"baseline\" }}>\n <NativeText\n numberOfLines={1}\n style={{ flex: 1, color: colors.label, fontSize: 17, lineHeight: 22, fontWeight: row.unread || (row.unreadCount ?? 0) > 0 ? \"600\" : \"400\" }}\n >\n {row.title}\n </NativeText>\n {row.timeLabel ? (\n <NativeText testID={`${row.testID}-time`} style={{ marginLeft: 8, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.timeLabel}\n </NativeText>\n ) : null}\n </View>\n {row.preview ? (\n <NativeText numberOfLines={2} style={{ marginTop: 2, color: colors.secondaryLabel, fontSize: 15, lineHeight: 20 }}>\n {row.preview}\n </NativeText>\n ) : null}\n {row.meta ? (\n <NativeText testID={`${row.testID}-meta`} style={{ marginTop: 4, color: colors.tertiaryLabel, fontSize: 13, lineHeight: 18 }}>\n {row.meta}\n </NativeText>\n ) : null}\n </View>\n {row.unreadCount && row.unreadCount > 0 ? (\n <View style={{ marginLeft: 8 }}>\n <NativeBadge testID={`${row.testID}-count`}>{String(row.unreadCount)}</NativeBadge>\n </View>\n ) : null}\n {row.trailing ? <View style={{ marginLeft: 8 }}>{row.trailing}</View> : row.onPress ? <Chevron color={colors.tertiaryLabel} /> : null}\n </Pressable>\n {row.isLast ? null : (\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" style={{ flexDirection: \"row\", height: StyleSheet.hairlineWidth }}>\n <View testID={`${row.testID}-separator-inset`} style={{ width: separatorInset }} />\n <View testID={`${row.testID}-separator-line`} style={{ flex: 1, backgroundColor: colors.separator }} />\n </View>\n )}\n </View>\n );\n}\n\nfunction Chevron({ color }: { color: unknown }) {\n return (\n <NativeText accessibilityElementsHidden importantForAccessibility=\"no\" style={{ marginLeft: 8, color: color as string, fontSize: 20, lineHeight: 22 }}>\n ›\n </NativeText>\n );\n}\n\nfunction UnreadDot({ unread, testID, color }: { unread: boolean; testID: string; color: unknown }) {\n if (!unread) return <View testID={testID} style={{ width: 10, height: 10 }} />;\n return <View testID={testID} style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: color as string }} />;\n}\n\nfunction DefaultFooter({ loadingMore, testID }: InboxPageSlotMap[\"footer\"]) {\n if (!loadingMore) return null;\n return (\n <NativeLoadingState fullScreen={false} size=\"small\" accessibilityLabel=\"Loading more\" className=\"py-4\" testID={testID} />\n );\n}\n\nfunction DefaultEmpty({ title, body, actionLabel, onAction, testID }: InboxPageSlotMap[\"empty\"]) {\n return (\n <NativeEmptyState\n variant=\"first-run\"\n title={title}\n body={body}\n testID={testID}\n primaryAction={\n actionLabel && onAction ? (\n <NativeButton onPress={onAction} testID={`${testID}-action`}>\n {actionLabel}\n </NativeButton>\n ) : undefined\n }\n />\n );\n}\n"]}
@@ -133,5 +133,5 @@ function useThemeRoles(options = {}) {
133
133
  var sentBubbleColor = (roles) => roles.tint;
134
134
 
135
135
  export { GenesisModulesProvider, animateMotion, motionSpring, motionTiming, playHaptic, sentBubbleColor, useGenesisModules, useHaptics, useMotion, usePressFeedback, useReducedMotion, useThemeMode, useThemeRoles };
136
- //# sourceMappingURL=chunk-PMS2V46D.js.map
137
- //# sourceMappingURL=chunk-PMS2V46D.js.map
136
+ //# sourceMappingURL=chunk-VHUUOH46.js.map
137
+ //# sourceMappingURL=chunk-VHUUOH46.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/use-reduced-motion.ts","../src/hooks/use-motion.ts","../src/native-modules.tsx","../src/hooks/use-haptics.ts","../src/hooks/use-press-feedback.ts","../src/hooks/use-theme-mode.ts","../src/hooks/use-theme-roles.ts"],"names":["useMemo","useCallback","useEffect","useState"],"mappings":";;;;;;AAgBA,IAAI,SAAA,GAAY,KAAA;AAOT,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAA,GAAU,IAAA;AACd,IAAA,MAAM,GAAA,GAAM,CAAC,CAAA,KAAe;AAC1B,MAAA,SAAA,GAAY,CAAA;AACZ,MAAA,IAAI,OAAA,aAAoB,CAAC,CAAA;AAAA,IAC3B,CAAA;AACA,I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AAAe,GAC5B;AAEA,EAAAD,UAAU,MAAM;AACd,IAAA,MAAM,MAAM,UAAA,CAAW,iBAAA,CAAkB,CAAC,EAAE,aAAY,KAAM;AAC5D,MAAA,SAAA,CAAU,WAAW,CAAA;AAAA,IACvB,CAAC,CAAA;AACD,IAAA,OAAO,MAAM,IAAI,MAAA,EAAO;AAAA,EAC1B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,MAAA,KAAW,SAAS,MAAA,GAAS,OAAA;AACtC;ACDO,SAAS,aAAA,CAAc,OAAA,GAAgC,EAAC,EAAoB;AACjF,EAAA,MAAM,SAAS,YAAA,EAAa;AAC5B,EAAA,MAAM,EAAE,IAAA,EAAM,WAAA,GAAc,KAAA,EAAM,GAAI,OAAA;AACtC,EAAA,MAAM,cAAA,GAAiB,eAAe,QAAA,CAAS,EAAA,KAAO,aAAa,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA,IAAK,EAAA;AAC/F,EAAA,OAAOF,OAAAA;AAAA,IACL,MACE,iBAAA,CAA8B;AAAA,MAC5B,MAAA,EAAQ,QAAA,CAAS,EAAA,KAAO,KAAA,GAAQ,KAAA,GAAQ,SAAA;AAAA,MACxC,MAAA;AAAA,MACA,aAAA,EAAe,CAAC,IAAA,KAAS,aAAA,CAAc,IAAI,CAAA;AAAA,MAC3C,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACH,CAAC,MAAA,EAAQ,IAAA,EAAM,cAAc;AAAA,GAC/B;AACF;AAGO,IAAM,eAAA,GAAkB,CAAK,KAAA,KAA0B,KAAA,CAAM","file":"chunk-PMS2V46D.js","sourcesContent":["/**\n * useReducedMotion — subscribe to the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n","/**\n * useMotion — the shared motion tokens (genesis-design-system's\n * `resolveMotion`), with the OS's reduce-motion setting applied.\n *\n * Every Genesis primitive that moves reads its durations, easings and springs\n * from here instead of its own constants, so motion is defined once for web\n * and native. Under Reduce Motion every duration is 0 and `animateMotion`\n * returns the final value, so a component lands without moving.\n *\n * The brand's motion level isn't read from a provider yet: pass `level` (a\n * brand whose design system chose `none` passes `\"none\"`). Without it,\n * `calm`.\n *\n * On the JS thread (an effect, a PanResponder), `animateMotion`:\n *\n * ```tsx\n * const motion = useMotion();\n * const { reanimated: R } = useGenesisModules();\n * opacity.value = animateMotion(R, motion, 1, { duration: \"fast\", easing: \"decelerate\" });\n * ```\n *\n * Inside a worklet (a gesture's `onEnd`, an animated scroll handler), build\n * the config with the worklet-safe `motionSpring` / `motionTiming` and call\n * Reanimated yourself:\n *\n * ```tsx\n * .onEnd((e) => { x.value = withSpring(0, motionSpring(motion, \"snappy\", e.velocityX)); })\n * opacity.value = withTiming(1, motionTiming(motion, \"fast\", Easing, \"decelerate\"));\n * ```\n *\n * A repeating animation checks `motion.reduced` first: a zero-length repeat\n * would flash every frame.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport {\n resolveMotion,\n type MotionDurations,\n type MotionEasings,\n type MotionLevel,\n type MotionSprings,\n type MotionTokens,\n} from \"@marktiderman/genesis-design-system/tokens/motion\";\nimport type { GenesisReanimatedModule } from \"../native-modules\";\nimport { useReducedMotion } from \"./use-reduced-motion\";\n\nexport interface UseMotionOptions {\n /** The brand's motion level. Default `calm`; `none` holds everything still, like Reduce Motion. */\n level?: MotionLevel;\n}\n\nexport function useMotion(options: UseMotionOptions = {}): MotionTokens {\n const reducedMotion = useReducedMotion();\n const level = options.level ?? \"calm\";\n return useMemo(() => resolveMotion(level, { reducedMotion }), [level, reducedMotion]);\n}\n\n/** How to get there: a named spring (keeps a gesture's velocity), or a named duration and easing. */\nexport type MotionHow =\n | { spring: keyof MotionSprings; velocity?: number; duration?: never; easing?: never }\n | { duration: keyof MotionDurations; easing?: keyof MotionEasings; spring?: never; velocity?: never };\n\n/** What `motionSpring` gives `withSpring`. */\nexport interface MotionSpringConfig {\n damping: number;\n stiffness: number;\n mass: number;\n velocity?: number;\n}\n\n/** What `motionTiming` gives `withTiming`. */\nexport interface MotionTimingConfig {\n duration: number;\n easing?: unknown;\n}\n\n/**\n * A `withSpring` config from a named spring. Worklet-safe (plain data in,\n * plain data out). Under reduced motion it's the stiff, critically damped\n * spring that settles in a few frames; to not move at all, check\n * `motion.reduced` and assign the value.\n */\nexport function motionSpring(motion: MotionTokens, name: keyof MotionSprings, velocity?: number): MotionSpringConfig {\n \"worklet\";\n const s = motion.spring[name];\n return typeof velocity === \"number\" && !motion.reduced\n ? { damping: s.damping, stiffness: s.stiffness, mass: s.mass, velocity }\n : { damping: s.damping, stiffness: s.stiffness, mass: s.mass };\n}\n\n/**\n * A `withTiming` config from a named duration and easing. Pass Reanimated's\n * `Easing` (`R.Easing`, or `Easing` imported in a worklet) so the token's\n * curve is used; a module without `Easing.bezier` gets Reanimated's default\n * curve. Worklet-safe.\n */\nexport function motionTiming(\n motion: MotionTokens,\n duration: keyof MotionDurations,\n Easing: Pick<GenesisReanimatedModule[\"Easing\"], \"bezier\"> | undefined,\n easing: keyof MotionEasings = \"out\",\n): MotionTimingConfig {\n \"worklet\";\n const [x1, y1, x2, y2] = motion.easing[easing];\n const curve = Easing?.bezier ? Easing.bezier(x1, y1, x2, y2) : undefined;\n return curve === undefined ? { duration: motion.duration[duration] } : { duration: motion.duration[duration], easing: curve };\n}\n\n/**\n * A Reanimated animation to `toValue` with the motion tokens, for a shared\n * value on the JS thread: `x.value = animateMotion(R, motion, 0, { spring: \"smooth\" })`.\n * Under reduced motion it returns `toValue` itself, so nothing moves.\n *\n * It takes no completion callback: Reanimated runs one on the UI thread, so\n * it must be a worklet, and the reduced path couldn't keep that promise. To\n * act when an animation ends, call `withSpring` / `withTiming` yourself with\n * `motionSpring` / `motionTiming` and a worklet callback. A module without\n * `withSpring` (an older one, a test fake) gets a `withTiming` at `base`.\n */\nexport function animateMotion(R: GenesisReanimatedModule, motion: MotionTokens, toValue: number, how: MotionHow): number {\n if (motion.reduced) return toValue;\n if (how.spring !== undefined) {\n if (R.withSpring) return R.withSpring(toValue, motionSpring(motion, how.spring, how.velocity));\n return R.withTiming(toValue, motionTiming(motion, \"base\", R.Easing));\n }\n return R.withTiming(toValue, motionTiming(motion, how.duration, R.Easing, how.easing));\n}\n","/**\n * GenesisModulesProvider — the native modules an app opts in to, passed in\n * once near the root. Genesis never `require()`s these itself: an app that\n * has a module installed imports it and hands it over, and every component\n * that could use it falls back to plain React Native when it isn't here.\n *\n * import { FlashList } from \"@shopify/flash-list\";\n * import { Image } from \"expo-image\";\n * import * as Reanimated from \"react-native-reanimated\";\n * import * as GlassEffect from \"expo-glass-effect\";\n * import { SymbolView } from \"expo-symbols\";\n * import DateTimePicker from \"@expo/ui/community/datetime-picker\";\n * import { lucideIcons } from \"@marktiderman/genesis-ui-native/icons/lucide\";\n * import { DarkTheme, DefaultTheme, ThemeProvider } from \"expo-router\";\n *\n * // At module scope, not inline:\n * const modules = { list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,\n * symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker,\n * navigation: { ThemeProvider, DefaultTheme, DarkTheme } };\n * <GenesisModulesProvider modules={modules}>…</GenesisModulesProvider>\n *\n * (`GenesisNativeApp` from `@marktiderman/genesis-native` takes the same\n * object as its `modules` prop and mounts this for you.)\n *\n * | Module | Used by | Without it |\n * | ------------------------------ | ---------------------------------------- | ----------------------------- |\n * | `list` (FlashList v2) | NativeResourcePage, NotificationsPage | FlatList / SectionList |\n * | `image` (expo-image) | NativeAvatar, NativeImage | React Native `Image` |\n * | `reanimated` (Reanimated 4) | Toast, Drawer, Skeleton | React Native `Animated` |\n * | `glass` (expo-glass-effect) | Toast, NativeGlassSurface, update banner | the solid surface |\n * | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |\n * | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |\n * | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |\n * | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |\n * | `haptics` (expo-haptics) | useHaptics, usePressFeedback, NativeComposerBar (send) | no haptics |\n * | `swipeable` (react-native-gesture-handler's `ReanimatedSwipeable`) | NativeSwipeRow, InboxPage: the swipe to a row's actions | the actions on long press and as accessibility actions |\n * | `navigation` (React Navigation's theming: from `expo-router` in an Expo Router app, which bundles its own copy; `@react-navigation/native` otherwise) | GenesisNativeApp: headers and tab bars in the brand's light and dark colors | React Navigation's default (light) theme |\n *\n * The props below are written structurally (no import of the optional\n * packages), so this package builds and type-checks without any of them.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { GenesisHapticsModule } from \"./hooks/use-haptics\";\nimport type { ColorValue } from \"react-native\";\nimport type { NativeIconName } from \"./icon-names\";\n\n/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */\nexport interface GenesisListProps<T> {\n data: readonly T[];\n renderItem: (info: { item: T; index: number }) => ReactNode;\n keyExtractor?: (item: T, index: number) => string;\n getItemType?: (item: T, index: number) => string | number | undefined;\n stickyHeaderIndices?: number[];\n /** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */\n stickyHeaderConfig?: { offset?: number };\n ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;\n ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;\n contentContainerStyle?: Record<string, unknown>;\n refreshing?: boolean;\n onRefresh?: () => void;\n refreshControl?: ReactNode;\n testID?: string;\n}\n\n/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */\nexport type GenesisListComponent = ComponentType<GenesisListProps<any>>;\n\n/** The expo-image `Image` props Genesis passes. */\nexport interface GenesisImageProps {\n /** `cacheKey` keys the cache in place of the URL. */\n source: { uri: string; cacheKey?: string } | number | null;\n style?: unknown;\n contentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n cachePolicy?: \"none\" | \"disk\" | \"memory\" | \"memory-disk\";\n placeholder?: unknown;\n placeholderContentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n transition?: number | null;\n recyclingKey?: string | null;\n priority?: \"low\" | \"normal\" | \"high\" | null;\n onError?: (event: unknown) => void;\n onLoad?: (event: unknown) => void;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `Image` from `expo-image`. */\nexport type GenesisImageComponent = ComponentType<GenesisImageProps>;\n\n/** `import * as Reanimated from \"react-native-reanimated\"` (v4). Only what Genesis calls is listed. */\nexport interface GenesisReanimatedModule {\n default: { View: ComponentType<any> };\n useSharedValue: <V>(initial: V) => { value: V };\n useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;\n withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n /** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */\n withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** A React Navigation theme (`ReactNavigation.Theme`): the colors Genesis sets, and the fonts it keeps. */\nexport interface GenesisNavigationTheme {\n dark: boolean;\n colors: { primary: ColorValue; background: ColorValue; card: ColorValue; text: ColorValue; border: ColorValue; notification: ColorValue };\n fonts?: unknown;\n}\n\n/**\n * React Navigation's theming. In an Expo Router app take it from `expo-router`: it bundles its own\n * React Navigation, and its navigators read that copy's theme, not `@react-navigation/native`'s.\n */\nexport interface GenesisNavigationModule {\n ThemeProvider: ComponentType<{ value: any; children: ReactNode }>;\n DefaultTheme: GenesisNavigationTheme;\n DarkTheme: GenesisNavigationTheme;\n}\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\n/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n automaticOffset?: boolean;\n children?: ReactNode;\n testID?: string;\n}>;\n\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n navigation?: GenesisNavigationModule;\n /** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: \"translate-with-padding\"`). */\n keyboardAvoidingView?: KeyboardAvoidingLike;\n /** expo-haptics (`import * as Haptics from \"expo-haptics\"`): `useHaptics`, `usePressFeedback`, and the primitives that answer a touch. Without it, no haptics. */\n haptics?: GenesisHapticsModule;\n /** react-native-gesture-handler's `ReanimatedSwipeable`: NativeSwipeRow and InboxPage's rows. Without it, no swipe; the actions stay on long press. */\n swipeable?: GenesisSwipeableComponent;\n}\n\n/** The props NativeSwipeRow passes; `ReanimatedSwipeable` takes them, and its ref has `close()`. */\nexport type GenesisSwipeableComponent = ComponentType<{\n ref?: unknown;\n testID?: string;\n friction?: number;\n overshootLeft?: boolean;\n overshootRight?: boolean;\n onSwipeableWillOpen?: () => void;\n renderLeftActions?: () => ReactNode;\n renderRightActions?: () => ReactNode;\n children?: ReactNode;\n}>;\n\nconst EMPTY: GenesisModules = Object.freeze({});\nconst GenesisModulesContext = createContext<GenesisModules>(EMPTY);\n\nexport interface GenesisModulesProviderProps {\n modules: GenesisModules;\n children: ReactNode;\n}\n\n/**\n * Pass the optional native modules the app has installed. Nested providers\n * merge: an inner one adds to or replaces what an outer one gave. Define the\n * `modules` object once at module scope (as the starter's\n * `src/lib/native-modules.ts` does): a new inline object on every render\n * re-renders every component that reads it.\n */\nexport function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps) {\n const outer = useContext(GenesisModulesContext);\n const value = useMemo(() => (outer === EMPTY ? modules : { ...outer, ...modules }), [outer, modules]);\n return createElement(GenesisModulesContext.Provider, { value }, children);\n}\n\n/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */\nexport function useGenesisModules(): GenesisModules {\n return useContext(GenesisModulesContext);\n}\n","/**\n * Haptics, one way in: the app passes expo-haptics once, as `GenesisModules.haptics`, and every\n * Genesis primitive (and the app's own pieces) plays the same kinds of feedback through\n * `useHaptics()`. Without the module nothing plays, and nothing throws.\n *\n * import * as Haptics from \"expo-haptics\";\n * <GenesisModulesProvider modules={{ haptics: Haptics }}>\n *\n * const haptic = useHaptics();\n * haptic(\"select\");\n *\n * Kinds follow the platforms' own vocabulary: a light, medium or heavy impact (a press, a swipe\n * passing its threshold, a long press opening a menu), a selection tick (a picker or a tab\n * changing), and a success, warning or error notification. The OS's own haptics setting applies;\n * Reduce Motion doesn't turn haptics off (they're not motion).\n *\n * @stability Beta\n */\nimport { useCallback } from \"react\";\nimport { useGenesisModules } from \"../native-modules\";\n\n/** What a haptic says. */\nexport type HapticKind = \"light\" | \"medium\" | \"heavy\" | \"select\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * `import * as Haptics from \"expo-haptics\"`: the parts Genesis calls, written structurally (the\n * same shape as genesis-chat's `HapticsLike`, so one module serves both).\n */\nexport interface GenesisHapticsModule {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown; Heavy?: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** Plays a haptic on the module given; never throws and never rejects. No module, no haptic. */\nexport function playHaptic(haptics: GenesisHapticsModule | undefined, kind: HapticKind): void {\n if (!haptics) return;\n try {\n const as = (s: unknown) => s as never;\n const styles = haptics.ImpactFeedbackStyle;\n const notes = haptics.NotificationFeedbackType;\n const p =\n kind === \"light\"\n ? haptics.impactAsync(as(styles.Light))\n : kind === \"medium\"\n ? haptics.impactAsync(as(styles.Medium))\n : kind === \"heavy\"\n ? haptics.impactAsync(as(styles.Heavy ?? styles.Medium))\n : kind === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(as(kind === \"success\" ? notes.Success : kind === \"warning\" ? notes.Warning : notes.Error));\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n\n/** A function that plays a haptic through the app's `GenesisModules.haptics`. Stable across renders. */\nexport function useHaptics(): (kind: HapticKind) => void {\n const { haptics } = useGenesisModules();\n return useCallback((kind: HapticKind) => playHaptic(haptics, kind), [haptics]);\n}\n","/**\n * usePressFeedback: how a pressable answers a touch, the same for buttons, rows and cards. It\n * shrinks a little while held (on the motion tokens' `press` duration) and springs back on release\n * (`snappy`), and can play a haptic when the press lands. Under Reduce Motion (or brand motion\n * `none`) it dims instead of moving.\n *\n * const press = usePressFeedback({ haptic: \"light\" });\n * <Pressable onPress={save} onPressIn={press.onPressIn} onPressOut={press.onPressOut}>\n * <Animated.View style={press.style}>…</Animated.View>\n * </Pressable>\n *\n * The haptic plays on `onPressIn` for `select` (a tick under the finger, as iOS does). Any other\n * kind plays when you call `press.confirm()` from `onPress`, so a press cancelled by scrolling\n * stays quiet.\n *\n * Built on React Native's `Animated`, so it works without Reanimated.\n *\n * @stability Beta\n */\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useMotion, type UseMotionOptions } from \"./use-motion\";\nimport { useHaptics, type HapticKind } from \"./use-haptics\";\n\ntype AnimatedValue = InstanceType<typeof Animated.Value>;\n\nexport interface PressFeedbackOptions {\n /** A haptic when the press counts (`confirm()`), or `select` as a tick on press-in. Default none. */\n haptic?: HapticKind | false;\n /** How far it shrinks while held. Default 0.97. */\n scale?: number;\n /** Under Reduce Motion: how far it dims while held. Default 0.6. */\n dimTo?: number;\n /** No feedback (a disabled button). */\n disabled?: boolean;\n /** The brand's motion level, as `useMotion` takes it. */\n level?: UseMotionOptions[\"level\"];\n}\n\nexport interface PressFeedback {\n onPressIn: () => void;\n onPressOut: () => void;\n /** Call from `onPress`: plays the haptic for a press that counted. */\n confirm: () => void;\n /** For an `Animated.View` around the pressable's content. */\n style: { transform?: { scale: AnimatedValue }[]; opacity?: AnimatedValue };\n}\n\nexport function usePressFeedback({ haptic = false, scale = 0.97, dimTo = 0.6, disabled = false, level }: PressFeedbackOptions = {}): PressFeedback {\n const motion = useMotion(level ? { level } : {});\n const play = useHaptics();\n const value = useRef(new Animated.Value(1)).current;\n const reduced = motion.reduced;\n\n const to = useCallback(\n (target: number, held: boolean) => {\n if (held || reduced) {\n Animated.timing(value, { toValue: target, duration: motion.duration.press, useNativeDriver: true }).start();\n } else {\n const s = motion.spring.snappy;\n Animated.spring(value, { toValue: target, damping: s.damping, stiffness: s.stiffness, mass: s.mass, useNativeDriver: true }).start();\n }\n },\n [value, motion, reduced],\n );\n\n const onPressIn = useCallback(() => {\n if (disabled) return;\n to(reduced ? dimTo : scale, true);\n if (haptic === \"select\") play(\"select\");\n }, [disabled, reduced, dimTo, scale, to, haptic, play]);\n\n // Always let go, even if the pressable was disabled mid-press (a send that started), and start\n // from rest whenever it's disabled, so it never comes back still shrunk.\n const onPressOut = useCallback(() => to(1, false), [to]);\n useEffect(() => {\n if (disabled) value.setValue(1);\n }, [disabled, value]);\n\n const confirm = useCallback(() => {\n if (!disabled && haptic && haptic !== \"select\") play(haptic);\n }, [disabled, haptic, play]);\n\n const style = useMemo(() => (disabled ? {} : reduced ? { opacity: value } : { transform: [{ scale: value }] }), [disabled, reduced, value]);\n\n return { onPressIn, onPressOut, confirm, style };\n}\n","/**\n * useThemeMode — read the active color scheme (light / dark / unset).\n *\n * Wraps RN's `Appearance.getColorScheme()` + `Appearance.addChangeListener`\n * with a stable React hook so consumers don't have to wire it themselves.\n *\n * Use this in tokens-aware components when you need to choose between\n * light/dark variants OUTSIDE of Tailwind's `dark:` modifier (e.g., to pick\n * an asset, run an extra-color computation, or set StatusBar style).\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { Appearance, type ColorSchemeName } from \"react-native\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport function useThemeMode(): ThemeMode {\n const [scheme, setScheme] = useState<ColorSchemeName>(\n Appearance.getColorScheme(),\n );\n\n useEffect(() => {\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(colorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return scheme === \"dark\" ? \"dark\" : \"light\";\n}\n","/**\n * useThemeRoles — the theme roles (background, label, separator, tint…) as\n * colors for this platform and color scheme.\n *\n * On iOS every neutral role is a system color through `PlatformColor`, so a\n * screen follows light and dark mode, increased contrast and accessibility\n * settings like the system apps. On Android the roles are the Genesis tokens\n * for the current scheme, or Material You colors on Android 12+ with\n * `materialYou`. A brand sets `tint`.\n *\n * Use it for `style` props and anything Tailwind classes don't reach, such as\n * navigation header and tab bar options.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport { Platform, PlatformColor, type ColorValue } from \"react-native\";\nimport { resolveThemeRoles, type ThemeRole } from \"@marktiderman/genesis-design-system\";\nimport { useThemeMode } from \"./use-theme-mode\";\n\nexport type ThemeRoleColors = Record<ThemeRole, ColorValue>;\n\nexport interface UseThemeRolesOptions {\n /** The brand's primary color. */\n tint?: string;\n /** On Android 12+, use Material You dynamic colors for the neutral roles (and the tint, unless `tint` is set). Ignored elsewhere. */\n materialYou?: boolean;\n}\n\nexport function useThemeRoles(options: UseThemeRolesOptions = {}): ThemeRoleColors {\n const scheme = useThemeMode();\n const { tint, materialYou = false } = options;\n const androidDynamic = materialYou && Platform.OS === \"android\" && Number(Platform.Version) >= 31;\n return useMemo(\n () =>\n resolveThemeRoles<ColorValue>({\n target: Platform.OS === \"ios\" ? \"ios\" : \"android\",\n scheme,\n platformColor: (name) => PlatformColor(name),\n tint,\n androidDynamic,\n }),\n [scheme, tint, androidDynamic],\n );\n}\n\n/** The colour of a message you sent, on every thread on the phone. Its text is `text-primary-foreground`. */\nexport const sentBubbleColor = <C,>(roles: { tint: C }): C => roles.tint;\n"]}
1
+ {"version":3,"sources":["../src/hooks/use-reduced-motion.ts","../src/hooks/use-motion.ts","../src/native-modules.tsx","../src/hooks/use-haptics.ts","../src/hooks/use-press-feedback.ts","../src/hooks/use-theme-mode.ts","../src/hooks/use-theme-roles.ts"],"names":["useMemo","useCallback","useEffect","useState"],"mappings":";;;;;;AAgBA,IAAI,SAAA,GAAY,KAAA;AAOT,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CAA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useReducedMotion — subscribe to the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n","/**\n * useMotion — the shared motion tokens (genesis-design-system's\n * `resolveMotion`), with the OS's reduce-motion setting applied.\n *\n * Every Genesis primitive that moves reads its durations, easings and springs\n * from here instead of its own constants, so motion is defined once for web\n * and native. Under Reduce Motion every duration is 0 and `animateMotion`\n * returns the final value, so a component lands without moving.\n *\n * The brand's motion level isn't read from a provider yet: pass `level` (a\n * brand whose design system chose `none` passes `\"none\"`). Without it,\n * `calm`.\n *\n * On the JS thread (an effect, a PanResponder), `animateMotion`:\n *\n * ```tsx\n * const motion = useMotion();\n * const { reanimated: R } = useGenesisModules();\n * opacity.value = animateMotion(R, motion, 1, { duration: \"fast\", easing: \"decelerate\" });\n * ```\n *\n * Inside a worklet (a gesture's `onEnd`, an animated scroll handler), build\n * the config with the worklet-safe `motionSpring` / `motionTiming` and call\n * Reanimated yourself:\n *\n * ```tsx\n * .onEnd((e) => { x.value = withSpring(0, motionSpring(motion, \"snappy\", e.velocityX)); })\n * opacity.value = withTiming(1, motionTiming(motion, \"fast\", Easing, \"decelerate\"));\n * ```\n *\n * A repeating animation checks `motion.reduced` first: a zero-length repeat\n * would flash every frame.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport {\n resolveMotion,\n type MotionDurations,\n type MotionEasings,\n type MotionLevel,\n type MotionSprings,\n type MotionTokens,\n} from \"@marktiderman/genesis-design-system/tokens/motion\";\nimport type { GenesisReanimatedModule } from \"../native-modules\";\nimport { useReducedMotion } from \"./use-reduced-motion\";\n\nexport interface UseMotionOptions {\n /** The brand's motion level. Default `calm`; `none` holds everything still, like Reduce Motion. */\n level?: MotionLevel;\n}\n\nexport function useMotion(options: UseMotionOptions = {}): MotionTokens {\n const reducedMotion = useReducedMotion();\n const level = options.level ?? \"calm\";\n return useMemo(() => resolveMotion(level, { reducedMotion }), [level, reducedMotion]);\n}\n\n/** How to get there: a named spring (keeps a gesture's velocity), or a named duration and easing. */\nexport type MotionHow =\n | { spring: keyof MotionSprings; velocity?: number; duration?: never; easing?: never }\n | { duration: keyof MotionDurations; easing?: keyof MotionEasings; spring?: never; velocity?: never };\n\n/** What `motionSpring` gives `withSpring`. */\nexport interface MotionSpringConfig {\n damping: number;\n stiffness: number;\n mass: number;\n velocity?: number;\n}\n\n/** What `motionTiming` gives `withTiming`. */\nexport interface MotionTimingConfig {\n duration: number;\n easing?: unknown;\n}\n\n/**\n * A `withSpring` config from a named spring. Worklet-safe (plain data in,\n * plain data out). Under reduced motion it's the stiff, critically damped\n * spring that settles in a few frames; to not move at all, check\n * `motion.reduced` and assign the value.\n */\nexport function motionSpring(motion: MotionTokens, name: keyof MotionSprings, velocity?: number): MotionSpringConfig {\n \"worklet\";\n const s = motion.spring[name];\n return typeof velocity === \"number\" && !motion.reduced\n ? { damping: s.damping, stiffness: s.stiffness, mass: s.mass, velocity }\n : { damping: s.damping, stiffness: s.stiffness, mass: s.mass };\n}\n\n/**\n * A `withTiming` config from a named duration and easing. Pass Reanimated's\n * `Easing` (`R.Easing`, or `Easing` imported in a worklet) so the token's\n * curve is used; a module without `Easing.bezier` gets Reanimated's default\n * curve. Worklet-safe.\n */\nexport function motionTiming(\n motion: MotionTokens,\n duration: keyof MotionDurations,\n Easing: Pick<GenesisReanimatedModule[\"Easing\"], \"bezier\"> | undefined,\n easing: keyof MotionEasings = \"out\",\n): MotionTimingConfig {\n \"worklet\";\n const [x1, y1, x2, y2] = motion.easing[easing];\n const curve = Easing?.bezier ? Easing.bezier(x1, y1, x2, y2) : undefined;\n return curve === undefined ? { duration: motion.duration[duration] } : { duration: motion.duration[duration], easing: curve };\n}\n\n/**\n * A Reanimated animation to `toValue` with the motion tokens, for a shared\n * value on the JS thread: `x.value = animateMotion(R, motion, 0, { spring: \"smooth\" })`.\n * Under reduced motion it returns `toValue` itself, so nothing moves.\n *\n * It takes no completion callback: Reanimated runs one on the UI thread, so\n * it must be a worklet, and the reduced path couldn't keep that promise. To\n * act when an animation ends, call `withSpring` / `withTiming` yourself with\n * `motionSpring` / `motionTiming` and a worklet callback. A module without\n * `withSpring` (an older one, a test fake) gets a `withTiming` at `base`.\n */\nexport function animateMotion(R: GenesisReanimatedModule, motion: MotionTokens, toValue: number, how: MotionHow): number {\n if (motion.reduced) return toValue;\n if (how.spring !== undefined) {\n if (R.withSpring) return R.withSpring(toValue, motionSpring(motion, how.spring, how.velocity));\n return R.withTiming(toValue, motionTiming(motion, \"base\", R.Easing));\n }\n return R.withTiming(toValue, motionTiming(motion, how.duration, R.Easing, how.easing));\n}\n","/**\n * GenesisModulesProvider — the native modules an app opts in to, passed in\n * once near the root. Genesis never `require()`s these itself: an app that\n * has a module installed imports it and hands it over, and every component\n * that could use it falls back to plain React Native when it isn't here.\n *\n * import { FlashList } from \"@shopify/flash-list\";\n * import { Image } from \"expo-image\";\n * import * as Reanimated from \"react-native-reanimated\";\n * import * as GlassEffect from \"expo-glass-effect\";\n * import { SymbolView } from \"expo-symbols\";\n * import DateTimePicker from \"@expo/ui/community/datetime-picker\";\n * import { lucideIcons } from \"@marktiderman/genesis-ui-native/icons/lucide\";\n * import { DarkTheme, DefaultTheme, ThemeProvider } from \"expo-router\";\n *\n * // At module scope, not inline:\n * const modules = { list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,\n * symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker,\n * navigation: { ThemeProvider, DefaultTheme, DarkTheme } };\n * <GenesisModulesProvider modules={modules}>…</GenesisModulesProvider>\n *\n * (`GenesisNativeApp` from `@marktiderman/genesis-native` takes the same\n * object as its `modules` prop and mounts this for you.)\n *\n * | Module | Used by | Without it |\n * | ------------------------------ | ---------------------------------------- | ----------------------------- |\n * | `list` (FlashList v2) | NativeResourcePage, NotificationsPage | FlatList / SectionList |\n * | `image` (expo-image) | NativeAvatar, NativeImage | React Native `Image` |\n * | `reanimated` (Reanimated 4) | Toast, Drawer, Skeleton | React Native `Animated` |\n * | `glass` (expo-glass-effect) | Toast, NativeGlassSurface, update banner | the solid surface |\n * | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |\n * | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |\n * | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |\n * | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |\n * | `haptics` (expo-haptics) | useHaptics, usePressFeedback, NativeComposerBar (send) | no haptics |\n * | `swipeable` (react-native-gesture-handler's `ReanimatedSwipeable`) | NativeSwipeRow, InboxPage: the swipe to a row's actions | the actions on long press and as accessibility actions |\n * | `navigation` (React Navigation's theming: from `expo-router` in an Expo Router app, which bundles its own copy; `@react-navigation/native` otherwise) | GenesisNativeApp: headers and tab bars in the brand's light and dark colors | React Navigation's default (light) theme |\n *\n * The props below are written structurally (no import of the optional\n * packages), so this package builds and type-checks without any of them.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { GenesisHapticsModule } from \"./hooks/use-haptics\";\nimport type { ColorValue } from \"react-native\";\nimport type { NativeIconName } from \"./icon-names\";\n\n/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */\nexport interface GenesisListProps<T> {\n data: readonly T[];\n renderItem: (info: { item: T; index: number }) => ReactNode;\n keyExtractor?: (item: T, index: number) => string;\n getItemType?: (item: T, index: number) => string | number | undefined;\n stickyHeaderIndices?: number[];\n /** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */\n stickyHeaderConfig?: { offset?: number };\n ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;\n ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;\n contentContainerStyle?: Record<string, unknown>;\n refreshing?: boolean;\n onRefresh?: () => void;\n refreshControl?: ReactNode;\n testID?: string;\n}\n\n/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */\nexport type GenesisListComponent = ComponentType<GenesisListProps<any>>;\n\n/** The expo-image `Image` props Genesis passes. */\nexport interface GenesisImageProps {\n /** `cacheKey` keys the cache in place of the URL. */\n source: { uri: string; cacheKey?: string } | number | null;\n style?: unknown;\n contentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n cachePolicy?: \"none\" | \"disk\" | \"memory\" | \"memory-disk\";\n placeholder?: unknown;\n placeholderContentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n transition?: number | null;\n recyclingKey?: string | null;\n priority?: \"low\" | \"normal\" | \"high\" | null;\n onError?: (event: unknown) => void;\n onLoad?: (event: unknown) => void;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `Image` from `expo-image`. */\nexport type GenesisImageComponent = ComponentType<GenesisImageProps>;\n\n/** `import * as Reanimated from \"react-native-reanimated\"` (v4). Only what Genesis calls is listed. */\nexport interface GenesisReanimatedModule {\n default: { View: ComponentType<any> };\n useSharedValue: <V>(initial: V) => { value: V };\n useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;\n withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n /** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */\n withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** A React Navigation theme (`ReactNavigation.Theme`): the colors Genesis sets, and the fonts it keeps. */\nexport interface GenesisNavigationTheme {\n dark: boolean;\n colors: { primary: ColorValue; background: ColorValue; card: ColorValue; text: ColorValue; border: ColorValue; notification: ColorValue };\n fonts?: unknown;\n}\n\n/**\n * React Navigation's theming. In an Expo Router app take it from `expo-router`: it bundles its own\n * React Navigation, and its navigators read that copy's theme, not `@react-navigation/native`'s.\n */\nexport interface GenesisNavigationModule {\n ThemeProvider: ComponentType<{ value: any; children: ReactNode }>;\n DefaultTheme: GenesisNavigationTheme;\n DarkTheme: GenesisNavigationTheme;\n}\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\n/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n automaticOffset?: boolean;\n children?: ReactNode;\n testID?: string;\n}>;\n\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n navigation?: GenesisNavigationModule;\n /** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: \"translate-with-padding\"`). */\n keyboardAvoidingView?: KeyboardAvoidingLike;\n /** expo-haptics (`import * as Haptics from \"expo-haptics\"`): `useHaptics`, `usePressFeedback`, and the primitives that answer a touch. Without it, no haptics. */\n haptics?: GenesisHapticsModule;\n /** react-native-gesture-handler's `ReanimatedSwipeable`: NativeSwipeRow and InboxPage's rows. Without it, no swipe; the actions stay on long press. */\n swipeable?: GenesisSwipeableComponent;\n /**\n * react-native-svg (`import * as Svg from \"react-native-svg\"`): NativeChartContainer draws line\n * and area charts with it. Without it, bars still draw (they're views) and a line chart shows its\n * points only.\n */\n svg?: GenesisSvgModule;\n /**\n * Picks files for NativeFileUploadField (and a form's file and image fields): wrap\n * expo-document-picker's `getDocumentAsync` or expo-image-picker's `launchImageLibraryAsync`\n * and return the picked files, or `[]` when the person cancelled.\n */\n filePicker?: GenesisFilePicker;\n}\n\n/** A file a person picked on the phone: where it is, its name, and its type and size when known. */\nexport interface NativePickedFile {\n uri: string;\n name: string;\n /** MIME type, e.g. \"image/jpeg\". */\n type?: string | undefined;\n /** Bytes. */\n size?: number | undefined;\n}\n\n/**\n * Opens the system's picker; resolves to what was picked, `[]` when the person cancelled. Reject\n * when it can't pick (a permission denied, an iCloud download that failed): the field shows its\n * `labels.pickFailed` sentence, never the raw error. If your app explains a denial itself (with a\n * link to Settings, say), do that and resolve `[]`.\n */\nexport type GenesisFilePicker = (options: { multiple: boolean; accept?: string | undefined }) => Promise<NativePickedFile[]>;\n\n/** The react-native-svg parts NativeChartContainer draws with. */\nexport interface GenesisSvgModule {\n default?: ComponentType<{ width?: number; height?: number; children?: ReactNode; testID?: string }>;\n Svg?: ComponentType<{ width?: number; height?: number; children?: ReactNode; testID?: string }>;\n Path: ComponentType<{ d: string; stroke?: ColorValue; strokeWidth?: number; fill?: ColorValue; fillOpacity?: number; testID?: string }>;\n}\n\n/** The props NativeSwipeRow passes; `ReanimatedSwipeable` takes them, and its ref has `close()`. */\nexport type GenesisSwipeableComponent = ComponentType<{\n ref?: unknown;\n testID?: string;\n friction?: number;\n overshootLeft?: boolean;\n overshootRight?: boolean;\n onSwipeableWillOpen?: () => void;\n renderLeftActions?: () => ReactNode;\n renderRightActions?: () => ReactNode;\n children?: ReactNode;\n}>;\n\nconst EMPTY: GenesisModules = Object.freeze({});\nconst GenesisModulesContext = createContext<GenesisModules>(EMPTY);\n\nexport interface GenesisModulesProviderProps {\n modules: GenesisModules;\n children: ReactNode;\n}\n\n/**\n * Pass the optional native modules the app has installed. Nested providers\n * merge: an inner one adds to or replaces what an outer one gave. Define the\n * `modules` object once at module scope (as the starter's\n * `src/lib/native-modules.ts` does): a new inline object on every render\n * re-renders every component that reads it.\n */\nexport function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps) {\n const outer = useContext(GenesisModulesContext);\n const value = useMemo(() => (outer === EMPTY ? modules : { ...outer, ...modules }), [outer, modules]);\n return createElement(GenesisModulesContext.Provider, { value }, children);\n}\n\n/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */\nexport function useGenesisModules(): GenesisModules {\n return useContext(GenesisModulesContext);\n}\n","/**\n * Haptics, one way in: the app passes expo-haptics once, as `GenesisModules.haptics`, and every\n * Genesis primitive (and the app's own pieces) plays the same kinds of feedback through\n * `useHaptics()`. Without the module nothing plays, and nothing throws.\n *\n * import * as Haptics from \"expo-haptics\";\n * <GenesisModulesProvider modules={{ haptics: Haptics }}>\n *\n * const haptic = useHaptics();\n * haptic(\"select\");\n *\n * Kinds follow the platforms' own vocabulary: a light, medium or heavy impact (a press, a swipe\n * passing its threshold, a long press opening a menu), a selection tick (a picker or a tab\n * changing), and a success, warning or error notification. The OS's own haptics setting applies;\n * Reduce Motion doesn't turn haptics off (they're not motion).\n *\n * @stability Beta\n */\nimport { useCallback } from \"react\";\nimport { useGenesisModules } from \"../native-modules\";\n\n/** What a haptic says. */\nexport type HapticKind = \"light\" | \"medium\" | \"heavy\" | \"select\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * `import * as Haptics from \"expo-haptics\"`: the parts Genesis calls, written structurally (the\n * same shape as genesis-chat's `HapticsLike`, so one module serves both).\n */\nexport interface GenesisHapticsModule {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown; Heavy?: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** Plays a haptic on the module given; never throws and never rejects. No module, no haptic. */\nexport function playHaptic(haptics: GenesisHapticsModule | undefined, kind: HapticKind): void {\n if (!haptics) return;\n try {\n const as = (s: unknown) => s as never;\n const styles = haptics.ImpactFeedbackStyle;\n const notes = haptics.NotificationFeedbackType;\n const p =\n kind === \"light\"\n ? haptics.impactAsync(as(styles.Light))\n : kind === \"medium\"\n ? haptics.impactAsync(as(styles.Medium))\n : kind === \"heavy\"\n ? haptics.impactAsync(as(styles.Heavy ?? styles.Medium))\n : kind === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(as(kind === \"success\" ? notes.Success : kind === \"warning\" ? notes.Warning : notes.Error));\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n\n/** A function that plays a haptic through the app's `GenesisModules.haptics`. Stable across renders. */\nexport function useHaptics(): (kind: HapticKind) => void {\n const { haptics } = useGenesisModules();\n return useCallback((kind: HapticKind) => playHaptic(haptics, kind), [haptics]);\n}\n","/**\n * usePressFeedback: how a pressable answers a touch, the same for buttons, rows and cards. It\n * shrinks a little while held (on the motion tokens' `press` duration) and springs back on release\n * (`snappy`), and can play a haptic when the press lands. Under Reduce Motion (or brand motion\n * `none`) it dims instead of moving.\n *\n * const press = usePressFeedback({ haptic: \"light\" });\n * <Pressable onPress={save} onPressIn={press.onPressIn} onPressOut={press.onPressOut}>\n * <Animated.View style={press.style}>…</Animated.View>\n * </Pressable>\n *\n * The haptic plays on `onPressIn` for `select` (a tick under the finger, as iOS does). Any other\n * kind plays when you call `press.confirm()` from `onPress`, so a press cancelled by scrolling\n * stays quiet.\n *\n * Built on React Native's `Animated`, so it works without Reanimated.\n *\n * @stability Beta\n */\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useMotion, type UseMotionOptions } from \"./use-motion\";\nimport { useHaptics, type HapticKind } from \"./use-haptics\";\n\ntype AnimatedValue = InstanceType<typeof Animated.Value>;\n\nexport interface PressFeedbackOptions {\n /** A haptic when the press counts (`confirm()`), or `select` as a tick on press-in. Default none. */\n haptic?: HapticKind | false;\n /** How far it shrinks while held. Default 0.97. */\n scale?: number;\n /** Under Reduce Motion: how far it dims while held. Default 0.6. */\n dimTo?: number;\n /** No feedback (a disabled button). */\n disabled?: boolean;\n /** The brand's motion level, as `useMotion` takes it. */\n level?: UseMotionOptions[\"level\"];\n}\n\nexport interface PressFeedback {\n onPressIn: () => void;\n onPressOut: () => void;\n /** Call from `onPress`: plays the haptic for a press that counted. */\n confirm: () => void;\n /** For an `Animated.View` around the pressable's content. */\n style: { transform?: { scale: AnimatedValue }[]; opacity?: AnimatedValue };\n}\n\nexport function usePressFeedback({ haptic = false, scale = 0.97, dimTo = 0.6, disabled = false, level }: PressFeedbackOptions = {}): PressFeedback {\n const motion = useMotion(level ? { level } : {});\n const play = useHaptics();\n const value = useRef(new Animated.Value(1)).current;\n const reduced = motion.reduced;\n\n const to = useCallback(\n (target: number, held: boolean) => {\n if (held || reduced) {\n Animated.timing(value, { toValue: target, duration: motion.duration.press, useNativeDriver: true }).start();\n } else {\n const s = motion.spring.snappy;\n Animated.spring(value, { toValue: target, damping: s.damping, stiffness: s.stiffness, mass: s.mass, useNativeDriver: true }).start();\n }\n },\n [value, motion, reduced],\n );\n\n const onPressIn = useCallback(() => {\n if (disabled) return;\n to(reduced ? dimTo : scale, true);\n if (haptic === \"select\") play(\"select\");\n }, [disabled, reduced, dimTo, scale, to, haptic, play]);\n\n // Always let go, even if the pressable was disabled mid-press (a send that started), and start\n // from rest whenever it's disabled, so it never comes back still shrunk.\n const onPressOut = useCallback(() => to(1, false), [to]);\n useEffect(() => {\n if (disabled) value.setValue(1);\n }, [disabled, value]);\n\n const confirm = useCallback(() => {\n if (!disabled && haptic && haptic !== \"select\") play(haptic);\n }, [disabled, haptic, play]);\n\n const style = useMemo(() => (disabled ? {} : reduced ? { opacity: value } : { transform: [{ scale: value }] }), [disabled, reduced, value]);\n\n return { onPressIn, onPressOut, confirm, style };\n}\n","/**\n * useThemeMode — read the active color scheme (light / dark / unset).\n *\n * Wraps RN's `Appearance.getColorScheme()` + `Appearance.addChangeListener`\n * with a stable React hook so consumers don't have to wire it themselves.\n *\n * Use this in tokens-aware components when you need to choose between\n * light/dark variants OUTSIDE of Tailwind's `dark:` modifier (e.g., to pick\n * an asset, run an extra-color computation, or set StatusBar style).\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { Appearance, type ColorSchemeName } from \"react-native\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport function useThemeMode(): ThemeMode {\n const [scheme, setScheme] = useState<ColorSchemeName>(\n Appearance.getColorScheme(),\n );\n\n useEffect(() => {\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(colorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return scheme === \"dark\" ? \"dark\" : \"light\";\n}\n","/**\n * useThemeRoles — the theme roles (background, label, separator, tint…) as\n * colors for this platform and color scheme.\n *\n * On iOS every neutral role is a system color through `PlatformColor`, so a\n * screen follows light and dark mode, increased contrast and accessibility\n * settings like the system apps. On Android the roles are the Genesis tokens\n * for the current scheme, or Material You colors on Android 12+ with\n * `materialYou`. A brand sets `tint`.\n *\n * Use it for `style` props and anything Tailwind classes don't reach, such as\n * navigation header and tab bar options.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport { Platform, PlatformColor, type ColorValue } from \"react-native\";\nimport { resolveThemeRoles, type ThemeRole } from \"@marktiderman/genesis-design-system\";\nimport { useThemeMode } from \"./use-theme-mode\";\n\nexport type ThemeRoleColors = Record<ThemeRole, ColorValue>;\n\nexport interface UseThemeRolesOptions {\n /** The brand's primary color. */\n tint?: string;\n /** On Android 12+, use Material You dynamic colors for the neutral roles (and the tint, unless `tint` is set). Ignored elsewhere. */\n materialYou?: boolean;\n}\n\nexport function useThemeRoles(options: UseThemeRolesOptions = {}): ThemeRoleColors {\n const scheme = useThemeMode();\n const { tint, materialYou = false } = options;\n const androidDynamic = materialYou && Platform.OS === \"android\" && Number(Platform.Version) >= 31;\n return useMemo(\n () =>\n resolveThemeRoles<ColorValue>({\n target: Platform.OS === \"ios\" ? \"ios\" : \"android\",\n scheme,\n platformColor: (name) => PlatformColor(name),\n tint,\n androidDynamic,\n }),\n [scheme, tint, androidDynamic],\n );\n}\n\n/** The colour of a message you sent, on every thread on the phone. Its text is `text-primary-foreground`. */\nexport const sentBubbleColor = <C,>(roles: { tint: C }): C => roles.tint;\n"]}