@flare-engine/ui 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { TextStyle, ViewStyle } from "react-native";
2
+ import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
3
3
  //#region src/button.d.ts
4
4
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
5
5
  interface ButtonProps {
@@ -11,7 +11,7 @@ interface ButtonProps {
11
11
  tabIndex?: number;
12
12
  /** Stable focus id. If omitted, a generated id is used. */
13
13
  focusId?: string;
14
- style?: ViewStyle;
14
+ style?: StyleProp<ViewStyle>;
15
15
  }
16
16
  declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
17
17
  //#endregion
@@ -40,7 +40,7 @@ interface DialoguePanelProps {
40
40
  readonly choices?: readonly DialogueChoice[];
41
41
  /** Advance callback — used only when `choices` is empty / omitted. */
42
42
  readonly onAdvance?: () => void;
43
- readonly style?: ViewStyle;
43
+ readonly style?: StyleProp<ViewStyle>;
44
44
  }
45
45
  /**
46
46
  * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`
@@ -157,9 +157,13 @@ interface LabelProps {
157
157
  variant?: LabelVariant;
158
158
  tone?: LabelTone;
159
159
  mono?: boolean;
160
- style?: TextStyle;
160
+ style?: StyleProp<TextStyle>;
161
+ numberOfLines?: number;
162
+ ellipsizeMode?: TextProps['ellipsizeMode'];
163
+ adjustsFontSizeToFit?: boolean;
164
+ minimumFontScale?: number;
161
165
  }
162
- declare function Label({ children, variant, tone, mono, style }: LabelProps): ReactNode;
166
+ declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
163
167
  //#endregion
164
168
  //#region src/layout.d.ts
165
169
  /**
@@ -213,7 +217,7 @@ interface ListProps {
213
217
  /** Gap between items in pixels. Defaults to theme.spacing.sm. */
214
218
  gap?: number;
215
219
  direction?: 'column' | 'row';
216
- style?: ViewStyle;
220
+ style?: StyleProp<ViewStyle>;
217
221
  }
218
222
  /**
219
223
  * Vertical (or horizontal) stack with consistent gap. Thin container; the
@@ -243,7 +247,7 @@ interface MainMenuKitProps {
243
247
  * or a version/build string.
244
248
  */
245
249
  readonly footer?: ReactNode;
246
- readonly style?: ViewStyle;
250
+ readonly style?: StyleProp<ViewStyle>;
247
251
  }
248
252
  /**
249
253
  * Title-screen kit: headline, optional subtitle, vertical button list,
@@ -279,7 +283,7 @@ interface PanelProps {
279
283
  padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
280
284
  /** Corner radius token. Defaults to 'md'. */
281
285
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
282
- style?: ViewStyle;
286
+ style?: StyleProp<ViewStyle>;
283
287
  }
284
288
  declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
285
289
  //#endregion
@@ -293,7 +297,7 @@ interface ProgressBarProps {
293
297
  trackColor?: string;
294
298
  /** Fill color override. Defaults to theme.colors.accent. */
295
299
  fillColor?: string;
296
- style?: ViewStyle;
300
+ style?: StyleProp<ViewStyle>;
297
301
  }
298
302
  declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
299
303
  //#endregion
@@ -325,7 +329,7 @@ interface ShopPanelProps {
325
329
  readonly ownedLabel?: string;
326
330
  /** Localized label for the purchase action. Defaults to the item's price. */
327
331
  readonly purchaseLabelFor?: (item: ShopItem) => string;
328
- readonly style?: ViewStyle;
332
+ readonly style?: StyleProp<ViewStyle>;
329
333
  }
330
334
  /**
331
335
  * List-style shop panel. Caller builds the `items` array by joining a
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-context.ts","../src/focus-keyboard-driver.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/shop-panel.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ;;iBAGM,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;;;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ;;;;;;;;;iBAUH,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;;;;;;;;;;;UCxCP;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,SAAS,MAAM;EACf,WAAW;EACX,MAAM;;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,WAAW;;iBAOP,sBAAsB;;;UCvCrB;EACf,SAAS;EACT;;cAGW,8BAAY,QAAA;iBAET,mBAAmB;iBAKnB;;;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;iBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;;;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;iBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;;;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;iBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;;;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ;;iBAGM,QACd,UACA,SACA,MACA,MACA,SACC,aAAa;;;;;;;;;;;;;;KCTJ;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;;iBAec,cACd,WAAW,iBACX,mBAAmB,gBAClB;;;UClEc;EACf,WAAW;;EAEX;EACA;EACA,QAAQ;;;;;;iBAOM,OAAO,UAAU,KAAK,WAAsB,SAAS,YAAY;;;UCVhE;;WAEN;;WAEA;WACA;WACA,UAAU;WACV;;UAGM;;WAEN;;WAEA;;WAEA,gBAAgB;;;;;WAKhB,SAAS;WACT,QAAQ;;;;;;;;;iBAUH,cACd,OACA,UACA,OACA,QACA,SACC,mBAAmB;;;UCxCL;EACf;EACA,WAAW;;EAEX;;EAEA;;;;;;;iBAQc,QACd,SACA,UACA,iBACA,mBACC,aAAa;;;UCnBC;EACf,WAAW;;EAEX;;EAEA;;EAEA;EACA,QAAQ;;iBAGM,QACd,UACA,SACA,SACA,QACA,SACC,aAAa;;;UCjBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ;;iBAGM,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;;;UCfL;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;WAMA;WACA;;UAGM;WACN,gBAAgB;;WAEhB,aAAa;;WAEb,aAAa;;WAEb;;WAEA,oBAAoB,MAAM;WAC1B,QAAQ;;;;;;;;;iBAUH,YACd,OACA,YACA,YACA,YACA,kBACA,SACC,iBAAiB;;;UClDH;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;;cAGI,WAAW;cA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;iBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;iBAIpE,YAAY"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-context.ts","../src/focus-keyboard-driver.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/shop-panel.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ,UAAU;;iBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;;;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;iBAUb,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;;;;;;;;;;;UCxCP;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,SAAS,MAAM;EACf,WAAW;EACX,MAAM;;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,WAAW;;iBAOP,sBAAsB;;;UCvCrB;EACf,SAAS;EACT;;cAGW,8BAAY,QAAA;iBAET,mBAAmB;iBAKnB;;;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;iBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;;;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;iBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;;;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;iBAGc,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;;iBAGc,QACd,UACA,SACA,MACA,MACA,OACA,eACA,eAC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AAS;EACT,YAAY;EACZ,OAAO;;cAGI,WAAW;cA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;iBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;iBAIpE,YAAY"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { TextStyle, ViewStyle } from "react-native";
2
+ import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
3
3
  //#region src/button.d.ts
4
4
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
5
5
  interface ButtonProps {
@@ -11,7 +11,7 @@ interface ButtonProps {
11
11
  tabIndex?: number;
12
12
  /** Stable focus id. If omitted, a generated id is used. */
13
13
  focusId?: string;
14
- style?: ViewStyle;
14
+ style?: StyleProp<ViewStyle>;
15
15
  }
16
16
  declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
17
17
  //#endregion
@@ -40,7 +40,7 @@ interface DialoguePanelProps {
40
40
  readonly choices?: readonly DialogueChoice[];
41
41
  /** Advance callback — used only when `choices` is empty / omitted. */
42
42
  readonly onAdvance?: () => void;
43
- readonly style?: ViewStyle;
43
+ readonly style?: StyleProp<ViewStyle>;
44
44
  }
45
45
  /**
46
46
  * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`
@@ -157,9 +157,13 @@ interface LabelProps {
157
157
  variant?: LabelVariant;
158
158
  tone?: LabelTone;
159
159
  mono?: boolean;
160
- style?: TextStyle;
160
+ style?: StyleProp<TextStyle>;
161
+ numberOfLines?: number;
162
+ ellipsizeMode?: TextProps['ellipsizeMode'];
163
+ adjustsFontSizeToFit?: boolean;
164
+ minimumFontScale?: number;
161
165
  }
162
- declare function Label({ children, variant, tone, mono, style }: LabelProps): ReactNode;
166
+ declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
163
167
  //#endregion
164
168
  //#region src/layout.d.ts
165
169
  /**
@@ -213,7 +217,7 @@ interface ListProps {
213
217
  /** Gap between items in pixels. Defaults to theme.spacing.sm. */
