@marktiderman/genesis-ui-native 3.5.1 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -7
- package/dist/{chunk-ONH2PCGH.js → chunk-3KFUS7O6.js} +9 -15
- package/dist/chunk-3KFUS7O6.js.map +1 -0
- package/dist/{chunk-LBVD7XXL.js → chunk-7NDKIIOT.js} +627 -20
- package/dist/chunk-7NDKIIOT.js.map +1 -0
- package/dist/chunk-CAI7LGN6.js +39 -0
- package/dist/chunk-CAI7LGN6.js.map +1 -0
- package/dist/{chunk-ABVSSJNT.js → chunk-GBNIBHSU.js} +198 -168
- package/dist/chunk-GBNIBHSU.js.map +1 -0
- package/dist/chunk-IXC3LO2K.js +410 -0
- package/dist/chunk-IXC3LO2K.js.map +1 -0
- package/dist/{chunk-GHYUNNNU.js → chunk-KH2RVAI5.js} +174 -93
- package/dist/chunk-KH2RVAI5.js.map +1 -0
- package/dist/{chunk-6KWEAGRD.js → chunk-O4BMDV7I.js} +110 -17
- package/dist/chunk-O4BMDV7I.js.map +1 -0
- package/dist/chunk-RTYO24SC.js +105 -0
- package/dist/chunk-RTYO24SC.js.map +1 -0
- package/dist/{chunk-D5RKSPMH.js → chunk-YWDDDYDI.js} +4 -3
- package/dist/chunk-YWDDDYDI.js.map +1 -0
- package/dist/components/index.d.ts +382 -10
- package/dist/components/index.js +6 -5
- package/dist/data/index.d.ts +68 -4
- package/dist/data/index.js +231 -30
- package/dist/data/index.js.map +1 -1
- package/dist/hooks/index.d.ts +90 -2
- package/dist/hooks/index.js +3 -3
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/icons/lucide.js +7 -1
- package/dist/icons/lucide.js.map +1 -1
- package/dist/{inbox-page-BEarNEIP.d.ts → inbox-page-B7_Oi2fS.d.ts} +2 -44
- package/dist/index.d.ts +8 -5
- package/dist/index.js +9 -8
- package/dist/layouts/index.d.ts +40 -51
- package/dist/layouts/index.js +6 -4
- package/dist/{native-modules-PwnGltOU.d.ts → native-modules-DEJJQhDx.d.ts} +55 -1
- package/package.json +101 -4
- package/src/__tests__/doctor-rules.test.ts +87 -0
- package/src/__tests__/native-modules-lists.test.tsx +1 -0
- package/src/components/__tests__/button-haptic.test.tsx +52 -0
- package/src/components/__tests__/composer-bar.test.tsx +79 -0
- package/src/components/__tests__/gallery-card.test.tsx +59 -0
- package/src/components/__tests__/gallery-grid.test.tsx +160 -0
- package/src/components/__tests__/lightbox-resnap.test.tsx +50 -0
- package/src/components/__tests__/lightbox-zoom.test.ts +33 -0
- package/src/components/__tests__/lightbox.test.tsx +141 -0
- package/src/components/__tests__/live-indicator.test.tsx +72 -0
- package/src/components/__tests__/rating.test.tsx +82 -0
- package/src/components/__tests__/thread-list.test.tsx +219 -0
- package/src/components/button.tsx +18 -1
- package/src/components/composer-bar.tsx +276 -0
- package/src/components/drawer.tsx +15 -9
- package/src/components/gallery-card.tsx +109 -0
- package/src/components/gallery-grid.tsx +285 -0
- package/src/components/gallery-layout.ts +2 -0
- package/src/components/gallery-types.ts +2 -0
- package/src/components/index.ts +44 -0
- package/src/components/lightbox-zoom.tsx +282 -0
- package/src/components/lightbox.tsx +342 -0
- package/src/components/live-indicator.tsx +139 -0
- package/src/components/rating.tsx +128 -0
- package/src/components/skeleton.tsx +9 -4
- package/src/components/thread-list.tsx +457 -0
- package/src/components/toast.tsx +7 -4
- package/src/data/NativeConflictSheet.tsx +181 -0
- package/src/data/NativeResourceForm.tsx +15 -1
- package/src/data/index.ts +2 -0
- package/src/data/resource-view/NativeRecordView.tsx +85 -8
- package/src/data/resource-view/NativeResourceView.tsx +79 -32
- package/src/data/resource-view/__tests__/native-record-view.test.tsx +95 -1
- package/src/data/resource-view/__tests__/native-resource-gallery.test.tsx +125 -0
- package/src/hooks/__tests__/use-haptics.test.tsx +146 -0
- package/src/hooks/__tests__/use-motion.test.tsx +106 -0
- package/src/hooks/__tests__/use-thread-jump.test.tsx +88 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-haptics.ts +64 -0
- package/src/hooks/use-motion.ts +128 -0
- package/src/hooks/use-press-feedback.ts +87 -0
- package/src/hooks/use-thread-jump.ts +110 -0
- package/src/icon-names.ts +6 -0
- package/src/icons/lucide.ts +12 -0
- package/src/layouts/__tests__/inbox-page.test.tsx +6 -0
- package/src/layouts/__tests__/thread-page.test.tsx +114 -14
- package/src/layouts/inbox-page.tsx +6 -55
- package/src/layouts/index.ts +2 -0
- package/src/layouts/thread-page.tsx +326 -262
- package/src/native-modules.tsx +20 -2
- package/dist/chunk-6KWEAGRD.js.map +0 -1
- package/dist/chunk-7PCWEY6R.js +0 -27
- package/dist/chunk-7PCWEY6R.js.map +0 -1
- package/dist/chunk-ABVSSJNT.js.map +0 -1
- package/dist/chunk-D5RKSPMH.js.map +0 -1
- package/dist/chunk-GHYUNNNU.js.map +0 -1
- package/dist/chunk-LBVD7XXL.js.map +0 -1
- package/dist/chunk-ONH2PCGH.js.map +0 -1
- package/dist/chunk-Z3AQYVUA.js +0 -36
- package/dist/chunk-Z3AQYVUA.js.map +0 -1
package/src/native-modules.tsx
CHANGED
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
* | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |
|
|
32
32
|
* | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |
|
|
33
33
|
* | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |
|
|
34
|
+
* | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |
|
|
35
|
+
* | `haptics` (expo-haptics) | useHaptics, usePressFeedback, NativeComposerBar (send) | no haptics |
|
|
34
36
|
* | `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 |
|
|
35
37
|
*
|
|
36
38
|
* The props below are written structurally (no import of the optional
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
* @stability Beta
|
|
40
42
|
*/
|
|
41
43
|
import { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from "react";
|
|
44
|
+
import type { GenesisHapticsModule } from "./hooks/use-haptics";
|
|
42
45
|
import type { ColorValue } from "react-native";
|
|
43
46
|
import type { NativeIconName } from "./icon-names";
|
|
44
47
|
|
|
@@ -90,9 +93,11 @@ export interface GenesisReanimatedModule {
|
|
|
90
93
|
useSharedValue: <V>(initial: V) => { value: V };
|
|
91
94
|
useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;
|
|
92
95
|
withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;
|
|
96
|
+
/** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */
|
|
97
|
+
withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;
|
|
93
98
|
withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;
|
|
94
99
|
cancelAnimation: (value: { value: unknown }) => void;
|
|
95
|
-
Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown };
|
|
100
|
+
Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };
|
|
96
101
|
ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };
|
|
97
102
|
}
|
|
98
103
|
|
|
@@ -130,7 +135,7 @@ export interface GenesisSymbolProps {
|
|
|
130
135
|
export type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;
|
|
131
136
|
|
|
132
137
|
/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */
|
|
133
|
-
export type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; strokeWidth?: number; testID?: string }>;
|
|
138
|
+
export type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;
|
|
134
139
|
|
|
135
140
|
/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */
|
|
136
141
|
export type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;
|
|
@@ -169,6 +174,15 @@ export interface GenesisNavigationModule {
|
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
/** Every optional native module Genesis components can use. Each is optional on its own. */
|
|
177
|
+
/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */
|
|
178
|
+
export type KeyboardAvoidingLike = ComponentType<{
|
|
179
|
+
behavior?: "height" | "padding" | "position" | "translate-with-padding";
|
|
180
|
+
keyboardVerticalOffset?: number;
|
|
181
|
+
automaticOffset?: boolean;
|
|
182
|
+
children?: ReactNode;
|
|
183
|
+
testID?: string;
|
|
184
|
+
}>;
|
|
185
|
+
|
|
172
186
|
export interface GenesisModules {
|
|
173
187
|
list?: GenesisListComponent;
|
|
174
188
|
image?: GenesisImageComponent;
|
|
@@ -178,6 +192,10 @@ export interface GenesisModules {
|
|
|
178
192
|
icons?: GenesisIconSet;
|
|
179
193
|
datePicker?: GenesisDatePickerComponent;
|
|
180
194
|
navigation?: GenesisNavigationModule;
|
|
195
|
+
/** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: "translate-with-padding"`). */
|
|
196
|
+
keyboardAvoidingView?: KeyboardAvoidingLike;
|
|
197
|
+
/** expo-haptics (`import * as Haptics from "expo-haptics"`): `useHaptics`, `usePressFeedback`, and the primitives that answer a touch. Without it, no haptics. */
|
|
198
|
+
haptics?: GenesisHapticsModule;
|
|
181
199
|
}
|
|
182
200
|
|
|
183
201
|
const EMPTY: GenesisModules = Object.freeze({});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/text.tsx","../src/components/button.tsx","../src/native-modules.tsx","../src/components/empty-state.tsx","../src/icon-names.ts","../src/components/icon.tsx","../src/components/list-item.tsx","../src/components/section-list.tsx","../src/components/refresh-control.tsx","../src/components/badge.tsx","../src/components/input.tsx","../src/components/loading-state.tsx"],"names":["RNText","cva","jsx","jsxs","Text","View","Pressable","Platform","ActivityIndicator"],"mappings":";;;;;;;;;AASA,IAAM,YAAA,GAAe,IAAI,iBAAA,EAAmB;AAAA,EAC1C,QAAA,EAAU;AAAA,IACR,MAAA,EAAQ;AAAA,MACN,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,IAAA,EAAM,iCAAA;AAAA,MACN,SAAA,EAAW,+BAAA;AAAA,MACX,OAAA,EAAS,+BAAA;AAAA,MACT,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,MAAA,EAAQ;AAAA;AAEZ,CAAC;AA2BD,SAAS,UAAA,CAAW;AAAA,EAClB,SAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoB;AAClB,EAAA,uBACE,GAAA;AAAA,IAACA,IAAA;AAAA,IAAA;AAAA,MACC,WAAW,EAAA,CAAG,YAAA,CAAa,EAAE,MAAA,EAAQ,GAAG,SAAS,CAAA;AAAA,MAChD,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;ACzDA,IAAM,cAAA,GAAiBC,GAAAA;AAAA,EACrB,iDAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,YAAA;AAAA,QACT,SAAA,EAAW,cAAA;AAAA,QACX,O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AA;AAAA,MACjH,UAAA,EAAU,IAAA;AAAA,MACV,iBAAA,EAAkB,aAAA;AAAA,MAClB,kBAAA,EAAoB,MAAA;AAAA,MACpB,kBAAA,EAAoB,EAAE,IAAA,EAAM,IAAA,EAAK;AAAA,MAEjC,QAAA,EAAA;AAAA,wBAAAH,GAAAA,CAACM,iBAAAA,EAAA,EAAkB,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,QAAA,CAAA,EAAY,IAAA,EAAY,KAAA,EAAQ,KAAA,IAAS,KAAA,CAAM,IAAA,EAAiB,CAAA;AAAA,QACnG,KAAA,mBACCN,GAAAA,CAAC,UAAA,EAAA,EAAW,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,MAAA,CAAA,EAAU,MAAA,EAAO,SAAA,EAAU,SAAA,EAAU,mCAAA,EAC/D,iBACH,CAAA,GACE;AAAA;AAAA;AAAA,GACN;AAGF,EAAA,IAAI,CAAC,YAAY,OAAO,OAAA;AAExB,EAAA,uBACEA,GAAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,KAAA,EAAO,aAAA;AAAA,MACP,SAAA,EAAW,EAAA,CAAG,kDAAA,EAAoD,SAAS,CAAA;AAAA,MAE1E,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-6KWEAGRD.js","sourcesContent":["/**\n * Text — typography primitive with semantic presets (h1, h2, body, caption, etc.).\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Text as RNText, type TextProps } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst textVariants = cva(\"text-foreground\", {\n variants: {\n preset: {\n h1: \"text-3xl font-bold leading-9\",\n h2: \"text-2xl font-bold leading-8\",\n h3: \"text-xl font-semibold leading-7\",\n h4: \"text-lg font-semibold leading-7\",\n body: \"text-base font-normal leading-6\",\n \"body-sm\": \"text-sm font-normal leading-5\",\n caption: \"text-xs font-normal leading-4\",\n label: \"text-sm font-medium leading-5\",\n },\n },\n defaultVariants: {\n preset: \"body\",\n },\n});\n\n// `className` is declared explicitly here — not inherited from react-native's\n// `TextProps` via NativeWind's global augmentation, which does not resolve across\n// the RN / nativewind / react-native-css-interop version matrix. Mirrors every\n// other ui-native primitive (Button, Tooltip, ChipGroup, …); the implementation\n// already consumes `className` below.\nexport interface NativeTextProps\n extends TextProps,\n VariantProps<typeof textVariants> {\n /** NativeWind utility class string applied to the underlying Text. */\n className?: string;\n}\n\n/**\n * Allowed `preset` values on {@link NativeText}. Re-exported as a named type\n * so consumer brand packages can build preset-driven typography APIs without\n * having to reach into `NativeTextProps['preset']` themselves.\n *\n * Example (consumer):\n * ```ts\n * import type { TextPreset } from \"@marktiderman/genesis-ui-native\";\n * function Heading({ as }: { as: TextPreset }) { ... }\n * ```\n */\nexport type TextPreset = NonNullable<NativeTextProps[\"preset\"]>;\n\nfunction NativeText({\n className,\n preset,\n children,\n ...props\n}: NativeTextProps) {\n return (\n <RNText\n className={cn(textVariants({ preset }), className)}\n {...props}\n >\n {children}\n </RNText>\n );\n}\n\nexport { NativeText, textVariants };\n","/**\n * Button — primary touch target. Variants: default, secondary, outline, ghost, destructive.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { ActivityIndicator, Pressable, Text, type AccessibilityState } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst buttonVariants = cva(\n \"flex-row items-center justify-center rounded-md\",\n {\n variants: {\n variant: {\n default: \"bg-primary\",\n secondary: \"bg-secondary\",\n outline: \"border border-input bg-transparent\",\n ghost: \"bg-transparent\",\n destructive: \"bg-destructive\",\n },\n size: {\n sm: \"h-9 px-3 gap-1.5\",\n md: \"h-10 px-4 gap-2\",\n lg: \"h-11 px-8 gap-2\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nconst buttonTextVariants = cva(\"font-medium text-center\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n outline: \"text-foreground\",\n ghost: \"text-foreground\",\n destructive: \"text-destructive-foreground\",\n },\n size: {\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\nexport interface NativeButtonProps\n extends VariantProps<typeof buttonVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n onPress?: () => void;\n disabled?: boolean;\n loading?: boolean;\n testID?: string;\n /** What a screen reader says, when the text alone isn't enough (\"Vote for Dark mode\"). Default: the text. */\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /** Merged with the button's own `disabled` and `busy`: `{ selected: true }` for a vote cast, a filter on. */\n accessibilityState?: AccessibilityState;\n}\n\nfunction NativeButton({\n className,\n textClassName,\n variant,\n size,\n children,\n onPress,\n disabled,\n loading,\n accessibilityState,\n ...props\n}: NativeButtonProps) {\n const isDisabled = disabled || loading;\n\n return (\n <Pressable\n className={cn(\n buttonVariants({ variant, size }),\n isDisabled && \"opacity-50\",\n className\n )}\n onPress={onPress}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ ...accessibilityState, disabled: isDisabled, busy: loading }}\n {...props}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={\n variant === \"outline\" || variant === \"ghost\"\n ? undefined\n : \"white\"\n }\n />\n ) : null}\n {typeof children === \"string\" ? (\n <Text\n className={cn(\n buttonTextVariants({ variant, size }),\n textClassName\n )}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Pressable>\n );\n}\n\nexport { NativeButton, buttonVariants, buttonTextVariants };\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 * | `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 { 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 source: { uri: 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 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 };\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; 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. */\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}\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 * EmptyState — what to show when a list / screen has no data.\n *\n * Three semantic variants drive default messaging:\n * - \"first-run\": user has never had data here. Optimistic.\n * - \"no-results\": user filtered/searched and got nothing. Suggest reset.\n * - \"error\": fetching failed. Suggest retry.\n *\n * The variant only sets sensible defaults for `title` and tone — pass\n * your own `title`, `body`, `primaryAction`, `secondaryAction`, etc. to\n * override. Mirrors the @marktiderman/genesis-ui web `<EmptyState>` API where\n * possible (illustration vs icon slot, primary/secondary actions).\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport type NativeEmptyStateVariant = \"first-run\" | \"no-results\" | \"error\";\n\n/**\n * Action descriptor for primary/secondary CTAs. Either pass a structured\n * object (renders a Pressable button via the consumer's button slot) or\n * pass an arbitrary node via `action` for maximum flexibility.\n */\nexport interface NativeEmptyStateAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface NativeEmptyStateProps {\n /** Variant drives default tone + default title. Default \"first-run\". */\n variant?: NativeEmptyStateVariant;\n /** Headline. Falls back to a variant-specific default. */\n title?: string;\n /** Body copy shown below the title. (Alias: `description`.) */\n body?: string;\n /**\n * @deprecated Prefer `body`. `description` remains for back-compat with\n * the original C3 API; both are accepted but `body` wins if both passed.\n */\n description?: string;\n /** Optional illustration (artwork node) above the title. */\n illustration?: React.ReactNode;\n /** Optional icon node above the title (use either icon or illustration). */\n icon?: React.ReactNode;\n /**\n * Primary CTA. When provided, the consumer is responsible for rendering\n * the button itself (we accept a node, not a label) so brand + token\n * styling is honored. The web API takes a `{label, onPress}` descriptor;\n * on native, prefer to pass a `<NativeButton>` directly to avoid\n * cross-package coupling.\n */\n primaryAction?: React.ReactNode;\n /** Secondary CTA, rendered below the primary. */\n secondaryAction?: React.ReactNode;\n /**\n * Free-form action slot. Equivalent to `primaryAction`; accepted for\n * back-compat with the C3 API. If both `action` and `primaryAction` are\n * passed, `primaryAction` wins.\n */\n action?: React.ReactNode;\n /**\n * Developer-facing error details. Only rendered when __DEV__ is true at\n * runtime (we infer by reading `process.env.NODE_ENV !== \"production\"`).\n */\n details?: string;\n className?: string;\n testID?: string;\n}\n\nconst defaults: Record<NativeEmptyStateVariant, { title: string; tone: string }> = {\n \"first-run\": { title: \"Nothing here yet\", tone: \"text-muted-foreground\" },\n \"no-results\": { title: \"No results\", tone: \"text-muted-foreground\" },\n error: { title: \"Something went wrong\", tone: \"text-destructive\" },\n};\n\nexport function NativeEmptyState({\n variant = \"first-run\",\n title,\n body,\n description,\n illustration,\n icon,\n primaryAction,\n secondaryAction,\n action,\n details,\n className,\n testID,\n}: NativeEmptyStateProps) {\n const meta = defaults[variant];\n const resolvedBody = body ?? description;\n const resolvedPrimary = primaryAction ?? action;\n // Read NODE_ENV defensively — some bundlers don't define `process` at\n // runtime (e.g., RN classic), so we guard via globalThis. The `details`\n // slot is dev-only; we explicitly enumerate non-production values so an\n // undefined NODE_ENV doesn't accidentally leak diagnostic strings.\n const proc = (globalThis as { process?: { env?: { NODE_ENV?: string } } })\n .process;\n const nodeEnv = proc?.env?.NODE_ENV;\n const isDev = nodeEnv === \"development\" || nodeEnv === \"test\";\n\n return (\n <View\n testID={testID ?? `empty-state-${variant}`}\n accessibilityRole=\"summary\"\n className={cn(\n \"items-center justify-center gap-3 px-8 py-12\",\n className\n )}\n >\n {illustration ? <View accessibilityElementsHidden>{illustration}</View> : null}\n {icon && !illustration ? (\n <View accessibilityElementsHidden>{icon}</View>\n ) : null}\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className={cn(\n \"text-center text-lg font-semibold\",\n variant === \"error\" ? \"text-destructive\" : \"text-foreground\"\n )}\n >\n {title ?? meta.title}\n </Text>\n {resolvedBody ? (\n <Text\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"max-w-sm text-center text-sm\", meta.tone)}\n >\n {resolvedBody}\n </Text>\n ) : null}\n {resolvedPrimary ? (\n <View\n testID={testID ? `${testID}-primary-action` : undefined}\n className=\"mt-2\"\n >\n {resolvedPrimary}\n </View>\n ) : null}\n {secondaryAction ? (\n <View\n testID={testID ? `${testID}-secondary-action` : undefined}\n className=\"mt-1\"\n >\n {secondaryAction}\n </View>\n ) : null}\n {details && isDev ? (\n <Text\n testID={testID ? `${testID}-details` : undefined}\n className=\"mt-2 max-w-sm text-center text-xs text-muted-foreground\"\n >\n {details}\n </Text>\n ) : null}\n </View>\n );\n}\n","/**\n * The semantic icon names Genesis components ask for, and the SF Symbol each\n * one draws on iOS. Components say \"settings\" or \"bell\", never a library's\n * own name; `lucideIcons` (`/icons/lucide`) maps the same names for Android,\n * web and the SF Symbol fallback.\n *\n * @stability Beta\n */\nexport const SF_SYMBOLS = {\n \"arrow-left\": \"arrow.left\",\n \"arrow-up\": \"arrow.up\",\n bell: \"bell\",\n calendar: \"calendar\",\n camera: \"camera\",\n \"camera-flip\": \"arrow.triangle.2.circlepath.camera\",\n check: \"checkmark\",\n \"chevron-down\": \"chevron.down\",\n \"chevron-left\": \"chevron.left\",\n \"chevron-right\": \"chevron.right\",\n \"chevron-up\": \"chevron.up\",\n clock: \"clock\",\n close: \"xmark\",\n compose: \"square.and.pencil\",\n copy: \"doc.on.doc\",\n download: \"square.and.arrow.down\",\n edit: \"pencil\",\n error: \"xmark.circle\",\n expand: \"arrow.up.left.and.arrow.down.right\",\n \"external-link\": \"arrow.up.right.square\",\n file: \"doc\",\n filter: \"line.3.horizontal.decrease\",\n heart: \"heart\",\n home: \"house\",\n image: \"photo\",\n info: \"info.circle\",\n lock: \"lock\",\n \"log-out\": \"rectangle.portrait.and.arrow.right\",\n mail: \"envelope\",\n menu: \"line.3.horizontal\",\n message: \"bubble.left\",\n mic: \"mic\",\n minus: \"minus\",\n more: \"ellipsis\",\n paperclip: \"paperclip\",\n pause: \"pause.fill\",\n pin: \"pin\",\n play: \"play.fill\",\n plus: \"plus\",\n refresh: \"arrow.clockwise\",\n reply: \"arrowshape.turn.up.left\",\n search: \"magnifyingglass\",\n settings: \"gearshape\",\n share: \"square.and.arrow.up\",\n smile: \"face.smiling\",\n star: \"star\",\n stop: \"stop.fill\",\n success: \"checkmark.circle\",\n trash: \"trash\",\n user: \"person\",\n video: \"video\",\n volume: \"speaker.wave.2.fill\",\n \"volume-off\": \"speaker.slash.fill\",\n warning: \"exclamationmark.triangle\",\n} as const;\n\n/** A semantic icon name: what the icon is for. */\nexport type NativeIconName = keyof typeof SF_SYMBOLS;\n\n/** Every semantic icon name. */\nexport const NATIVE_ICON_NAMES = Object.keys(SF_SYMBOLS) as NativeIconName[];\n","/**\n * NativeIcon — an icon by what it is for (\"settings\", \"bell\"), not by a\n * library's name. On iOS it draws the SF Symbol (expo-symbols' `SymbolView`,\n * passed as `modules.symbol`); on Android and web, and as the SF Symbol's\n * fallback, it draws the icon set given as `modules.icons` (`lucideIcons`\n * from `@marktiderman/genesis-ui-native/icons/lucide`). With neither, it\n * keeps the icon's space empty and warns once in development.\n *\n * Decorative by default (hidden from screen readers). Give `label` when the\n * icon carries meaning on its own, such as an icon-only button's content.\n *\n * @stability Beta\n */\nimport { Platform, View, type ColorValue } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { SF_SYMBOLS, type NativeIconName } from \"../icon-names\";\nimport { useGenesisModules } from \"../native-modules\";\n\nexport interface NativeIconProps {\n name: NativeIconName;\n /** Points. Default 20. */\n size?: number;\n /** Default the theme's label color. */\n color?: ColorValue;\n /** iOS SF Symbol weight. */\n weight?: \"ultraLight\" | \"thin\" | \"light\" | \"regular\" | \"medium\" | \"semibold\" | \"bold\" | \"heavy\" | \"black\";\n /** Read by screen readers. Without it the icon is decorative and hidden from them. */\n label?: string;\n testID?: string;\n}\n\ndeclare const __DEV__: boolean | undefined;\nconst warned = new Set<string>();\n\nfunction warnOnce(name: string) {\n if (typeof __DEV__ === \"undefined\" || !__DEV__ || warned.has(name)) return;\n warned.add(name);\n console.warn(\n `[genesis] NativeIcon \"${name}\" has nothing to draw with: pass modules.icons (lucideIcons from \"@marktiderman/genesis-ui-native/icons/lucide\") and, for SF Symbols on iOS, modules.symbol (SymbolView from \"expo-symbols\") to GenesisModulesProvider.`,\n );\n}\n\nexport function NativeIcon({ name, size = 20, color, weight, label, testID }: NativeIconProps) {\n const { symbol: SymbolView, icons } = useGenesisModules();\n const roles = useThemeRoles();\n const tint = color ?? roles.label;\n const a11y = label\n ? { accessible: true, accessibilityRole: \"image\" as const, accessibilityLabel: label }\n : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: \"no-hide-descendants\" as const };\n const Fallback = icons?.[name];\n const fallback = Fallback ? <Fallback size={size} color={tint} testID={testID ? `${testID}-fallback` : undefined} /> : null;\n\n if (Platform.OS === \"ios\" && SymbolView) {\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size }}>\n <SymbolView name={SF_SYMBOLS[name]} size={size} tintColor={tint} weight={weight} fallback={fallback} style={{ width: size, height: size }} />\n </View>\n );\n }\n if (!fallback) warnOnce(name);\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size, alignItems: \"center\", justifyContent: \"center\" }}>\n {fallback}\n </View>\n );\n}\n","/**\n * ListItem — recurring row in a list (settings, contacts, results).\n *\n * Slots: leading (avatar / icon), title, subtitle, trailing\n * (chevron / accessory / action). Supports pressable variants with\n * automatic divider rendering between adjacent items via a wrapper\n * pattern (see <NativeListItemDivider>).\n *\n * For platform-default chevrons, pass `showChevron`; the chevron uses\n * the muted-foreground token.\n *\n * @stability Beta\n */\nimport { Platform, Pressable, Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { NativeIcon } from \"./icon\";\n\nexport interface NativeListItemProps {\n title: string;\n subtitle?: string;\n /** Slot rendered to the left of the title (avatar / icon). */\n leading?: React.ReactNode;\n /** Slot rendered to the right of the title (badge / accessory). */\n trailing?: React.ReactNode;\n /** When true, renders a chevron-right at the end. */\n showChevron?: boolean;\n /** When provided, the row becomes pressable. */\n onPress?: () => void;\n disabled?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NativeListItem({\n title,\n subtitle,\n leading,\n trailing,\n showChevron,\n onPress,\n disabled,\n className,\n testID,\n}: NativeListItemProps) {\n const inner = (\n <>\n {leading ? <View className=\"mr-3\">{leading}</View> : null}\n <View className=\"flex-1\">\n <Text className=\"text-base text-foreground\" numberOfLines={1}>\n {title}\n </Text>\n {subtitle ? (\n <Text\n className=\"mt-0.5 text-xs text-muted-foreground\"\n numberOfLines={2}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n {trailing ? <View className=\"ml-3\">{trailing}</View> : null}\n {showChevron ? <Chevron /> : null}\n </>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"native-list-item\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n disabled && \"opacity-50\",\n className\n )}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View\n testID={testID ?? \"native-list-item\"}\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n className\n )}\n >\n {inner}\n </View>\n );\n}\n\n/**\n * The drill-in chevron: an SF Symbol on iOS or the app's icon set\n * (`modules.symbol` / `modules.icons`) when given, else a text \"›\".\n */\nfunction Chevron() {\n const { symbol, icons } = useGenesisModules();\n const roles = useThemeRoles();\n if ((Platform.OS === \"ios\" && symbol) || icons?.[\"chevron-right\"]) {\n return (\n <View className=\"ml-2\">\n <NativeIcon name=\"chevron-right\" size={14} weight=\"semibold\" color={roles.tertiaryLabel} testID=\"native-list-item-chevron\" />\n </View>\n );\n }\n return (\n <Text\n accessibilityElementsHidden\n className=\"ml-2 text-base text-muted-foreground\"\n >\n ›\n </Text>\n );\n}\n\nexport function NativeListItemDivider({ className }: { className?: string }) {\n return <View className={cn(\"h-px bg-border\", className)} />;\n}\n","/**\n * SectionList header pattern — opinionated header style for\n * react-native SectionList rows.\n *\n * The full SectionList API stays with React Native; Genesis ships the\n * header component so consumers can pass it as `renderSectionHeader`\n * and get a consistent visual: muted background, uppercase tracking,\n * sticky-friendly padding.\n *\n * Pattern:\n *\n * <SectionList\n * sections={...}\n * renderItem={({ item }) => <NativeListItem title={item.label} />}\n * renderSectionHeader={({ section }) => (\n * <NativeSectionListHeader title={section.title} />\n * )}\n * />\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeSectionListHeaderProps {\n title: string;\n /** Optional trailing content (e.g., a count badge). */\n trailing?: React.ReactNode;\n className?: string;\n testID?: string;\n}\n\nexport function NativeSectionListHeader({\n title,\n trailing,\n className,\n testID,\n}: NativeSectionListHeaderProps) {\n return (\n <View\n testID={testID ?? \"native-section-header\"}\n accessibilityRole=\"header\"\n className={cn(\n \"flex-row items-center justify-between border-b border-border bg-muted px-4 py-2\",\n className\n )}\n >\n <Text className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {title}\n </Text>\n {trailing}\n </View>\n );\n}\n","/**\n * RefreshControl wrapper — token-aware tint over RN's RefreshControl.\n *\n * Use as the `refreshControl` prop on ScrollView / FlatList / SectionList.\n * The tint defaults to the theme's `tint` role; consumers can override\n * per-call. We re-export RN's\n * RefreshControl shape so the API mirrors what consumers already know.\n *\n * @stability Beta\n */\nimport { RefreshControl } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\n\nexport interface NativeRefreshControlProps {\n refreshing: boolean;\n onRefresh: () => void;\n /** Hex / RGB color override. Falls back to the theme primary. */\n tintColor?: string;\n /** Title shown under the iOS spinner. */\n title?: string;\n /** Color of the iOS title text. */\n titleColor?: string;\n /** Android colors prop (an array of progress colors). */\n colors?: string[];\n /** Android progress background. */\n progressBackgroundColor?: string;\n testID?: string;\n}\n\n/**\n * Pull to refresh, tinted with the theme's `tint` role. Works under any Genesis root.\n */\n// The tint comes from `useThemeRoles`, not `useGenesisTheme` from `providers/native`: that is\n// another context, which the native app shell's `GenesisThemeProvider` never mounts, so it threw there.\nexport function NativeRefreshControl({ tintColor, colors, testID, ...rest }: NativeRefreshControlProps) {\n const tint = useThemeRoles().tint;\n const androidTint = typeof tint === \"string\" ? [tint] : undefined;\n return <RefreshControl {...rest} tintColor={tintColor ?? (tint as string)} colors={colors ?? androidTint} testID={testID ?? \"native-refresh-control\"} />;\n}\n","/**\n * Badge — compact status / count / category tag.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst badgeVariants = cva(\n \"flex-row items-center self-start rounded-full border px-2.5 py-0.5\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary\",\n secondary: \"border-transparent bg-secondary\",\n destructive: \"border-transparent bg-destructive\",\n outline: \"border-border bg-transparent\",\n success: \"border-transparent bg-success/15\",\n warning: \"border-transparent bg-warning/15\",\n info: \"border-transparent bg-info/15\",\n muted: \"border-transparent bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst badgeTextVariants = cva(\"text-xs font-medium\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n destructive: \"text-destructive-foreground\",\n outline: \"text-foreground\",\n // AA-safe status text on the /15 tint. The bare status token\n // (text-success ~2.2:1) fails WCAG AA. The `-dark` stop is optional in\n // the brand schema (only `status.*.DEFAULT` is required) AND regresses\n // dark mode — a dark shade on the dark-surface tint drops to ~1.7–2.6:1.\n // Instead use the semantic Tailwind ramp (always present, brand-\n // independent, same hues as the Genesis status tokens) with a `dark:`\n // stop. Measured: light /15 tint emerald-700 4.76 / amber-800 6.32 /\n // blue-700 5.64; dark-surface tint emerald-300 ≥8.2 / amber-200 ≥10.8 /\n // blue-300 ≥8.2 — AA in both modes across the static preset and the\n // themeFromBrand() runtime dark map.\n success: \"text-emerald-700 dark:text-emerald-300\",\n warning: \"text-amber-800 dark:text-amber-200\",\n info: \"text-blue-700 dark:text-blue-300\",\n muted: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\nexport interface NativeBadgeProps\n extends VariantProps<typeof badgeVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n accessibilityLabel?: string;\n testID?: string;\n}\n\nfunction NativeBadge({\n className,\n textClassName,\n variant,\n children,\n ...props\n}: NativeBadgeProps) {\n return (\n <View className={cn(badgeVariants({ variant }), className)} accessibilityRole=\"text\" {...props}>\n {typeof children === \"string\" ? (\n <Text\n className={cn(badgeTextVariants({ variant }), textClassName)}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </View>\n );\n}\n\nexport { NativeBadge, badgeVariants, badgeTextVariants };\n","/**\n * Input — single-line text field.\n *\n * @stability Stable\n */\nimport { Text, TextInput, type TextInputProps, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeInputProps extends TextInputProps {\n className?: string;\n inputClassName?: string;\n label?: string;\n error?: string;\n}\n\nfunction NativeInput({\n className,\n inputClassName,\n label,\n error,\n editable = true,\n placeholderTextColor,\n ...props\n}: NativeInputProps) {\n return (\n <View className={cn(\"gap-1.5\", className)}>\n {label ? (\n <Text className=\"text-sm font-medium text-foreground\">\n {label}\n </Text>\n ) : null}\n <TextInput\n className={cn(\n \"h-10 rounded-md border border-input bg-background px-3 text-base text-foreground\",\n !editable && \"opacity-50\",\n error && \"border-destructive\",\n inputClassName\n )}\n editable={editable}\n placeholderTextColor={placeholderTextColor ?? nativeColors.neutral[400]}\n accessibilityLabel={label}\n {...props}\n />\n {error ? (\n <Text className=\"text-sm text-destructive\">{error}</Text>\n ) : null}\n </View>\n );\n}\n\nexport { NativeInput };\n","/**\n * LoadingState — a centred spinner for a screen (or part of one) that is\n * waiting: a redirect while the session loads, the first fetch of a page.\n *\n * Use it instead of a hand-rolled `<View><ActivityIndicator /></View>`: the\n * spinner takes the theme tint, screen readers hear one \"Loading\" progress\n * bar (or your `label`), and the full-screen form sits inside the safe area\n * on the screen background. For content-shaped placeholders (a list about to\n * appear) use `NativeSkeleton`; for known progress use `NativeProgress`.\n *\n * if (!session) return <NativeLoadingState />; // whole screen\n * <NativeLoadingState fullScreen={false} label=\"Loading more\" size=\"small\" />\n *\n * `ScreenContainer loading` renders the inline form in place of its body.\n *\n * @stability Beta\n */\nimport { ActivityIndicator, View, type ColorValue } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeText } from \"./text\";\n\nexport type NativeLoadingStateEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface NativeLoadingStateProps {\n /** Text shown under the spinner. It is also what screen readers announce. */\n label?: string;\n /** What screen readers announce when no `label` is shown. Default `\"Loading\"`. */\n accessibilityLabel?: string;\n /** Spinner size. Default `\"large\"`. */\n size?: \"small\" | \"large\";\n /**\n * `true` (default): fill the screen on the theme background, inside the\n * safe area. `false`: a padded, centred block that fills its parent, for a\n * screen body, a section or a list footer.\n */\n fullScreen?: boolean;\n /** Safe-area edges when `fullScreen`. Default all four. */\n safeAreaEdges?: NativeLoadingStateEdge[];\n /** Spinner color. Defaults to the theme tint. */\n color?: ColorValue;\n className?: string;\n /** testID on the root; the spinner is `${testID}-spinner`, the label `${testID}-label`. Default `\"loading-state\"`. */\n testID?: string;\n}\n\nconst ALL_EDGES: NativeLoadingStateEdge[] = [\"top\", \"bottom\", \"left\", \"right\"];\n\nexport function NativeLoadingState({\n label,\n accessibilityLabel,\n size = \"large\",\n fullScreen = true,\n safeAreaEdges = ALL_EDGES,\n color,\n className,\n testID = \"loading-state\",\n}: NativeLoadingStateProps) {\n const roles = useThemeRoles();\n const spoken = label ?? accessibilityLabel ?? \"Loading\";\n\n const content = (\n <View\n testID={fullScreen ? `${testID}-content` : testID}\n className={cn(\"items-center justify-center gap-3 px-4 py-8\", !fullScreen && \"flex-grow\", !fullScreen && className)}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={spoken}\n accessibilityState={{ busy: true }}\n >\n <ActivityIndicator testID={`${testID}-spinner`} size={size} color={(color ?? roles.tint) as string} />\n {label ? (\n <NativeText testID={`${testID}-label`} preset=\"body-sm\" className=\"text-muted-foreground text-center\">\n {label}\n </NativeText>\n ) : null}\n </View>\n );\n\n if (!fullScreen) return content;\n\n return (\n <SafeAreaView\n testID={testID}\n edges={safeAreaEdges}\n className={cn(\"flex-1 items-center justify-center bg-background\", className)}\n >\n {content}\n </SafeAreaView>\n );\n}\n"]}
|
package/dist/chunk-7PCWEY6R.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { AccessibilityInfo } from 'react-native';
|
|
3
|
-
|
|
4
|
-
// src/hooks/use-reduced-motion.ts
|
|
5
|
-
var lastKnown = false;
|
|
6
|
-
function useReducedMotion() {
|
|
7
|
-
const [reduced, setReduced] = useState(lastKnown);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
let mounted = true;
|
|
10
|
-
const set = (v) => {
|
|
11
|
-
lastKnown = v;
|
|
12
|
-
if (mounted) setReduced(v);
|
|
13
|
-
};
|
|
14
|
-
AccessibilityInfo.isReduceMotionEnabled().then(set).catch(() => {
|
|
15
|
-
});
|
|
16
|
-
const sub = AccessibilityInfo.addEventListener("reduceMotionChanged", set);
|
|
17
|
-
return () => {
|
|
18
|
-
mounted = false;
|
|
19
|
-
sub?.remove?.();
|
|
20
|
-
};
|
|
21
|
-
}, []);
|
|
22
|
-
return reduced;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { useReducedMotion };
|
|
26
|
-
//# sourceMappingURL=chunk-7PCWEY6R.js.map
|
|
27
|
-
//# sourceMappingURL=chunk-7PCWEY6R.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-reduced-motion.ts"],"names":[],"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,IAAA,iBAAA,CAAkB,uBAAsB,CACrC,IAAA,CAAK,GAAG,CAAA,CAGR,MAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AACjB,IAAA,MAAM,GAAA,GAAM,iBAAA,CAAkB,gBAAA,CAAiB,qBAAA,EAAuB,GAAG,CAAA;AACzE,IAAA,OAAO,MAAM;AACX,MAAA,OAAA,GAAU,KAAA;AACV,MAAA,GAAA,EAAK,MAAA,IAAS;AAAA,IAChB,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,OAAA;AACT","file":"chunk-7PCWEY6R.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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layouts/settings-page.tsx","../src/layouts/keyboard.tsx","../src/layouts/settings-sub-page.tsx","../src/layouts/notifications-page.tsx","../src/layouts/thread-page.tsx","../src/layouts/auth.tsx","../src/layouts/auth-screen.tsx","../src/layouts/apple-sign-in.tsx","../src/layouts/google-sign-in.tsx"],"names":["Fragment","jsx","jsxs","View","Platform","useContext","useMemo","useCallback","renderSlot","DefaultSectionHeader","DefaultRow","DefaultEmpty","SafeAreaView","createElement","KeyboardAvoidingView","ScrollView","Pressable","Text","useState","useRef"],"mappings":";;;;;;;;;;AAiIO,SAAS,4BACd,KAAA,EACyB;AACzB,EAAA,OAAO,oBAAA,CAAqB;AAAA,IAC1B,WAAA,EAAa,MAAM,WAAA,IAAe,UAAA;AAAA,IAClC,KAAA,EAAO,MAAM,KAAA,IAAS,IAAA;AAAA,IACtB,kBAAA,EAAoB,MAAM,kBAAA,IAAsB,OAAA;AAAA,IAChD,YAAY,KAAA,CAAM,UAAA;AAAA,IAClB,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,eAAe,KAAA,CAAM;AAAA,GACtB,CAAA;AACH;AAEO,SAAS,YAAA,CAAa;AAAA,EAC3B,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA,GAAS,eAAA;AAAA,EACT,QAAA;AAAA,EACA,QAAQ,EAAC;AAAA,EACT,YAAY;AACd,CAAA,EAAsB;AAIpB,EAAA,MAAM,SAAS,aAAA,EAAc;AAC7B,EAAA,MAAM,KAAA,GAA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,SAAS,cAAA,CAAe,EAAE,OAAA,EAAS,KAAA,GAAQ,wBAAwB,IAAA,EAAM,QAAA,EAAU,OAAA,GAAU,IAAA,EAAK,EAAqD;AAC5J,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AACrB,EAAA,OAAO,EAAE,EAAA,EAAI,QAAA,EAAU,KAAA,EAAO,IAAA,EAAM,SAAS,QAAA,EAAS;AACxD","file":"chunk-ABVSSJNT.js","sourcesContent":["/**\n * SettingsPage — top-level settings layout.\n *\n * Composes `<ScreenContainer scroll>` underneath, renders a sectioned\n * `ListItem` list, and surfaces an optional dangerous-action footer\n * (e.g., \"Sign out\", \"Delete account\") in destructive tone.\n *\n * Why ship a layout: every consumer rebuilds this list with the same\n * three pieces (sections → rows → footer). Genesis ships the assembly so\n * consumers compose, not rebuild.\n *\n * Layer-3 customization: pass `headerTitle`, `headerLeft`, `headerRight`,\n * `large`, `scrollEdgeBehavior`, OR a direct `headerOptions={...}`\n * passthrough. The composed options are rendered via the consumer's own\n * `<Stack.Screen options={...}>` — see `getStackScreenOptions()` helper.\n *\n * Colors come from theme roles (`useThemeRoles`). On iOS it is the Settings\n * app's inset grouped style: the page is `systemGroupedBackground`, each\n * section a rounded group of cells on `secondarySystemGroupedBackground` with\n * hairline `separator` lines between cells, inset from the leading edge to\n * the cell text; the header is an uppercase footnote in `secondaryLabel`\n * above the group and the footnote sits under it in the same color. On\n * Android, cells are full width and the header is a Material subheader in the\n * theme's primary color. Neither platform draws a band or a rule behind a\n * header. Cell content itself is `NativeListItem`'s.\n *\n * Slots: replace or drop one part without leaving the layout. `slots`\n * swaps a part (`sectionHeader`, `row`, `footnote`, `dangerousActions`) for\n * your component, which receives exactly the props the default would;\n * `slotProps` feeds the default more props; `null` drops the part.\n *\n * Escape hatch: drop down to `<ScreenContainer>` if the layout structure\n * doesn't fit.\n *\n * @stability Beta\n */\nimport { Fragment, useState, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { Platform, StyleSheet, View } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeListItem } from \"../components/list-item\";\nimport { NativeText } from \"../components/text\";\nimport { NativeButton } from \"../components/button\";\nimport { cn } from \"../utils\";\nimport {\n ScreenContainer,\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\n\nexport interface SettingsPageRow {\n /** Stable id for keying. */\n id: string;\n title: string;\n subtitle?: string;\n /** Leading slot (icon, avatar, etc.). */\n leading?: ReactNode;\n /** Trailing slot (badge, switch, version string, etc.). */\n trailing?: ReactNode;\n /** When true, renders a chevron at the row end (drill-in affordance). */\n showChevron?: boolean;\n /** Press handler — required for chevron rows. */\n onPress?: () => void;\n /** Disable the row (greyed + non-pressable). */\n disabled?: boolean;\n /** testID override for the row. Falls back to `settings-row-<id>`. */\n testID?: string;\n}\n\nexport interface SettingsPageSection {\n /** Stable id for keying. */\n id: string;\n /** Optional uppercase section header. Pass `null` to skip the header for an unlabeled section. */\n title?: string;\n /** Optional caption rendered under the rows (compliance text, hint, etc.). */\n footnote?: string;\n /** Rows in render order. */\n rows: SettingsPageRow[];\n /**\n * Content rendered inside the section's group, after the rows: a part that\n * a pattern built on SettingsPage lets you replace (a block's slot), kept\n * under the same header, in the same group and above the same footnote.\n */\n children?: ReactNode;\n}\n\n/** A destructive-tone action in the footer, e.g. \"Sign out\". */\nexport interface SettingsPageDangerousAction {\n label: string;\n onPress: () => void;\n /** When true, renders with extra emphasis. Default `false`. */\n emphasized?: boolean;\n testID?: string;\n}\n\n/** The parts of a {@link SettingsPage} that `slots` and `slotProps` reach, with the props each receives. */\nexport type SettingsPageSlotMap = {\n sectionHeader: { title: string; testID: string };\n row: SettingsPageRow & { testID: string; isLast: boolean };\n footnote: { text: string };\n dangerousActions: { actions: SettingsPageDangerousAction[]; testID: string };\n};\n\nexport interface SettingsPageProps extends ScreenHeaderProps {\n /** Sectioned content. Order is preserved. */\n sections: SettingsPageSection[];\n /**\n * Optional dangerous-action row(s) shown after the last section in a\n * destructive-tone footer. Typical: \"Sign out\", \"Delete account\".\n */\n dangerousActions?: SettingsPageDangerousAction[];\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<SettingsPageSlotMap>;\n /** More props for a default part, merged over what the layout passes. */\n slotProps?: SlotPropsFor<SettingsPageSlotMap>;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"settings-page\"`. */\n testID?: string;\n /** Pass-through children rendered ABOVE the first section (e.g., a profile card). */\n children?: ReactNode;\n}\n\n/**\n * Convenience helper for callers that want to wire `<Stack.Screen options={...}>`\n * without re-importing composeHeaderOptions. Defaults `large: true` and\n * `scrollEdgeBehavior: \"match\"` to match the Apple HIG large-title settings\n * pattern out of the box.\n */\nexport function getSettingsPageStackOptions(\n props: ScreenHeaderProps & { headerTitle?: string },\n): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Settings\",\n large: props.large ?? true,\n scrollEdgeBehavior: props.scrollEdgeBehavior ?? \"match\",\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\nexport function SettingsPage({\n sections,\n dangerousActions,\n className,\n testID = \"settings-page\",\n children,\n slots = {},\n slotProps = {},\n}: SettingsPageProps) {\n // Note: header props (headerTitle, headerLeft, headerRight, etc.) are\n // accepted on the type for API ergonomics but consumed by\n // getSettingsPageStackOptions() at the consumer's <Stack.Screen> level.\n const colors = useThemeRoles();\n const inset = Platform.OS === \"ios\";\n\n return (\n <ScreenContainer\n scroll\n safeAreaEdges={[\"left\", \"right\", \"bottom\"]}\n testID={testID}\n contentClassName=\"pb-8\"\n className={className}\n style={{ backgroundColor: colors.groupedBackground }}\n >\n {children ? <View className=\"px-4 pt-2\">{children}</View> : null}\n\n {sections.map((section) => (\n <View\n key={section.id}\n testID={`${testID}-section-${section.id}`}\n className=\"mt-6\"\n >\n {section.title\n ? renderSlot(\n DefaultSectionHeader,\n slots.sectionHeader,\n { title: section.title, testID: `${testID}-section-${section.id}-header` },\n slotProps.sectionHeader,\n )\n : null}\n <View\n testID={`${testID}-section-${section.id}-group`}\n className={inset ? \"overflow-hidden\" : \"border-y\"}\n style={[\n { backgroundColor: colors.surface, borderColor: colors.separator },\n inset ? { marginHorizontal: IOS_GROUP_MARGIN, borderRadius: iosGroupRadius() } : null,\n ]}\n >\n {section.rows.map((row, rowIndex) => (\n <Fragment key={row.id}>\n {renderSlot(\n DefaultRow,\n slots.row,\n { ...row, testID: row.testID ?? `${testID}-row-${row.id}`, isLast: rowIndex === section.rows.length - 1 },\n slotProps.row,\n )}\n </Fragment>\n ))}\n {section.children}\n </View>\n {section.footnote\n ? renderSlot(DefaultFootnote, slots.footnote, { text: section.footnote }, slotProps.footnote)\n : null}\n </View>\n ))}\n\n {dangerousActions && dangerousActions.length > 0\n ? renderSlot(\n DefaultDangerousActions,\n slots.dangerousActions,\n {\n actions: dangerousActions.map((action) => ({ ...action, testID: action.testID ?? `${testID}-danger-${slug(action.label)}` })),\n testID: `${testID}-dangerous-actions`,\n },\n slotProps.dangerousActions,\n )\n : null}\n </ScreenContainer>\n );\n}\n\n/** UIKit's inset grouped margin on a phone, in points. */\nconst IOS_GROUP_MARGIN = 16;\n\n/** UIKit's inset grouped corner radius: 10pt through iOS 18, 26pt from iOS 26. */\nfunction iosGroupRadius(): number {\n return Number.parseFloat(String(Platform.Version)) >= 26 ? 26 : 10;\n}\n\n/** From iOS 26 a separator also stops short of the trailing edge. */\nfunction iosTrailingSeparatorInset(): boolean {\n return Platform.OS === \"ios\" && Number.parseFloat(String(Platform.Version)) >= 26;\n}\n\n/**\n * iOS: the Settings app's inset grouped header, an uppercase footnote in\n * `secondaryLabel` on the page background. It sits over the group (same\n * margin) and is padded like a cell (`px-4`), so it lines up with the cell\n * text. Android: a Material list subheader in the brand's primary color\n * (`text-primary`, which follows the app's theme). Neither draws a band or a\n * rule. iOS reads uppercased text as written in capitals, so the label is the\n * title as written, and VoiceOver doesn't spell short words out.\n */\nfunction DefaultSectionHeader({ title, testID }: SettingsPageSlotMap[\"sectionHeader\"]) {\n const colors = useThemeRoles();\n if (Platform.OS === \"ios\") {\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n accessibilityLabel={title}\n dynamicTypeRamp=\"footnote\"\n className=\"px-4 pb-1.5 pt-2\"\n style={{\n marginHorizontal: IOS_GROUP_MARGIN,\n color: colors.secondaryLabel,\n fontSize: 13,\n lineHeight: 18,\n textTransform: \"uppercase\",\n }}\n >\n {title}\n </NativeText>\n );\n }\n return (\n <NativeText\n testID={testID}\n accessibilityRole=\"header\"\n className=\"px-4 pb-2 pt-4 text-primary\"\n style={{ fontSize: 14, lineHeight: 20, fontWeight: \"500\" }}\n >\n {title}\n </NativeText>\n );\n}\n\nfunction DefaultRow({ isLast, id: _id, leading, ...row }: SettingsPageSlotMap[\"row\"]) {\n const colors = useThemeRoles();\n // A separator starts at the cell text: the same `px-4` (and `mr-3` past a\n // leading icon, measured once it lays out) as `NativeListItem`, so it lines\n // up whatever the NativeWind rem is. A row lays out start to end, so this\n // follows right-to-left layouts too.\n const [leadingWidth, setLeadingWidth] = useState(0);\n return (\n <>\n <NativeListItem\n testID={row.testID}\n // The cell wrapper carries the surface color from theme roles.\n className=\"bg-transparent\"\n title={row.title}\n subtitle={row.subtitle}\n leading={\n leading ? (\n <View onLayout={(event) => setLeadingWidth(event.nativeEvent.layout.width)}>{leading}</View>\n ) : undefined\n }\n trailing={row.trailing}\n showChevron={row.showChevron}\n onPress={row.onPress}\n disabled={row.disabled}\n />\n {isLast ? null : (\n <View\n testID={`${row.testID}-separator`}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n className=\"flex-row\"\n style={{ height: StyleSheet.hairlineWidth }}\n >\n <View className=\"w-4\" />\n {leading ? <View className=\"mr-3\" style={{ width: leadingWidth }} /> : null}\n <View testID={`${row.testID}-separator-line`} className=\"flex-1\" style={{ backgroundColor: colors.separator }} />\n {iosTrailingSeparatorInset() ? <View className=\"w-4\" /> : null}\n </View>\n )}\n </>\n );\n}\n\nfunction DefaultFootnote({ text }: SettingsPageSlotMap[\"footnote\"]) {\n const colors = useThemeRoles();\n if (Platform.OS === \"ios\") {\n return (\n <NativeText\n dynamicTypeRamp=\"footnote\"\n className=\"px-4 pt-1.5\"\n style={{ marginHorizontal: IOS_GROUP_MARGIN, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18 }}\n >\n {text}\n </NativeText>\n );\n }\n return (\n <NativeText preset=\"body-sm\" className=\"px-4 pt-2\" style={{ color: colors.secondaryLabel }}>\n {text}\n </NativeText>\n );\n}\n\nfunction DefaultDangerousActions({ actions, testID }: SettingsPageSlotMap[\"dangerousActions\"]) {\n return (\n <View testID={testID} className={cn(\"mt-8 gap-2 px-4\")}>\n {actions.map((action) => (\n <NativeButton\n key={action.label}\n testID={action.testID}\n variant={action.emphasized ? \"destructive\" : \"outline\"}\n onPress={action.onPress}\n >\n {action.label}\n </NativeButton>\n ))}\n </View>\n );\n}\n\nfunction slug(s: string): string {\n return s\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-|-$/g, \"\");\n}\n","/**\n * Keyboard-aware scrolling for form screens. Expo recommends\n * react-native-keyboard-controller's `KeyboardAwareScrollView` over\n * `KeyboardAvoidingView` for real apps; it is an optional peer here, so an app\n * that has it passes it once:\n *\n * import { KeyboardAwareScrollView, KeyboardProvider, KeyboardToolbar } from \"react-native-keyboard-controller\";\n * <KeyboardProvider>\n * <KeyboardScrollProvider component={KeyboardAwareScrollView} toolbar={KeyboardToolbar}>…</KeyboardScrollProvider>\n * </KeyboardProvider>\n *\n * `KeyboardAwareScrollView` does nothing without react-native-keyboard-controller's\n * `KeyboardProvider` above it, mounted once at the root. (The native app\n * shell does both, with `keyboardProvider` and `keyboardScroll`.) Without a\n * scroll view here, form screens fall back to `KeyboardAvoidingView`.\n *\n * `toolbar` (optional, `KeyboardToolbar`) adds the previous / next / done bar\n * above the keyboard on Genesis's multi-field form layouts (`AuthScreen`,\n * `SettingsSubPage`). It needs `component` too: the bar sits beside the\n * keyboard-aware scroll view. Without it, nothing changes.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\n/** The props Genesis passes to a keyboard-aware scroll view. */\nexport interface KeyboardScrollProps {\n children?: ReactNode;\n testID?: string;\n keyboardShouldPersistTaps?: \"always\" | \"never\" | \"handled\";\n contentContainerStyle?: ViewStyle;\n /** iOS: inset content under a translucent or large-title header, as `ScreenContainer` does. */\n contentInsetAdjustmentBehavior?: \"automatic\" | \"scrollableAxes\" | \"never\" | \"always\";\n /** Extra space between the focused input and the keyboard. */\n bottomOffset?: number;\n}\n\n/**\n * The props Genesis may pass to a keyboard toolbar, all optional and all\n * `KeyboardToolbar`'s own: a settings form passes none (previous / next /\n * done), a one-question form (forms-native's `FormFocus`) hides the arrows\n * and makes Done its Next or Send. To theme it, pass a wrapper defined at\n * module scope that renders it with your props and forwards these.\n */\nexport interface KeyboardToolbarProps {\n /** Show the previous / next arrows. `KeyboardToolbar`'s default is true. */\n showArrows?: boolean;\n /** The done button's label. */\n doneText?: ReactNode;\n /** Called when done is pressed. The keyboard closes too, unless the callback calls `event.preventDefault()`. */\n onDoneCallback?: (event: { preventDefault(): void }) => void;\n}\n\n/**\n * Height of react-native-keyboard-controller's `KeyboardToolbar`, kept clear\n * above the focused input. Mirrors `KEYBOARD_TOOLBAR_HEIGHT` in the library's\n * `src/components/KeyboardToolbar/constants.ts` (1.22): move them together.\n */\nexport const KEYBOARD_TOOLBAR_HEIGHT = 42;\n\ninterface KeyboardScrollValue {\n component: ComponentType<KeyboardScrollProps>;\n toolbar: ComponentType<KeyboardToolbarProps> | null;\n}\n\nconst KeyboardScrollContext = createContext<KeyboardScrollValue | null>(null);\n\nexport function KeyboardScrollProvider({\n component,\n toolbar,\n children,\n}: {\n component: ComponentType<KeyboardScrollProps>;\n /** `KeyboardToolbar` from react-native-keyboard-controller: previous / next / done above the keyboard. */\n toolbar?: ComponentType<KeyboardToolbarProps>;\n children: ReactNode;\n}) {\n const value = useMemo(() => ({ component, toolbar: toolbar ?? null }), [component, toolbar]);\n return createElement(KeyboardScrollContext.Provider, { value }, children);\n}\n\n/** The app's keyboard-aware scroll view, or null when none was provided. */\nexport function useKeyboardScroll(): ComponentType<KeyboardScrollProps> | null {\n return useContext(KeyboardScrollContext)?.component ?? null;\n}\n\n/** The app's keyboard toolbar, or null when none was provided (or no scroll view to go with it). */\nexport function useKeyboardToolbar(): ComponentType<KeyboardToolbarProps> | null {\n return useContext(KeyboardScrollContext)?.toolbar ?? null;\n}\n","/**\n * SettingsSubPage — drill-in detail layout.\n *\n * Composes a KeyboardAvoidingView + scroll + dirty-form leave warning +\n * optimistic-save pattern. The save action is surfaced in the nav bar via\n * a `<NavBarSaveButton>` rendered through `headerRight`.\n *\n * Why ship: the recurring shape is \"form fields + nav-bar Save + leave\n * guard\"; consumers re-implement this every time. Genesis ships the\n * shape so consumers focus on the form fields themselves.\n *\n * Layer-3 customization: pass `headerTitle`, `headerLeft`, OR a direct\n * `headerOptions={...}`. Use `getSettingsSubPageStackOptions()` to get a\n * `<Stack.Screen options={...}>` object (with the save button wired via\n * `headerRight`).\n *\n * @stability Beta\n */\nimport { useCallback, type ReactNode } from \"react\";\nimport { Alert, KeyboardAvoidingView, Platform, View } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { KEYBOARD_TOOLBAR_HEIGHT, useKeyboardScroll, useKeyboardToolbar } from \"./keyboard\";\nimport {\n ScreenContainer,\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\nimport { NavBarSaveButton } from \"./nav-bar\";\n\nexport interface SettingsSubPageProps extends ScreenHeaderProps {\n /** Form / detail body content. Pass any node tree. */\n children: ReactNode;\n /**\n * When true, the Save button is enabled and the back-confirm guard\n * fires when the user tries to leave. Mark `true` whenever the form\n * has unsaved changes.\n */\n dirty?: boolean;\n /** When true, the Save button shows a busy indicator and is non-pressable. */\n saving?: boolean;\n /** Save handler. Required to render a Save button in the nav bar. */\n onSave?: () => void | Promise<void>;\n /**\n * Confirm-leave hook. Implementations should integrate with the\n * navigator's `beforeRemove` listener (React Navigation) — Genesis\n * provides a default `Alert` confirm helper via `confirmDiscardChanges()`.\n * Pass null to opt OUT of the leave guard.\n */\n onConfirmLeave?: ((proceed: () => void) => void) | null;\n /** Save button label. Default `\"Save\"`. */\n saveLabel?: string;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"settings-sub-page\"`. */\n testID?: string;\n}\n\n/**\n * Default leave-guard helper. Pops a native Alert with Discard / Keep\n * Editing buttons; calls `proceed()` only if the user opts to discard.\n *\n * <SettingsSubPage onConfirmLeave={confirmDiscardChanges} ... />\n */\nexport function confirmDiscardChanges(proceed: () => void): void {\n Alert.alert(\n \"Discard changes?\",\n \"You have unsaved changes. Leave this screen and lose them?\",\n [\n { text: \"Keep editing\", style: \"cancel\" },\n {\n text: \"Discard\",\n style: \"destructive\",\n onPress: () => proceed(),\n },\n ],\n );\n}\n\n/**\n * Compose `<Stack.Screen options={...}>` for a SettingsSubPage. Wires\n * the nav-bar Save button via `headerRight` automatically when `onSave`\n * is passed.\n */\nexport function getSettingsSubPageStackOptions(props: {\n headerTitle?: string;\n dirty?: boolean;\n saving?: boolean;\n onSave?: () => void | Promise<void>;\n saveLabel?: string;\n large?: boolean;\n scrollEdgeBehavior?: ScreenHeaderProps[\"scrollEdgeBehavior\"];\n headerLeft?: ScreenHeaderProps[\"headerLeft\"];\n headerRight?: ScreenHeaderProps[\"headerRight\"];\n headerOptions?: ScreenHeaderProps[\"headerOptions\"];\n}): Record<string, unknown> {\n const {\n headerTitle,\n dirty,\n saving,\n onSave,\n saveLabel = \"Save\",\n large = false,\n scrollEdgeBehavior,\n headerLeft,\n headerRight,\n headerOptions,\n } = props;\n\n // Auto-wire headerRight with save button if not overridden.\n const resolvedHeaderRight =\n headerRight ??\n (onSave\n ? () => (\n <NavBarSaveButton\n label={saveLabel}\n onPress={() => {\n void onSave();\n }}\n disabled={!dirty}\n loading={saving}\n />\n )\n : undefined);\n\n return composeHeaderOptions({\n headerTitle,\n headerLeft,\n headerRight: resolvedHeaderRight,\n large,\n scrollEdgeBehavior,\n headerOptions,\n });\n}\n\nexport function SettingsSubPage({\n children,\n onConfirmLeave,\n className,\n testID = \"settings-sub-page\",\n}: SettingsSubPageProps) {\n // Note: dirty / saving / onSave / saveLabel / screen header props are\n // consumed by getSettingsSubPageStackOptions() at the consumer level —\n // SettingsSubPage itself is intentionally minimal so the same component\n // works for both pure form pages AND screens with Stack.Screen options\n // wired separately. We only render the body chrome here.\n //\n // The actual `beforeRemove` wire-up lives at the consumer's navigator\n // level — they call `useNavigation().addListener('beforeRemove', ...)`\n // and inside the callback they invoke `props.onConfirmLeave(proceed)`.\n // We expose `confirmDiscardChanges()` as the canonical helper so\n // consumers get the leave-guard semantics for free.\n const _onConfirmLeave = useCallback(\n (proceed: () => void) => {\n if (onConfirmLeave === null) {\n proceed();\n return;\n }\n const fn = onConfirmLeave ?? confirmDiscardChanges;\n fn(proceed);\n },\n [onConfirmLeave],\n );\n void _onConfirmLeave;\n\n const KeyboardScroll = useKeyboardScroll();\n const KeyboardToolbar = useKeyboardToolbar();\n if (KeyboardScroll) {\n // No bottom edge here: the toolbar sticks to the keyboard from the container's bottom, so a\n // bottom inset (the home indicator, or a tab bar's height) would float it that far above the\n // keyboard, and leave it showing above the tab bar with the keyboard closed. The scroll view's\n // automatic content inset keeps the last field clear of the bottom instead.\n return (\n <ScreenContainer safeAreaEdges={[\"left\", \"right\"]} testID={testID}>\n <KeyboardScroll\n testID={`${testID}-keyboard`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n bottomOffset={KeyboardToolbar ? 24 + KEYBOARD_TOOLBAR_HEIGHT : 24}\n >\n {/* Same padding and className as the fallback path, so `className` overrides it the same way. */}\n <View className={cn(\"p-4\", className)}>\n <View testID={`${testID}-form`} className=\"gap-4\">\n {children}\n </View>\n </View>\n </KeyboardScroll>\n {KeyboardToolbar ? <KeyboardToolbar /> : null}\n </ScreenContainer>\n );\n }\n return (\n <KeyboardAvoidingView\n testID={`${testID}-kav`}\n style={{ flex: 1 }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n >\n <ScreenContainer\n scroll\n safeAreaEdges={[\"left\", \"right\", \"bottom\"]}\n testID={testID}\n contentClassName={cn(\"p-4\", className)}\n keyboardShouldPersistTaps=\"handled\"\n >\n <View testID={`${testID}-form`} className=\"gap-4\">\n {children}\n </View>\n </ScreenContainer>\n </KeyboardAvoidingView>\n );\n}\n","/**\n * NotificationsPage — feed-style notifications list.\n *\n * Composes:\n * - SectionList grouped by relative date (Today / Yesterday / Earlier)\n * - Pull-to-refresh\n * - Empty state slot (auto-rendered when `items` is empty)\n * - Mark-all-read action surfaced via `headerRight` helper\n * - Per-row \"mark read\" action exposed via the consumer's row press\n * (swipe-to-mark-read is documented as Maestro / E2E only because it\n * requires gesture-handler — consumers wire it via their own row\n * wrapper; this layout exposes the unread state via row props).\n *\n * Slots: replace or drop (`null`) `sectionHeader`, `row` or `empty`\n * through `slots`; feed a default part through `slotProps`.\n *\n * Header customization: `headerTitle`, `headerLeft`, `headerRight`,\n * `headerOptions`. Use `getNotificationsPageStackOptions()` to wire a\n * \"Mark all read\" action via `headerRight` automatically.\n *\n * @stability Beta\n */\nimport { useCallback, useContext, useMemo, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport {\n Platform,\n Pressable,\n RefreshControl,\n ScrollView,\n SectionList,\n Text,\n View,\n} from \"react-native\";\nimport { SafeAreaInsetsContext, SafeAreaView } from \"react-native-safe-area-context\";\nimport { NativeSectionListHeader } from \"../components/section-list\";\nimport { NativeListItem } from \"../components/list-item\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { cn } from \"../utils\";\nimport { useGenesisModules } from \"../native-modules\";\nimport {\n composeHeaderOptions,\n type ScreenHeaderProps,\n} from \"./screen-container\";\n\nexport interface NotificationItem {\n /** Stable id. */\n id: string;\n /** Headline text. */\n title: string;\n /** Optional secondary line. */\n body?: string;\n /** ISO date string OR Date instance. Used for grouping. */\n timestamp: string | Date;\n /** Read flag. Unread rows render with emphasis (a leading dot). */\n unread?: boolean;\n /** Optional press handler — typically opens the related screen. */\n onPress?: () => void;\n /** Optional leading slot (avatar / icon). */\n leading?: ReactNode;\n /** testID override. Falls back to `notifications-row-<id>`. */\n testID?: string;\n}\n\n/** The parts of a {@link NotificationsPage} that `slots` and `slotProps` reach. */\nexport type NotificationsPageSlotMap = {\n sectionHeader: { title: string };\n row: NotificationItem & { testID: string };\n empty: { title: string; body: string; testID: string };\n};\n\nexport interface NotificationsPageProps extends ScreenHeaderProps {\n /** Notification items. Empty array → empty state. */\n items: NotificationItem[];\n /** When true, the SectionList shows the refresh spinner. */\n refreshing?: boolean;\n /** Pull-to-refresh handler. */\n onRefresh?: () => void | Promise<void>;\n /** Mark-all-read handler. When provided, exposes a header action. */\n onMarkAllRead?: () => void;\n /** Override the auto-rendered empty state. Prefer `slots.empty`. */\n emptyState?: ReactNode;\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<NotificationsPageSlotMap>;\n /** More props for a default part, merged over what the layout passes. */\n slotProps?: SlotPropsFor<NotificationsPageSlotMap>;\n /** Optional override of the empty-state title. */\n emptyTitle?: string;\n /** Optional override of the empty-state body copy. */\n emptyBody?: string;\n /**\n * Where a section header sticks, in points from the top of the list. Under a large-title header\n * (`getNotificationsPageStackOptions`' default) the list runs under the native header (iOS\n * insets its rows, and the title collapses as it scrolls), so a header stuck at 0 would sit\n * under the status bar. Default on iOS: under the collapsed navigation bar of an iPhone in\n * portrait (`defaultStickyHeaderOffset`); elsewhere 0. Pass 0 when the list starts below an\n * opaque header (a standard one before iOS 26), the safe area's top with no header, and your own\n * value on iPad (a 50 pt bar) or in landscape (32 pt).\n */\n stickyHeaderOffset?: number;\n /** Override root container styling. */\n className?: string;\n /** testID on the root container. Default `\"notifications-page\"`. */\n testID?: string;\n}\n\n/**\n * Compose `<Stack.Screen options={...}>` for a NotificationsPage. Wires\n * a \"Mark all read\" action via `headerRight` when `onMarkAllRead` is\n * passed.\n */\nexport function getNotificationsPageStackOptions(props: {\n headerTitle?: string;\n onMarkAllRead?: () => void;\n large?: boolean;\n scrollEdgeBehavior?: ScreenHeaderProps[\"scrollEdgeBehavior\"];\n headerLeft?: ScreenHeaderProps[\"headerLeft\"];\n headerRight?: ScreenHeaderProps[\"headerRight\"];\n headerOptions?: ScreenHeaderProps[\"headerOptions\"];\n}): Record<string, unknown> {\n const {\n headerTitle,\n onMarkAllRead,\n large,\n scrollEdgeBehavior,\n headerLeft,\n headerRight,\n headerOptions,\n } = props;\n\n const resolvedHeaderRight =\n headerRight ??\n (onMarkAllRead\n ? () => (\n <Pressable\n testID=\"notifications-mark-all-read\"\n accessibilityRole=\"button\"\n accessibilityLabel=\"Mark all read\"\n onPress={onMarkAllRead}\n hitSlop={8}\n className=\"min-h-[44px] justify-center px-3\"\n >\n <Text className=\"text-base text-primary\">Mark all read</Text>\n </Pressable>\n )\n : undefined);\n\n return composeHeaderOptions({\n headerTitle: headerTitle ?? \"Notifications\",\n headerLeft,\n headerRight: resolvedHeaderRight,\n large: large ?? true,\n scrollEdgeBehavior: scrollEdgeBehavior ?? \"match\",\n headerOptions,\n });\n}\n\n// Returns a stable section title for a timestamp. Computes against the\n// caller's local clock for consistency with the rest of the app.\nfunction bucketFor(ts: string | Date, now = new Date()): string {\n const d = typeof ts === \"string\" ? new Date(ts) : ts;\n const startOfDay = (date: Date) => {\n const x = new Date(date);\n x.setHours(0, 0, 0, 0);\n return x.getTime();\n };\n const today = startOfDay(now);\n const yesterday = today - 24 * 60 * 60 * 1000;\n const day = startOfDay(d);\n if (day === today) return \"Today\";\n if (day === yesterday) return \"Yesterday\";\n return \"Earlier\";\n}\n\ninterface Section {\n title: string;\n data: NotificationItem[];\n}\n\nfunction groupByDate(items: NotificationItem[], now = new Date()): Section[] {\n const map = new Map<string, NotificationItem[]>();\n // Iterate in input order so stable sort within bucket.\n for (const item of items) {\n const bucket = bucketFor(item.timestamp, now);\n const arr = map.get(bucket) ?? [];\n arr.push(item);\n map.set(bucket, arr);\n }\n // Stable section order: Today / Yesterday / Earlier.\n const order = [\"Today\", \"Yesterday\", \"Earlier\"];\n return order\n .filter((title) => map.has(title))\n .map((title) => ({\n title,\n data: map.get(title) ?? [],\n }));\n}\n\ntype FlatRow = { kind: \"header\"; title: string } | { kind: \"item\"; item: NotificationItem; last: boolean };\n\nfunction flattenSections(sections: Section[]): { rows: FlatRow[]; headerIndices: number[] } {\n const rows: FlatRow[] = [];\n const headerIndices: number[] = [];\n for (const section of sections) {\n headerIndices.push(rows.length);\n rows.push({ kind: \"header\", title: section.title });\n section.data.forEach((item, i) => rows.push({ kind: \"item\", item, last: i === section.data.length - 1 }));\n }\n return { rows, headerIndices };\n}\n\nfunction flatRowKey(row: FlatRow) {\n return row.kind === \"header\" ? `header:${row.title}` : row.item.id;\n}\n\n/** A row with its separator and the section's last row differ in height: separate recycling pools. */\nfunction flatRowType(row: FlatRow) {\n return row.kind === \"header\" ? \"header\" : row.last ? \"item-last\" : \"item\";\n}\n\nconst NO_SLOTS = {};\n\n/**\n * The height of iOS's compact navigation bar, below the status bar: 44 pt up to iOS 18, 54 pt\n * from iOS 26 (measured on an iOS 26 simulator, the collapsed large-title bar of a native stack).\n */\nexport function iosCompactNavigationBarHeight(version: number | string): number {\n const major = typeof version === \"number\" ? version : parseInt(version, 10);\n return Number.isFinite(major) && major >= 26 ? 54 : 44;\n}\n\n/**\n * Where a list's section headers stick by default: on iOS, the bottom of the collapsed\n * navigation bar (the safe area's top plus the compact bar), since the list runs under the\n * header; elsewhere 0 (the header sits above the list).\n */\nexport function defaultStickyHeaderOffset(os: string, version: number | string, safeAreaTop: number): number {\n return os === \"ios\" ? safeAreaTop + iosCompactNavigationBarHeight(version) : 0;\n}\n\n// Expose internal helpers for unit tests via a side-channel export.\nexport const __test = { bucketFor, groupByDate, flattenSections };\n\nexport function NotificationsPage({\n items,\n refreshing,\n onRefresh,\n emptyState,\n emptyTitle,\n emptyBody,\n className,\n testID = \"notifications-page\",\n slots = NO_SLOTS,\n slotProps = NO_SLOTS,\n stickyHeaderOffset,\n}: NotificationsPageProps) {\n // The context, not useSafeAreaInsets(): before a provider has measured (tests, the first frame) it is null, not a throw.\n const safeTop = useContext(SafeAreaInsetsContext)?.top ?? 0;\n const stickAt = stickyHeaderOffset ?? defaultStickyHeaderOffset(Platform.OS, Platform.Version, safeTop);\n // Note: header props (headerTitle, headerLeft, headerRight, large,\n // scrollEdgeBehavior, headerOptions) are accepted on the type for API\n // ergonomics but consumed by getNotificationsPageStackOptions() at the\n // consumer's <Stack.Screen> level — not by this component.\n\n const sections = useMemo(() => groupByDate(items), [items]);\n // FlashList v2 (`modules.list`) has no SectionList: the sections become one\n // flat list whose header rows stick (FlashList's own section-list recipe).\n const { list: FlashList } = useGenesisModules();\n const flat = useMemo(() => flattenSections(sections), [sections]);\n // Stable, so a parent re-render doesn't re-render every visible cell.\n const renderFlatRow = useCallback(\n ({ item: row }: { item: FlatRow }) =>\n row.kind === \"header\" ? (\n renderSlot(DefaultSectionHeader, slots.sectionHeader, { title: row.title }, slotProps.sectionHeader)\n ) : (\n <>\n {renderSlot(DefaultRow, slots.row, { ...row.item, testID: row.item.testID ?? `${testID}-row-${row.item.id}` }, slotProps.row)}\n {row.last ? null : <RowSeparator />}\n </>\n ),\n [slots, slotProps, testID],\n );\n\n if (items.length === 0) {\n // A scroll view, like the lists below: iOS insets only scroll views for the large-title\n // header and the tab bar, so a plain view would sit under the header (and the Dynamic Island).\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <ScrollView\n testID={`${testID}-empty-scroll`}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ flexGrow: 1, justifyContent: \"center\" }}\n refreshControl={\n onRefresh ? (\n <RefreshControl testID={`${testID}-refresh`} refreshing={!!refreshing} onRefresh={onRefresh} />\n ) : undefined\n }\n >\n {emptyState ??\n renderSlot(\n DefaultEmpty,\n slots.empty,\n {\n title: emptyTitle ?? \"No notifications\",\n body: emptyBody ?? \"When you get a notification, it'll show up here.\",\n testID: `${testID}-empty`,\n },\n slotProps.empty,\n )}\n </ScrollView>\n </SafeAreaView>\n );\n }\n\n if (FlashList) {\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <FlashList\n testID={`${testID}-list`}\n data={flat.rows}\n keyExtractor={flatRowKey}\n getItemType={flatRowType}\n stickyHeaderIndices={flat.headerIndices}\n // Under the native header, not under the status bar.\n stickyHeaderConfig={{ offset: stickAt }}\n renderItem={renderFlatRow}\n refreshing={onRefresh ? !!refreshing : undefined}\n onRefresh={onRefresh ? () => void onRefresh() : undefined}\n contentContainerStyle={{ paddingBottom: 28 }}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView\n testID={testID}\n edges={[\"left\", \"right\", \"bottom\"]}\n className={cn(\"flex-1 bg-background\", className)}\n >\n <SectionList<NotificationItem, Section>\n testID={`${testID}-list`}\n sections={sections}\n keyExtractor={(item) => item.id}\n renderSectionHeader={({ section }) =>\n renderSlot(DefaultSectionHeader, slots.sectionHeader, { title: section.title }, slotProps.sectionHeader)\n }\n renderItem={({ item }) =>\n renderSlot(DefaultRow, slots.row, { ...item, testID: item.testID ?? `${testID}-row-${item.id}` }, slotProps.row)\n }\n ItemSeparatorComponent={RowSeparator}\n // React Native's sticky headers pin to the very top of the list, which is under the native\n // header on iOS, with no offset to move them down: with one, the headers scroll with\n // their rows instead. (FlashList, `modules.list`, sticks them under the header.)\n stickySectionHeadersEnabled={stickAt === 0}\n refreshControl={\n onRefresh ? (\n <RefreshControl\n testID={`${testID}-refresh`}\n refreshing={!!refreshing}\n onRefresh={onRefresh}\n />\n ) : undefined\n }\n contentContainerClassName=\"pb-8\"\n />\n </SafeAreaView>\n );\n}\n\nfunction RowSeparator() {\n return <View className=\"h-px bg-border ml-4\" />;\n}\n\nfunction DefaultSectionHeader({ title }: NotificationsPageSlotMap[\"sectionHeader\"]) {\n return <NativeSectionListHeader title={title} />;\n}\n\nfunction DefaultRow(item: NotificationsPageSlotMap[\"row\"]) {\n return (\n <NativeListItem\n testID={item.testID}\n title={item.title}\n subtitle={item.body}\n leading={item.leading ?? <UnreadDot unread={!!item.unread} testID={`${item.testID}-unread`} />}\n onPress={item.onPress}\n />\n );\n}\n\nfunction DefaultEmpty({ title, body, testID }: NotificationsPageSlotMap[\"empty\"]) {\n return <NativeEmptyState variant=\"first-run\" title={title} body={body} testID={testID} />;\n}\n\nfunction UnreadDot({\n unread,\n testID,\n}: {\n unread: boolean;\n testID?: string;\n}) {\n if (!unread) {\n return <View className=\"h-2 w-2\" testID={testID} />;\n }\n return (\n <View\n testID={testID}\n accessibilityLabel=\"Unread\"\n className=\"h-2 w-2 rounded-full bg-primary\"\n />\n );\n}\n","/**\n * ThreadPage — one conversation: messages oldest first, a composer at the\n * bottom that stays above the keyboard, attachments, a read receipt, and\n * \"load earlier\" paging.\n *\n * Generic: a support ticket with staff replies, a direct message, a comment\n * thread. Mine are on the trailing side in the tint, theirs on the leading\n * side on `surface`, over the `groupedBackground` page (SettingsPage's iOS\n * palette).\n *\n * Keyboard: with `KeyboardScrollProvider` (the native app shell's\n * `keyboardScroll`, react-native-keyboard-controller's\n * `KeyboardAwareScrollView`), the messages and the composer scroll together\n * and the composer is kept above the keyboard. Without it, a\n * `KeyboardAvoidingView` does the same on iOS. Either way the thread stays\n * scrolled to the newest message as it grows.\n *\n * Read-only: pass `composer={null}` (a closed ticket, a viewer) and an\n * optional `closedNotice`.\n *\n * Slots: `message`, `attachment`, `readReceipt`, `composer`,\n * `composerAccessory` (beside the input: attach a screenshot), `header`\n * (above the messages: what the thread is about), `earlier` and `empty`.\n *\n * @stability Beta\n */\nimport { createElement, useEffect, useRef, type ReactNode } from \"react\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { ActivityIndicator, Image, KeyboardAvoidingView, Platform, Pressable, ScrollView, TextInput, View } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeEmptyState } from \"../components/empty-state\";\nimport { NativeText } from \"../components/text\";\nimport { composeHeaderOptions, type ScreenHeaderProps } from \"./screen-container\";\nimport { useKeyboardScroll } from \"./keyboard\";\n\nexport interface ThreadAttachment {\n id: string;\n /** An image URI (a signed URL, a file:// path). */\n uri: string;\n width?: number;\n height?: number;\n accessibilityLabel?: string;\n onPress?: () => void;\n}\n\nexport interface ThreadMessage {\n id: string;\n body: string;\n /** Sent by the person using the app: trailing side, tint. */\n mine: boolean;\n /** Shown over theirs (\"Support\"); never over mine. */\n authorName?: string;\n timestamp: string | Date;\n /** An optimistic message: `sending`, then `sent`, or `failed` with `onRetry`. */\n status?: \"sending\" | \"sent\" | \"failed\";\n onRetry?: () => void;\n attachments?: ThreadAttachment[];\n}\n\nexport interface ThreadComposer {\n value: string;\n onChangeText: (text: string) => void;\n onSend: () => void;\n /** A send is in flight: the button spins and won't send twice. */\n sending?: boolean;\n placeholder?: string;\n sendLabel?: string;\n /** Turns the send button off (besides an empty or blank value). */\n disabled?: boolean;\n maxLength?: number;\n}\n\n/** What the default parts say. */\nexport interface ThreadLabels {\n /** Who \"mine\" is, to VoiceOver. */\n you: string;\n sending: string;\n notSent: string;\n retryHint: string;\n}\n\nconst DEFAULT_LABELS: ThreadLabels = { you: \"You\", sending: \"Sending\", notSent: \"Not sent. Tap to retry.\", retryHint: \"Double tap to send again\" };\n\nexport type ThreadPageSlotMap = {\n message: ThreadMessage & { testID: string; timeLabel: string; showReadReceipt: boolean; labels: ThreadLabels };\n attachment: ThreadAttachment & { testID: string; mine: boolean };\n readReceipt: { label: string; testID: string };\n /** `accessory` is the `composerAccessory` slot, already rendered. */\n composer: ThreadComposer & { testID: string; accessory?: ReactNode };\n composerAccessory: { testID: string };\n header: { testID: string };\n earlier: { loading: boolean; onPress: () => void; label: string; testID: string };\n empty: { title: string; body: string; testID: string };\n};\n\nexport interface ThreadPageProps extends ScreenHeaderProps {\n /** Oldest first. */\n messages: ThreadMessage[];\n /** `null`: read-only, no composer. */\n composer: ThreadComposer | null;\n /** Shown instead of the composer when it is `null` (\"This conversation is closed\"). */\n closedNotice?: string;\n /** Above the messages (what the thread is about). Prefer `slots.header` for a component. */\n header?: ReactNode;\n /**\n * When the other side last read the thread. My newest message sent before\n * it shows the read receipt.\n */\n readAt?: string | Date | null;\n readLabel?: string;\n /** There are older messages: shows a \"load earlier\" button at the top. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\n emptyTitle?: string;\n emptyBody?: string;\n formatTime?: (date: Date) => string;\n /** The words the defaults say, for translating. */\n labels?: Partial<ThreadLabels>;\n slots?: Slots<ThreadPageSlotMap>;\n slotProps?: SlotPropsFor<ThreadPageSlotMap>;\n /** testID on the root. Default `\"thread-page\"`. */\n testID?: string;\n}\n\n/** `<Stack.Screen options>` for a ThreadPage: a standard (not large) title, like Messages. */\nexport function getThreadPageStackOptions(props: ScreenHeaderProps & { headerTitle?: string }): Record<string, unknown> {\n return composeHeaderOptions({\n headerTitle: props.headerTitle ?? \"Conversation\",\n large: props.large ?? false,\n scrollEdgeBehavior: props.scrollEdgeBehavior,\n headerLeft: props.headerLeft,\n headerRight: props.headerRight,\n headerOptions: props.headerOptions,\n });\n}\n\nconst toDate = (value: string | Date) => (typeof value === \"string\" ? new Date(value) : value);\n\nfunction defaultTime(date: Date): string {\n return date.toLocaleString(undefined, { month: \"short\", day: \"numeric\", hour: \"numeric\", minute: \"2-digit\" });\n}\n\n/** The newest of my messages the other side has read, or null. */\nexport function readReceiptFor(messages: readonly ThreadMessage[], readAt: string | Date | null | undefined): string | null {\n if (!readAt) return null;\n const read = toDate(readAt).getTime();\n for (let i = messages.length - 1; i >= 0; i--) {\n const m = messages[i]!;\n if (m.mine && m.status !== \"sending\" && m.status !== \"failed\" && toDate(m.timestamp).getTime() <= read) return m.id;\n }\n return null;\n}\n\ninterface ScrollLike {\n scrollToEnd?: (options?: { animated?: boolean }) => void;\n}\n\nexport function ThreadPage({\n messages,\n composer,\n closedNotice,\n header,\n readAt,\n readLabel = \"Read\",\n hasEarlier = false,\n onLoadEarlier,\n loadingEarlier = false,\n earlierLabel = \"Load earlier messages\",\n emptyTitle,\n emptyBody,\n formatTime = defaultTime,\n labels: labelOverrides,\n slots = {},\n slotProps = {},\n testID = \"thread-page\",\n}: ThreadPageProps) {\n const colors = useThemeRoles();\n const KeyboardScroll = useKeyboardScroll();\n const scrollRef = useRef<ScrollLike | null>(null);\n const receiptFor = readReceiptFor(messages, readAt);\n const labels: ThreadLabels = { ...DEFAULT_LABELS, ...labelOverrides };\n const newest = messages[messages.length - 1]?.id;\n\n // Keep the newest message in view when one arrives (or is sent).\n useEffect(() => {\n scrollRef.current?.scrollToEnd?.({ animated: true });\n }, [newest]);\n\n const body = (\n <View style={{ flexGrow: 1 }}>\n {header ?? renderSlot(Nothing, slots.header, { testID: `${testID}-header` }, slotProps.header)}\n {hasEarlier && onLoadEarlier\n ? renderSlot(\n DefaultEarlier,\n slots.earlier,\n { loading: loadingEarlier, onPress: onLoadEarlier, label: earlierLabel, testID: `${testID}-earlier` },\n slotProps.earlier,\n )\n : null}\n <View testID={`${testID}-messages`} accessibilityRole=\"list\" style={{ flexGrow: 1, justifyContent: \"flex-end\", paddingHorizontal: 12, paddingVertical: 8, gap: 6 }}>\n {messages.length === 0\n ? renderSlot(\n DefaultEmpty,\n slots.empty,\n { title: emptyTitle ?? \"No messages yet\", body: emptyBody ?? \"Write the first one below.\", testID: `${testID}-empty` },\n slotProps.empty,\n )\n : messages.map((message) => (\n <View key={message.id}>\n {renderSlot(\n DefaultMessage,\n slots.message,\n {\n ...message,\n testID: `${testID}-message-${message.id}`,\n timeLabel: formatTime(toDate(message.timestamp)),\n showReadReceipt: message.id === receiptFor,\n labels,\n },\n slotProps.message,\n )}\n {message.attachments?.length ? (\n <View style={{ flexDirection: \"row\", flexWrap: \"wrap\", gap: 6, justifyContent: message.mine ? \"flex-end\" : \"flex-start\", marginTop: 4 }}>\n {message.attachments.map((attachment) => (\n <View key={attachment.id}>\n {renderSlot(\n DefaultAttachment,\n slots.attachment,\n { ...attachment, mine: message.mine, testID: `${testID}-attachment-${attachment.id}` },\n slotProps.attachment,\n )}\n </View>\n ))}\n </View>\n ) : null}\n {message.id === receiptFor\n ? renderSlot(DefaultReadReceipt, slots.readReceipt, { label: readLabel, testID: `${testID}-read-receipt` }, slotProps.readReceipt)\n : null}\n </View>\n ))}\n </View>\n </View>\n );\n\n const footer = composer ? (\n renderSlot(\n DefaultComposer,\n slots.composer,\n {\n ...composer,\n testID: `${testID}-composer`,\n accessory: renderSlot(Nothing, slots.composerAccessory, { testID: `${testID}-composer-accessory` }, slotProps.composerAccessory),\n },\n slotProps.composer,\n )\n ) : closedNotice ? (\n <NativeText testID={`${testID}-closed`} style={{ textAlign: \"center\", padding: 16, color: colors.secondaryLabel, fontSize: 13, lineHeight: 18 }}>\n {closedNotice}\n </NativeText>\n ) : null;\n\n const page = { flex: 1, backgroundColor: colors.groupedBackground };\n const onContentSizeChange = () => scrollRef.current?.scrollToEnd?.({ animated: false });\n\n if (KeyboardScroll) {\n // The composer scrolls with the messages, so the keyboard-aware view keeps it (the focused input) above the keyboard.\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={page}>\n {createElement(\n KeyboardScroll as never,\n {\n ref: scrollRef,\n testID: `${testID}-keyboard`,\n keyboardShouldPersistTaps: \"handled\",\n contentInsetAdjustmentBehavior: \"automatic\",\n contentContainerStyle: { flexGrow: 1 },\n bottomOffset: 8,\n onContentSizeChange,\n } as never,\n body,\n footer,\n )}\n </SafeAreaView>\n );\n }\n return (\n <SafeAreaView testID={testID} edges={[\"left\", \"right\", \"bottom\"]} style={page}>\n <KeyboardAvoidingView testID={`${testID}-kav`} style={{ flex: 1 }} behavior={Platform.OS === \"ios\" ? \"padding\" : undefined} keyboardVerticalOffset={Platform.OS === \"ios\" ? 100 : 0}>\n <ScrollView\n ref={scrollRef as never}\n testID={`${testID}-scroll`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ flexGrow: 1 }}\n onContentSizeChange={onContentSizeChange}\n >\n {body}\n </ScrollView>\n {footer}\n </KeyboardAvoidingView>\n </SafeAreaView>\n );\n}\n\nfunction Nothing(_props: { testID: string }) {\n return null;\n}\n\nfunction DefaultEarlier({ loading, onPress, label, testID }: ThreadPageSlotMap[\"earlier\"]) {\n return (\n <View style={{ alignItems: \"center\", paddingTop: 8 }}>\n <NativeButton variant=\"ghost\" size=\"sm\" onPress={onPress} loading={loading} testID={testID}>\n {label}\n </NativeButton>\n </View>\n );\n}\n\nfunction DefaultEmpty({ title, body, testID }: ThreadPageSlotMap[\"empty\"]) {\n return <NativeEmptyState variant=\"first-run\" title={title} body={body} testID={testID} />;\n}\n\n// No `color` key on mine: an undefined color in the style would override the class's.\nconst MINE_TEXT = { fontSize: 17, lineHeight: 22 } as const;\n\nfunction DefaultMessage(message: ThreadPageSlotMap[\"message\"]) {\n const colors = useThemeRoles();\n const failed = message.status === \"failed\";\n const { labels } = message;\n const label = [message.mine ? labels.you : (message.authorName ?? \"\"), message.body, message.timeLabel, failed ? labels.notSent : message.status === \"sending\" ? labels.sending : null]\n .filter(Boolean)\n .join(\", \");\n return (\n <View style={{ alignItems: message.mine ? \"flex-end\" : \"flex-start\" }}>\n {!message.mine && message.authorName ? (\n <NativeText style={{ marginLeft: 12, marginBottom: 2, color: colors.secondaryLabel, fontSize: 12, lineHeight: 16 }}>{message.authorName}</NativeText>\n ) : null}\n <Pressable\n testID={message.testID}\n accessible\n accessibilityLabel={label}\n accessibilityHint={failed && message.onRetry ? labels.retryHint : undefined}\n onPress={failed ? message.onRetry : undefined}\n style={{\n maxWidth: \"80%\",\n paddingHorizontal: 14,\n paddingVertical: 8,\n borderRadius: 18,\n backgroundColor: message.mine ? colors.tint : colors.surface,\n opacity: message.status === \"sending\" ? 0.6 : 1,\n }}\n >\n <NativeText className={message.mine ? \"text-primary-foreground\" : undefined} style={message.mine ? MINE_TEXT : { ...MINE_TEXT, color: colors.label }}>\n {message.body}\n </NativeText>\n </Pressable>\n <NativeText\n testID={`${message.testID}-time`}\n style={{ marginTop: 2, marginHorizontal: 12, color: failed ? colors.destructive : colors.tertiaryLabel, fontSize: 11, lineHeight: 14 }}\n >\n {failed ? labels.notSent : message.timeLabel}\n </NativeText>\n </View>\n );\n}\n\nfunction DefaultAttachment({ uri, width, height, accessibilityLabel, onPress, testID }: ThreadPageSlotMap[\"attachment\"]) {\n const ratio = width && height ? width / height : 0.6;\n const w = 140;\n return (\n <Pressable testID={testID} accessibilityRole=\"image\" accessibilityLabel={accessibilityLabel ?? \"Attachment\"} onPress={onPress} disabled={!onPress}>\n <Image source={{ uri }} style={{ width: w, height: Math.round(w / ratio), borderRadius: 12 }} resizeMode=\"cover\" />\n </Pressable>\n );\n}\n\nfunction DefaultReadReceipt({ label, testID }: ThreadPageSlotMap[\"readReceipt\"]) {\n const colors = useThemeRoles();\n return (\n <NativeText testID={testID} style={{ alignSelf: \"flex-end\", marginHorizontal: 12, color: colors.secondaryLabel, fontSize: 11, lineHeight: 14 }}>\n {label}\n </NativeText>\n );\n}\n\nfunction DefaultComposer({\n value,\n onChangeText,\n onSend,\n sending = false,\n placeholder = \"Message\",\n sendLabel = \"Send\",\n disabled = false,\n maxLength,\n testID,\n accessory,\n}: ThreadPageSlotMap[\"composer\"]) {\n const colors = useThemeRoles();\n const blank = !value.trim();\n return (\n <View\n testID={testID}\n style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 8, paddingHorizontal: 12, paddingTop: 8, paddingBottom: 8, backgroundColor: colors.groupedBackground }}\n >\n {accessory}\n <TextInput\n testID={`${testID}-input`}\n value={value}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={placeholder}\n multiline\n maxLength={maxLength}\n editable={!sending}\n style={{\n flex: 1,\n minHeight: 36,\n maxHeight: 120,\n paddingHorizontal: 14,\n paddingTop: 8,\n paddingBottom: 8,\n borderRadius: 18,\n fontSize: 17,\n color: colors.label as string,\n backgroundColor: colors.surface,\n }}\n />\n {sending ? (\n <View style={{ height: 36, justifyContent: \"center\", paddingHorizontal: 8 }}>\n <ActivityIndicator testID={`${testID}-sending`} accessibilityLabel=\"Sending\" />\n </View>\n ) : (\n <NativeButton size=\"sm\" onPress={onSend} disabled={disabled || blank} testID={`${testID}-send`}>\n {sendLabel}\n </NativeButton>\n )}\n </View>\n );\n}\n","/**\n * Auth primitive group (PRD-07 simplification #3).\n *\n * Auth flows are the most consumer-divergent screen in any app. Instead\n * of shipping a god-component with a sea of variants, Genesis ships\n * three small primitives that consumers compose on a regular `<View>`:\n *\n * - <AuthBranding> — slot for branded logo + headline + subhead\n * - <SocialAuthRow> — provider buttons (Apple / Google / GitHub / …)\n * - <AuthForm> — email + password (or magic link) + submit\n *\n * Composition lives in `apps/<consumer>/...` — see\n * `standards/usage-doctrine.md` § Auth composition for worked examples.\n *\n * @stability Beta\n */\nimport { Fragment, useCallback, useRef, useState, type ReactNode } from \"react\";\nimport { Pressable, Text, View } from \"react-native\";\nimport { NativeButton } from \"../components/button\";\nimport { NativeInput } from \"../components/input\";\nimport { NativeText } from \"../components/text\";\nimport { cn } from \"../utils\";\n\n// ---------------------------------------------------------------------------\n// AuthBranding — branding slot above the form\n// ---------------------------------------------------------------------------\n\nexport interface AuthBrandingProps {\n /** Brand mark (logo node). */\n logo?: ReactNode;\n /** Headline text. Renders as h1. */\n headline?: string;\n /** Subhead under the headline. Renders as muted body. */\n subhead?: string;\n /** Override the root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function AuthBranding({\n logo,\n headline,\n subhead,\n className,\n testID = \"auth-branding\",\n}: AuthBrandingProps) {\n return (\n <View\n testID={testID}\n accessibilityRole=\"header\"\n className={cn(\"items-center gap-3 pb-8\", className)}\n >\n {logo ? (\n <View testID={`${testID}-logo`} className=\"mb-2\">\n {logo}\n </View>\n ) : null}\n {headline ? (\n <NativeText\n preset=\"h1\"\n testID={`${testID}-headline`}\n className=\"text-center\"\n >\n {headline}\n </NativeText>\n ) : null}\n {subhead ? (\n <NativeText\n preset=\"body\"\n testID={`${testID}-subhead`}\n className=\"text-center text-muted-foreground\"\n >\n {subhead}\n </NativeText>\n ) : null}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// SocialAuthRow — provider buttons\n// ---------------------------------------------------------------------------\n\nexport type SocialAuthProvider = {\n /** Stable id used as React key + testID suffix. */\n id: string;\n /** Visible label, e.g., \"Continue with Apple\". */\n label: string;\n /** Optional leading icon node. */\n icon?: ReactNode;\n /** Press handler. */\n onPress: () => void | Promise<void>;\n /** When true, the button is disabled (e.g., loading). */\n disabled?: boolean;\n /**\n * Draw the provider's own button instead of the default outline button,\n * for a provider whose brand rules require theirs (Apple: see\n * `appleProvider`). Receives the testID the default would use.\n */\n render?: (props: { testID: string; disabled?: boolean }) => ReactNode;\n};\n\nexport interface SocialAuthRowProps {\n providers: SocialAuthProvider[];\n /**\n * Optional separator label rendered between social row and the form\n * below (e.g., \"or\"). Pass `null` to suppress. Default `\"or\"`.\n */\n separator?: string | null;\n /** Override root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function SocialAuthRow({\n providers,\n separator = \"or\",\n className,\n testID = \"social-auth-row\",\n}: SocialAuthRowProps) {\n if (providers.length === 0) return null;\n return (\n <View testID={testID} className={cn(\"gap-3\", className)}>\n <View className=\"gap-2\">\n {providers.map((p) =>\n p.render ? (\n <Fragment key={p.id}>{p.render({ testID: `${testID}-${p.id}`, disabled: p.disabled })}</Fragment>\n ) : (\n <NativeButton\n key={p.id}\n testID={`${testID}-${p.id}`}\n variant=\"outline\"\n disabled={p.disabled}\n onPress={() => {\n void p.onPress();\n }}\n >\n <View className=\"flex-row items-center gap-2\">\n {p.icon}\n <Text className=\"text-sm font-medium text-foreground\">\n {p.label}\n </Text>\n </View>\n </NativeButton>\n ),\n )}\n </View>\n {separator !== null && separator !== undefined ? (\n <View\n testID={`${testID}-separator`}\n className=\"my-2 flex-row items-center gap-3\"\n accessibilityElementsHidden\n >\n <View className=\"h-px flex-1 bg-border\" />\n <Text className=\"text-xs uppercase tracking-wider text-muted-foreground\">\n {separator}\n </Text>\n <View className=\"h-px flex-1 bg-border\" />\n </View>\n ) : null}\n </View>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AuthForm — email + password (or magic link) + submit\n// ---------------------------------------------------------------------------\n\nexport interface AuthFormValues {\n email: string;\n /** Empty string when `mode === \"magic-link\"`. */\n password: string;\n}\n\nexport interface AuthFormProps {\n /**\n * `\"password\"` (default) renders email + password.\n * `\"magic-link\"` renders email only and the submit button label\n * defaults to \"Send magic link\".\n */\n mode?: \"password\" | \"magic-link\";\n /** Submit handler. Receives the current form values. */\n onSubmit: (values: AuthFormValues) => void | Promise<void>;\n /**\n * Optional validation slot — return `null` to allow submission, or a\n * string error message to block. Called on every submit.\n */\n validate?: (values: AuthFormValues) => string | null;\n /** Override the submit button label. */\n submitLabel?: string;\n /** When true, submit button is disabled and shows a busy indicator. */\n loading?: boolean;\n /**\n * Top-level error (set by the consumer after a server-side rejection,\n * e.g., \"Invalid credentials\"). Shown above the submit button.\n */\n errorMessage?: string;\n /** Initial email. Useful for \"log in as <user>\" deep links. */\n initialEmail?: string;\n /** Slot rendered AFTER the inputs but BEFORE the submit (e.g., \"Forgot password\" link). */\n belowFields?: ReactNode;\n /** Override root container styling. */\n className?: string;\n testID?: string;\n}\n\nexport function AuthForm({\n mode = \"password\",\n onSubmit,\n validate,\n submitLabel,\n loading,\n errorMessage,\n initialEmail = \"\",\n belowFields,\n className,\n testID = \"auth-form\",\n}: AuthFormProps) {\n const [email, setEmail] = useState(initialEmail);\n const [password, setPassword] = useState(\"\");\n const [localError, setLocalError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n const passwordRef = useRef<{ focus(): void } | null>(null);\n\n const isMagic = mode === \"magic-link\";\n const resolvedSubmitLabel =\n submitLabel ?? (isMagic ? \"Send magic link\" : \"Sign in\");\n\n const handleSubmit = useCallback(async () => {\n // Guard against double-tap and stacked submits — the user's onSubmit\n // is async, so we own a local `submitting` flag in addition to the\n // parent-controlled `loading` prop.\n if (submitting || loading) return;\n\n setLocalError(null);\n const values: AuthFormValues = {\n email: email.trim(),\n password: isMagic ? \"\" : password,\n };\n if (validate) {\n const err = validate(values);\n if (err) {\n setLocalError(err);\n return;\n }\n }\n if (!values.email) {\n setLocalError(\"Email is required\");\n return;\n }\n if (!isMagic && !values.password) {\n setLocalError(\"Password is required\");\n return;\n }\n\n // Await the consumer's onSubmit so we surface unhandled rejections\n // as a local error string instead of dropping them on the floor.\n setSubmitting(true);\n try {\n await onSubmit(values);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n setLocalError(message);\n } finally {\n setSubmitting(false);\n }\n }, [email, password, isMagic, validate, onSubmit, submitting, loading]);\n\n const visibleError = errorMessage ?? localError ?? null;\n\n return (\n <View testID={testID} className={cn(\"gap-3\", className)}>\n <View className=\"gap-1\">\n <Text className=\"text-sm font-medium text-foreground\">Email</Text>\n <NativeInput\n testID={`${testID}-email`}\n accessibilityLabel=\"Email\"\n value={email}\n onChangeText={setEmail}\n placeholder=\"you@example.com\"\n autoCapitalize=\"none\"\n autoCorrect={false}\n keyboardType=\"email-address\"\n textContentType=\"emailAddress\"\n autoComplete=\"email\"\n returnKeyType={isMagic ? \"send\" : \"next\"}\n editable={!loading && !submitting}\n // Magic-link mode: the email field is the last input, so return\n // submits. Password mode: React Native doesn't move focus by\n // itself, so return focuses the password field and keeps the\n // keyboard open.\n submitBehavior={isMagic ? \"blurAndSubmit\" : \"submit\"}\n onSubmitEditing={isMagic ? handleSubmit : () => passwordRef.current?.focus()}\n />\n </View>\n\n {isMagic ? null : (\n <View className=\"gap-1\">\n <Text className=\"text-sm font-medium text-foreground\">Password</Text>\n <NativeInput\n ref={passwordRef}\n testID={`${testID}-password`}\n accessibilityLabel=\"Password\"\n value={password}\n onChangeText={setPassword}\n placeholder=\"••••••••\"\n secureTextEntry\n textContentType=\"password\"\n autoComplete=\"current-password\"\n autoCapitalize=\"none\"\n autoCorrect={false}\n returnKeyType=\"send\"\n editable={!loading && !submitting}\n onSubmitEditing={handleSubmit}\n />\n </View>\n )}\n\n {belowFields}\n\n {visibleError ? (\n <Text\n testID={`${testID}-error`}\n accessibilityRole=\"alert\"\n className=\"text-sm text-destructive\"\n >\n {visibleError}\n </Text>\n ) : null}\n\n <NativeButton\n testID={`${testID}-submit`}\n onPress={() => {\n void handleSubmit();\n }}\n loading={loading || submitting}\n disabled={loading || submitting}\n >\n {resolvedSubmitLabel}\n </NativeButton>\n </View>\n );\n}\n\n// Convenience: a \"Forgot password?\" link consumers can drop into the\n// `belowFields` slot. Kept as a simple Pressable so it inherits brand\n// tokens via the consumer's tailwind config.\nexport function ForgotPasswordLink({\n onPress,\n label = \"Forgot password?\",\n testID = \"auth-forgot-password\",\n}: {\n onPress: () => void;\n label?: string;\n testID?: string;\n}) {\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"link\"\n accessibilityLabel={label}\n onPress={onPress}\n hitSlop={8}\n className=\"self-end\"\n >\n <Text className=\"text-sm font-medium text-primary\">{label}</Text>\n </Pressable>\n );\n}\n","/**\n * AuthScreen — a whole sign-in screen: branding, social providers, the\n * email form with a \"Forgot password?\" link, and a footer (terms, a\n * sign-up link). It assembles the auth primitives (`AuthBranding`,\n * `SocialAuthRow`, `AuthForm`, `ForgotPasswordLink`) so an app passes\n * props instead of composing them.\n *\n * The form stays above the keyboard on small phones: with the app's\n * `KeyboardScrollProvider` (react-native-keyboard-controller), else with\n * `KeyboardAvoidingView`. With the provider's `toolbar` (`KeyboardToolbar`),\n * a previous / next / done bar rides above the keyboard. In development, on\n * iOS, it warns when a third-party provider is offered without Sign in with\n * Apple (App Store Review Guideline 4.8 rejects that). `appleProvider()`\n * adds Apple's own button in one line.\n *\n * Slots: replace or drop (`null`) `branding`, `social`, `form` or `footer`;\n * `slotProps` feeds a default part. Composing the primitives yourself is\n * still the escape hatch.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport { KeyboardAvoidingView, Platform, View } from \"react-native\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport {\n AuthBranding,\n AuthForm,\n ForgotPasswordLink,\n SocialAuthRow,\n type AuthBrandingProps,\n type AuthFormProps,\n type SocialAuthProvider,\n} from \"./auth\";\nimport { ScreenContainer } from \"./screen-container\";\nimport { KEYBOARD_TOOLBAR_HEIGHT, useKeyboardScroll, useKeyboardToolbar } from \"./keyboard\";\n\n/** The parts of an {@link AuthScreen} that `slots` and `slotProps` reach. */\nexport type AuthScreenSlotMap = {\n branding: AuthBrandingProps;\n social: { providers: SocialAuthProvider[]; testID: string };\n form: AuthFormProps;\n footer: { children: ReactNode; testID: string };\n};\n\nexport interface AuthScreenProps {\n /** Logo, headline and subhead above everything else. */\n branding?: AuthBrandingProps;\n /**\n * Sign-in providers (Apple, Google…). None: no social row. A `null` or\n * `false` entry is skipped, so a platform-only provider such as\n * `appleProvider(...)` (null off iOS) goes in the list as is.\n */\n providers?: Array<SocialAuthProvider | null | false | undefined>;\n /** The email form. */\n form: AuthFormProps;\n /** Adds a \"Forgot password?\" link below the fields (password mode only). */\n onForgotPassword?: () => void;\n /** Below the form: terms, a sign-up link. */\n footer?: ReactNode;\n /** Replace (a component) or drop (`null`) one part. */\n slots?: Slots<AuthScreenSlotMap>;\n /** More props for a default part, merged over what the screen passes. */\n slotProps?: SlotPropsFor<AuthScreenSlotMap>;\n /** testID on the root container. Default `\"auth-screen\"`. */\n testID?: string;\n}\n\nexport function AuthScreen({\n branding,\n providers: givenProviders,\n form,\n onForgotPassword,\n footer,\n slots = {},\n slotProps = {},\n testID = \"auth-screen\",\n}: AuthScreenProps) {\n const providers = givenProviders?.filter((p): p is SocialAuthProvider => !!p);\n warnIfNoAppleSignIn(providers);\n const forgot =\n onForgotPassword && (form.mode ?? \"password\") === \"password\" ? <ForgotPasswordLink onPress={onForgotPassword} /> : null;\n const formProps: AuthFormProps = { ...form, belowFields: form.belowFields ?? forgot, testID: form.testID ?? `${testID}-form` };\n const KeyboardScroll = useKeyboardScroll();\n const KeyboardToolbar = useKeyboardToolbar();\n const content = (\n <>\n {branding ? renderSlot(AuthBranding, slots.branding, { ...branding, testID: branding.testID ?? `${testID}-branding` }, slotProps.branding) : null}\n {providers?.length\n ? renderSlot(DefaultSocial, slots.social, { providers, testID: `${testID}-social` }, slotProps.social)\n : null}\n {renderSlot(AuthForm, slots.form, formProps, slotProps.form)}\n {footer ? renderSlot(DefaultFooter, slots.footer, { children: footer, testID: `${testID}-footer` }, slotProps.footer) : null}\n </>\n );\n if (KeyboardScroll) {\n return (\n <ScreenContainer testID={testID}>\n <KeyboardScroll\n testID={`${testID}-keyboard`}\n keyboardShouldPersistTaps=\"handled\"\n contentInsetAdjustmentBehavior=\"automatic\"\n bottomOffset={KeyboardToolbar ? 24 + KEYBOARD_TOOLBAR_HEIGHT : 24}\n contentContainerStyle={{ flexGrow: 1, justifyContent: \"center\", gap: 24, paddingHorizontal: 24, paddingVertical: 32 }}\n >\n {content}\n </KeyboardScroll>\n {KeyboardToolbar ? <KeyboardToolbar /> : null}\n </ScreenContainer>\n );\n }\n return (\n <KeyboardAvoidingView testID={`${testID}-kav`} style={{ flex: 1 }} behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}>\n <ScreenContainer scroll keyboardShouldPersistTaps=\"handled\" testID={testID} contentClassName=\"flex-grow justify-center gap-6 px-6 py-8\">\n {content}\n </ScreenContainer>\n </KeyboardAvoidingView>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\ndeclare const process: { env: Record<string, string | undefined> } | undefined;\nconst warnedNoApple = new Set<string>();\n\n/** Development-only: App Store Review Guideline 4.8 requires Sign in with Apple alongside third-party sign-in. */\nfunction warnIfNoAppleSignIn(providers: SocialAuthProvider[] | undefined) {\n const dev = typeof __DEV__ !== \"undefined\" ? __DEV__ : typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\";\n if (!dev || Platform.OS !== \"ios\" || !providers?.length) return;\n if (providers.some((p) => p.id === \"apple\")) return;\n const ids = providers.map((p) => p.id).join(\",\");\n if (warnedNoApple.has(ids)) return;\n warnedNoApple.add(ids);\n console.warn(\n `[genesis] AuthScreen offers ${providers.map((p) => p.label).join(\", \")} on iOS without Sign in with Apple. App Store Review Guideline 4.8 requires it; add appleProvider({ apple: AppleAuthentication, onPress }) (or any provider with id \"apple\"). If you did, expo-apple-authentication wasn't passed in.`,\n );\n}\n\nfunction DefaultSocial({ providers, testID }: AuthScreenSlotMap[\"social\"]) {\n return <SocialAuthRow providers={providers} testID={testID} />;\n}\n\nfunction DefaultFooter({ children, testID }: AuthScreenSlotMap[\"footer\"]) {\n return (\n <View testID={testID} className=\"items-center\">\n {children}\n </View>\n );\n}\n","/**\n * Sign in with Apple for `AuthScreen` / `SocialAuthRow`, drawn with Apple's\n * own `AppleAuthenticationButton` (Apple's Human Interface Guidelines require\n * its button; a look-alike gets an app rejected). Nothing here imports\n * `expo-apple-authentication`: pass the module in.\n *\n * ```tsx\n * import * as AppleAuthentication from \"expo-apple-authentication\";\n *\n * <AuthScreen providers={[appleProvider({ apple: AppleAuthentication, onPress: signIn }), google]} … />\n * ```\n *\n * `appleProvider` returns `null` off iOS or without the module, and\n * `AuthScreen` skips a `null` provider, so the same line works everywhere.\n *\n * @stability Beta\n */\nimport { useRef, useState, type ComponentType } from \"react\";\nimport { Platform, View, type ViewStyle } from \"react-native\";\nimport { useThemeMode } from \"../hooks/use-theme-mode\";\nimport type { SocialAuthProvider } from \"./auth\";\n\n/** The parts of `expo-apple-authentication` the button uses. Pass the module itself. */\nexport interface AppleButtonModuleLike {\n AppleAuthenticationButton: ComponentType<{\n buttonType: number;\n buttonStyle: number;\n cornerRadius?: number;\n onPress: () => void;\n // The style the button is given, typed as the module types it: with `unknown` here the real\n // module's button (which takes a ViewStyle) wasn't assignable under strictFunctionTypes.\n style?: ViewStyle;\n testID?: string;\n accessibilityState?: { disabled?: boolean; busy?: boolean };\n }>;\n AppleAuthenticationButtonType: { SIGN_IN: number; CONTINUE: number; SIGN_UP: number };\n AppleAuthenticationButtonStyle: { BLACK: number; WHITE: number; WHITE_OUTLINE: number };\n}\n\nexport interface AppleSignInButtonProps {\n /** `expo-apple-authentication`. */\n apple: AppleButtonModuleLike;\n /** Usually `() => signInWithApple(supabase, AppleAuthentication, { digest })` from `@marktiderman/genesis-supabase/native`. */\n onPress: () => void | Promise<void>;\n /** Apple's wording: \"Sign in with Apple\", \"Continue with Apple\" (default) or \"Sign up with Apple\". */\n type?: \"sign-in\" | \"continue\" | \"sign-up\";\n /** `\"auto\"` (default): black in light mode, white in dark, as Apple recommends. */\n appearance?: \"auto\" | \"black\" | \"white\" | \"white-outline\";\n /** Default 10, to sit with Genesis buttons. */\n cornerRadius?: number;\n /** Default 44, the recommended touch target (Apple's HIG minimum for this button is 30pt). */\n height?: number;\n /** Dims the button and ignores presses. It is also ignored on its own while an `onPress` promise is pending, so a second tap can't open a second sheet. */\n disabled?: boolean;\n testID?: string;\n}\n\n/** Apple's branded button, full width. Renders nothing off iOS. */\nexport function AppleSignInButton({\n apple,\n onPress,\n type = \"continue\",\n appearance = \"auto\",\n cornerRadius = 10,\n height = 44,\n disabled,\n testID = \"apple-sign-in\",\n}: AppleSignInButtonProps) {\n const mode = useThemeMode();\n // A ref, not only state: two taps in the same frame both see the old state.\n const pending = useRef(false);\n const [busy, setBusy] = useState(false);\n if (Platform.OS !== \"ios\") return null;\n const press = async () => {\n if (disabled || pending.current) return;\n pending.current = true;\n setBusy(true);\n try {\n await onPress();\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n const inactive = !!disabled || busy;\n const { AppleAuthenticationButton, AppleAuthenticationButtonType: Type, AppleAuthenticationButtonStyle: Style } = apple;\n const buttonType = type === \"sign-in\" ? Type.SIGN_IN : type === \"sign-up\" ? Type.SIGN_UP : Type.CONTINUE;\n const resolved = appearance === \"auto\" ? (mode === \"dark\" ? \"white\" : \"black\") : appearance;\n const buttonStyle = resolved === \"white\" ? Style.WHITE : resolved === \"white-outline\" ? Style.WHITE_OUTLINE : Style.BLACK;\n return (\n <View testID={`${testID}-container`} pointerEvents={inactive ? \"none\" : \"auto\"} style={disabled ? { opacity: 0.5 } : undefined}>\n <AppleAuthenticationButton\n testID={testID}\n buttonType={buttonType}\n buttonStyle={buttonStyle}\n cornerRadius={cornerRadius}\n style={{ width: \"100%\", height }}\n accessibilityState={{ disabled: inactive, busy }}\n onPress={() => {\n void press();\n }}\n />\n </View>\n );\n}\n\nexport interface AppleProviderOptions extends Omit<AppleSignInButtonProps, \"apple\" | \"testID\"> {\n /** `expo-apple-authentication`, or `undefined` where it isn't installed. */\n apple: AppleButtonModuleLike | null | undefined;\n /**\n * The provider's `label`, used only by `AuthScreen`'s dev warning and a\n * custom `social` slot. Apple's button draws and announces its own localized\n * text. Default follows `type`: \"Continue with Apple\", \"Sign in with Apple\"\n * or \"Sign up with Apple\".\n */\n label?: string;\n}\n\nconst APPLE_LABELS = { continue: \"Continue with Apple\", \"sign-in\": \"Sign in with Apple\", \"sign-up\": \"Sign up with Apple\" } as const;\n\n/**\n * A `SocialAuthProvider` (id `\"apple\"`) that draws Apple's button, for\n * `AuthScreen`'s `providers`. `null` off iOS or without the module.\n *\n * @stability Beta\n */\nexport function appleProvider({ apple, label, ...button }: AppleProviderOptions): SocialAuthProvider | null {\n if (Platform.OS !== \"ios\" || !apple) return null;\n return {\n id: \"apple\",\n label: label ?? APPLE_LABELS[button.type ?? \"continue\"],\n onPress: button.onPress,\n disabled: button.disabled,\n render: ({ testID, disabled }) => <AppleSignInButton apple={apple} {...button} disabled={disabled} testID={testID} />,\n };\n}\n","/**\n * Google sign-in for `AuthScreen` / `SocialAuthRow`: the provider entry,\n * drawn as the row's outline button. Nothing here imports\n * `@react-native-google-signin/google-signin`; sign in with\n * `signInWithGoogle` from `@marktiderman/genesis-supabase/native`.\n *\n * ```tsx\n * <AuthScreen providers={[appleProvider({ apple, onPress: onApple }), googleProvider({ onPress: onGoogle })]} … />\n * ```\n *\n * Google's branding guidelines want its \"G\" mark on the button: pass it as\n * `icon` (Genesis ships no Google artwork). On iOS, offer Sign in with Apple\n * too (App Store Review Guideline 4.8); `AuthScreen` warns in development\n * when it's missing.\n *\n * @stability Beta\n */\nimport type { ReactNode } from \"react\";\nimport type { SocialAuthProvider } from \"./auth\";\n\nexport interface GoogleProviderOptions {\n /** Usually `() => signInWithGoogle(supabase, GoogleOneTapSignIn, { digest })`. */\n onPress: () => void | Promise<void>;\n /** Default \"Continue with Google\", Google's own wording. */\n label?: string;\n /** Google's \"G\" mark, as the app draws it. */\n icon?: ReactNode;\n disabled?: boolean;\n /** `false` (or `null`) gives `null`, so a switched-off provider goes in the list as is. Default true. */\n enabled?: boolean | null;\n}\n\n/**\n * A `SocialAuthProvider` (id `\"google\"`) for `AuthScreen`'s `providers`, or\n * `null` when `enabled` is false.\n *\n * @stability Beta\n */\nexport function googleProvider({ onPress, label = \"Continue with Google\", icon, disabled, enabled = true }: GoogleProviderOptions): SocialAuthProvider | null {\n if (!enabled) return null;\n return { id: \"google\", label, icon, onPress, disabled };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-genesis-extension.ts"],"names":[],"mappings":";;;AAkDA,IAAM,sBAAA,GAAyB,aAAA;AAAA,EAC7B;AACF,CAAA;AAOO,SAAS,uBAAA,CAAwB;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,OAAO,aAAA;AAAA,IACL,sBAAA,CAAuB,QAAA;AAAA,IACvB,EAAE,KAAA,EAAM;AAAA,IACR;AAAA,GACF;AACF;AAOO,SAAS,oBACd,GAAA,EACgC;AAChC,EAAA,MAAM,GAAA,GAAM,WAAW,sBAAsB,CAAA;AAC7C,EAAA,OAAO,MAAM,GAAG,CAAA;AAClB","file":"chunk-D5RKSPMH.js","sourcesContent":["/**\n * useGenesisExtension — read a brand-package `extensions[<key>]` token scale.\n *\n * Brand packages declare domain-specific token categories under the\n * `extensions` slot of the canonical schema (PRD-07 D8 design decision).\n * Genesis primitives don't read these — only consumer composites do — so\n * this hook is the canonical accessor.\n *\n * Resolution order:\n * 1. `BrandExtensionsContext` value (set via <BrandExtensionsProvider>)\n * 2. `undefined` — the extension key isn't declared\n *\n * Consumers wire the provider once at app root; calls anywhere downstream\n * read by key.\n *\n * <BrandExtensionsProvider value={brand.extensions}>\n * <App />\n * </BrandExtensionsProvider>\n *\n * const moodTokens = useGenesisExtension(\"mood\");\n * // moodTokens?.[500] etc. — shape is consumer-defined\n *\n * Type contract: the canonical `BrandExtensions` interface lives in\n * `@marktiderman/genesis-design-system` (declaration-merging surface). At\n * runtime, consumers may pass a partially-populated object whose keys\n * match their own augmented `BrandExtensions`. We intentionally accept\n * `Partial<BrandExtensions>` here so the provider works with brand\n * packages that haven't declared extensions yet (a common case in newly\n * scaffolded apps).\n *\n * @stability Beta\n */\nimport {\n createContext,\n createElement,\n useContext,\n type ReactNode,\n} from \"react\";\nimport type { BrandExtensions } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Runtime shape passed to `<BrandExtensionsProvider>`. Consumers augment\n * the canonical `BrandExtensions` interface (in design-system) via TS\n * declaration merging; the provider accepts the resulting record.\n *\n * `Partial<>` so brand packages that have no extensions can still wrap\n * their app in the provider without TS errors.\n */\nexport type BrandExtensionsValue = Partial<BrandExtensions>;\n\nconst BrandExtensionsContext = createContext<BrandExtensionsValue | undefined>(\n undefined,\n);\n\nexport interface BrandExtensionsProviderProps {\n value?: BrandExtensionsValue;\n children: ReactNode;\n}\n\nexport function BrandExtensionsProvider({\n value,\n children,\n}: BrandExtensionsProviderProps) {\n return createElement(\n BrandExtensionsContext.Provider,\n { value },\n children,\n );\n}\n\n/**\n * Read an extension scale by key. Returns `undefined` when the provider\n * isn't mounted OR when the key isn't declared on the brand. The return\n * type follows the consumer's augmented `BrandExtensions[K]`.\n */\nexport function useGenesisExtension<K extends keyof BrandExtensions>(\n key: K,\n): BrandExtensions[K] | undefined {\n const ctx = useContext(BrandExtensionsContext);\n return ctx?.[key];\n}\n"]}
|