@flare-engine/ui 0.4.16 → 0.4.17

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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as FocusManager, c as createFocusManager, i as createFocusKeyboardDriver, n as FocusKeyboardDriver, o as FocusManagerOptions, r as FocusKeyboardDriverOptions, s as FocusNode, t as FocusKeySource } from "./focus-ILunQnll.mjs";
2
- import { ReactNode } from "react";
3
- import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
2
+ import { ReactNode, Ref } from "react";
3
+ import { StyleProp, Text, TextProps, TextStyle, View, ViewStyle } from "react-native";
4
4
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
5
5
  interface ButtonProps {
6
6
  label: string;
@@ -18,8 +18,10 @@ interface ButtonProps {
18
18
  */
19
19
  focusOnPress?: boolean;
20
20
  style?: StyleProp<ViewStyle>;
21
+ /** Passed to the root `Pressable`, whose instance is a `View`. */
22
+ ref?: Ref<View>;
21
23
  }
22
- export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, focusOnPress, style }: ButtonProps): ReactNode;
24
+ export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, focusOnPress, style, ref }: ButtonProps): ReactNode;
23
25
  interface DialogueChoice {
24
26
  /** Display label (already localized by the caller). */
25
27
  readonly label: string;
@@ -104,8 +106,10 @@ interface LabelProps {
104
106
  ellipsizeMode?: TextProps['ellipsizeMode'];
105
107
  adjustsFontSizeToFit?: boolean;
106
108
  minimumFontScale?: number;
109
+ /** Passed to the root `Text`. */
110
+ ref?: Ref<Text>;
107
111
  }
108
- export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
112
+ export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale, ref }: LabelProps): ReactNode;
109
113
  /**
110
114
  * Minimal flex-like layout resolver.
111
115
  *
@@ -216,8 +220,10 @@ interface PanelProps {
216
220
  /** Corner radius token. Defaults to 'md'. */
217
221
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
218
222
  style?: StyleProp<ViewStyle>;
223
+ /** Passed to the root `View`. */
224
+ ref?: Ref<View>;
219
225
  }
220
- export declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
226
+ export declare function Panel({ children, variant, padding, radius, style, ref }: PanelProps): ReactNode;
221
227
  interface ProgressBarProps {
222
228
  /** Progress in [0, 1]. Values outside are clamped. */
223
229
  value: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus-context.ts","../src/focus-provider.tsx","../src/hud-bar.tsx","../src/label.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/panel.tsx","../src/progress-bar.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;;;;;;EAMA;EACA,QAAQ,UAAU;;wBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,cACA,SACC,cAAc;UC3BA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;wBAUb,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;UC9CP;EACf,SAAS;EACT;;qBAGW,8BAAY,QAAA;wBAET,mBAAmB;wBAKnB;UCXC;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;wBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;wBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EAC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qB;wBAIpE,YAAY"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus-context.ts","../src/focus-provider.tsx","../src/hud-bar.tsx","../src/label.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/panel.tsx","../src/progress-bar.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;;;;;;EAMA;EACA,QAAQ,UAAU;;EAElB,MAAM,IAAI;;wBAGI,SACd,OACA,SACA,SACA,UACA,UACA,SACA,cACA,OACA,OACC,cAAc;UC9BA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;wBAUb,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;UC9CP;EACf,SAAS;EACT;;qBAGW,8BAAY,QAAA;wBAET,mBAAmB;wBAKnB;UCXC;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;wBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;wBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ,UAAU;EAClB;EACA,gBAAgB;EAChB;EACA;;EAEA,MAAM,IAAI;;wBAGI,QACd,UACA,SACA,MACA,MACA,OACA,eACA,eACA,sBACA,kBACA,OACC,aAAa;;;;;;;;;;;;KCpBJ;KACA;KAOA;UAEK;EACf;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,WAAW;EACX;EACA,UAAU,QAAQ;EAClB,iBAAiB;EACjB,aAAa;;UAGE;EACf;EACA;EACA;EACA;;wBAec,cACd,WAAW,iBACX,mBAAmB,gBAClB;UClEc;EACf,WAAW;;EAEX;EACA;EACA,QAAQ,UAAU;;;;;;wBAOJ,OAAO,UAAU,KAAK,WAAsB,SAAS,YAAY;UCVhE;;WAEN;;WAEA;WACA;WACA,UAAU;WACV;;UAGM;;WAEN;;WAEA;;WAEA,gBAAgB;;;;;WAKhB,SAAS;WACT,QAAQ,UAAU;;;;;;;;;wBAUb,cACd,OACA,UACA,OACA,QACA,SACC,mBAAmB;UCxCL;EACf;EACA,WAAW;;EAEX;;EAEA;;;;;;;wBAQc,QACd,SACA,UACA,iBACA,mBACC,aAAa;UCnBC;EACf,WAAW;;EAEX;;EAEA;;EAEA;EACA,QAAQ,UAAU;;EAElB,MAAM,IAAI;;wBAGI,QACd,UACA,SACA,SACA,QACA,OACA,OACC,aAAa;UCpBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;UCpBL;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;qBAGI,WAAW;qBA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;wBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;wBAIpE,YAAY"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as FocusManager, c as createFocusManager, i as createFocusKeyboardDriver, n as FocusKeyboardDriver, o as FocusManagerOptions, r as FocusKeyboardDriverOptions, s as FocusNode, t as FocusKeySource } from "./focus-ILunQnll.js";
