{"slug":"tool-approval","name":"Tool Approval","description":"Hold to let an agent run a tool.","group":"AI agents","detail_url":"https://beui.dev/native/r/tool-approval","page_url":"https://beui.dev/react-native/tool-approval","expo_go_url":"exp://u.expo.dev/93a3a95c-6dc2-4adb-b57c-efbecf859f25/--/tool-approval?runtime-version=exposdk%3A57.0.0&channel-name=production","source_url":"https://github.com/starc007/beui-native/tree/main/src/components/tool-approval","libraries":["react","react-native","react-native-reanimated","react-native-svg","react-native-worklets","uniwind"],"install":["npx expo install react-native-reanimated react-native-svg react-native-worklets","npm install uniwind tailwindcss"],"setup":["Quickest: run `npx beui-native add <slug>` from the app's root. It writes the files below and installs the libraries.","Copy the files into the app and keep their folder layout: components import the shared files by relative path.","Add the theme tokens once, imported after Tailwind and Uniwind in the CSS file Uniwind reads.","Wrap the app in GestureHandlerRootView if it uses react-native-gesture-handler and isn't already.","Works in Expo and in bare React Native. Every component honors the system Reduce Motion setting."],"files":[{"path":"src/components/tool-approval/index.ts","content":"export type {\n  ToolApprovalCodeProps,\n  ToolApprovalParameter,\n  ToolApprovalProps,\n  ToolApprovalRisk,\n  ToolApprovalStatus,\n} from \"./tool-approval\";\nexport { ToolApproval, ToolApprovalCode } from \"./tool-approval\";\n","type":"component"},{"path":"src/components/tool-approval/tool-approval.tsx","content":"import { type ReactNode, useEffect, useRef, useState } from \"react\";\nimport {\n  Pressable,\n  StyleSheet,\n  Text,\n  View,\n  type ViewProps,\n} from \"react-native\";\nimport Animated, {\n  cancelAnimation,\n  Easing,\n  useAnimatedStyle,\n  useSharedValue,\n  withSpring,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { scheduleOnRN } from \"react-native-worklets\";\nimport { useResolveClassNames } from \"uniwind\";\nimport { useReducedMotionPreference } from \"../../hooks/use-reduced-motion\";\nimport {\n  AlertGlyph,\n  CheckGlyph,\n  ChevronDownGlyph,\n  CrossGlyph,\n  ShieldGlyph,\n} from \"../../primitives/agent-icons\";\nimport { Disclosure } from \"../../primitives/disclosure\";\nimport { RollText } from \"../../primitives/roll-text\";\nimport { RunningBar } from \"../../primitives/running-bar\";\nimport { SpinGlyph } from \"../../primitives/spin-glyph\";\nimport { EASE_OUT, SPRING_PRESS, SPRING_SWAP } from \"../../styles/motion\";\n\nexport type ToolApprovalStatus =\n  | \"pending\"\n  | \"approving\"\n  | \"approved\"\n  | \"denied\"\n  | \"running\"\n  | \"complete\"\n  | \"error\";\n\nexport type ToolApprovalParameter = {\n  id: string;\n  label: string;\n  value: ReactNode;\n};\n\nconst STATUS_LABEL: Record<ToolApprovalStatus, string> = {\n  pending: \"Approval required\",\n  approving: \"Approving\",\n  approved: \"Approved\",\n  denied: \"Denied\",\n  running: \"Running\",\n  complete: \"Completed\",\n  error: \"Failed\",\n};\n\n// Full class strings, so Uniwind can see every token at build time.\nconst STATUS_TEXT: Record<ToolApprovalStatus, string> = {\n  pending: \"text-warning\",\n  approving: \"text-primary\",\n  running: \"text-primary\",\n  approved: \"text-success\",\n  complete: \"text-success\",\n  denied: \"text-destructive\",\n  error: \"text-destructive\",\n};\n\nexport type ToolApprovalCodeProps = { code: string; className?: string };\n\n/** A command or snippet in a parameter value, set in monospace. */\nexport function ToolApprovalCode({\n  code,\n  className = \"\",\n}: ToolApprovalCodeProps) {\n  return (\n    <View\n      className={`rounded-lg border border-border bg-surface px-2.5 py-2 ${className}`}\n    >\n      <Text className=\"font-mono text-xs leading-5 text-foreground/85\">\n        {code}\n      </Text>\n    </View>\n  );\n}\n\nfunction ActionButton({\n  label,\n  className,\n  textClassName,\n  reduce,\n  onPress,\n}: {\n  label: string;\n  className: string;\n  textClassName: string;\n  reduce: boolean;\n  onPress?: () => void;\n}) {\n  const scale = useSharedValue(1);\n  const style = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }));\n  return (\n    <Pressable\n      accessibilityRole=\"button\"\n      onPress={onPress}\n      onPressIn={() => {\n        if (!reduce) scale.value = withSpring(0.97, SPRING_PRESS);\n      }}\n      onPressOut={() => {\n        scale.value = withSpring(1, SPRING_PRESS);\n      }}\n    >\n      <Animated.View\n        style={[styles.action, style]}\n        className={`rounded-xl px-4 ${className}`}\n      >\n        <Text className={`text-sm font-semibold ${textClassName}`}>\n          {label}\n        </Text>\n      </Animated.View>\n    </Pressable>\n  );\n}\n\nconst HOLD_DRAIN = { duration: 220, easing: EASE_OUT };\n\n/**\n * A button that confirms only after a press and hold, so a stray thumb can't\n * approve a tool run. A fill sweeps across while held and drains back if let\n * go early. Screen readers activate it with a double tap.\n */\nfunction HoldButton({\n  label,\n  className,\n  textClassName,\n  fillClassName,\n  duration,\n  reduce,\n  onConfirm,\n}: {\n  label: string;\n  className: string;\n  textClassName: string;\n  fillClassName: string;\n  duration: number;\n  reduce: boolean;\n  onConfirm?: () => void;\n}) {\n  const progress = useSharedValue(0);\n  // The label coaches the gesture: \"Keep holding…\" while pressed, and\n  // \"Hold to allow\" after a tap that let go too soon.\n  const [phase, setPhase] = useState<\"idle\" | \"holding\" | \"short\">(\"idle\");\n  const shortTimer = useRef<ReturnType<typeof setTimeout> | undefined>(\n    undefined,\n  );\n  useEffect(() => () => clearTimeout(shortTimer.current), []);\n  const scale = useSharedValue(1);\n  const confirmed = useRef(false);\n\n  const confirm = () => {\n    if (confirmed.current) return;\n    confirmed.current = true;\n    onConfirm?.();\n  };\n\n  const fillStyle = useAnimatedStyle(() => ({\n    transform: [{ scaleX: progress.value }],\n  }));\n  const pressStyle = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }));\n\n  return (\n    <Pressable\n      accessibilityRole=\"button\"\n      accessibilityLabel={label}\n      accessibilityHint=\"Press and hold to confirm\"\n      accessibilityActions={[{ name: \"activate\" }]}\n      onAccessibilityAction={confirm}\n      onPressIn={() => {\n        confirmed.current = false;\n        clearTimeout(shortTimer.current);\n        setPhase(\"holding\");\n        if (!reduce) scale.value = withSpring(0.97, SPRING_PRESS);\n        progress.value = withTiming(\n          1,\n          { duration, easing: Easing.linear },\n          (finished) => {\n            if (finished) scheduleOnRN(confirm);\n          },\n        );\n      }}\n      onPressOut={() => {\n        scale.value = withSpring(1, SPRING_PRESS);\n        if (confirmed.current) {\n          setPhase(\"idle\");\n          return;\n        }\n        cancelAnimation(progress);\n        progress.value = withTiming(0, HOLD_DRAIN);\n        setPhase(\"short\");\n        shortTimer.current = setTimeout(() => setPhase(\"idle\"), 1600);\n      }}\n    >\n      <Animated.View\n        style={[styles.action, pressStyle]}\n        className={`overflow-hidden rounded-xl px-4 ${className}`}\n      >\n        <Animated.View\n          pointerEvents=\"none\"\n          style={[StyleSheet.absoluteFill, styles.fill, fillStyle]}\n          className={fillClassName}\n        />\n        {/* The widest label holds the width, so neighbours never shift. */}\n        <View>\n          <Text className={`text-sm font-semibold opacity-0 ${textClassName}`}>\n            {label.length > \"Keep holding…\".length ? label : \"Keep holding…\"}\n          </Text>\n          <View style={styles.labelLayer}>\n            <RollText\n              value={phase}\n              text={\n                phase === \"holding\"\n                  ? \"Keep holding…\"\n                  : phase === \"short\"\n                    ? \"Hold to allow\"\n                    : label\n              }\n              className={`text-sm font-semibold ${textClassName}`}\n              reduce={reduce}\n            />\n          </View>\n        </View>\n      </Animated.View>\n    </Pressable>\n  );\n}\n\nexport type ToolApprovalRisk = \"low\" | \"normal\" | \"high\";\n\nexport type ToolApprovalProps = Omit<ViewProps, \"children\"> & {\n  /** The tool's name, such as `terminal.run`. */\n  tool: string;\n  /** Defaults to \"Allow this tool to run?\". */\n  title?: string;\n  description?: string;\n  /** What the tool will be called with, behind \"View details\". */\n  parameters?: ToolApprovalParameter[];\n  /** Defaults to \"pending\". You move it forward as the run progresses. */\n  status?: ToolApprovalStatus;\n  /**\n   * How careful allowing should be. \"low\" allows on a tap; \"normal\" (the\n   * default) needs a press and hold; \"high\" needs a longer hold, tints the\n   * card and says why in `riskNote`.\n   */\n  risk?: ToolApprovalRisk;\n  /** Why a high-risk tool deserves a second look, such as \"Deletes files\". */\n  riskNote?: string;\n  /** What happened, shown once the run ends, such as \"49 tests passed in 2.1s\". */\n  result?: string;\n  /** Controlled details state. */\n  open?: boolean;\n  /** Defaults to false. */\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  onApprove?: () => void;\n  /** Shows \"Always allow\". */\n  onAlwaysAllow?: () => void;\n  onDeny?: () => void;\n  /** Overrides how allowing is confirmed; by default it follows `risk`. */\n  confirm?: \"hold\" | \"tap\";\n  /** Milliseconds to hold. Defaults to 600, or 900 for high risk. */\n  holdDuration?: number;\n  className?: string;\n  /** Swaps states without motion, independently of the system preference. */\n  disableAnimation?: boolean;\n};\n\n/**\n * Asks before an agent runs a tool, then follows the run to its result in\n * the same card. Allowing takes a press and hold unless the tool is low risk.\n */\nexport function ToolApproval({\n  tool,\n  title = \"Allow this tool to run?\",\n  description,\n  parameters = [],\n  status = \"pending\",\n  risk = \"normal\",\n  riskNote,\n  result,\n  open: controlledOpen,\n  defaultOpen = false,\n  onOpenChange,\n  onApprove,\n  onAlwaysAllow,\n  onDeny,\n  confirm,\n  holdDuration,\n  className = \"\",\n  disableAnimation = false,\n  ...props\n}: ToolApprovalProps) {\n  const reducedMotion = useReducedMotionPreference();\n  const reduce = reducedMotion || disableAnimation;\n  const [internalOpen, setInternalOpen] = useState(defaultOpen);\n  const open = controlledOpen ?? internalOpen;\n  const pending = status === \"pending\";\n  const busy = status === \"approving\" || status === \"running\";\n  const ended =\n    status === \"complete\" || status === \"error\" || status === \"denied\";\n  const high = risk === \"high\";\n  const confirmBy = confirm ?? (risk === \"low\" ? \"tap\" : \"hold\");\n  const hold = holdDuration ?? (high ? 900 : 600);\n  const previous = useRef(status);\n  const turn = useSharedValue(open ? 1 : 0);\n  const { color: muted } = useResolveClassNames(\"text-muted\");\n  const { color: tone } = useResolveClassNames(STATUS_TONE[status]);\n\n  const setOpen = (next: boolean) => {\n    if (controlledOpen === undefined) setInternalOpen(next);\n    onOpenChange?.(next);\n  };\n\n  // Folds the details once a decision is made.\n  useEffect(() => {\n    const was = previous.current;\n    previous.current = status;\n    if (was === \"pending\" && status !== \"pending\") setOpen(false);\n  });\n\n  useEffect(() => {\n    turn.value = reduce\n      ? open\n        ? 1\n        : 0\n      : withSpring(open ? 1 : 0, SPRING_SWAP);\n  }, [open, reduce, turn]);\n  const chevronStyle = useAnimatedStyle(() => ({\n    transform: [{ rotate: `${turn.value * 180}deg` }],\n  }));\n\n  const icon = busy ? (\n    <SpinGlyph size={14} color={tone} reduce={reduce} />\n  ) : status === \"error\" ? (\n    <AlertGlyph size={14} color={tone} />\n  ) : status === \"denied\" ? (\n    <CrossGlyph size={14} color={tone} />\n  ) : status === \"approved\" || status === \"complete\" ? (\n    <CheckGlyph size={14} color={tone} />\n  ) : high ? (\n    <AlertGlyph size={14} color={tone} />\n  ) : (\n    <ShieldGlyph size={14} color={tone} />\n  );\n\n  const allowClass = high ? \"bg-destructive\" : \"bg-primary\";\n  const allowText = high ? \"text-background\" : \"text-on-primary\";\n  const allow =\n    confirmBy === \"hold\" ? (\n      <HoldButton\n        label=\"Allow once\"\n        className={allowClass}\n        textClassName={allowText}\n        fillClassName=\"bg-background/25\"\n        duration={hold}\n        reduce={reduce}\n        onConfirm={onApprove}\n      />\n    ) : (\n      <ActionButton\n        label=\"Allow once\"\n        className={allowClass}\n        textClassName={allowText}\n        reduce={reduce}\n        onPress={onApprove}\n      />\n    );\n  const always = onAlwaysAllow ? (\n    confirmBy === \"hold\" ? (\n      <HoldButton\n        label=\"Always allow\"\n        className=\"border border-border-strong bg-background\"\n        textClassName=\"text-foreground\"\n        fillClassName=\"bg-foreground/10\"\n        duration={hold}\n        reduce={reduce}\n        onConfirm={onAlwaysAllow}\n      />\n    ) : (\n      <ActionButton\n        label=\"Always allow\"\n        className=\"border border-border-strong bg-background\"\n        textClassName=\"text-foreground\"\n        reduce={reduce}\n        onPress={onAlwaysAllow}\n      />\n    )\n  ) : null;\n\n  return (\n    <View\n      accessibilityState={{ busy }}\n      className={`w-full overflow-hidden rounded-2xl border ${high && pending ? \"border-destructive/30 bg-destructive/5\" : \"border-border bg-surface/50\"} ${className}`}\n      {...props}\n    >\n      <View className=\"gap-2 p-4\">\n        {/* The tool and where the run is, on one quiet line. */}\n        <View accessibilityLiveRegion=\"polite\" style={styles.meta}>\n          <View style={styles.metaIcon}>{icon}</View>\n          <Text\n            numberOfLines={1}\n            className=\"shrink font-mono text-xs text-muted\"\n          >\n            {tool}\n          </Text>\n          <View style={styles.spacer} />\n          <RollText\n            text={STATUS_LABEL[status]}\n            className={`text-xs font-medium ${STATUS_TEXT[status]}`}\n            reduce={reduce}\n          />\n        </View>\n        <Text className=\"text-base font-semibold leading-6 text-foreground\">\n          {title}\n        </Text>\n        {description ? (\n          <Text className=\"text-sm leading-5 text-muted\">{description}</Text>\n        ) : null}\n        {high && riskNote && pending ? (\n          <View\n            style={styles.note}\n            className=\"rounded-lg bg-destructive/10 px-3 py-2\"\n          >\n            <AlertGlyph size={14} color={tone} />\n            <Text className=\"flex-1 text-xs font-medium leading-4 text-destructive\">\n              {riskNote}\n            </Text>\n          </View>\n        ) : null}\n        {parameters.length > 0 ? (\n          <Pressable\n            accessibilityRole=\"button\"\n            accessibilityState={{ expanded: open }}\n            onPress={() => setOpen(!open)}\n            hitSlop={10}\n            style={styles.details}\n          >\n            <Text className=\"text-xs font-medium text-muted\">\n              {open ? \"Hide details\" : \"View details\"}\n            </Text>\n            <Animated.View style={chevronStyle}>\n              <ChevronDownGlyph size={14} color={muted} />\n            </Animated.View>\n          </Pressable>\n        ) : null}\n      </View>\n      {parameters.length > 0 ? (\n        <Disclosure open={open} reduce={reduce}>\n          <View className=\"mx-4 mb-4 gap-3 rounded-xl border border-border bg-background/70 p-3\">\n            {parameters.map((parameter) => (\n              <View key={parameter.id} style={styles.parameter}>\n                <Text className=\"text-xs text-muted\">{parameter.label}</Text>\n                <View>\n                  {typeof parameter.value === \"string\" ? (\n                    <Text className=\"font-mono text-xs text-foreground/85\">\n                      {parameter.value}\n                    </Text>\n                  ) : (\n                    parameter.value\n                  )}\n                </View>\n              </View>\n            ))}\n          </View>\n        </Disclosure>\n      ) : null}\n      {/* The run's outcome, in the card that asked for it. */}\n      <Disclosure open={ended && Boolean(result)} reduce={reduce}>\n        <View\n          style={styles.result}\n          className={`mx-4 mb-4 rounded-xl px-3 py-2.5 ${RESULT_CLASS[status]}`}\n        >\n          <Text className={`text-sm leading-5 ${RESULT_TEXT[status]}`}>\n            {result}\n          </Text>\n        </View>\n      </Disclosure>\n      <Disclosure open={pending} reduce={reduce}>\n        {/* Thumb-sized: the main action spans the card, the others share a row. */}\n        <View className=\"gap-2 border-t border-border p-4\">\n          {allow}\n          <View style={styles.secondary}>\n            {always ? <View style={styles.flex}>{always}</View> : null}\n            <View style={styles.flex}>\n              <ActionButton\n                label=\"Deny\"\n                className=\"bg-foreground/5\"\n                textClassName=\"text-foreground\"\n                reduce={reduce}\n                onPress={onDeny}\n              />\n            </View>\n          </View>\n        </View>\n      </Disclosure>\n      {busy ? <RunningBar reduce={reduce} /> : null}\n    </View>\n  );\n}\n\nconst STATUS_TONE: Record<ToolApprovalStatus, string> = {\n  pending: \"text-muted\",\n  approving: \"text-primary\",\n  running: \"text-primary\",\n  approved: \"text-success\",\n  complete: \"text-success\",\n  denied: \"text-muted\",\n  error: \"text-destructive\",\n};\n// Denied isn't a failure, so its note stays neutral.\nconst RESULT_TEXT: Record<ToolApprovalStatus, string> = {\n  pending: \"text-foreground\",\n  approving: \"text-foreground\",\n  running: \"text-foreground\",\n  approved: \"text-success\",\n  complete: \"text-success\",\n  denied: \"text-foreground/80\",\n  error: \"text-destructive\",\n};\nconst RESULT_CLASS: Record<ToolApprovalStatus, string> = {\n  pending: \"\",\n  approving: \"\",\n  running: \"\",\n  approved: \"bg-success/10\",\n  complete: \"bg-success/10\",\n  denied: \"bg-foreground/5\",\n  error: \"bg-destructive/10\",\n};\n\nconst styles = StyleSheet.create({\n  flex: { flex: 1, minWidth: 0 },\n  spacer: { flex: 1 },\n  meta: { flexDirection: \"row\", alignItems: \"center\", gap: 6, minHeight: 20 },\n  metaIcon: {\n    width: 16,\n    height: 16,\n    alignItems: \"center\",\n    justifyContent: \"center\",\n  },\n  note: { flexDirection: \"row\", alignItems: \"center\", gap: 8 },\n  details: {\n    flexDirection: \"row\",\n    alignItems: \"center\",\n    gap: 4,\n    alignSelf: \"flex-start\",\n  },\n  // Label above value: a phone is too narrow for a label column beside code.\n  parameter: { gap: 4 },\n  result: { flexDirection: \"row\" },\n  secondary: { flexDirection: \"row\", gap: 8 },\n  action: { minHeight: 46, alignItems: \"center\", justifyContent: \"center\" },\n  fill: { transformOrigin: [\"0%\", \"50%\", 0] },\n  labelLayer: {\n    position: \"absolute\",\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    alignItems: \"center\",\n    justifyContent: \"center\",\n  },\n  bar: {\n    position: \"absolute\",\n    left: 0,\n    right: 0,\n    bottom: 0,\n    height: 2,\n    overflow: \"hidden\",\n  },\n  barFill: {\n    position: \"absolute\",\n    left: 0,\n    top: 0,\n    bottom: 0,\n    width: \"35%\",\n    borderRadius: 1,\n  },\n});\n","type":"component"},{"path":"src/hooks/use-presence.ts","content":"import { useEffect, useRef, useState } from \"react\";\n\nexport type PresenceItem<T> = {\n  key: string;\n  value: T;\n  /** False for the item present on first render, so it does not animate in. */\n  appear: boolean;\n  exiting: boolean;\n};\n\n/**\n * Keeps replaced items mounted while they animate out, like AnimatePresence.\n * A key that returns while exiting is revived in place.\n */\nexport function usePresence<T>(\n  key: string | null,\n  value: T,\n  exitDuration: (value: T) => number,\n) {\n  const [items, setItems] = useState<PresenceItem<T>[]>(() =>\n    key === null ? [] : [{ key, value, appear: false, exiting: false }],\n  );\n  const [currentKey, setCurrentKey] = useState(key);\n  const exitDurationRef = useRef(exitDuration);\n  exitDurationRef.current = exitDuration;\n\n  // Adjust during render so the new item and the exits start in the same frame.\n  if (key !== currentKey) {\n    setCurrentKey(key);\n    setItems((previous) => {\n      const next = previous.map((item) =>\n        item.key === key\n          ? { ...item, value, exiting: false }\n          : { ...item, exiting: true },\n      );\n      if (key !== null && !previous.some((item) => item.key === key)) {\n        next.push({ key, value, appear: true, exiting: false });\n      }\n      return next;\n    });\n  }\n\n  const exitingKeys = items\n    .filter((item) => item.exiting)\n    .map((item) => item.key)\n    .join(\"\\n\");\n\n  useEffect(() => {\n    if (!exitingKeys) return;\n    const timers = items\n      .filter((item) => item.exiting)\n      .map((item) =>\n        setTimeout(() => {\n          setItems((previous) =>\n            previous.filter(\n              (candidate) => !(candidate.key === item.key && candidate.exiting),\n            ),\n          );\n        }, exitDurationRef.current(item.value)),\n      );\n    return () => {\n      for (const timer of timers) clearTimeout(timer);\n    };\n    // Restart removal timers only when the set of exiting items changes.\n  }, [exitingKeys]);\n\n  return items;\n}\n","type":"shared"},{"path":"src/hooks/use-reduced-motion.ts","content":"import { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\nimport { useReducedMotion } from \"react-native-reanimated\";\n\n/** Reanimated supplies a synchronous initial value; native events keep it current. */\nexport function useReducedMotionPreference() {\n  const initialValue = useReducedMotion();\n  const [reducedMotion, setReducedMotion] = useState(initialValue);\n\n  useEffect(() => {\n    let active = true;\n    let receivedEvent = false;\n    const subscription = AccessibilityInfo.addEventListener(\n      \"reduceMotionChanged\",\n      (value) => {\n        receivedEvent = true;\n        setReducedMotion(value);\n      },\n    );\n    void AccessibilityInfo.isReduceMotionEnabled().then((value) => {\n      if (active && !receivedEvent) setReducedMotion(value);\n    });\n    return () => {\n      active = false;\n      subscription.remove();\n    };\n  }, []);\n\n  return reducedMotion;\n}\n","type":"shared"},{"path":"src/primitives/agent-icons.tsx","content":"import type { ReactNode } from \"react\";\nimport type { ColorValue } from \"react-native\";\nimport Svg, { Circle, Path, Rect } from \"react-native-svg\";\n\ntype GlyphProps = { size?: number; color?: ColorValue; strokeWidth?: number };\n\nfunction Glyph({\n  size = 16,\n  color = \"currentColor\",\n  strokeWidth = 2,\n  children,\n}: GlyphProps & { children: ReactNode }) {\n  return (\n    <Svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke={color}\n      strokeWidth={strokeWidth}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      {children}\n    </Svg>\n  );\n}\n\n// Simple 24-unit stroke glyphs shared by the agent components.\n\nexport function ChevronDownGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M6 9l6 6 6-6\" />\n    </Glyph>\n  );\n}\n\nexport function ArrowUpGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M12 19V5M5.5 11.5L12 5l6.5 6.5\" />\n    </Glyph>\n  );\n}\n\nexport function PlusGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M12 5v14M5 12h14\" />\n    </Glyph>\n  );\n}\n\nexport function StopGlyph({ size = 12, color }: GlyphProps) {\n  return (\n    <Svg width={size} height={size} viewBox=\"0 0 12 12\">\n      <Rect x={1} y={1} width={10} height={10} rx={2.5} fill={color} />\n    </Svg>\n  );\n}\n\nexport function CheckGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M5 12.5l4.5 4.5L19 7\" />\n    </Glyph>\n  );\n}\n\nexport function CopyGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Rect x={8.5} y={8.5} width={12} height={12} rx={2.5} />\n      <Path d=\"M15.5 5.5v-.5A2 2 0 0 0 13.5 3h-8.5A2 2 0 0 0 3 5v8.5a2 2 0 0 0 2 2h.5\" />\n    </Glyph>\n  );\n}\n\nexport function RetryGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M3.5 12a8.5 8.5 0 1 0 2.6-6.1L3.5 8.5\" />\n      <Path d=\"M3.5 3.5v5h5\" />\n    </Glyph>\n  );\n}\n\nexport function ThumbGlyph({\n  down = false,\n  ...props\n}: GlyphProps & { down?: boolean }) {\n  return (\n    <Glyph {...props}>\n      <Path\n        d=\"M7.5 10.5v10M7.5 10.5L11 3.5a2.5 2.5 0 0 1 2.5 2.5v3.5h5a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.3 20.5H4.5a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z\"\n        transform={down ? \"rotate(180 12 12)\" : undefined}\n      />\n    </Glyph>\n  );\n}\n\nexport function SearchGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={11} cy={11} r={6.5} />\n      <Path d=\"M16 16l4 4\" />\n    </Glyph>\n  );\n}\n\nexport function GlobeGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M3.5 12h17M12 3.5c2.4 2.5 3.5 5.3 3.5 8.5s-1.1 6-3.5 8.5c-2.4-2.5-3.5-5.3-3.5-8.5s1.1-6 3.5-8.5z\" />\n    </Glyph>\n  );\n}\n\nexport function FileGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M14 3.5H7.5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2V8z\" />\n      <Path d=\"M14 3.5V8h4.5M9 13h6M9 16.5h4\" />\n    </Glyph>\n  );\n}\n\nexport function PencilGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M4 20h4L19 9a2.1 2.1 0 0 0-4-4L4 16z\" />\n      <Path d=\"M13.5 6.5l4 4M14 20h6\" />\n    </Glyph>\n  );\n}\n\nexport function TerminalGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Rect x={3.5} y={4.5} width={17} height={15} rx={2.5} />\n      <Path d=\"M7.5 10l2.5 2-2.5 2M12.5 15h4\" />\n    </Glyph>\n  );\n}\n\nexport function WrenchGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M14.5 6.5a4 4 0 0 0 5 5l-8.8 8.8a2.1 2.1 0 0 1-3-3l8.8-8.8a4 4 0 0 1-2-2z\" />\n    </Glyph>\n  );\n}\n\nexport function SparkleGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M12 4l1.8 4.6L18.5 10.5l-4.7 1.9L12 17l-1.8-4.6-4.7-1.9 4.7-1.9z\" />\n      <Path d=\"M18.5 16.5v3M17 18h3\" />\n    </Glyph>\n  );\n}\n\nexport function MessageGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M20 14.5a2 2 0 0 1-2 2H8.5L4 20V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z\" />\n    </Glyph>\n  );\n}\n\nexport function ImageGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Rect x={3.5} y={4.5} width={17} height={15} rx={2.5} />\n      <Circle cx={9} cy={10} r={1.5} />\n      <Path d=\"M20.5 15.5l-4.5-4.5-9 8.5\" />\n    </Glyph>\n  );\n}\n\nexport function ShieldGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M12 3.5l7 2.5v5.5c0 4.4-3 7.7-7 9-4-1.3-7-4.6-7-9V6z\" />\n      <Path d=\"M9 12l2 2 4-4\" />\n    </Glyph>\n  );\n}\n\nexport function AlertGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M12 8v4.5M12 16h.01\" />\n    </Glyph>\n  );\n}\n\nexport function CrossGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M6.5 6.5l11 11M17.5 6.5l-11 11\" />\n    </Glyph>\n  );\n}\n\nexport function HelpGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M9.6 9.5a2.5 2.5 0 0 1 4.8 1c0 1.7-2.4 2.2-2.4 3.5M12 16.8h.01\" />\n    </Glyph>\n  );\n}\n\nexport function ArrowGlyph({\n  back = false,\n  ...props\n}: GlyphProps & { back?: boolean }) {\n  return (\n    <Glyph {...props}>\n      <Path\n        d=\"M5 12h14M13 6l6 6-6 6\"\n        transform={back ? \"rotate(180 12 12)\" : undefined}\n      />\n    </Glyph>\n  );\n}\n\nexport function BracesGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M8.5 4H8a2 2 0 0 0-2 2v3.5A2.5 2.5 0 0 1 3.5 12 2.5 2.5 0 0 1 6 14.5V18a2 2 0 0 0 2 2h.5M15.5 4h.5a2 2 0 0 1 2 2v3.5a2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0-2.5 2.5V18a2 2 0 0 1-2 2h-.5\" />\n    </Glyph>\n  );\n}\n\nexport function BanGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M6 6l12 12\" />\n    </Glyph>\n  );\n}\n\nexport function CircleCheckGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M8.5 12.2l2.4 2.4 4.6-4.8\" />\n    </Glyph>\n  );\n}\n\nexport function CircleCrossGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M9.5 9.5l5 5M14.5 9.5l-5 5\" />\n    </Glyph>\n  );\n}\n\nexport function ListGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M4 6.5l1.5 1.5L8 5.5M4 13l1.5 1.5L8 12M11.5 7h8.5M11.5 13.5h8.5M11.5 19h8.5M4.5 19h2\" />\n    </Glyph>\n  );\n}\n\n/** An open ring, spun by SpinGlyph. */\nexport function RingGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M20.5 12a8.5 8.5 0 1 1-6-8.1\" />\n    </Glyph>\n  );\n}\n\nexport function ReplyGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M9.5 7L4.5 12l5 5M4.5 12h10a5 5 0 0 1 5 5v1\" />\n    </Glyph>\n  );\n}\n\nexport function WrapGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M4 6.5h16M4 12h12.5a3.25 3.25 0 0 1 0 6.5H12M4 18.5h4.5M14 16.5l-2 2 2 2\" />\n    </Glyph>\n  );\n}\n\nexport function BookGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M12 6.5c-1.6-1.3-4-2-7.5-2v13c3.5 0 5.9.7 7.5 2 1.6-1.3 4-2 7.5-2v-13c-3.5 0-5.9.7-7.5 2zM12 6.5v13\" />\n    </Glyph>\n  );\n}\n\nexport function ExternalGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M14 4.5h5.5V10M19.5 4.5L11 13M17 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h4\" />\n    </Glyph>\n  );\n}\n\nexport function DoubleCheckGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Path d=\"M2.5 12.5l4.5 4.5 9-9.5M12 16.5l.5.5 9-9.5\" />\n    </Glyph>\n  );\n}\n\nexport function ClockGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Circle cx={12} cy={12} r={8.5} />\n      <Path d=\"M12 7.5V12l3 2\" />\n    </Glyph>\n  );\n}\n\nexport function MicGlyph(props: GlyphProps) {\n  return (\n    <Glyph {...props}>\n      <Rect x={9} y={3.5} width={6} height={11} rx={3} />\n      <Path d=\"M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5v3\" />\n    </Glyph>\n  );\n}\n","type":"shared"},{"path":"src/primitives/disclosure.tsx","content":"import { type ReactNode, useEffect, useRef } from \"react\";\nimport { StyleSheet, View, type ViewStyle } from \"react-native\";\nimport Animated, {\n  measure,\n  useAnimatedRef,\n  useAnimatedStyle,\n  useSharedValue,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { scheduleOnUI } from \"react-native-worklets\";\nimport { EASE_OUT } from \"../styles/motion\";\n\nconst OPEN = { duration: 220, easing: EASE_OUT };\nconst CLOSE = { duration: 140, easing: EASE_OUT };\nconst DROP = 4;\n// The height while settled open: unconstrained, so growing content just flows.\nconst NATURAL = -1;\n\nexport type DisclosureProps = {\n  open: boolean;\n  /** Snaps open and closed, keeping only the fade. */\n  reduce: boolean;\n  /** Caps the open height; content clips beyond it. */\n  maxHeight?: number;\n  style?: ViewStyle;\n  children: ReactNode;\n};\n\n/**\n * Collapsible content shared by the agent components: the height eases\n * between closed and the content's size while the content fades and drops 4\n * points into place. Settled open, the height is left alone, so content that\n * grows (streamed rows, new sources) is never clipped. Closed content is\n * hidden from screen readers and touches.\n */\nexport function Disclosure({\n  open,\n  reduce,\n  maxHeight,\n  style,\n  children,\n}: DisclosureProps) {\n  // The content's height, kept current by layout events; measuring on demand\n  // can read 0 for content inside a scroll view.\n  const contentHeight = useSharedValue(0);\n  const clipRef = useAnimatedRef<Animated.View>();\n  const height = useSharedValue(open ? NATURAL : 0);\n  const shown = useSharedValue(open ? 1 : 0);\n  const mounted = useRef(false);\n\n  useEffect(() => {\n    // The first render is already in place.\n    if (!mounted.current) {\n      mounted.current = true;\n      return;\n    }\n    const cap = maxHeight ?? Number.POSITIVE_INFINITY;\n    scheduleOnUI(() => {\n      \"worklet\";\n      // Real sizes, read on the UI thread at the moment of the change.\n      const full = Math.min(contentHeight.value, cap);\n      if (open) {\n        const from = height.value === NATURAL ? full : height.value;\n        if (reduce) {\n          height.value = NATURAL;\n        } else {\n          height.value = from;\n          height.value = withTiming(full, OPEN, (done) => {\n            if (done) height.value = NATURAL;\n          });\n        }\n      } else {\n        const clip = measure(clipRef);\n        const from =\n          height.value === NATURAL ? (clip?.height ?? full) : height.value;\n        height.value = from;\n        height.value = reduce ? 0 : withTiming(0, CLOSE);\n      }\n    });\n    shown.value = withTiming(\n      open ? 1 : 0,\n      reduce ? { duration: 0 } : open ? OPEN : CLOSE,\n    );\n  }, [clipRef, contentHeight, height, maxHeight, open, reduce, shown]);\n\n  const clipStyle = useAnimatedStyle(() =>\n    // Settled open, the clip follows the content's measured height.\n    height.value === NATURAL\n      ? {\n          height: Math.min(\n            contentHeight.value,\n            maxHeight ?? Number.POSITIVE_INFINITY,\n          ),\n        }\n      : { height: height.value },\n  );\n  const contentStyle = useAnimatedStyle(\n    () => ({\n      opacity: shown.value,\n      transform: [{ translateY: reduce ? 0 : (1 - shown.value) * -DROP }],\n    }),\n    [reduce],\n  );\n\n  return (\n    <Animated.View\n      ref={clipRef}\n      pointerEvents={open ? \"auto\" : \"none\"}\n      accessibilityElementsHidden={!open}\n      importantForAccessibility={open ? \"auto\" : \"no-hide-descendants\"}\n      style={[styles.clip, clipStyle, style]}\n    >\n      {/* Absolutely placed, so the content keeps its natural height while the\n          clip around it is short, and can be measured at any time. */}\n      <Animated.View style={[styles.content, contentStyle]}>\n        <View\n          style={styles.measure}\n          onLayout={({ nativeEvent }) => {\n            contentHeight.value = nativeEvent.layout.height;\n          }}\n        >\n          {children}\n        </View>\n      </Animated.View>\n    </Animated.View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  clip: { overflow: \"hidden\" },\n  content: { position: \"absolute\", left: 0, right: 0, top: 0 },\n  measure: { flexShrink: 0 },\n});\n","type":"shared"},{"path":"src/primitives/roll-text.tsx","content":"import { useEffect, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\nimport Animated, {\n  useAnimatedStyle,\n  useSharedValue,\n  withSpring,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { usePresence } from \"../hooks/use-presence\";\nimport { EASE_OUT, SPRING_SWAP } from \"../styles/motion\";\n\nconst EXIT = { duration: 140, easing: EASE_OUT };\nconst TRAVEL = 0.9;\n\n/** Progress runs 0 (below) → 1 (resting) → 2 (rolled away above). */\nfunction Layer({\n  text,\n  appear,\n  exiting,\n  reduce,\n  height,\n  className,\n  lines,\n}: {\n  text: string;\n  appear: boolean;\n  exiting: boolean;\n  reduce: boolean;\n  height: number;\n  className: string;\n  lines?: number;\n}) {\n  const progress = useSharedValue(appear && !reduce ? 0 : 1);\n\n  useEffect(() => {\n    if (reduce) {\n      progress.value = exiting ? 2 : 1;\n      return;\n    }\n    progress.value = exiting ? withTiming(2, EXIT) : withSpring(1, SPRING_SWAP);\n  }, [exiting, progress, reduce]);\n\n  const style = useAnimatedStyle(() => {\n    const p = progress.value;\n    return {\n      opacity: Math.max(0, Math.min(1, p <= 1 ? p : 2 - p)),\n      transform: [{ translateY: (1 - p) * height * TRAVEL }],\n    };\n  }, [height]);\n\n  return (\n    <Animated.View style={[styles.layer, style]}>\n      <Text numberOfLines={lines} className={className}>\n        {text}\n      </Text>\n    </Animated.View>\n  );\n}\n\nexport type RollTextProps = {\n  /** Changing the value rolls the new text in; defaults to the text itself. */\n  value?: string;\n  text: string;\n  className: string;\n  reduce: boolean;\n  /** Lines before truncating. Defaults to 1; pass 0 to wrap freely. */\n  numberOfLines?: number;\n};\n\n/**\n * Text that rolls up when it changes: the new line rises in from below as the\n * old one rolls up and away. Clipped to its own lines, so only the text moves.\n */\nexport function RollText({\n  value,\n  text,\n  className,\n  reduce,\n  numberOfLines = 1,\n}: RollTextProps) {\n  const lines = numberOfLines === 0 ? undefined : numberOfLines;\n  const [height, setHeight] = useState(16);\n  const items = usePresence(value ?? text, text, () =>\n    reduce ? 0 : EXIT.duration + 40,\n  );\n\n  return (\n    <View style={styles.slot}>\n      {/* Sizes the slot to the current text. */}\n      <Text\n        numberOfLines={lines}\n        className={className}\n        style={styles.sizer}\n        onLayout={({ nativeEvent }) => setHeight(nativeEvent.layout.height)}\n      >\n        {text}\n      </Text>\n      {items.map((item) => (\n        <Layer\n          key={item.key}\n          text={item.value}\n          appear={item.appear}\n          exiting={item.exiting}\n          reduce={reduce}\n          height={height}\n          className={className}\n          lines={lines}\n        />\n      ))}\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  slot: { overflow: \"hidden\", flexShrink: 1, minWidth: 0 },\n  sizer: { opacity: 0 },\n  layer: { position: \"absolute\", left: 0, right: 0, top: 0 },\n});\n","type":"shared"},{"path":"src/primitives/running-bar.tsx","content":"import { useEffect, useState } from \"react\";\nimport { StyleSheet, View } from \"react-native\";\nimport Animated, {\n  cancelAnimation,\n  useAnimatedStyle,\n  useSharedValue,\n  withRepeat,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { EASE_IN_OUT } from \"../styles/motion\";\n\n/**\n * A thin bar that slides along a card's bottom edge while work runs. Place it\n * last inside a card with `overflow: hidden`. Reduced motion shows a still tint.\n */\nexport function RunningBar({ reduce }: { reduce: boolean }) {\n  const [width, setWidth] = useState(0);\n  const x = useSharedValue(0);\n  useEffect(() => {\n    if (reduce || width === 0) return;\n    x.value = 0;\n    x.value = withRepeat(\n      withTiming(1, { duration: 1200, easing: EASE_IN_OUT }),\n      -1,\n      false,\n    );\n    return () => cancelAnimation(x);\n  }, [reduce, width, x]);\n  const style = useAnimatedStyle(() => ({\n    transform: [{ translateX: -width * 0.35 + x.value * width * 1.35 }],\n  }));\n  return (\n    <View\n      pointerEvents=\"none\"\n      style={styles.bar}\n      onLayout={({ nativeEvent }) => setWidth(nativeEvent.layout.width)}\n    >\n      {reduce ? (\n        <View style={StyleSheet.absoluteFill} className=\"bg-primary/40\" />\n      ) : (\n        <Animated.View style={[styles.fill, style]} className=\"bg-primary\" />\n      )}\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  bar: {\n    position: \"absolute\",\n    left: 0,\n    right: 0,\n    bottom: 0,\n    height: 2,\n    overflow: \"hidden\",\n  },\n  fill: {\n    position: \"absolute\",\n    left: 0,\n    top: 0,\n    bottom: 0,\n    width: \"35%\",\n    borderRadius: 1,\n  },\n});\n","type":"shared"},{"path":"src/primitives/spin-glyph.tsx","content":"import { useEffect } from \"react\";\nimport type { ColorValue } from \"react-native\";\nimport Animated, {\n  cancelAnimation,\n  Easing,\n  ReduceMotion,\n  useAnimatedStyle,\n  useSharedValue,\n  withRepeat,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { RingGlyph } from \"./agent-icons\";\n\n/**\n * A spinning ring for busy states. Reduced motion holds it still; the ring\n * still reads as \"in progress\".\n */\nexport function SpinGlyph({\n  size = 16,\n  color,\n  reduce,\n}: {\n  size?: number;\n  color?: ColorValue;\n  reduce: boolean;\n}) {\n  const turn = useSharedValue(0);\n\n  useEffect(() => {\n    if (reduce) {\n      cancelAnimation(turn);\n      turn.value = 0;\n      return;\n    }\n    turn.value = 0;\n    turn.value = withRepeat(\n      withTiming(1, {\n        duration: 900,\n        easing: Easing.linear,\n        reduceMotion: ReduceMotion.Never,\n      }),\n      -1,\n      false,\n    );\n    return () => cancelAnimation(turn);\n  }, [reduce, turn]);\n\n  const style = useAnimatedStyle(() => ({\n    transform: [{ rotate: `${turn.value * 360}deg` }],\n  }));\n\n  return (\n    <Animated.View style={style}>\n      <RingGlyph size={size} color={color} />\n    </Animated.View>\n  );\n}\n","type":"shared"},{"path":"src/styles/motion.ts","content":"import { Easing, ReduceMotion } from \"react-native-reanimated\";\n\n// Mirrors beUI's lib/ease.ts so native motion matches the web library.\n\nexport const EASE_OUT = Easing.bezier(0.16, 1, 0.3, 1);\nexport const EASE_IN_OUT = Easing.bezier(0.77, 0, 0.175, 1);\n\n/** Press feedback on buttons and other tappable surfaces. */\nexport const SPRING_PRESS = {\n  stiffness: 500,\n  damping: 30,\n  mass: 0.6,\n  reduceMotion: ReduceMotion.System,\n} as const;\n\n/** Content swaps: label and icon slots trading places inside a control. */\nexport const SPRING_SWAP = {\n  stiffness: 460,\n  damping: 30,\n  mass: 0.55,\n  reduceMotion: ReduceMotion.System,\n} as const;\n\n/** Shared-layout glides: pills, indicators and panels moving between positions. */\nexport const SPRING_LAYOUT = {\n  stiffness: 360,\n  damping: 32,\n  mass: 0.6,\n  reduceMotion: ReduceMotion.System,\n} as const;\n\n/** Dragged handles and fills; critically damped so values never rebound off an end. */\nexport const SPRING_GLIDE = {\n  stiffness: 700,\n  damping: 50,\n  mass: 0.5,\n  reduceMotion: ReduceMotion.System,\n} as const;\n\nexport const motion = {\n  press: SPRING_PRESS,\n  swap: SPRING_SWAP,\n  layout: SPRING_LAYOUT,\n  glide: SPRING_GLIDE,\n  exit: { duration: 160, easing: EASE_OUT, reduceMotion: ReduceMotion.System },\n  fade: { duration: 150, reduceMotion: ReduceMotion.System },\n} as const;\n","type":"shared"},{"path":"src/styles/theme.css","content":"/* Matches the default beUI palette in ui-components/lib/themes.ts.\n   Native surface maps to card; muted maps to muted-foreground. */\n@layer theme {\n  :root {\n    @variant light {\n      --color-background: oklch(99% 0 0);\n      --color-surface: oklch(97% 0 0);\n      --color-foreground: oklch(15% 0 0);\n      --color-muted: oklch(50% 0 0);\n      --color-border: oklch(15% 0 0 / 0.06);\n      --color-border-strong: oklch(15% 0 0 / 0.16);\n      --color-primary: #0285f7;\n      --color-on-primary: #ffffff;\n      --color-destructive: #dc2626;\n      --color-success: #059669;\n      --color-warning: #d97706;\n    }\n  }\n\n  :root {\n    @variant dark {\n      --color-background: #151515;\n      --color-surface: #1c1c1c;\n      --color-foreground: oklch(96% 0 0);\n      --color-muted: oklch(62% 0 0);\n      --color-border: rgb(255 255 255 / 0.05);\n      --color-border-strong: rgb(255 255 255 / 0.14);\n      --color-primary: #0285f7;\n      --color-on-primary: #ffffff;\n      --color-destructive: #f87171;\n      --color-success: #34d399;\n      --color-warning: #fbbf24;\n    }\n  }\n\n  /* Tailwind's default monospace stack isn't a font React Native can load. */\n  :root {\n    @variant ios {\n      --font-mono: Menlo;\n    }\n  }\n\n  :root {\n    @variant android {\n      --font-mono: monospace;\n    }\n  }\n}\n","type":"theme"}]}