214
218
  gap?: number;
215
219
  direction?: 'column' | 'row';
216
- style?: ViewStyle;
220
+ style?: StyleProp<ViewStyle>;
217
221
  }
218
222
  /**
219
223
  * Vertical (or horizontal) stack with consistent gap. Thin container; the
@@ -243,7 +247,7 @@ interface MainMenuKitProps {
243
247
  * or a version/build string.
244
248
  */
245
249
  readonly footer?: ReactNode;
246
- readonly style?: ViewStyle;
250
+ readonly style?: StyleProp<ViewStyle>;
247
251
  }
248
252
  /**
249
253
  * Title-screen kit: headline, optional subtitle, vertical button list,
@@ -279,7 +283,7 @@ interface PanelProps {
279
283
  padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
280
284
  /** Corner radius token. Defaults to 'md'. */
281
285
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
282
- style?: ViewStyle;
286
+ style?: StyleProp<ViewStyle>;
283
287
  }
284
288
  declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
285
289
  //#endregion
@@ -293,7 +297,7 @@ interface ProgressBarProps {
293
297
  trackColor?: string;
294
298
  /** Fill color override. Defaults to theme.colors.accent. */
295
299
  fillColor?: string;
296
- style?: ViewStyle;
300
+ style?: StyleProp<ViewStyle>;
297
301
  }
298
302
  declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
299
303
  //#endregion
@@ -325,7 +329,7 @@ interface ShopPanelProps {
325
329
  readonly ownedLabel?: string;
326
330
  /** Localized label for the purchase action. Defaults to the item's price. */
327
331
  readonly purchaseLabelFor?: (item: ShopItem) => string;
328
- readonly style?: ViewStyle;
332
+ readonly style?: StyleProp<ViewStyle>;
329
333
  }
330
334
  /**
331
335
  * List-style shop panel. Caller builds the `items` array by joining a
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-context.ts","../src/focus-keyboard-driver.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/shop-panel.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ;;iBAGM,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;;;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ;;;;;;;;;iBAUH,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;;;;;;;;;;;UCxCP;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,SAAS,MAAM;EACf,WAAW;EACX,MAAM;;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,WAAW;;iBAOP,sBAAsB;;;UCvCrB;EACf,SAAS;EACT;;cAGW,8BAAY,QAAA;iBAET,mBAAmB;iBAKnB;;;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;iBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;;;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;iBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;;;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;iBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;;;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ;;iBAGM,QACd,UACA,SACA,MACA,MACA,SACC,aAAa;;;;;;;;;;;;;;KCTJ;KACA;KAOA;UAEK;EACf;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;UA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version":3,"file":"index.d.ts","names":[],"sources":["../src/button.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-context.ts","../src/focus-keyboard-driver.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/shop-panel.tsx","../src/theme.ts"],"mappings":";;;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ,UAAU;;iBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;;;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;iBAUb,gBACd,SACA,MACA,UACA,SACA,WACA,SACC,qBAAqB;;;;;;;;;;;UCxCP;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf,SAAS,MAAM;EACf,WAAW;EACX,MAAM;;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU,WAAW;;iBAOP,sBAAsB;;;UCvCrB;EACf,SAAS;EACT;;cAGW,8BAAY,QAAA;iBAET,mBAAmB;iBAKnB;;;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;iBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;;;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;iBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;;;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;iBAGc,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;;iBAGc,QACd,UACA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AGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;cAGI,WAAW;cA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;iBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;iBAIpE,YAAY"}
package/dist/index.js CHANGED
@@ -192,7 +192,7 @@ const styles = react_native.StyleSheet.create({ wrap: {
192
192
  } });
193
193
  //#endregion
194
194
  //#region src/label.tsx
195
- function Label({ children, variant = "md", tone = "default", mono = false, style }) {
195
+ function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }) {
196
196
  const theme = useTheme();
197
197
  const sizeMap = {
198
198
  xs: theme.typography.sizeXs,
@@ -202,6 +202,10 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
202
202
  xl: theme.typography.sizeXl
203
203
  };
204
204
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
205
+ numberOfLines,
206
+ ellipsizeMode,
207
+ adjustsFontSizeToFit,
208
+ minimumFontScale,
205
209
  style: [{
206
210
  color: {
207
211
  default: theme.colors.text,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Pressable","View","Text","StyleSheet","Text","View","View","Pressable","View","View","View","Fragment","View","View","Pressable","View"],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-keyboard-driver.ts","../src/focus-provider.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/shop-panel.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport interface FocusContextValue {\n manager: FocusManager;\n focusedId: string | null;\n}\n\nexport const FocusContext = createContext<FocusContextValue | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.manager : null;\n}\n\nexport function useFocusedId(): string | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.focusedId : null;\n}\n","import { createContext, createElement, type ReactNode, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusedId, useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: ViewStyle;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const focusedId = useFocusedId();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = focusedId === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { Text, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: TextStyle;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return <Text style={[base, style]}>{children}</Text>;\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: ViewStyle;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: ViewStyle;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Portrait resolution is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static choice list, never reordered\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n /** Explicit opt-in initial focus: focuses the first node in tab order (or clears if empty). */\n focusFirst(): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n // No focus side-effect: on a touch-first engine an auto-focused first\n // registrant paints a permanent focus ring with no input. Focus stays null\n // until a driver (keyboard/gamepad) or an explicit focusFirst() acts.\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n focusFirst() {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import type { FocusManager } from './focus.js';\n\n/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */\nexport interface FocusKeySource {\n wasPressed(code: string): boolean;\n}\n\nexport interface FocusKeyboardDriver {\n /** Call once per frame; polls edges and drives the manager. */\n update(): void;\n}\n\nexport interface FocusKeyboardDriverOptions {\n next?: readonly string[];\n prev?: readonly string[];\n activate?: readonly string[];\n}\n\nconst DEFAULT_NEXT: readonly string[] = ['ArrowDown', 'ArrowRight', 'Tab'];\nconst DEFAULT_PREV: readonly string[] = ['ArrowUp', 'ArrowLeft'];\nconst DEFAULT_ACTIVATE: readonly string[] = ['Enter', 'Space'];\n\nexport function createFocusKeyboardDriver(\n manager: FocusManager,\n keys: FocusKeySource,\n options?: FocusKeyboardDriverOptions,\n): FocusKeyboardDriver {\n const nextCodes = options?.next ?? DEFAULT_NEXT;\n const prevCodes = options?.prev ?? DEFAULT_PREV;\n const activateCodes = options?.activate ?? DEFAULT_ACTIVATE;\n\n return {\n update(): void {\n for (let i = 0; i < nextCodes.length; i++) {\n if (keys.wasPressed(nextCodes[i]!)) {\n manager.next();\n return;\n }\n }\n for (let i = 0; i < prevCodes.length; i++) {\n if (keys.wasPressed(prevCodes[i]!)) {\n manager.prev();\n return;\n }\n }\n for (let i = 0; i < activateCodes.length; i++) {\n if (keys.wasPressed(activateCodes[i]!)) {\n manager.activate();\n return;\n }\n }\n },\n };\n}\n","import { createElement, type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { createFocusManager, type FocusManager } from './focus.js';\nimport { FocusContext, type FocusContextValue } from './focus-context.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n /**\n * Opt-in initial focus: focus the tab-order first node once, at the commit\n * where this provider mounts. Off by default so a touch-first tree shows no\n * focus ring until a driver acts. This is mount-time only — it picks among the\n * nodes registered by that first commit and does not re-fire for children that\n * mount later (async/lazy sets). For a dynamic set drive focus explicitly\n * (a keyboard/gamepad driver, or manager.focusFirst()).\n */\n autoFocus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and publishes\n * { manager, focusedId } as context state so consumers re-render on focus\n * moves.\n */\nexport function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [focusedId, setFocusedId] = useState<string | null>(() => mgr.getFocused());\n\n useEffect(() => {\n setFocusedId(mgr.getFocused());\n return mgr.subscribe((id) => {\n setFocusedId(id);\n });\n }, [mgr]);\n\n useEffect(() => {\n // Child register effects run before this parent effect, so every node is\n // registered here → focusFirst() picks the true tab-order first.\n if (autoFocus && mgr.getFocused() === null) mgr.focusFirst();\n }, [autoFocus, mgr]);\n\n const value = useMemo<FocusContextValue>(() => ({ manager: mgr, focusedId }), [mgr, focusedId]);\n\n return createElement(FocusContext.Provider, { value }, children);\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: ViewStyle;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: ViewStyle;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: ViewStyle;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Save-slot / settings / credits panels are built on top of this kit by the\n * consumer; the kit itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: ViewStyle;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Price strings and ownership copy are caller-provided so the UI kit stays\n * localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n}\n"],"mappings":";;;;;AAQA,MAAa,gBAAA,GAAA,MAAA,cAAA,CAAuD,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,OAAA,GAAA,MAAA,WAAA,CAAiB,YAAY;CACnC,OAAO,MAAM,IAAI,UAAU;AAC7B;AAEA,SAAgB,eAA8B;CAC5C,MAAM,OAAA,GAAA,MAAA,WAAA,CAAiB,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,MAA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,GAAA,kBAAA,KAAA,CAACC,aAAAA,MAAD;IAEE,OAAO;KACL,WAAW,MAAM,IAAI,IAAI,MAAM,QAAQ;KACvC,YAAY,MAAM,IAAI,IAAI,MAAM,QAAQ;KACxC,gBAAgB,MAAM,IAAI,IAAI;KAC9B,gBAAgB,MAAM,OAAO;IAC/B;cAPF;KASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAO,SAAQ;gBAAM,KAAK;KAAa,CAAA;KACtC,KAAK,gBAAgB,KAAA,IACpB,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAO,SAAQ;MAAK,MAAK;MAAQ,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACnE,KAAK;KACD,CAAA,IACL;KACJ,iBAAA,GAAA,kBAAA,IAAA,CAACA,aAAAA,MAAD;MAAM,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACxC,QACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OAAQ,OAAO;OAAY,SAAQ;OAAQ,UAAA;MAAU,CAAA,IAErD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OACE,OAAO,mBAAmB,iBAAiB,IAAI,IAAI,KAAK;OACxD,SAAQ;OACR,UAAU,KAAK;OACf,eAAe,WAAW,KAAK,SAAS;MACzC,CAAA;KAEC,CAAA;IACF;MA1BC,KAAK,SA0BN;EAEV,CAAC;CACI,CAAA;AAEX"}
