@marktiderman/genesis-ui-native 3.6.0 → 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 +44 -0
- package/dist/{chunk-AGTBABAH.js → chunk-3KFUS7O6.js} +4 -4
- package/dist/{chunk-AGTBABAH.js.map → chunk-3KFUS7O6.js.map} +1 -1
- package/dist/{chunk-2Z72MYHB.js → chunk-7NDKIIOT.js} +5 -5
- package/dist/{chunk-2Z72MYHB.js.map → chunk-7NDKIIOT.js.map} +1 -1
- package/dist/chunk-CAI7LGN6.js +39 -0
- package/dist/chunk-CAI7LGN6.js.map +1 -0
- package/dist/{chunk-FUMSL7VZ.js → chunk-GBNIBHSU.js} +6 -6
- package/dist/{chunk-FUMSL7VZ.js.map → chunk-GBNIBHSU.js.map} +1 -1
- package/dist/{chunk-SEJ6RBP7.js → chunk-IXC3LO2K.js} +100 -51
- package/dist/chunk-IXC3LO2K.js.map +1 -0
- package/dist/{chunk-NDXNSSM6.js → chunk-KH2RVAI5.js} +3 -4
- package/dist/chunk-KH2RVAI5.js.map +1 -0
- package/dist/{chunk-6PGLX6ET.js → chunk-O4BMDV7I.js} +14 -16
- package/dist/chunk-O4BMDV7I.js.map +1 -0
- package/dist/{chunk-4OQOJ2OC.js → chunk-RTYO24SC.js} +30 -5
- package/dist/chunk-RTYO24SC.js.map +1 -0
- package/dist/{chunk-ZRQAFFTN.js → chunk-YWDDDYDI.js} +2 -2
- package/dist/{chunk-ZRQAFFTN.js.map → chunk-YWDDDYDI.js.map} +1 -1
- package/dist/components/index.d.ts +55 -10
- package/dist/components/index.js +6 -5
- package/dist/data/index.js +4 -4
- package/dist/hooks/index.d.ts +32 -3
- package/dist/hooks/index.js +3 -2
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -8
- package/dist/layouts/index.js +6 -5
- package/dist/{native-modules-Cl3zw3kh.d.ts → native-modules-DEJJQhDx.d.ts} +29 -1
- package/package.json +25 -2
- package/src/__tests__/doctor-rules.test.ts +27 -0
- package/src/components/__tests__/button-haptic.test.tsx +52 -0
- package/src/components/__tests__/composer-bar.test.tsx +24 -0
- package/src/components/__tests__/thread-list.test.tsx +63 -0
- package/src/components/button.tsx +18 -1
- package/src/components/composer-bar.tsx +101 -23
- package/src/components/index.ts +1 -1
- package/src/components/thread-list.tsx +43 -13
- package/src/hooks/__tests__/use-haptics.test.tsx +146 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-haptics.ts +64 -0
- package/src/hooks/use-press-feedback.ts +87 -0
- package/src/native-modules.tsx +4 -0
- package/dist/chunk-4OQOJ2OC.js.map +0 -1
- package/dist/chunk-6PGLX6ET.js.map +0 -1
- package/dist/chunk-NDXNSSM6.js.map +0 -1
- package/dist/chunk-SEJ6RBP7.js.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Haptics, one way in: the app passes expo-haptics once, as `GenesisModules.haptics`, and every
|
|
3
|
+
* Genesis primitive (and the app's own pieces) plays the same kinds of feedback through
|
|
4
|
+
* `useHaptics()`. Without the module nothing plays, and nothing throws.
|
|
5
|
+
*
|
|
6
|
+
* import * as Haptics from "expo-haptics";
|
|
7
|
+
* <GenesisModulesProvider modules={{ haptics: Haptics }}>
|
|
8
|
+
*
|
|
9
|
+
* const haptic = useHaptics();
|
|
10
|
+
* haptic("select");
|
|
11
|
+
*
|
|
12
|
+
* Kinds follow the platforms' own vocabulary: a light, medium or heavy impact (a press, a swipe
|
|
13
|
+
* passing its threshold, a long press opening a menu), a selection tick (a picker or a tab
|
|
14
|
+
* changing), and a success, warning or error notification. The OS's own haptics setting applies;
|
|
15
|
+
* Reduce Motion doesn't turn haptics off (they're not motion).
|
|
16
|
+
*
|
|
17
|
+
* @stability Beta
|
|
18
|
+
*/
|
|
19
|
+
import { useCallback } from "react";
|
|
20
|
+
import { useGenesisModules } from "../native-modules";
|
|
21
|
+
|
|
22
|
+
/** What a haptic says. */
|
|
23
|
+
export type HapticKind = "light" | "medium" | "heavy" | "select" | "success" | "warning" | "error";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* `import * as Haptics from "expo-haptics"`: the parts Genesis calls, written structurally (the
|
|
27
|
+
* same shape as genesis-chat's `HapticsLike`, so one module serves both).
|
|
28
|
+
*/
|
|
29
|
+
export interface GenesisHapticsModule {
|
|
30
|
+
impactAsync(style?: never): Promise<void>;
|
|
31
|
+
selectionAsync(): Promise<void>;
|
|
32
|
+
notificationAsync(type?: never): Promise<void>;
|
|
33
|
+
ImpactFeedbackStyle: { Light: unknown; Medium: unknown; Heavy?: unknown };
|
|
34
|
+
NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Plays a haptic on the module given; never throws and never rejects. No module, no haptic. */
|
|
38
|
+
export function playHaptic(haptics: GenesisHapticsModule | undefined, kind: HapticKind): void {
|
|
39
|
+
if (!haptics) return;
|
|
40
|
+
try {
|
|
41
|
+
const as = (s: unknown) => s as never;
|
|
42
|
+
const styles = haptics.ImpactFeedbackStyle;
|
|
43
|
+
const notes = haptics.NotificationFeedbackType;
|
|
44
|
+
const p =
|
|
45
|
+
kind === "light"
|
|
46
|
+
? haptics.impactAsync(as(styles.Light))
|
|
47
|
+
: kind === "medium"
|
|
48
|
+
? haptics.impactAsync(as(styles.Medium))
|
|
49
|
+
: kind === "heavy"
|
|
50
|
+
? haptics.impactAsync(as(styles.Heavy ?? styles.Medium))
|
|
51
|
+
: kind === "select"
|
|
52
|
+
? haptics.selectionAsync()
|
|
53
|
+
: haptics.notificationAsync(as(kind === "success" ? notes.Success : kind === "warning" ? notes.Warning : notes.Error));
|
|
54
|
+
void p?.catch?.(() => undefined);
|
|
55
|
+
} catch {
|
|
56
|
+
// A haptic is never worth an error.
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A function that plays a haptic through the app's `GenesisModules.haptics`. Stable across renders. */
|
|
61
|
+
export function useHaptics(): (kind: HapticKind) => void {
|
|
62
|
+
const { haptics } = useGenesisModules();
|
|
63
|
+
return useCallback((kind: HapticKind) => playHaptic(haptics, kind), [haptics]);
|
|
64
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePressFeedback: how a pressable answers a touch, the same for buttons, rows and cards. It
|
|
3
|
+
* shrinks a little while held (on the motion tokens' `press` duration) and springs back on release
|
|
4
|
+
* (`snappy`), and can play a haptic when the press lands. Under Reduce Motion (or brand motion
|
|
5
|
+
* `none`) it dims instead of moving.
|
|
6
|
+
*
|
|
7
|
+
* const press = usePressFeedback({ haptic: "light" });
|
|
8
|
+
* <Pressable onPress={save} onPressIn={press.onPressIn} onPressOut={press.onPressOut}>
|
|
9
|
+
* <Animated.View style={press.style}>…</Animated.View>
|
|
10
|
+
* </Pressable>
|
|
11
|
+
*
|
|
12
|
+
* The haptic plays on `onPressIn` for `select` (a tick under the finger, as iOS does). Any other
|
|
13
|
+
* kind plays when you call `press.confirm()` from `onPress`, so a press cancelled by scrolling
|
|
14
|
+
* stays quiet.
|
|
15
|
+
*
|
|
16
|
+
* Built on React Native's `Animated`, so it works without Reanimated.
|
|
17
|
+
*
|
|
18
|
+
* @stability Beta
|
|
19
|
+
*/
|
|
20
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
21
|
+
import { Animated } from "react-native";
|
|
22
|
+
import { useMotion, type UseMotionOptions } from "./use-motion";
|
|
23
|
+
import { useHaptics, type HapticKind } from "./use-haptics";
|
|
24
|
+
|
|
25
|
+
type AnimatedValue = InstanceType<typeof Animated.Value>;
|
|
26
|
+
|
|
27
|
+
export interface PressFeedbackOptions {
|
|
28
|
+
/** A haptic when the press counts (`confirm()`), or `select` as a tick on press-in. Default none. */
|
|
29
|
+
haptic?: HapticKind | false;
|
|
30
|
+
/** How far it shrinks while held. Default 0.97. */
|
|
31
|
+
scale?: number;
|
|
32
|
+
/** Under Reduce Motion: how far it dims while held. Default 0.6. */
|
|
33
|
+
dimTo?: number;
|
|
34
|
+
/** No feedback (a disabled button). */
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** The brand's motion level, as `useMotion` takes it. */
|
|
37
|
+
level?: UseMotionOptions["level"];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PressFeedback {
|
|
41
|
+
onPressIn: () => void;
|
|
42
|
+
onPressOut: () => void;
|
|
43
|
+
/** Call from `onPress`: plays the haptic for a press that counted. */
|
|
44
|
+
confirm: () => void;
|
|
45
|
+
/** For an `Animated.View` around the pressable's content. */
|
|
46
|
+
style: { transform?: { scale: AnimatedValue }[]; opacity?: AnimatedValue };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function usePressFeedback({ haptic = false, scale = 0.97, dimTo = 0.6, disabled = false, level }: PressFeedbackOptions = {}): PressFeedback {
|
|
50
|
+
const motion = useMotion(level ? { level } : {});
|
|
51
|
+
const play = useHaptics();
|
|
52
|
+
const value = useRef(new Animated.Value(1)).current;
|
|
53
|
+
const reduced = motion.reduced;
|
|
54
|
+
|
|
55
|
+
const to = useCallback(
|
|
56
|
+
(target: number, held: boolean) => {
|
|
57
|
+
if (held || reduced) {
|
|
58
|
+
Animated.timing(value, { toValue: target, duration: motion.duration.press, useNativeDriver: true }).start();
|
|
59
|
+
} else {
|
|
60
|
+
const s = motion.spring.snappy;
|
|
61
|
+
Animated.spring(value, { toValue: target, damping: s.damping, stiffness: s.stiffness, mass: s.mass, useNativeDriver: true }).start();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[value, motion, reduced],
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const onPressIn = useCallback(() => {
|
|
68
|
+
if (disabled) return;
|
|
69
|
+
to(reduced ? dimTo : scale, true);
|
|
70
|
+
if (haptic === "select") play("select");
|
|
71
|
+
}, [disabled, reduced, dimTo, scale, to, haptic, play]);
|
|
72
|
+
|
|
73
|
+
// Always let go, even if the pressable was disabled mid-press (a send that started), and start
|
|
74
|
+
// from rest whenever it's disabled, so it never comes back still shrunk.
|
|
75
|
+
const onPressOut = useCallback(() => to(1, false), [to]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (disabled) value.setValue(1);
|
|
78
|
+
}, [disabled, value]);
|
|
79
|
+
|
|
80
|
+
const confirm = useCallback(() => {
|
|
81
|
+
if (!disabled && haptic && haptic !== "select") play(haptic);
|
|
82
|
+
}, [disabled, haptic, play]);
|
|
83
|
+
|
|
84
|
+
const style = useMemo(() => (disabled ? {} : reduced ? { opacity: value } : { transform: [{ scale: value }] }), [disabled, reduced, value]);
|
|
85
|
+
|
|
86
|
+
return { onPressIn, onPressOut, confirm, style };
|
|
87
|
+
}
|
package/src/native-modules.tsx
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
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
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 |
|
|
35
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 |
|
|
36
37
|
*
|
|
37
38
|
* The props below are written structurally (no import of the optional
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
* @stability Beta
|
|
41
42
|
*/
|
|
42
43
|
import { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from "react";
|
|
44
|
+
import type { GenesisHapticsModule } from "./hooks/use-haptics";
|
|
43
45
|
import type { ColorValue } from "react-native";
|
|
44
46
|
import type { NativeIconName } from "./icon-names";
|
|
45
47
|
|
|
@@ -192,6 +194,8 @@ export interface GenesisModules {
|
|
|
192
194
|
navigation?: GenesisNavigationModule;
|
|
193
195
|
/** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: "translate-with-padding"`). */
|
|
194
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;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
const EMPTY: GenesisModules = Object.freeze({});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-reduced-motion.ts","../src/hooks/use-motion.ts","../src/hooks/use-theme-mode.ts","../src/hooks/use-theme-roles.ts"],"names":["useState","useEffect","useMemo"],"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,I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F,EAAA,MAAM,SAAS,YAAA,EAAa;AAC5B,EAAA,MAAM,EAAE,IAAA,EAAM,WAAA,GAAc,KAAA,EAAM,GAAI,OAAA;AACtC,EAAA,MAAM,cAAA,GAAiB,eAAe,QAAA,CAAS,EAAA,KAAO,aAAa,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA,IAAK,EAAA;AAC/F,EAAA,OAAOC,OAAAA;AAAA,IACL,MACE,iBAAA,CAA8B;AAAA,MAC5B,MAAA,EAAQ,QAAA,CAAS,EAAA,KAAO,KAAA,GAAQ,KAAA,GAAQ,SAAA;AAAA,MACxC,MAAA;AAAA,MACA,aAAA,EAAe,CAAC,IAAA,KAAS,aAAA,CAAc,IAAI,CAAA;AAAA,MAC3C,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,IACH,CAAC,MAAA,EAAQ,IAAA,EAAM,cAAc;AAAA,GAC/B;AACF","file":"chunk-4OQOJ2OC.js","sourcesContent":["/**\n * useReducedMotion — subscribe to the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n","/**\n * useMotion — the shared motion tokens (genesis-design-system's\n * `resolveMotion`), with the OS's reduce-motion setting applied.\n *\n * Every Genesis primitive that moves reads its durations, easings and springs\n * from here instead of its own constants, so motion is defined once for web\n * and native. Under Reduce Motion every duration is 0 and `animateMotion`\n * returns the final value, so a component lands without moving.\n *\n * The brand's motion level isn't read from a provider yet: pass `level` (a\n * brand whose design system chose `none` passes `\"none\"`). Without it,\n * `calm`.\n *\n * On the JS thread (an effect, a PanResponder), `animateMotion`:\n *\n * ```tsx\n * const motion = useMotion();\n * const { reanimated: R } = useGenesisModules();\n * opacity.value = animateMotion(R, motion, 1, { duration: \"fast\", easing: \"decelerate\" });\n * ```\n *\n * Inside a worklet (a gesture's `onEnd`, an animated scroll handler), build\n * the config with the worklet-safe `motionSpring` / `motionTiming` and call\n * Reanimated yourself:\n *\n * ```tsx\n * .onEnd((e) => { x.value = withSpring(0, motionSpring(motion, \"snappy\", e.velocityX)); })\n * opacity.value = withTiming(1, motionTiming(motion, \"fast\", Easing, \"decelerate\"));\n * ```\n *\n * A repeating animation checks `motion.reduced` first: a zero-length repeat\n * would flash every frame.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport {\n resolveMotion,\n type MotionDurations,\n type MotionEasings,\n type MotionLevel,\n type MotionSprings,\n type MotionTokens,\n} from \"@marktiderman/genesis-design-system/tokens/motion\";\nimport type { GenesisReanimatedModule } from \"../native-modules\";\nimport { useReducedMotion } from \"./use-reduced-motion\";\n\nexport interface UseMotionOptions {\n /** The brand's motion level. Default `calm`; `none` holds everything still, like Reduce Motion. */\n level?: MotionLevel;\n}\n\nexport function useMotion(options: UseMotionOptions = {}): MotionTokens {\n const reducedMotion = useReducedMotion();\n const level = options.level ?? \"calm\";\n return useMemo(() => resolveMotion(level, { reducedMotion }), [level, reducedMotion]);\n}\n\n/** How to get there: a named spring (keeps a gesture's velocity), or a named duration and easing. */\nexport type MotionHow =\n | { spring: keyof MotionSprings; velocity?: number; duration?: never; easing?: never }\n | { duration: keyof MotionDurations; easing?: keyof MotionEasings; spring?: never; velocity?: never };\n\n/** What `motionSpring` gives `withSpring`. */\nexport interface MotionSpringConfig {\n damping: number;\n stiffness: number;\n mass: number;\n velocity?: number;\n}\n\n/** What `motionTiming` gives `withTiming`. */\nexport interface MotionTimingConfig {\n duration: number;\n easing?: unknown;\n}\n\n/**\n * A `withSpring` config from a named spring. Worklet-safe (plain data in,\n * plain data out). Under reduced motion it's the stiff, critically damped\n * spring that settles in a few frames; to not move at all, check\n * `motion.reduced` and assign the value.\n */\nexport function motionSpring(motion: MotionTokens, name: keyof MotionSprings, velocity?: number): MotionSpringConfig {\n \"worklet\";\n const s = motion.spring[name];\n return typeof velocity === \"number\" && !motion.reduced\n ? { damping: s.damping, stiffness: s.stiffness, mass: s.mass, velocity }\n : { damping: s.damping, stiffness: s.stiffness, mass: s.mass };\n}\n\n/**\n * A `withTiming` config from a named duration and easing. Pass Reanimated's\n * `Easing` (`R.Easing`, or `Easing` imported in a worklet) so the token's\n * curve is used; a module without `Easing.bezier` gets Reanimated's default\n * curve. Worklet-safe.\n */\nexport function motionTiming(\n motion: MotionTokens,\n duration: keyof MotionDurations,\n Easing: Pick<GenesisReanimatedModule[\"Easing\"], \"bezier\"> | undefined,\n easing: keyof MotionEasings = \"out\",\n): MotionTimingConfig {\n \"worklet\";\n const [x1, y1, x2, y2] = motion.easing[easing];\n const curve = Easing?.bezier ? Easing.bezier(x1, y1, x2, y2) : undefined;\n return curve === undefined ? { duration: motion.duration[duration] } : { duration: motion.duration[duration], easing: curve };\n}\n\n/**\n * A Reanimated animation to `toValue` with the motion tokens, for a shared\n * value on the JS thread: `x.value = animateMotion(R, motion, 0, { spring: \"smooth\" })`.\n * Under reduced motion it returns `toValue` itself, so nothing moves.\n *\n * It takes no completion callback: Reanimated runs one on the UI thread, so\n * it must be a worklet, and the reduced path couldn't keep that promise. To\n * act when an animation ends, call `withSpring` / `withTiming` yourself with\n * `motionSpring` / `motionTiming` and a worklet callback. A module without\n * `withSpring` (an older one, a test fake) gets a `withTiming` at `base`.\n */\nexport function animateMotion(R: GenesisReanimatedModule, motion: MotionTokens, toValue: number, how: MotionHow): number {\n if (motion.reduced) return toValue;\n if (how.spring !== undefined) {\n if (R.withSpring) return R.withSpring(toValue, motionSpring(motion, how.spring, how.velocity));\n return R.withTiming(toValue, motionTiming(motion, \"base\", R.Easing));\n }\n return R.withTiming(toValue, motionTiming(motion, how.duration, R.Easing, how.easing));\n}\n","/**\n * useThemeMode — read the active color scheme (light / dark / unset).\n *\n * Wraps RN's `Appearance.getColorScheme()` + `Appearance.addChangeListener`\n * with a stable React hook so consumers don't have to wire it themselves.\n *\n * Use this in tokens-aware components when you need to choose between\n * light/dark variants OUTSIDE of Tailwind's `dark:` modifier (e.g., to pick\n * an asset, run an extra-color computation, or set StatusBar style).\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { Appearance, type ColorSchemeName } from \"react-native\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport function useThemeMode(): ThemeMode {\n const [scheme, setScheme] = useState<ColorSchemeName>(\n Appearance.getColorScheme(),\n );\n\n useEffect(() => {\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(colorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return scheme === \"dark\" ? \"dark\" : \"light\";\n}\n","/**\n * useThemeRoles — the theme roles (background, label, separator, tint…) as\n * colors for this platform and color scheme.\n *\n * On iOS every neutral role is a system color through `PlatformColor`, so a\n * screen follows light and dark mode, increased contrast and accessibility\n * settings like the system apps. On Android the roles are the Genesis tokens\n * for the current scheme, or Material You colors on Android 12+ with\n * `materialYou`. A brand sets `tint`.\n *\n * Use it for `style` props and anything Tailwind classes don't reach, such as\n * navigation header and tab bar options.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport { Platform, PlatformColor, type ColorValue } from \"react-native\";\nimport { resolveThemeRoles, type ThemeRole } from \"@marktiderman/genesis-design-system\";\nimport { useThemeMode } from \"./use-theme-mode\";\n\nexport type ThemeRoleColors = Record<ThemeRole, ColorValue>;\n\nexport interface UseThemeRolesOptions {\n /** The brand's primary color. */\n tint?: string;\n /** On Android 12+, use Material You dynamic colors for the neutral roles (and the tint, unless `tint` is set). Ignored elsewhere. */\n materialYou?: boolean;\n}\n\nexport function useThemeRoles(options: UseThemeRolesOptions = {}): ThemeRoleColors {\n const scheme = useThemeMode();\n const { tint, materialYou = false } = options;\n const androidDynamic = materialYou && Platform.OS === \"android\" && Number(Platform.Version) >= 31;\n return useMemo(\n () =>\n resolveThemeRoles<ColorValue>({\n target: Platform.OS === \"ios\" ? \"ios\" : \"android\",\n scheme,\n platformColor: (name) => PlatformColor(name),\n tint,\n androidDynamic,\n }),\n [scheme, tint, androidDynamic],\n );\n}\n"]}
|
|
@@ -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/skeleton.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;A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AA;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-6PGLX6ET.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 * | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |\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 /** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */\n withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** A React Navigation theme (`ReactNavigation.Theme`): the colors Genesis sets, and the fonts it keeps. */\nexport interface GenesisNavigationTheme {\n dark: boolean;\n colors: { primary: ColorValue; background: ColorValue; card: ColorValue; text: ColorValue; border: ColorValue; notification: ColorValue };\n fonts?: unknown;\n}\n\n/**\n * React Navigation's theming. In an Expo Router app take it from `expo-router`: it bundles its own\n * React Navigation, and its navigators read that copy's theme, not `@react-navigation/native`'s.\n */\nexport interface GenesisNavigationModule {\n ThemeProvider: ComponentType<{ value: any; children: ReactNode }>;\n DefaultTheme: GenesisNavigationTheme;\n DarkTheme: GenesisNavigationTheme;\n}\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\n/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n automaticOffset?: boolean;\n children?: ReactNode;\n testID?: string;\n}>;\n\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n navigation?: GenesisNavigationModule;\n /** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: \"translate-with-padding\"`). */\n keyboardAvoidingView?: KeyboardAvoidingLike;\n}\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 aperture: \"camera.aperture\",\n bell: \"bell\",\n calendar: \"calendar\",\n camera: \"camera\",\n \"camera-flip\": \"arrow.triangle.2.circlepath.camera\",\n check: \"checkmark\",\n clapperboard: \"movieclapper\",\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 \"folder-plus\": \"folder.badge.plus\",\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 maximize: \"arrow.up.left.and.arrow.down.right\",\n menu: \"line.3.horizontal\",\n message: \"bubble.left\",\n mic: \"mic\",\n minus: \"minus\",\n more: \"ellipsis\",\n paperclip: \"paperclip\",\n pause: \"pause.fill\",\n pin: \"pin\",\n play: \"play.fill\",\n plus: \"plus\",\n radio: \"dot.radiowaves.left.and.right\",\n refresh: \"arrow.clockwise\",\n reply: \"arrowshape.turn.up.left\",\n search: \"magnifyingglass\",\n settings: \"gearshape\",\n \"settings-2\": \"slider.horizontal.3\",\n share: \"square.and.arrow.up\",\n smile: \"face.smiling\",\n 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 * Skeleton — loading placeholder block.\n *\n * Pulses with Reanimated 4 when the app passes it (`modules.reanimated` on\n * `GenesisModulesProvider`), else with React Native's Animated. While Reduce\n * Motion is on it holds still at a legible opacity.\n *\n * @stability Stable\n */\nimport { useEffect, useRef } from \"react\";\nimport { Animated, Easing } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { useMotion } from \"../hooks/use-motion\";\nimport { useGenesisModules, type GenesisReanimatedModule } from \"../native-modules\";\n\nexport interface NativeSkeletonProps {\n className?: string;\n /**\n * Width of the skeleton. Use className for NativeWind sizing instead\n * when possible (e.g. className=\"w-24 h-4\").\n */\n width?: number;\n height?: number;\n /** Shorthand that sets both width and height (useful for circle skeletons). */\n size?: number;\n circle?: boolean;\n testID?: string;\n}\n\nconst LOW = 0.3;\nconst HIGH = 1;\n// Held still under Reduce Motion (visual-regression flow\n// `screenshot-reduced-motion.yaml`; Apple HIG / WCAG 2.3.3).\nconst STILL = 0.6;\n\nfunction sizeStyles({ width, height, size }: NativeSkeletonProps): Array<{ width?: number; height?: number }> {\n const w = width ?? size;\n const h = height ?? size;\n const styles: Array<{ width?: number; height?: number }> = [];\n if (w !== undefined) styles.push({ width: w });\n if (h !== undefined) styles.push({ height: h });\n return styles;\n}\n\nfunction skeletonClass({ className, circle }: NativeSkeletonProps) {\n return cn(\"rounded-md bg-muted\", circle && \"rounded-full\", className);\n}\n\nfunction NativeSkeleton(props: NativeSkeletonProps) {\n const { reanimated } = useGenesisModules();\n return reanimated ? <ReanimatedSkeleton {...props} reanimated={reanimated} /> : <AnimatedSkeleton {...props} />;\n}\n\nfunction ReanimatedSkeleton({ reanimated: R, ...props }: NativeSkeletonProps & { reanimated: GenesisReanimatedModule }) {\n // One pulse cycle from the shared motion tokens; under Reduce Motion it holds still (a zero-length repeat would flash).\n const motion = useMotion();\n const reduceMotion = motion.reduced;\n const PULSE_MS = motion.duration.pulse;\n const opacity = R.useSharedValue(LOW);\n useEffect(() => {\n R.cancelAnimation(opacity);\n if (reduceMotion) {\n opacity.value = STILL;\n return undefined;\n }\n opacity.value = LOW;\n opacity.value = R.withRepeat(R.withTiming(HIGH, { duration: PULSE_MS, easing: R.Easing.inOut(R.Easing.ease) }), -1, true);\n return () => R.cancelAnimation(opacity);\n // `R` and `opacity` are stable for the component's life.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reduceMotion]);\n const animatedStyle = R.useAnimatedStyle(() => {\n \"worklet\";\n return { opacity: opacity.value };\n });\n const AnimatedView = R.default.View;\n return (\n <AnimatedView\n className={skeletonClass(props)}\n style={[animatedStyle, ...sizeStyles(props)]}\n testID={props.testID}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n />\n );\n}\n\nfunction AnimatedSkeleton(props: NativeSkeletonProps) {\n const opacity = useRef(new Animated.Value(LOW)).current;\n // One pulse cycle from the shared motion tokens; under Reduce Motion it holds still (a zero-length repeat would flash).\n const motion = useMotion();\n const reduceMotion = motion.reduced;\n const PULSE_MS = motion.duration.pulse;\n\n useEffect(() => {\n if (reduceMotion) {\n opacity.setValue(STILL);\n return;\n }\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, {\n toValue: HIGH,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: LOW,\n duration: PULSE_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n ])\n );\n animation.start();\n return () => animation.stop();\n }, [opacity, reduceMotion]);\n\n return (\n <Animated.View\n className={skeletonClass(props)}\n style={[{ opacity }, ...sizeStyles(props)] as any[]}\n testID={props.testID}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n />\n );\n}\n\nexport { NativeSkeleton };\n","/**\n * LoadingState — a centred spinner for a screen (or part of one) that is\n * waiting: a redirect while the session loads, the first fetch of a page.\n *\n * Use it instead of a hand-rolled `<View><ActivityIndicator /></View>`: the\n * spinner takes the theme tint, screen readers hear one \"Loading\" progress\n * bar (or your `label`), and the full-screen form sits inside the safe area\n * on the screen background. For content-shaped placeholders (a list about to\n * appear) use `NativeSkeleton`; for known progress use `NativeProgress`.\n *\n * if (!session) return <NativeLoadingState />; // whole screen\n * <NativeLoadingState fullScreen={false} label=\"Loading more\" size=\"small\" />\n *\n * `ScreenContainer loading` renders the inline form in place of its body.\n *\n * @stability Beta\n */\nimport { ActivityIndicator, View, type ColorValue } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { NativeText } from \"./text\";\n\nexport type NativeLoadingStateEdge = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface NativeLoadingStateProps {\n /** Text shown under the spinner. It is also what screen readers announce. */\n label?: string;\n /** What screen readers announce when no `label` is shown. Default `\"Loading\"`. */\n accessibilityLabel?: string;\n /** Spinner size. Default `\"large\"`. */\n size?: \"small\" | \"large\";\n /**\n * `true` (default): fill the screen on the theme background, inside the\n * safe area. `false`: a padded, centred block that fills its parent, for a\n * screen body, a section or a list footer.\n */\n fullScreen?: boolean;\n /** Safe-area edges when `fullScreen`. Default all four. */\n safeAreaEdges?: NativeLoadingStateEdge[];\n /** Spinner color. Defaults to the theme tint. */\n color?: ColorValue;\n className?: string;\n /** testID on the root; the spinner is `${testID}-spinner`, the label `${testID}-label`. Default `\"loading-state\"`. */\n testID?: string;\n}\n\nconst ALL_EDGES: NativeLoadingStateEdge[] = [\"top\", \"bottom\", \"left\", \"right\"];\n\nexport function NativeLoadingState({\n label,\n accessibilityLabel,\n size = \"large\",\n fullScreen = true,\n safeAreaEdges = ALL_EDGES,\n color,\n className,\n testID = \"loading-state\",\n}: NativeLoadingStateProps) {\n const roles = useThemeRoles();\n const spoken = label ?? accessibilityLabel ?? \"Loading\";\n\n const content = (\n <View\n testID={fullScreen ? `${testID}-content` : testID}\n className={cn(\"items-center justify-center gap-3 px-4 py-8\", !fullScreen && \"flex-grow\", !fullScreen && className)}\n accessible\n accessibilityRole=\"progressbar\"\n accessibilityLabel={spoken}\n accessibilityState={{ busy: true }}\n >\n <ActivityIndicator testID={`${testID}-spinner`} size={size} color={(color ?? roles.tint) as string} />\n {label ? (\n <NativeText testID={`${testID}-label`} preset=\"body-sm\" className=\"text-muted-foreground text-center\">\n {label}\n </NativeText>\n ) : null}\n </View>\n );\n\n if (!fullScreen) return content;\n\n return (\n <SafeAreaView\n testID={testID}\n edges={safeAreaEdges}\n className={cn(\"flex-1 items-center justify-center bg-background\", className)}\n >\n {content}\n </SafeAreaView>\n );\n}\n"]}
|