2
- import { ReactNode } from "react";
3
- import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
2
+ import { ReactNode, Ref } from "react";
3
+ import { StyleProp, Text, TextProps, TextStyle, View, ViewStyle } from "react-native";
4
4
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
5
5
  interface ButtonProps {
6
6
  label: string;
@@ -18,8 +18,10 @@ interface ButtonProps {
18
18
  */
19
19
  focusOnPress?: boolean;
20
20
  style?: StyleProp<ViewStyle>;
21
+ /** Passed to the root `Pressable`, whose instance is a `View`. */
22
+ ref?: Ref<View>;
21
23
  }
22
- export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, focusOnPress, style }: ButtonProps): ReactNode;
24
+ export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, focusOnPress, style, ref }: ButtonProps): ReactNode;
23
25
  interface DialogueChoice {
24
26
  /** Display label (already localized by the caller). */
25
27
  readonly label: string;
@@ -104,8 +106,10 @@ interface LabelProps {
104
106
  ellipsizeMode?: TextProps['ellipsizeMode'];
105
107
  adjustsFontSizeToFit?: boolean;
106
108
  minimumFontScale?: number;
109
+ /** Passed to the root `Text`. */
110
+ ref?: Ref<Text>;
107
111
  }
108
- export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
112
+ export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale, ref }: LabelProps): ReactNode;
109
113
  /**
110
114
  * Minimal flex-like layout resolver.
111
115
  *
@@ -216,8 +220,10 @@ interface PanelProps {
216
220
  /** Corner radius token. Defaults to 'md'. */
217
221
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
218
222
  style?: StyleProp<ViewStyle>;
223
+ /** Passed to the root `View`. */
224
+ ref?: Ref<View>;
219
225
  }
