@flare-engine/ui 0.2.1 → 0.3.1

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/theme.ts","../src/focus.ts","../src/focus-context.ts","../src/focus-provider.tsx","../src/layout.ts","../src/panel.tsx","../src/label.tsx","../src/button.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/list.tsx","../src/modal.tsx","../src/dialogue-panel.tsx","../src/shop-panel.tsx","../src/main-menu-kit.tsx"],"sourcesContent":["export {\n darkTheme,\n lightTheme,\n ThemeProvider,\n useTheme,\n type Theme,\n type ThemeColors,\n type ThemeSpacing,\n type ThemeTypography,\n type ThemeRadii,\n type ThemeProviderProps,\n} from './theme.js';\nexport {\n createFocusManager,\n type FocusManager,\n type FocusNode,\n} from './focus.js';\nexport { FocusContext, useFocusManager } from './focus-context.js';\nexport { FocusProvider, type FocusProviderProps } from './focus-provider.js';\nexport {\n resolveLayout,\n type LayoutChild,\n type LayoutContainer,\n type LayoutRect,\n type FlexDirection,\n type JustifyContent,\n type AlignItems,\n type Padding,\n} from './layout.js';\nexport { Panel, type PanelProps } from './panel.js';\nexport {\n Label,\n type LabelProps,\n type LabelVariant,\n type LabelTone,\n} from './label.js';\nexport { Button, type ButtonProps, type ButtonVariant } from './button.js';\nexport { ProgressBar, type ProgressBarProps } from './progress-bar.js';\nexport { HUDBar, type HUDBarProps, type HUDBarKind } from './hud-bar.js';\nexport { List, type ListProps } from './list.js';\nexport { Modal, type ModalProps } from './modal.js';\nexport {\n DialoguePanel,\n type DialoguePanelProps,\n type DialogueChoice,\n} from './dialogue-panel.js';\nexport { ShopPanel, type ShopPanelProps, type ShopItem } from './shop-panel.js';\nexport {\n MainMenuKit,\n type MainMenuKitProps,\n type MainMenuItem,\n} from './main-menu-kit.js';\n","import { type ReactNode, createContext, createElement, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n if (focusedId === null && !node.disabled) {\n // Auto-focus first registered interactive node.\n setFocused(node.id);\n }\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport const FocusContext = createContext<FocusManager | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n return useContext(FocusContext);\n}\n","import { type ReactNode, createElement, useEffect, useState } from 'react';\nimport { FocusContext } from './focus-context.js';\nimport { type FocusManager, createFocusManager } from './focus.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and exposes it\n * through `FocusContext`. Also triggers a re-render whenever focus moves,\n * so primitives that read `focusedId` update their focus ring.\n */\nexport function FocusProvider({ manager, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [, force] = useState(0);\n\n useEffect(() => {\n return mgr.subscribe(() => {\n force((n) => n + 1);\n });\n }, [mgr]);\n\n return createElement(FocusContext.Provider, { value: mgr }, children);\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: ViewStyle;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Text, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: TextStyle;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return <Text style={[base, style]}>{children}</Text>;\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: ViewStyle;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = manager?.getFocused() === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: ViewStyle;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: ViewStyle;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: ViewStyle;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Extracted from Pan Tvardowski per Phase 11.14 (M9.4). Portrait resolution\n * is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: ViewStyle;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Extracted from Pan Tvardowski per Phase 11.14 (M9.3). Price strings and\n * ownership copy are caller-provided so the UI kit stays localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: ViewStyle;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Extracted from Pan Tvardowski per Phase 11.14 (M9.1). Save-slot / settings\n * / credits panels are built on top of this kit by the consumer; the kit\n * itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyE;AAmDlE,IAAM,YAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAAA,EAChD,YAAY;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,MAAM,KAAK;AACrD;AAEO,IAAM,aAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,MAAM;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AAAA,QACzB;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,sDAAC,SAAM,SAAQ,MAAK,MAAK,UAAS,OAAO,EAAE,cAAc,MAAM,QAAQ,GAAG,GACvE,iBACH;AAAA,QACC,aAAa,SACZ,8CAAC,SAAM,SAAQ,MAAK,MAAK,SAAQ,OAAO,EAAE,cAAc,MAAM,QAAQ,GAAG,GACtE,oBACH,IAEA,8CAAC,8BAAK,OAAO,EAAE,QAAQ,MAAM,QAAQ,GAAG,GAAG;AAAA,QAE7C,8CAAC,8BAAK,OAAO,EAAE,WAAW,WAAW,UAAU,KAAK,OAAO,OAAO,GAC/D,gBAAM,IAAI,CAAC,MAAM,MAChB,8CAAC,8BAAmB,OAAO,EAAE,WAAW,MAAM,IAAI,IAAI,MAAM,QAAQ,GAAG,GACrE;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,KAAK;AAAA,YACZ,SAAS,KAAK;AAAA,YACd,SAAS,KAAK,WAAW;AAAA,YACzB,UAAU,KAAK;AAAA,YACf,SAAS,KAAK;AAAA,YACd,UAAU;AAAA;AAAA,QACZ,KARS,KAAK,EAShB,CACD,GACH;AAAA,QACC,WAAW,SAAY,8CAAC,8BAAK,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG,GAAI,kBAAO,IAAU;AAAA;AAAA;AAAA,EAC1F;AAEJ;","names":["import_react","import_react","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime"]}
1
+ {"version":3,"file":"index.js","names":["Pressable","View","Text","StyleSheet","Text","View","View","Pressable","View","View","View","Fragment","View","View","Pressable","View"],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-keyboard-driver.ts","../src/focus-provider.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/shop-panel.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport interface FocusContextValue {\n manager: FocusManager;\n focusedId: string | null;\n}\n\nexport const FocusContext = createContext<FocusContextValue | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.manager : null;\n}\n\nexport function useFocusedId(): string | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.focusedId : null;\n}\n","import { createContext, createElement, type ReactNode, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, type StyleProp, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusedId, useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const focusedId = useFocusedId();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = focusedId === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { type StyleProp, Text, type TextProps, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: StyleProp<TextStyle>;\n numberOfLines?: number;\n ellipsizeMode?: TextProps['ellipsizeMode'];\n adjustsFontSizeToFit?: boolean;\n minimumFontScale?: number;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n numberOfLines,\n ellipsizeMode,\n adjustsFontSizeToFit,\n minimumFontScale,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return (\n <Text\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n minimumFontScale={minimumFontScale}\n style={[base, style]}\n >\n {children}\n </Text>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Portrait resolution is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static choice list, never reordered\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n /** Explicit opt-in initial focus: focuses the first node in tab order (or clears if empty). */\n focusFirst(): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n // No focus side-effect: on a touch-first engine an auto-focused first\n // registrant paints a permanent focus ring with no input. Focus stays null\n // until a driver (keyboard/gamepad) or an explicit focusFirst() acts.\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n focusFirst() {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import type { FocusManager } from './focus.js';\n\n/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */\nexport interface FocusKeySource {\n wasPressed(code: string): boolean;\n}\n\nexport interface FocusKeyboardDriver {\n /** Call once per frame; polls edges and drives the manager. */\n update(): void;\n}\n\nexport interface FocusKeyboardDriverOptions {\n next?: readonly string[];\n prev?: readonly string[];\n activate?: readonly string[];\n}\n\nconst DEFAULT_NEXT: readonly string[] = ['ArrowDown', 'ArrowRight', 'Tab'];\nconst DEFAULT_PREV: readonly string[] = ['ArrowUp', 'ArrowLeft'];\nconst DEFAULT_ACTIVATE: readonly string[] = ['Enter', 'Space'];\n\nexport function createFocusKeyboardDriver(\n manager: FocusManager,\n keys: FocusKeySource,\n options?: FocusKeyboardDriverOptions,\n): FocusKeyboardDriver {\n const nextCodes = options?.next ?? DEFAULT_NEXT;\n const prevCodes = options?.prev ?? DEFAULT_PREV;\n const activateCodes = options?.activate ?? DEFAULT_ACTIVATE;\n\n return {\n update(): void {\n for (let i = 0; i < nextCodes.length; i++) {\n if (keys.wasPressed(nextCodes[i]!)) {\n manager.next();\n return;\n }\n }\n for (let i = 0; i < prevCodes.length; i++) {\n if (keys.wasPressed(prevCodes[i]!)) {\n manager.prev();\n return;\n }\n }\n for (let i = 0; i < activateCodes.length; i++) {\n if (keys.wasPressed(activateCodes[i]!)) {\n manager.activate();\n return;\n }\n }\n },\n };\n}\n","import { createElement, type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { createFocusManager, type FocusManager } from './focus.js';\nimport { FocusContext, type FocusContextValue } from './focus-context.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n /**\n * Opt-in initial focus: focus the tab-order first node once, at the commit\n * where this provider mounts. Off by default so a touch-first tree shows no\n * focus ring until a driver acts. This is mount-time only — it picks among the\n * nodes registered by that first commit and does not re-fire for children that\n * mount later (async/lazy sets). For a dynamic set drive focus explicitly\n * (a keyboard/gamepad driver, or manager.focusFirst()).\n */\n autoFocus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and publishes\n * { manager, focusedId } as context state so consumers re-render on focus\n * moves.\n */\nexport function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [focusedId, setFocusedId] = useState<string | null>(() => mgr.getFocused());\n\n useEffect(() => {\n setFocusedId(mgr.getFocused());\n return mgr.subscribe((id) => {\n setFocusedId(id);\n });\n }, [mgr]);\n\n useEffect(() => {\n // Child register effects run before this parent effect, so every node is\n // registered here → focusFirst() picks the true tab-order first.\n if (autoFocus && mgr.getFocused() === null) mgr.focusFirst();\n }, [autoFocus, mgr]);\n\n const value = useMemo<FocusContextValue>(() => ({ manager: mgr, focusedId }), [mgr, focusedId]);\n\n return createElement(FocusContext.Provider, { value }, children);\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Save-slot / settings / credits panels are built on top of this kit by the\n * consumer; the kit itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Price strings and ownership copy are caller-provided so the UI kit stays\n * localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n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