1
+ {"version":3,"file":"index.js","names":["Pressable","View","Text","StyleSheet","Text","View","View","Pressable","View","View","View","Fragment","View","View","Pressable","View"],"sources":["../src/focus-context.ts","../src/theme.ts","../src/button.tsx","../src/label.tsx","../src/panel.tsx","../src/dialogue-panel.tsx","../src/focus.ts","../src/focus-keyboard-driver.ts","../src/focus-provider.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/shop-panel.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport interface FocusContextValue {\n manager: FocusManager;\n focusedId: string | null;\n}\n\nexport const FocusContext = createContext<FocusContextValue | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.manager : null;\n}\n\nexport function useFocusedId(): string | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.focusedId : null;\n}\n","import { createContext, createElement, type ReactNode, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, type StyleProp, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusedId, useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const focusedId = useFocusedId();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = focusedId === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { type StyleProp, Text, type TextProps, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: StyleProp<TextStyle>;\n numberOfLines?: number;\n ellipsizeMode?: TextProps['ellipsizeMode'];\n adjustsFontSizeToFit?: boolean;\n minimumFontScale?: number;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n numberOfLines,\n ellipsizeMode,\n adjustsFontSizeToFit,\n minimumFontScale,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return (\n <Text\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n minimumFontScale={minimumFontScale}\n style={[base, style]}\n >\n {children}\n </Text>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Portrait resolution is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static choice list, never reordered\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n /** Explicit opt-in initial focus: focuses the first node in tab order (or clears if empty). */\n focusFirst(): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n // No focus side-effect: on a touch-first engine an auto-focused first\n // registrant paints a permanent focus ring with no input. Focus stays null\n // until a driver (keyboard/gamepad) or an explicit focusFirst() acts.\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n focusFirst() {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import type { FocusManager } from './focus.js';\n\n/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */\nexport interface FocusKeySource {\n wasPressed(code: string): boolean;\n}\n\nexport interface FocusKeyboardDriver {\n /** Call once per frame; polls edges and drives the manager. */\n update(): void;\n}\n\nexport interface FocusKeyboardDriverOptions {\n next?: readonly string[];\n prev?: readonly string[];\n activate?: readonly string[];\n}\n\nconst DEFAULT_NEXT: readonly string[] = ['ArrowDown', 'ArrowRight', 'Tab'];\nconst DEFAULT_PREV: readonly string[] = ['ArrowUp', 'ArrowLeft'];\nconst DEFAULT_ACTIVATE: readonly string[] = ['Enter', 'Space'];\n\nexport function createFocusKeyboardDriver(\n manager: FocusManager,\n keys: FocusKeySource,\n options?: FocusKeyboardDriverOptions,\n): FocusKeyboardDriver {\n const nextCodes = options?.next ?? DEFAULT_NEXT;\n const prevCodes = options?.prev ?? DEFAULT_PREV;\n const activateCodes = options?.activate ?? DEFAULT_ACTIVATE;\n\n return {\n update(): void {\n for (let i = 0; i < nextCodes.length; i++) {\n if (keys.wasPressed(nextCodes[i]!)) {\n manager.next();\n return;\n }\n }\n for (let i = 0; i < prevCodes.length; i++) {\n if (keys.wasPressed(prevCodes[i]!)) {\n manager.prev();\n return;\n }\n }\n for (let i = 0; i < activateCodes.length; i++) {\n if (keys.wasPressed(activateCodes[i]!)) {\n manager.activate();\n return;\n }\n }\n },\n };\n}\n","import { createElement, type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { createFocusManager, type FocusManager } from './focus.js';\nimport { FocusContext, type FocusContextValue } from './focus-context.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n /**\n * Opt-in initial focus: focus the tab-order first node once, at the commit\n * where this provider mounts. Off by default so a touch-first tree shows no\n * focus ring until a driver acts. This is mount-time only — it picks among the\n * nodes registered by that first commit and does not re-fire for children that\n * mount later (async/lazy sets). For a dynamic set drive focus explicitly\n * (a keyboard/gamepad driver, or manager.focusFirst()).\n */\n autoFocus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and publishes\n * { manager, focusedId } as context state so consumers re-render on focus\n * moves.\n */\nexport function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [focusedId, setFocusedId] = useState<string | null>(() => mgr.getFocused());\n\n useEffect(() => {\n setFocusedId(mgr.getFocused());\n return mgr.subscribe((id) => {\n setFocusedId(id);\n });\n }, [mgr]);\n\n useEffect(() => {\n // Child register effects run before this parent effect, so every node is\n // registered here → focusFirst() picks the true tab-order first.\n if (autoFocus && mgr.getFocused() === null) mgr.focusFirst();\n }, [autoFocus, mgr]);\n\n const value = useMemo<FocusContextValue>(() => ({ manager: mgr, focusedId }), [mgr, focusedId]);\n\n return createElement(FocusContext.Provider, { value }, children);\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Save-slot / settings / credits panels are built on top of this kit by the\n * consumer; the kit itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Price strings and ownership copy are caller-provided so the UI kit stays\n * localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n}\n"],"mappings":";;;;;AAQA,MAAa,gBAAA,GAAA,MAAA,cAAA,CAAuD,IAAI;AAExE,SAAgB,kBAAuC;CACrD,MAAM,OAAA,GAAA,MAAA,WAAA,CAAiB,YAAY;CACnC,OA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AAA;MAAU,CAAA,IAErD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OACE,OAAO,mBAAmB,iBAAiB,IAAI,IAAI,KAAK;OACxD,SAAQ;OACR,UAAU,KAAK;OACf,eAAe,WAAW,KAAK,SAAS;MACzC,CAAA;KAEC,CAAA;IACF;MA1BC,KAAK,SA0BN;EAEV,CAAC;CACI,CAAA;AAEX"}
package/dist/index.mjs CHANGED
@@ -191,7 +191,7 @@ const styles = StyleSheet.create({ wrap: {
191
191
  } });