220
- export declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
226
+ export declare function Panel({ children, variant, padding, radius, style, ref }: PanelProps): ReactNode;
221
227
  interface ProgressBarProps {
222
228
  /** Progress in [0, 1]. Values outside are clamped. */
223
229
  value: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus-context.ts","../src/focus-provider.tsx","../src/hud-bar.tsx","../src/label.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/panel.tsx","../src/progress-bar.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;;;;;;EAMA;EACA,QAAQ,UAAU;;wBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,cACA,SACC,cAAc;UC3BA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;wBAUb,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;UC9CP;EACf,SAAS;EACT;;qBAGW,8BAAY,QAAA;wBAET,mBAAmB;wBAKnB;UCXC;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;wBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;wBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ,UAAU;EAClB;EACA,gBAAgB;EAChB;EACA;;wBAGc,QACd,UACA,SACA,MACA,MACA,OACA,eACA,eACA,sBACA,oBACC,aAAa;;;;;;;;;;;;KCjBJ;KACA;KAOA;UAEK;EACf;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,WAAW;EACX;EACA,UAAU,QAAQ;EAClB,iBAAiB;EACjB,aAAa;;UAGE;EACf;EACA;EACA;EACA;;wBAec,cACd,WAAW,iBACX,mBAAmB,gBAClB;UClEc;EACf,WAAW;;EAEX;EACA;EACA,QAAQ,UAAU;;;;;;wBAOJ,OAAO,UAAU,KAAK,WAAsB,SAAS,YAAY;UCVhE;;WAEN;;WAEA;WACA;WACA,UAAU;WACV;;UAGM;;WAEN;;WAEA;;WAEA,gBAAgB;;;;;WAKhB,SAAS;WACT,QAAQ,UAAU;;;;;;;;;wBAUb,cACd,OACA,UACA,OACA,QACA,SACC,mBAAmB;UCxCL;EACf;EACA,WAAW;;EAEX;;EAEA;;;;;;;wBAQc,QACd,SACA,UACA,iBACA,mBACC,aAAa;UCnBC;EACf,WAAW;;EAEX;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,QACd,UACA,SACA,SACA,QACA,SACC,aAAa;UCjBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;UCpBL;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;qBAGI,WAAW;qBA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;wBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;wBAIpE,YAAY"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus-context.ts","../src/focus-provider.tsx","../src/hud-bar.tsx","../src/label.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/panel.tsx","../src/progress-bar.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;;;;;;EAMA;EACA,QAAQ,UAAU;;EAElB,MAAM,IAAI;;wBAGI,SACd,OACA,SACA,SACA,UACA,UACA,SACA,cACA,OACA,OACC,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EAEX;;EAEA;;EAEA;EACA,QAAQ,UAAU;;EAElB,MAAM,IAAI;;wBAGI,QACd,UACA,SACA,SACA,QACA,OACA,OACC,aAAa;UCpBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;UCpBL;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;qBAGI,WAAW;qBA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;wBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;wBAIpE,YAAY"}
package/dist/index.js CHANGED
@@ -98,7 +98,7 @@ function useTheme() {
98
98
  return (0, react.useContext)(ThemeContext);
99
99
  }
100
100
  // src/button.tsx
101
- function Button({ label, onPress, variant = "primary", disabled = false, tabIndex = 0, focusId, focusOnPress = true, style }) {
101
+ function Button({ label, onPress, variant = "primary", disabled = false, tabIndex = 0, focusId, focusOnPress = true, style, ref }) {
102
102
  const theme = useTheme();
103
103
  const manager = useFocusManager();
104
104
  const focusedId = useFocusedId();
@@ -177,6 +177,7 @@ function Button({ label, onPress, variant = "primary", disabled = false, tabInde
177
177
  opacity: disabled ? .5 : 1
178
178
  };
179
179
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
180
+ ref,
180
181
  onPress: () => {
181
182
  if (disabled) return;
182
183
  if (focusOnPress) manager?.focus(id);
@@ -210,7 +211,7 @@ const styles = react_native.StyleSheet.create({ wrap: {
210
211
  justifyContent: "center"
211
212
  } });
212
213
  // src/label.tsx
213
- function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }) {
214
+ function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale, ref }) {
214
215
  const theme = useTheme();
215
216
  const sizeMap = {
216
217
  xs: theme.typography.sizeXs,
@@ -232,6 +233,7 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
232
233
  fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily
233
234
  };
234
235
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
236
+ ref,
235
237
  numberOfLines,
236
238
  ellipsizeMode,
237
239
  adjustsFontSizeToFit,
@@ -241,7 +243,7 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
241
243
  });
242
244
  }
243
245
  // src/panel.tsx
244
- function Panel({ children, variant = "surface", padding = "md", radius = "md", style }) {
246
+ function Panel({ children, variant = "surface", padding = "md", radius = "md", style, ref }) {
245
247
  const theme = useTheme();
246
248
  const base = {
247
249
  backgroundColor: variant === "elevated" ? theme.colors.surfaceAlt : theme.colors.surface,
@@ -251,6 +253,7 @@ function Panel({ children, variant = "surface", padding = "md", radius = "md", s
251
253
  borderColor: theme.colors.border
252
254
  };
253
255
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
256
+ ref,
254
257
  style: [base, style],
255
258
  children
256
259
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createContext","useContext","createContext","createElement","useContext","useId","useRef","useEffect","Pressable","View","Text","StyleSheet","Text","View","View","Pressable","useState","createFocusManager","useEffect","useMemo","createElement","View","View","Children","View","Fragment","View","View","Pressable"],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../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"],"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, useRef } 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 /**\n * Move focus to this button when it is pressed. Defaults to `true`. Set\n * `false` on touch-first screens so a tap leaves no focus ring behind;\n * `onPress` still fires.\n */\n focusOnPress?: boolean;\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 focusOnPress = true,\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 const latest = useRef({ onPress, disabled, tabIndex });\n latest.current = { onPress, disabled, tabIndex };\n const activateRef = useRef(() => {\n const { onPress: press, disabled: off } = latest.current;\n if (!off) press?.();\n });\n\n // Register once per (manager, id) and own the disposer; prop changes below\n // re-register in place so focus and tab order survive parent re-renders.\n useEffect(() => {\n if (!manager) return;\n const { tabIndex: order, disabled: off } = latest.current;\n return manager.register({\n id,\n tabIndex: order,\n disabled: off,\n onActivate: activateRef.current,\n });\n }, [manager, id]);\n\n useEffect(() => {\n if (!manager) return;\n manager.register({ id, tabIndex, disabled, onActivate: activateRef.current });\n }, [manager, id, tabIndex, disabled]);\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 if (focusOnPress) 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","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 { Children, 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 // `Children.toArray` flattens nested arrays (e.g. a `{items.map(...)}` child\n // sitting alongside JSX siblings) and drops null/undefined/boolean, unlike a\n // manual `Array.isArray` split which only unwraps one level.\n const flat = Children.toArray(children);\n for (const child of flat) {\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"],"mappings":";;;;;;AAQA,MAAa,gBAAA,GAAeA,MAAAA,cAAAA,CAAwC,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,OAAA,GAAMC,MAAAA,WAAAA,CAAW,YAAY;CACnC,OAAO,MAAM,IAAI,UAAU;AAC7B;AAEA,SAAgB,eAA8B;CAC5C,MAAM,OAAA,GAAMA,MAAAA,WAAAA,CAAW,YAAY;CACnC,OAAO,MAAM,IAAI,YAAY;AAC/B;;ACiCA,MAAa,YAAmB;CAC9B,MAAM;CACN,QAAQ;EACN,IAAI;EACJ,SAAS;EACT,YAAY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;GAAa,CAAA,IAAI;EACpF;;AAEV;;;;;;;ACnEA,SAAgB,MAAM,EACpB,SACA,UACA,iBACA,kBAAkB,MACM;CACxB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,aAAAA,MAAD;EACE,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,YAAY;GACZ,gBAAgB;EAClB;EACA,eAAc;EAVhB,UAAA,CAYE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,WAAD;GACE,SAAS;GACT,OAAO;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,iBAAiB,cAAc,gBAAgB;GACjD;EACD,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAO,SAAQ;GAAW,SAAQ;GAAK,OAAO;IAAE,UAAU;IAAK,UAAU;GAAM;GAC5E;EACI,CAAA,CACH;;AAEV"}
1
+ {"version":3,"file":"index.js","names":["createContext","useContext","createContext","createElement","useContext","useId","useRef","useEffect","Pressable","View","Text","StyleSheet","Text","View","View","Pressable","useState","createFocusManager","useEffect","useMemo","createElement","View","View","Children","View","Fragment","View","View","Pressable"],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../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"],"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, type Ref, useEffect, useId, useRef } 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 /**\n * Move focus to this button when it is pressed. Defaults to `true`. Set\n * `false` on touch-first screens so a tap leaves no focus ring behind;\n * `onPress` still fires.\n */\n focusOnPress?: boolean;\n style?: StyleProp<ViewStyle>;\n /** Passed to the root `Pressable`, whose instance is a `View`. */\n ref?: Ref<View>;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n focusOnPress = true,\n style,\n ref,\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 const latest = useRef({ onPress, disabled, tabIndex });\n latest.current = { onPress, disabled, tabIndex };\n const activateRef = useRef(() => {\n const { onPress: press, disabled: off } = latest.current;\n if (!off) press?.();\n });\n\n // Register once per (manager, id) and own the disposer; prop changes below\n // re-register in place so focus and tab order survive parent re-renders.\n useEffect(() => {\n if (!manager) return;\n const { tabIndex: order, disabled: off } = latest.current;\n return manager.register({\n id,\n tabIndex: order,\n disabled: off,\n onActivate: activateRef.current,\n });\n }, [manager, id]);\n\n useEffect(() => {\n if (!manager) return;\n manager.register({ id, tabIndex, disabled, onActivate: activateRef.current });\n }, [manager, id, tabIndex, disabled]);\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 ref={ref}\n onPress={() => {\n if (disabled) return;\n if (focusOnPress) 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, Ref } 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 /** Passed to the root `Text`. */\n ref?: Ref<Text>;\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 ref,\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 ref={ref}\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, Ref } 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 /** Passed to the root `View`. */\n ref?: Ref<View>;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n ref,\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 (\n <View ref={ref} style={[base, style]}>\n {children}\n </View>\n );\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","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 { Children, 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 // `Children.toArray` flattens nested arrays (e.g. a `{items.map(...)}` child\n // sitting alongside JSX siblings) and drops null/undefined/boolean, unlike a\n // manual `Array.isArray` split which only unwraps one level.\n const flat = Children.toArray(children);\n for (const child of flat) {\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"],"mappings":";;;;;;AAQA,MAAa,gBAAA,GAAeA,MAAAA,cAAAA,CAAwC,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,OAAA,GAAMC,MAAAA,WAAAA,CAAW,YAAY;CACnC,OAAO,MAAM,IAAI,UAAU;AAC7B;AAEA,SAAgB,eAA8B;CAC5C,MAAM,OAAA,GAAMA,MAAAA,WAAAA,CAAW,YAAY;CACnC,OAAO,MAAM,IAAI,YAAY;AAC/B;;ACiCA,MAAa,YAAmB;CAC9B,MAAM;CACN,QAAQ;EACN,IAAI;EACJ,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,WAAW;E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A,IAAI;EACpF;;AAEV;;;;;;;ACnEA,SAAgB,MAAM,EACpB,SACA,UACA,iBACA,kBAAkB,MACM;CACxB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,aAAAA,MAAD;EACE,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,YAAY;GACZ,gBAAgB;EAClB;EACA,eAAc;EAVhB,UAAA,CAYE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,WAAD;GACE,SAAS;GACT,OAAO;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,iBAAiB,cAAc,gBAAgB;GACjD;EACD,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAO,SAAQ;GAAW,SAAQ;GAAK,OAAO;IAAE,UAAU;IAAK,UAAU;GAAM;GAC5E;EACI,CAAA,CACH;;AAEV"}
package/dist/index.mjs CHANGED
@@ -97,7 +97,7 @@ function useTheme() {
97
97
  return useContext(ThemeContext);
98
98
  }
99
99
  // src/button.tsx
100
- function Button({ label, onPress, variant = "primary", disabled = false, tabIndex = 0, focusId, focusOnPress = true, style }) {
100
+ function Button({ label, onPress, variant = "primary", disabled = false, tabIndex = 0, focusId, focusOnPress = true, style, ref }) {
101
101
  const theme = useTheme();
102
102
  const manager = useFocusManager();
103
103
  const focusedId = useFocusedId();
@@ -176,6 +176,7 @@ function Button({ label, onPress, variant = "primary", disabled = false, tabInde
176
176
  opacity: disabled ? .5 : 1
177
177
  };
178
178
  return /* @__PURE__ */ jsx(Pressable, {
179
+ ref,
179
180
  onPress: () => {
180
181
  if (disabled) return;
181
182
  if (focusOnPress) manager?.focus(id);
@@ -209,7 +210,7 @@ const styles = StyleSheet.create({ wrap: {
209
210
  justifyContent: "center"
210
211
  } });
211
212
  // src/label.tsx
212
- function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }) {
213
+ function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale, ref }) {
213
214
  const theme = useTheme();
214
215
  const sizeMap = {
215
216
  xs: theme.typography.sizeXs,
@@ -231,6 +232,7 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
231
232
  fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily
232
233
  };
233
234
  return /* @__PURE__ */ jsx(Text, {
235
+ ref,
234
236
  numberOfLines,
235
237
  ellipsizeMode,
236
238
  adjustsFontSizeToFit,
@@ -240,7 +242,7 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
240
242
  });
241
243
  }
242
244
  // src/panel.tsx
243
- function Panel({ children, variant = "surface", padding = "md", radius = "md", style }) {
245
+ function Panel({ children, variant = "surface", padding = "md", radius = "md", style, ref }) {
244
246
  const theme = useTheme();
245
247
  const base = {
246
248
  backgroundColor: variant === "elevated" ? theme.colors.surfaceAlt : theme.colors.surface,
@@ -250,6 +252,7 @@ function Panel({ children, variant = "surface", padding = "md", radius = "md", s
250
252
  borderColor: theme.colors.border
251
253
  };
252
254
  return /* @__PURE__ */ jsx(View, {
255
+ ref,
253
256
  style: [base, style],
254
257
  children
255
258
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../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"],"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, useRef } 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 /**\n * Move focus to this button when it is pressed. Defaults to `true`. Set\n * `false` on touch-first screens so a tap leaves no focus ring behind;\n * `onPress` still fires.\n */\n focusOnPress?: boolean;\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 focusOnPress = true,\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 const latest = useRef({ onPress, disabled, tabIndex });\n latest.current = { onPress, disabled, tabIndex };\n const activateRef = useRef(() => {\n const { onPress: press, disabled: off } = latest.current;\n if (!off) press?.();\n });\n\n // Register once per (manager, id) and own the disposer; prop changes below\n // re-register in place so focus and tab order survive parent re-renders.\n useEffect(() => {\n if (!manager) return;\n const { tabIndex: order, disabled: off } = latest.current;\n return manager.register({\n id,\n tabIndex: order,\n disabled: off,\n onActivate: activateRef.current,\n });\n }, [manager, id]);\n\n useEffect(() => {\n if (!manager) return;\n manager.register({ id, tabIndex, disabled, onActivate: activateRef.current });\n }, [manager, id, tabIndex, disabled]);\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 if (focusOnPress) 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","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 { Children, 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 // `Children.toArray` flattens nested arrays (e.g. a `{items.map(...)}` child\n // sitting alongside JSX siblings) and drops null/undefined/boolean, unlike a\n // manual `Array.isArray` split which only unwraps one level.\n const flat = Children.toArray(children);\n for (const child of flat) {\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"],"mappings":";;;;;AAQA,MAAa,eAAe,cAAwC,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,MAAM,WAAW,YAAY;CACnC,OAAO,MAAM,IAAI,UAAU;AAC7B;AAEA,SAAgB,eAA8B;CAC5C,MAAM,MAAM,WAAW,YAAY;CACnC,OAAO,MAAM,IAAI,YAAY;AAC/B;;ACiCA,MAAa,YAAmB;CAC9B,MAAM;CACN,QAAQ;EACN,IAAI;EACJ,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,WAAW;EACX,QAAQ;EACR,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,SAAS;EACT,OAAO;CACT;CACA,SAAS;EAAE,IAAI;EAAG,IAAI;EAAG,IAAI;EAAI,IAAI;EAAI,IAAI;CAAG;CAChD,YAAY;EACV,QAAQ;EACR,QAAQ;EACR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AiB,cAAc,gBAAgB;GACjD;EACD,CAAA,GACD,oBAAC,OAAD;GAAO,SAAQ;GAAW,SAAQ;GAAK,OAAO;IAAE,UAAU;IAAK,UAAU;GAAM;GAC5E;EACI,CAAA,CACH;;AAEV"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../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"],"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, type Ref, useEffect, useId, useRef } 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 /**\n * Move focus to this button when it is pressed. Defaults to `true`. Set\n * `false` on touch-first screens so a tap leaves no focus ring behind;\n * `onPress` still fires.\n */\n focusOnPress?: boolean;\n style?: StyleProp<ViewStyle>;\n /** Passed to the root `Pressable`, whose instance is a `View`. */\n ref?: Ref<View>;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n focusOnPress = true,\n style,\n ref,\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 const latest = useRef({ onPress, disabled, tabIndex });\n latest.current = { onPress, disabled, tabIndex };\n const activateRef = useRef(() => {\n const { onPress: press, disabled: off } = latest.current;\n if (!off) press?.();\n });\n\n // Register once per (manager, id) and own the disposer; prop changes below\n // re-register in place so focus and tab order survive parent re-renders.\n useEffect(() => {\n if (!manager) return;\n const { tabIndex: order, disabled: off } = latest.current;\n return manager.register({\n id,\n tabIndex: order,\n disabled: off,\n onActivate: activateRef.current,\n });\n }, [manager, id]);\n\n useEffect(() => {\n if (!manager) return;\n manager.register({ id, tabIndex, disabled, onActivate: activateRef.current });\n }, [manager, id, tabIndex, disabled]);\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 ref={ref}\n onPress={() => {\n if (disabled) return;\n if (focusOnPress) 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, Ref } 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 /** Passed to the root `Text`. */\n ref?: Ref<Text>;\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 ref,\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 ref={ref}\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, Ref } 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 /** Passed to the root `View`. */\n ref?: Ref<View>;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n ref,\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 (\n <View ref={ref} style={[base, style]}>\n {children}\n </View>\n );\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","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 { Children, 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 // `Children.toArray` flattens nested arrays (e.g. a `{items.map(...)}` child\n // sitting alongside JSX siblings) and drops null/undefined/boolean, unlike a\n // manual `Array.isArray` split which only unwraps one level.\n const flat = Children.toArray(children);\n for (const child of flat) {\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"],"mappings":";;;;;AAQA,MAAa,eAAe,cAAwC,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,MAAM,WAAW,YAAY;CACnC,OAAO,MAAM,IAAI,UAAU;AAC7B;AAEA,SAAgB,eAA8B;CAC5C,MAAM,MAAM,WAAW,YAAY;CACnC,OAAO,MAAM,IAAI,YAAY;AAC/B;;ACiCA,MAAa,YAAmB;CAC9B,MAAM;CACN,QAAQ;EACN,IAAI;EACJ,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,WAAW;EACX,QAAQ;EACR,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,SAAS;EACT,OAAO;CACT;CACA,SAAS;EAAE,IAAI;EAAG,IAAI;EAAG,IAAI;EAAI,IAAI;EAAI,IAAI;CAAG;CAChD,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACV;CACA,OAAO;EAAE,MAAM;EAAG,IAAI;EAAG,IAAI;EAAG,IAAI;EAAI,MAAM;CAAK;AACrD;AAEA,MAAa,aAAoB;CAC/B,MAAM;CACN,QAAQ;EACN,IAAI;EACJ,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,WAAW;EACX,QAAQ;EACR,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,SAAS;EACT,OAAO;CACT;CACA,SAAS;EAAE,IAAI;EAAG,IAAI;EAAG,IAAI;EAAI,IAAI;EAAI,IAAI;CAAG;CAChD,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACV;CACA,OAAO;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W;KAAW,UAAU;KAAK,OAAO;IAAO;IAC/D,UAAA,MAAM,KAAK,MAAM,MAChB,oBAAC,MAAD;KAAoB,OAAO,EAAE,WAAW,MAAM,IAAI,IAAI,MAAM,QAAQ,GAAG;KACrE,UAAA,oBAAC,QAAD;MACE,OAAO,KAAK;MACZ,SAAS,KAAK;MACd,SAAS,KAAK,WAAW;MACzB,UAAU,KAAK;MACf,SAAS,KAAK;MACd,UAAU;KACX,CAAA;IACG,GATK,KAAK,EASV,CACP;GACG,CAAA;GACL,WAAW,KAAA,IAAY,oBAAC,MAAD;IAAM,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;IAAI,UAAA;GAAa,CAAA,IAAI;EACpF;;AAEV;;;;;;;ACnEA,SAAgB,MAAM,EACpB,SACA,UACA,iBACA,kBAAkB,MACM;CACxB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,qBAAC,MAAD;EACE,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,YAAY;GACZ,gBAAgB;EAClB;EACA,eAAc;EAVhB,UAAA,CAYE,oBAAC,WAAD;GACE,SAAS;GACT,OAAO;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,iBAAiB,cAAc,gBAAgB;GACjD;EACD,CAAA,GACD,oBAAC,OAAD;GAAO,SAAQ;GAAW,SAAQ;GAAK,OAAO;IAAE,UAAU;IAAK,UAAU;GAAM;GAC5E;EACI,CAAA,CACH;;AAEV"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flare-engine/ui",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "UI kit — themed primitives, focus navigation, flex layout resolver",
5
5
  "keywords": ["flare-engine", "ui", "react-native", "menu", "hud", "theme", "typescript"],
6
6
  "license": "Apache-2.0",