192
192
  //#endregion
193
193
  //#region src/label.tsx
194
- function Label({ children, variant = "md", tone = "default", mono = false, style }) {
194
+ function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }) {
195
195
  const theme = useTheme();
196
196
  const sizeMap = {
197
197
  xs: theme.typography.sizeXs,
@@ -201,6 +201,10 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
201
201
  xl: theme.typography.sizeXl
202
202
  };
203
203
  return /* @__PURE__ */ jsx(Text, {
204
+ numberOfLines,
205
+ ellipsizeMode,
206
+ adjustsFontSizeToFit,
207
+ minimumFontScale,
204
208
  style: [{
205
209
  color: {
206
210
  default: theme.colors.text,
@@ -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.ts","../src/focus-keyboard-driver.ts","../src/focus-provider.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/shop-panel.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport interface FocusContextValue {\n manager: FocusManager;\n focusedId: string | null;\n}\n\nexport const FocusContext = createContext<FocusContextValue | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.manager : null;\n}\n\nexport function useFocusedId(): string | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.focusedId : null;\n}\n","import { createContext, createElement, type ReactNode, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusedId, useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: ViewStyle;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const focusedId = useFocusedId();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = focusedId === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { Text, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: TextStyle;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return <Text style={[base, style]}>{children}</Text>;\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: ViewStyle;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: ViewStyle;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Portrait resolution is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static choice list, never reordered\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n /** Explicit opt-in initial focus: focuses the first node in tab order (or clears if empty). */\n focusFirst(): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n // No focus side-effect: on a touch-first engine an auto-focused first\n // registrant paints a permanent focus ring with no input. Focus stays null\n // until a driver (keyboard/gamepad) or an explicit focusFirst() acts.\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n focusFirst() {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import type { FocusManager } from './focus.js';\n\n/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */\nexport interface FocusKeySource {\n wasPressed(code: string): boolean;\n}\n\nexport interface FocusKeyboardDriver {\n /** Call once per frame; polls edges and drives the manager. */\n update(): void;\n}\n\nexport interface FocusKeyboardDriverOptions {\n next?: readonly string[];\n prev?: readonly string[];\n activate?: readonly string[];\n}\n\nconst DEFAULT_NEXT: readonly string[] = ['ArrowDown', 'ArrowRight', 'Tab'];\nconst DEFAULT_PREV: readonly string[] = ['ArrowUp', 'ArrowLeft'];\nconst DEFAULT_ACTIVATE: readonly string[] = ['Enter', 'Space'];\n\nexport function createFocusKeyboardDriver(\n manager: FocusManager,\n keys: FocusKeySource,\n options?: FocusKeyboardDriverOptions,\n): FocusKeyboardDriver {\n const nextCodes = options?.next ?? DEFAULT_NEXT;\n const prevCodes = options?.prev ?? DEFAULT_PREV;\n const activateCodes = options?.activate ?? DEFAULT_ACTIVATE;\n\n return {\n update(): void {\n for (let i = 0; i < nextCodes.length; i++) {\n if (keys.wasPressed(nextCodes[i]!)) {\n manager.next();\n return;\n }\n }\n for (let i = 0; i < prevCodes.length; i++) {\n if (keys.wasPressed(prevCodes[i]!)) {\n manager.prev();\n return;\n }\n }\n for (let i = 0; i < activateCodes.length; i++) {\n if (keys.wasPressed(activateCodes[i]!)) {\n manager.activate();\n return;\n }\n }\n },\n };\n}\n","import { createElement, type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { createFocusManager, type FocusManager } from './focus.js';\nimport { FocusContext, type FocusContextValue } from './focus-context.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n /**\n * Opt-in initial focus: focus the tab-order first node once, at the commit\n * where this provider mounts. Off by default so a touch-first tree shows no\n * focus ring until a driver acts. This is mount-time only — it picks among the\n * nodes registered by that first commit and does not re-fire for children that\n * mount later (async/lazy sets). For a dynamic set drive focus explicitly\n * (a keyboard/gamepad driver, or manager.focusFirst()).\n */\n autoFocus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and publishes\n * { manager, focusedId } as context state so consumers re-render on focus\n * moves.\n */\nexport function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [focusedId, setFocusedId] = useState<string | null>(() => mgr.getFocused());\n\n useEffect(() => {\n setFocusedId(mgr.getFocused());\n return mgr.subscribe((id) => {\n setFocusedId(id);\n });\n }, [mgr]);\n\n useEffect(() => {\n // Child register effects run before this parent effect, so every node is\n // registered here → focusFirst() picks the true tab-order first.\n if (autoFocus && mgr.getFocused() === null) mgr.focusFirst();\n }, [autoFocus, mgr]);\n\n const value = useMemo<FocusContextValue>(() => ({ manager: mgr, focusedId }), [mgr, focusedId]);\n\n return createElement(FocusContext.Provider, { value }, children);\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: ViewStyle;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: ViewStyle;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: ViewStyle;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Save-slot / settings / credits panels are built on top of this kit by the\n * consumer; the kit itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: ViewStyle;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Price strings and ownership copy are caller-provided so the UI kit stays\n * localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n}\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;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M,KAAK;KAAa,CAAA;KACtC,KAAK,gBAAgB,KAAA,IACpB,oBAAC,OAAD;MAAO,SAAQ;MAAK,MAAK;MAAQ,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACnE,KAAK;KACD,CAAA,IACL;KACJ,oBAAC,MAAD;MAAM,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACxC,QACC,oBAAC,QAAD;OAAQ,OAAO;OAAY,SAAQ;OAAQ,UAAA;MAAU,CAAA,IAErD,oBAAC,QAAD;OACE,OAAO,mBAAmB,iBAAiB,IAAI,IAAI,KAAK;OACxD,SAAQ;OACR,UAAU,KAAK;OACf,eAAe,WAAW,KAAK,SAAS;MACzC,CAAA;KAEC,CAAA;IACF;MA1BC,KAAK,SA0BN;EAEV,CAAC;CACI,CAAA;AAEX"}
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.ts","../src/focus-keyboard-driver.ts","../src/focus-provider.tsx","../src/progress-bar.tsx","../src/hud-bar.tsx","../src/layout.ts","../src/list.tsx","../src/main-menu-kit.tsx","../src/modal.tsx","../src/shop-panel.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { FocusManager } from './focus.js';\n\nexport interface FocusContextValue {\n manager: FocusManager;\n focusedId: string | null;\n}\n\nexport const FocusContext = createContext<FocusContextValue | null>(null);\n\nexport function useFocusManager(): FocusManager | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.manager : null;\n}\n\nexport function useFocusedId(): string | null {\n const ctx = useContext(FocusContext);\n return ctx ? ctx.focusedId : null;\n}\n","import { createContext, createElement, type ReactNode, useContext } from 'react';\n\nexport interface ThemeColors {\n bg: string;\n surface: string;\n surfaceAlt: string;\n border: string;\n text: string;\n textMuted: string;\n accent: string;\n accentText: string;\n danger: string;\n success: string;\n warning: string;\n focus: string;\n}\n\nexport interface ThemeSpacing {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n}\n\nexport interface ThemeTypography {\n sizeXs: number;\n sizeSm: number;\n sizeMd: number;\n sizeLg: number;\n sizeXl: number;\n fontFamily?: string;\n fontFamilyMono?: string;\n}\n\nexport interface ThemeRadii {\n none: number;\n sm: number;\n md: number;\n lg: number;\n pill: number;\n}\n\nexport interface Theme {\n name: string;\n colors: ThemeColors;\n spacing: ThemeSpacing;\n typography: ThemeTypography;\n radii: ThemeRadii;\n}\n\nexport const darkTheme: Theme = {\n name: 'dark',\n colors: {\n bg: '#0b0d10',\n surface: '#14181d',\n surfaceAlt: '#1d232b',\n border: '#2a323c',\n text: '#e7ecf1',\n textMuted: '#8c96a3',\n accent: '#4aa3ff',\n accentText: '#0b0d10',\n danger: '#ff5c5c',\n success: '#5dd39e',\n warning: '#f1c40f',\n focus: '#ffd166',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nexport const lightTheme: Theme = {\n name: 'light',\n colors: {\n bg: '#f6f8fa',\n surface: '#ffffff',\n surfaceAlt: '#eef1f4',\n border: '#d4dae0',\n text: '#13181d',\n textMuted: '#5b6670',\n accent: '#0a66d0',\n accentText: '#ffffff',\n danger: '#d12e2e',\n success: '#2f9d69',\n warning: '#c79600',\n focus: '#ff9500',\n },\n spacing: { xs: 4, sm: 8, md: 12, lg: 20, xl: 32 },\n typography: {\n sizeXs: 10,\n sizeSm: 12,\n sizeMd: 14,\n sizeLg: 18,\n sizeXl: 24,\n },\n radii: { none: 0, sm: 4, md: 8, lg: 16, pill: 9999 },\n};\n\nconst ThemeContext = createContext<Theme>(darkTheme);\n\nexport interface ThemeProviderProps {\n theme?: Theme;\n children: ReactNode;\n}\n\nexport function ThemeProvider({ theme = darkTheme, children }: ThemeProviderProps): ReactNode {\n return createElement(ThemeContext.Provider, { value: theme }, children);\n}\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext);\n}\n","import { type ReactNode, useEffect, useId } from 'react';\nimport { Pressable, type StyleProp, StyleSheet, Text, View, type ViewStyle } from 'react-native';\nimport { useFocusedId, useFocusManager } from './focus-context.js';\nimport { useTheme } from './theme.js';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nexport interface ButtonProps {\n label: string;\n onPress?: () => void;\n variant?: ButtonVariant;\n disabled?: boolean;\n /** Focus-navigation tab order. Lower is earlier. Defaults to 0. */\n tabIndex?: number;\n /** Stable focus id. If omitted, a generated id is used. */\n focusId?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Button({\n label,\n onPress,\n variant = 'primary',\n disabled = false,\n tabIndex = 0,\n focusId,\n style,\n}: ButtonProps): ReactNode {\n const theme = useTheme();\n const manager = useFocusManager();\n const focusedId = useFocusedId();\n const generated = useId();\n const id = focusId ?? generated;\n\n useEffect(() => {\n if (!manager) return;\n return manager.register({\n id,\n tabIndex,\n disabled,\n onActivate: () => {\n if (!disabled) onPress?.();\n },\n });\n }, [manager, id, tabIndex, disabled, onPress]);\n\n const focused = focusedId === id;\n\n let bg = theme.colors.surface;\n let fg = theme.colors.text;\n let border = theme.colors.border;\n switch (variant) {\n case 'primary':\n bg = theme.colors.accent;\n fg = theme.colors.accentText;\n border = theme.colors.accent;\n break;\n case 'secondary':\n bg = theme.colors.surfaceAlt;\n fg = theme.colors.text;\n border = theme.colors.border;\n break;\n case 'ghost':\n bg = 'transparent';\n fg = theme.colors.text;\n border = 'transparent';\n break;\n case 'danger':\n bg = theme.colors.danger;\n fg = theme.colors.accentText;\n border = theme.colors.danger;\n break;\n }\n\n const container: ViewStyle = {\n backgroundColor: bg,\n borderColor: focused ? theme.colors.focus : border,\n borderWidth: focused ? 2 : 1,\n borderRadius: theme.radii.md,\n paddingHorizontal: theme.spacing.md,\n paddingVertical: theme.spacing.sm,\n opacity: disabled ? 0.5 : 1,\n };\n\n return (\n <Pressable\n onPress={() => {\n if (disabled) return;\n manager?.focus(id);\n onPress?.();\n }}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, selected: focused }}\n style={[styles.wrap, container, style]}\n >\n <View>\n <Text style={{ color: fg, fontSize: theme.typography.sizeMd, textAlign: 'center' }}>\n {label}\n </Text>\n </View>\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: {\n alignSelf: 'stretch',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n","import type { ReactNode } from 'react';\nimport { type StyleProp, Text, type TextProps, type TextStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';\n\nexport interface LabelProps {\n children?: ReactNode;\n variant?: LabelVariant;\n tone?: LabelTone;\n mono?: boolean;\n style?: StyleProp<TextStyle>;\n numberOfLines?: number;\n ellipsizeMode?: TextProps['ellipsizeMode'];\n adjustsFontSizeToFit?: boolean;\n minimumFontScale?: number;\n}\n\nexport function Label({\n children,\n variant = 'md',\n tone = 'default',\n mono = false,\n style,\n numberOfLines,\n ellipsizeMode,\n adjustsFontSizeToFit,\n minimumFontScale,\n}: LabelProps): ReactNode {\n const theme = useTheme();\n const sizeMap = {\n xs: theme.typography.sizeXs,\n sm: theme.typography.sizeSm,\n md: theme.typography.sizeMd,\n lg: theme.typography.sizeLg,\n xl: theme.typography.sizeXl,\n };\n const toneMap = {\n default: theme.colors.text,\n muted: theme.colors.textMuted,\n accent: theme.colors.accent,\n danger: theme.colors.danger,\n success: theme.colors.success,\n warning: theme.colors.warning,\n };\n\n const base: TextStyle = {\n color: toneMap[tone],\n fontSize: sizeMap[variant],\n fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily,\n };\n\n return (\n <Text\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n minimumFontScale={minimumFontScale}\n style={[base, style]}\n >\n {children}\n </Text>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface PanelProps {\n children?: ReactNode;\n /** Visual style: surface (default) or elevated (surfaceAlt + border). */\n variant?: 'surface' | 'elevated';\n /** Padding size token. Defaults to 'md'. */\n padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /** Corner radius token. Defaults to 'md'. */\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Panel({\n children,\n variant = 'surface',\n padding = 'md',\n radius = 'md',\n style,\n}: PanelProps): ReactNode {\n const theme = useTheme();\n const bg = variant === 'elevated' ? theme.colors.surfaceAlt : theme.colors.surface;\n const pad = padding === 'none' ? 0 : theme.spacing[padding];\n const r = theme.radii[radius];\n\n const base: ViewStyle = {\n backgroundColor: bg,\n padding: pad,\n borderRadius: r,\n borderWidth: variant === 'elevated' ? 1 : 0,\n borderColor: theme.colors.border,\n };\n\n return <View style={[base, style]}>{children}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface DialogueChoice {\n /** Display label (already localized by the caller). */\n readonly label: string;\n /** Called when the player selects this choice. */\n readonly onPress: () => void;\n readonly disabled?: boolean;\n}\n\nexport interface DialoguePanelProps {\n /** Speaker name — rendered above the text. */\n readonly speaker: string;\n /** Line text — rendered in the body. */\n readonly text: string;\n /**\n * Portrait node. Typically an `<Image>` or a Skia/shape avatar keyed by\n * `LineNode.speakerPortraitKey`. When omitted, the portrait slot collapses.\n */\n readonly portrait?: ReactNode;\n /**\n * Optional choices. When present, renders a `Button` per option; when\n * absent, the panel tap-advances via `onAdvance`.\n */\n readonly choices?: readonly DialogueChoice[];\n /** Advance callback — used only when `choices` is empty / omitted. */\n readonly onAdvance?: () => void;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`\n * — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your\n * portrait resolver → `portrait` here.\n *\n * Portrait resolution is caller-owned so the UI kit stays asset-agnostic.\n */\nexport function DialoguePanel({\n speaker,\n text,\n portrait,\n choices,\n onAdvance,\n style,\n}: DialoguePanelProps): ReactNode {\n const theme = useTheme();\n const body = (\n <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>\n {portrait !== undefined ? (\n <View style={{ marginRight: theme.spacing.md }}>{portrait}</View>\n ) : null}\n <View style={{ flex: 1 }}>\n <Label variant=\"sm\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {speaker}\n </Label>\n <Label variant=\"md\">{text}</Label>\n {choices && choices.length > 0 ? (\n <View style={{ marginTop: theme.spacing.md }}>\n {choices.map((c, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static choice list, never reordered\n <View key={`${c.label}-${i}`} style={{ marginTop: i === 0 ? 0 : theme.spacing.xs }}>\n <Button\n label={c.label}\n onPress={c.onPress}\n disabled={c.disabled}\n variant=\"secondary\"\n />\n </View>\n ))}\n </View>\n ) : null}\n </View>\n </View>\n );\n\n if (choices && choices.length > 0) {\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n );\n }\n\n return (\n <Pressable onPress={onAdvance}>\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {body}\n </Panel>\n </Pressable>\n );\n}\n","/**\n * Keyboard + (future) gamepad focus navigation.\n *\n * Primitives register themselves with the focus manager by id + tab order.\n * The manager owns which id is currently focused and exposes `next` / `prev`\n * / `activate` actions for a driver (keyboard key handler, gamepad dpad)\n * to call. Components read `focusedId` to render a focus ring.\n */\n\nexport interface FocusNode {\n id: string;\n /** Lower tabIndex is focused first. Nodes with equal tabIndex fall back to registration order. */\n tabIndex: number;\n /** Called when this node is activated (Enter / A button). */\n onActivate?: () => void;\n /** Called when this node receives focus. */\n onFocus?: () => void;\n /** Called when this node loses focus. */\n onBlur?: () => void;\n /** If true, the node is skipped during navigation. */\n disabled?: boolean;\n}\n\nexport interface FocusManager {\n register(node: FocusNode): () => void;\n unregister(id: string): void;\n focus(id: string): void;\n /** Explicit opt-in initial focus: focuses the first node in tab order (or clears if empty). */\n focusFirst(): void;\n blur(): void;\n next(): void;\n prev(): void;\n activate(): void;\n getFocused(): string | null;\n getOrder(): readonly string[];\n subscribe(listener: (focusedId: string | null) => void): () => void;\n}\n\ninterface Entry extends FocusNode {\n seq: number;\n}\n\nexport function createFocusManager(): FocusManager {\n const nodes = new Map<string, Entry>();\n let seqCounter = 0;\n let focusedId: string | null = null;\n const listeners = new Set<(id: string | null) => void>();\n\n function notify(): void {\n for (const l of listeners) l(focusedId);\n }\n\n function orderedIds(): string[] {\n const entries = Array.from(nodes.values()).filter((e) => !e.disabled);\n entries.sort((a, b) => {\n if (a.tabIndex !== b.tabIndex) return a.tabIndex - b.tabIndex;\n return a.seq - b.seq;\n });\n return entries.map((e) => e.id);\n }\n\n function setFocused(next: string | null): void {\n if (next === focusedId) return;\n const prev = focusedId;\n focusedId = next;\n if (prev !== null) nodes.get(prev)?.onBlur?.();\n if (next !== null) nodes.get(next)?.onFocus?.();\n notify();\n }\n\n function move(delta: 1 | -1): void {\n const order = orderedIds();\n if (order.length === 0) {\n setFocused(null);\n return;\n }\n if (focusedId === null) {\n setFocused(delta === 1 ? (order[0] ?? null) : (order[order.length - 1] ?? null));\n return;\n }\n const idx = order.indexOf(focusedId);\n if (idx === -1) {\n setFocused(order[0] ?? null);\n return;\n }\n const nextIdx = (idx + delta + order.length) % order.length;\n setFocused(order[nextIdx] ?? null);\n }\n\n return {\n register(node) {\n // No focus side-effect: on a touch-first engine an auto-focused first\n // registrant paints a permanent focus ring with no input. Focus stays null\n // until a driver (keyboard/gamepad) or an explicit focusFirst() acts.\n const entry: Entry = { ...node, seq: seqCounter++ };\n nodes.set(node.id, entry);\n return () => {\n this.unregister(node.id);\n };\n },\n unregister(id) {\n if (!nodes.has(id)) return;\n nodes.delete(id);\n if (focusedId === id) {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n }\n },\n focus(id) {\n const entry = nodes.get(id);\n if (!entry || entry.disabled) return;\n setFocused(id);\n },\n focusFirst() {\n const order = orderedIds();\n setFocused(order[0] ?? null);\n },\n blur() {\n setFocused(null);\n },\n next() {\n move(1);\n },\n prev() {\n move(-1);\n },\n activate() {\n if (focusedId === null) return;\n nodes.get(focusedId)?.onActivate?.();\n },\n getFocused() {\n return focusedId;\n },\n getOrder() {\n return orderedIds();\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n","import type { FocusManager } from './focus.js';\n\n/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */\nexport interface FocusKeySource {\n wasPressed(code: string): boolean;\n}\n\nexport interface FocusKeyboardDriver {\n /** Call once per frame; polls edges and drives the manager. */\n update(): void;\n}\n\nexport interface FocusKeyboardDriverOptions {\n next?: readonly string[];\n prev?: readonly string[];\n activate?: readonly string[];\n}\n\nconst DEFAULT_NEXT: readonly string[] = ['ArrowDown', 'ArrowRight', 'Tab'];\nconst DEFAULT_PREV: readonly string[] = ['ArrowUp', 'ArrowLeft'];\nconst DEFAULT_ACTIVATE: readonly string[] = ['Enter', 'Space'];\n\nexport function createFocusKeyboardDriver(\n manager: FocusManager,\n keys: FocusKeySource,\n options?: FocusKeyboardDriverOptions,\n): FocusKeyboardDriver {\n const nextCodes = options?.next ?? DEFAULT_NEXT;\n const prevCodes = options?.prev ?? DEFAULT_PREV;\n const activateCodes = options?.activate ?? DEFAULT_ACTIVATE;\n\n return {\n update(): void {\n for (let i = 0; i < nextCodes.length; i++) {\n if (keys.wasPressed(nextCodes[i]!)) {\n manager.next();\n return;\n }\n }\n for (let i = 0; i < prevCodes.length; i++) {\n if (keys.wasPressed(prevCodes[i]!)) {\n manager.prev();\n return;\n }\n }\n for (let i = 0; i < activateCodes.length; i++) {\n if (keys.wasPressed(activateCodes[i]!)) {\n manager.activate();\n return;\n }\n }\n },\n };\n}\n","import { createElement, type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { createFocusManager, type FocusManager } from './focus.js';\nimport { FocusContext, type FocusContextValue } from './focus-context.js';\n\nexport interface FocusProviderProps {\n manager?: FocusManager;\n /**\n * Opt-in initial focus: focus the tab-order first node once, at the commit\n * where this provider mounts. Off by default so a touch-first tree shows no\n * focus ring until a driver acts. This is mount-time only — it picks among the\n * nodes registered by that first commit and does not re-fire for children that\n * mount later (async/lazy sets). For a dynamic set drive focus explicitly\n * (a keyboard/gamepad driver, or manager.focusFirst()).\n */\n autoFocus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Instantiates a FocusManager (or uses the one provided) and publishes\n * { manager, focusedId } as context state so consumers re-render on focus\n * moves.\n */\nexport function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode {\n const [mgr] = useState<FocusManager>(() => manager ?? createFocusManager());\n const [focusedId, setFocusedId] = useState<string | null>(() => mgr.getFocused());\n\n useEffect(() => {\n setFocusedId(mgr.getFocused());\n return mgr.subscribe((id) => {\n setFocusedId(id);\n });\n }, [mgr]);\n\n useEffect(() => {\n // Child register effects run before this parent effect, so every node is\n // registered here → focusFirst() picks the true tab-order first.\n if (autoFocus && mgr.getFocused() === null) mgr.focusFirst();\n }, [autoFocus, mgr]);\n\n const value = useMemo<FocusContextValue>(() => ({ manager: mgr, focusedId }), [mgr, focusedId]);\n\n return createElement(FocusContext.Provider, { value }, children);\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ProgressBarProps {\n /** Progress in [0, 1]. Values outside are clamped. */\n value: number;\n /** Height of the bar in pixels. */\n height?: number;\n /** Track color override. Defaults to theme.colors.surfaceAlt. */\n trackColor?: string;\n /** Fill color override. Defaults to theme.colors.accent. */\n fillColor?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function ProgressBar({\n value,\n height = 8,\n trackColor,\n fillColor,\n style,\n}: ProgressBarProps): ReactNode {\n const theme = useTheme();\n const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));\n const r = theme.radii.sm;\n\n return (\n <View\n style={[\n {\n height,\n borderRadius: r,\n backgroundColor: trackColor ?? theme.colors.surfaceAlt,\n overflow: 'hidden',\n },\n style,\n ]}\n >\n <View\n style={{\n width: `${clamped * 100}%`,\n height: '100%',\n backgroundColor: fillColor ?? theme.colors.accent,\n }}\n />\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { View } from 'react-native';\nimport { Label } from './label.js';\nimport { ProgressBar } from './progress-bar.js';\nimport { useTheme } from './theme.js';\n\nexport type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';\n\nexport interface HUDBarProps {\n label: string;\n value: number;\n max: number;\n kind?: HUDBarKind;\n /** When true, shows \"value / max\" next to the label. */\n showNumbers?: boolean;\n /** Override bar fill color. */\n fillColor?: string;\n}\n\nexport function HUDBar({\n label,\n value,\n max,\n kind = 'custom',\n showNumbers = true,\n fillColor,\n}: HUDBarProps): ReactNode {\n const theme = useTheme();\n const ratio = max <= 0 ? 0 : value / max;\n\n let color = fillColor;\n if (!color) {\n switch (kind) {\n case 'hp':\n color = theme.colors.danger;\n break;\n case 'mp':\n color = theme.colors.accent;\n break;\n case 'xp':\n color = theme.colors.success;\n break;\n default:\n color = theme.colors.accent;\n }\n }\n\n return (\n <View>\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: theme.spacing.xs,\n }}\n >\n <Label variant=\"sm\" tone=\"muted\">\n {label}\n </Label>\n {showNumbers && (\n <Label variant=\"sm\" tone=\"muted\" mono>\n {`${Math.max(0, Math.floor(value))} / ${Math.max(0, Math.floor(max))}`}\n </Label>\n )}\n </View>\n <ProgressBar value={ratio} fillColor={color} />\n </View>\n );\n}\n","/**\n * Minimal flex-like layout resolver.\n *\n * Computes positions + sizes for a single container + its direct children.\n * Supports row/column direction, gap, padding, main-axis `justifyContent`,\n * cross-axis `alignItems`, and per-child `grow` / `basis` / fixed size.\n *\n * Pure function — callers use it to drive their own renderer. React Native\n * already does its own flex, so this is primarily for Skia-rendered HUD /\n * menu layouts that need deterministic pixel positions.\n */\n\nexport type FlexDirection = 'row' | 'column';\nexport type JustifyContent =\n | 'start'\n | 'end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\nexport type AlignItems = 'start' | 'end' | 'center' | 'stretch';\n\nexport interface Padding {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface LayoutChild {\n /** Fixed main-axis size. Ignored when `grow > 0`. */\n basis?: number;\n /** Fractional share of leftover main-axis space. */\n grow?: number;\n /** Fixed cross-axis size. Overrides stretch. */\n crossSize?: number;\n}\n\nexport interface LayoutContainer {\n width: number;\n height: number;\n direction: FlexDirection;\n gap?: number;\n padding?: Partial<Padding>;\n justifyContent?: JustifyContent;\n alignItems?: AlignItems;\n}\n\nexport interface LayoutRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst ZERO_PAD: Padding = { top: 0, right: 0, bottom: 0, left: 0 };\n\nfunction resolvePadding(p: Partial<Padding> | undefined): Padding {\n if (!p) return ZERO_PAD;\n return {\n top: p.top ?? 0,\n right: p.right ?? 0,\n bottom: p.bottom ?? 0,\n left: p.left ?? 0,\n };\n}\n\nexport function resolveLayout(\n container: LayoutContainer,\n children: readonly LayoutChild[],\n): LayoutRect[] {\n const n = children.length;\n if (n === 0) return [];\n\n const pad = resolvePadding(container.padding);\n const gap = container.gap ?? 0;\n const isRow = container.direction === 'row';\n const mainSize =\n (isRow ? container.width : container.height) -\n (isRow ? pad.left + pad.right : pad.top + pad.bottom);\n const crossSize =\n (isRow ? container.height : container.width) -\n (isRow ? pad.top + pad.bottom : pad.left + pad.right);\n const mainStart = isRow ? pad.left : pad.top;\n const crossStart = isRow ? pad.top : pad.left;\n const justify = container.justifyContent ?? 'start';\n const align = container.alignItems ?? 'stretch';\n const totalGap = gap * Math.max(0, n - 1);\n\n let totalBasis = 0;\n let totalGrow = 0;\n for (const c of children) {\n totalBasis += c.basis ?? 0;\n totalGrow += c.grow ?? 0;\n }\n\n const leftover = mainSize - totalBasis - totalGap;\n const sizes: number[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const base = c.basis ?? 0;\n const growShare = totalGrow > 0 ? ((c.grow ?? 0) / totalGrow) * Math.max(0, leftover) : 0;\n sizes[i] = Math.max(0, base + growShare);\n }\n\n const used = sizes.reduce((acc, s) => acc + s, 0) + totalGap;\n const free = Math.max(0, mainSize - used);\n\n let cursor = mainStart;\n let spacing = gap;\n switch (justify) {\n case 'start':\n break;\n case 'end':\n cursor = mainStart + free;\n break;\n case 'center':\n cursor = mainStart + free / 2;\n break;\n case 'space-between':\n if (n > 1) spacing = gap + free / (n - 1);\n break;\n case 'space-around':\n if (n > 0) {\n const s = free / n;\n cursor = mainStart + s / 2;\n spacing = gap + s;\n }\n break;\n case 'space-evenly':\n if (n >= 0) {\n const s = free / (n + 1);\n cursor = mainStart + s;\n spacing = gap + s;\n }\n break;\n }\n\n const out: LayoutRect[] = new Array(n);\n for (let i = 0; i < n; i++) {\n const c = children[i] as LayoutChild;\n const mainLen = sizes[i] as number;\n const crossLen = c.crossSize !== undefined ? c.crossSize : align === 'stretch' ? crossSize : 0;\n\n let crossOffset: number;\n switch (align) {\n case 'start':\n crossOffset = 0;\n break;\n case 'end':\n crossOffset = crossSize - crossLen;\n break;\n case 'center':\n crossOffset = (crossSize - crossLen) / 2;\n break;\n case 'stretch':\n crossOffset = 0;\n break;\n }\n\n const x = isRow ? cursor : crossStart + crossOffset;\n const y = isRow ? crossStart + crossOffset : cursor;\n const w = isRow ? mainLen : crossLen;\n const h = isRow ? crossLen : mainLen;\n\n out[i] = { x, y, width: w, height: h };\n cursor += mainLen + spacing;\n }\n\n return out;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { useTheme } from './theme.js';\n\nexport interface ListProps {\n children?: ReactNode;\n /** Gap between items in pixels. Defaults to theme.spacing.sm. */\n gap?: number;\n direction?: 'column' | 'row';\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Vertical (or horizontal) stack with consistent gap. Thin container; the\n * focus manager handles navigation between interactive children.\n */\nexport function List({ children, gap, direction = 'column', style }: ListProps): ReactNode {\n const theme = useTheme();\n const g = gap ?? theme.spacing.sm;\n\n const items: ReactNode[] = [];\n let i = 0;\n const flat = Array.isArray(children) ? children : [children];\n for (const child of flat) {\n if (child === null || child === undefined || child === false) continue;\n if (i > 0) {\n const spacerStyle: ViewStyle = direction === 'row' ? { width: g } : { height: g };\n items.push(<View key={`s-${i}`} style={spacerStyle} />);\n }\n items.push(<Fragment key={`i-${i}`}>{child}</Fragment>);\n i++;\n }\n\n return <View style={[{ flexDirection: direction }, style]}>{items}</View>;\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button, type ButtonVariant } from './button.js';\nimport { Label } from './label.js';\nimport { useTheme } from './theme.js';\n\nexport interface MainMenuItem {\n /** Stable id — used as focus id + React key. */\n readonly id: string;\n /** Localized label. */\n readonly label: string;\n readonly onPress: () => void;\n readonly variant?: ButtonVariant;\n readonly disabled?: boolean;\n}\n\nexport interface MainMenuKitProps {\n /** Localized title. */\n readonly title: string;\n /** Optional localized subtitle — tagline, version, locale flag, etc. */\n readonly subtitle?: string;\n /** Button list. Rendered top-to-bottom in order. */\n readonly items: readonly MainMenuItem[];\n /**\n * Optional footer slot — typically a row of ghost buttons (credits, links)\n * or a version/build string.\n */\n readonly footer?: ReactNode;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * Title-screen kit: headline, optional subtitle, vertical button list,\n * optional footer slot. All strings are caller-supplied (localized upstream).\n *\n * Save-slot / settings / credits panels are built on top of this kit by the\n * consumer; the kit itself is a pure title-menu primitive.\n */\nexport function MainMenuKit({\n title,\n subtitle,\n items,\n footer,\n style,\n}: MainMenuKitProps): ReactNode {\n const theme = useTheme();\n return (\n <View\n style={[\n {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing.lg,\n },\n style,\n ]}\n >\n <Label variant=\"xl\" tone=\"accent\" style={{ marginBottom: theme.spacing.xs }}>\n {title}\n </Label>\n {subtitle !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginBottom: theme.spacing.lg }}>\n {subtitle}\n </Label>\n ) : (\n <View style={{ height: theme.spacing.lg }} />\n )}\n <View style={{ alignSelf: 'stretch', maxWidth: 320, width: '100%' }}>\n {items.map((item, i) => (\n <View key={item.id} style={{ marginTop: i === 0 ? 0 : theme.spacing.sm }}>\n <Button\n label={item.label}\n onPress={item.onPress}\n variant={item.variant ?? 'primary'}\n disabled={item.disabled}\n focusId={item.id}\n tabIndex={i}\n />\n </View>\n ))}\n </View>\n {footer !== undefined ? <View style={{ marginTop: theme.spacing.lg }}>{footer}</View> : null}\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { Panel } from './panel.js';\n\nexport interface ModalProps {\n visible: boolean;\n children?: ReactNode;\n /** Called when the backdrop is pressed. Return nothing to close, or do nothing to make it non-dismissable. */\n onBackdropPress?: () => void;\n /** Backdrop opacity 0..1. Defaults to 0.6. */\n backdropOpacity?: number;\n}\n\n/**\n * Overlay modal that renders a centered `Panel` with its children. Parent is\n * responsible for controlling visibility and (if desired) focus trapping via\n * the shared FocusManager.\n */\nexport function Modal({\n visible,\n children,\n onBackdropPress,\n backdropOpacity = 0.6,\n}: ModalProps): ReactNode {\n if (!visible) return null;\n\n return (\n <View\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n pointerEvents=\"box-none\"\n >\n <Pressable\n onPress={onBackdropPress}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: `rgba(0,0,0,${backdropOpacity})`,\n }}\n />\n <Panel variant=\"elevated\" padding=\"lg\" style={{ minWidth: 240, maxWidth: '80%' }}>\n {children}\n </Panel>\n </View>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { Button } from './button.js';\nimport { Label } from './label.js';\nimport { Panel } from './panel.js';\nimport { useTheme } from './theme.js';\n\nexport interface ShopItem {\n /** Store product id — forwarded verbatim to `onPurchase`. */\n readonly productId: string;\n /** Localized display title. */\n readonly title: string;\n /** Localized price string (from `Product.priceDisplay`). */\n readonly priceDisplay: string;\n /** Optional localized description. */\n readonly description?: string;\n /**\n * Entitlement key(s) that mark this product as already owned. When the\n * store reports any of these as entitled, the purchase button is replaced\n * with an \"owned\" label.\n */\n readonly ownedKeys?: readonly string[];\n readonly disabled?: boolean;\n}\n\nexport interface ShopPanelProps {\n readonly items: readonly ShopItem[];\n /** Returns `true` when the given entitlement key is already owned. */\n readonly isEntitled: (key: string) => boolean;\n /** Called when a not-owned item's purchase button is pressed. */\n readonly onPurchase: (productId: string) => void;\n /** Localized label for already-owned items. Defaults to \"Owned\". */\n readonly ownedLabel?: string;\n /** Localized label for the purchase action. Defaults to the item's price. */\n readonly purchaseLabelFor?: (item: ShopItem) => string;\n readonly style?: StyleProp<ViewStyle>;\n}\n\n/**\n * List-style shop panel. Caller builds the `items` array by joining a\n * `ProductCatalog` with the `Product[]` returned by `IAPProvider.getProducts`.\n *\n * Price strings and ownership copy are caller-provided so the UI kit stays\n * localization-free.\n */\nexport function ShopPanel({\n items,\n isEntitled,\n onPurchase,\n ownedLabel = 'Owned',\n purchaseLabelFor,\n style,\n}: ShopPanelProps): ReactNode {\n const theme = useTheme();\n return (\n <Panel variant=\"elevated\" padding=\"md\" style={style}>\n {items.map((item, i) => {\n const owned = item.ownedKeys?.some((k) => isEntitled(k)) ?? false;\n return (\n <View\n key={item.productId}\n style={{\n marginTop: i === 0 ? 0 : theme.spacing.md,\n paddingTop: i === 0 ? 0 : theme.spacing.md,\n borderTopWidth: i === 0 ? 0 : 1,\n borderTopColor: theme.colors.border,\n }}\n >\n <Label variant=\"md\">{item.title}</Label>\n {item.description !== undefined ? (\n <Label variant=\"sm\" tone=\"muted\" style={{ marginTop: theme.spacing.xs }}>\n {item.description}\n </Label>\n ) : null}\n <View style={{ marginTop: theme.spacing.sm }}>\n {owned ? (\n <Button label={ownedLabel} variant=\"ghost\" disabled />\n ) : (\n <Button\n label={purchaseLabelFor ? purchaseLabelFor(item) : item.priceDisplay}\n variant=\"primary\"\n disabled={item.disabled}\n onPress={() => onPurchase(item.productId)}\n />\n )}\n </View>\n </View>\n );\n })}\n </Panel>\n );\n}\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,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,IAAI,MAAM,QAAQ;KACvC,YAAY,MAAM,IAAI,IAAI,MAAM,QAAQ;KACxC,gBAAgB,MAAM,IAAI,IAAI;KAC9B,gBAAgB,MAAM,OAAO;IAC/B;cAPF;KASE,oBAAC,OAAD;MAAO,SAAQ;gBAAM,KAAK;KAAa,CAAA;KACtC,KAAK,gBAAgB,KAAA,IACpB,oBAAC,OAAD;MAAO,SAAQ;MAAK,MAAK;MAAQ,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACnE,KAAK;KACD,CAAA,IACL;KACJ,oBAAC,MAAD;MAAM,OAAO,EAAE,WAAW,MAAM,QAAQ,GAAG;gBACxC,QACC,oBAAC,QAAD;OAAQ,OAAO;OAAY,SAAQ;OAAQ,UAAA;MAAU,CAAA,IAErD,oBAAC,QAAD;OACE,OAAO,mBAAmB,iBAAiB,IAAI,IAAI,KAAK;OACxD,SAAQ;OACR,UAAU,KAAK;OACf,eAAe,WAAW,KAAK,SAAS;MACzC,CAAA;KAEC,CAAA;IACF;MA1BC,KAAK,SA0BN;EAEV,CAAC;CACI,CAAA;AAEX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flare-engine/ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "UI kit — themed primitives, focus navigation, flex layout resolver",
5
5
  "keywords": ["flare-engine", "ui", "react-native", "menu", "hud", "theme"],
6
6
  "license": "Apache-2.0",