@flare-engine/ui 0.4.6 → 0.4.7
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 +21 -51
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +21 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -62
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
|
|
3
|
-
//#region src/button.d.ts
|
|
4
3
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
4
|
interface ButtonProps {
|
|
6
5
|
label: string;
|
|
@@ -13,9 +12,7 @@ interface ButtonProps {
|
|
|
13
12
|
focusId?: string;
|
|
14
13
|
style?: StyleProp<ViewStyle>;
|
|
15
14
|
}
|
|
16
|
-
declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/dialogue-panel.d.ts
|
|
15
|
+
export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
|
|
19
16
|
interface DialogueChoice {
|
|
20
17
|
/** Display label (already localized by the caller). */
|
|
21
18
|
readonly label: string;
|
|
@@ -49,9 +46,7 @@ interface DialoguePanelProps {
|
|
|
49
46
|
*
|
|
50
47
|
* Portrait resolution is caller-owned so the UI kit stays asset-agnostic.
|
|
51
48
|
*/
|
|
52
|
-
declare function DialoguePanel({ speaker, text, portrait, choices, onAdvance, style }: DialoguePanelProps): ReactNode;
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/focus.d.ts
|
|
49
|
+
export declare function DialoguePanel({ speaker, text, portrait, choices, onAdvance, style }: DialoguePanelProps): ReactNode;
|
|
55
50
|
/**
|
|
56
51
|
* Keyboard + (future) gamepad focus navigation.
|
|
57
52
|
*
|
|
@@ -87,18 +82,14 @@ interface FocusManager {
|
|
|
87
82
|
getOrder(): readonly string[];
|
|
88
83
|
subscribe(listener: (focusedId: string | null) => void): () => void;
|
|
89
84
|
}
|
|
90
|
-
declare function createFocusManager(): FocusManager;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/focus-context.d.ts
|
|
85
|
+
export declare function createFocusManager(): FocusManager;
|
|
93
86
|
interface FocusContextValue {
|
|
94
87
|
manager: FocusManager;
|
|
95
88
|
focusedId: string | null;
|
|
96
89
|
}
|
|
97
|
-
declare const FocusContext: import("react").Context<FocusContextValue | null>;
|
|
98
|
-
declare function useFocusManager(): FocusManager | null;
|
|
99
|
-
declare function useFocusedId(): string | null;
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region src/focus-keyboard-driver.d.ts
|
|
90
|
+
export declare const FocusContext: import("react").Context<FocusContextValue | null>;
|
|
91
|
+
export declare function useFocusManager(): FocusManager | null;
|
|
92
|
+
export declare function useFocusedId(): string | null;
|
|
102
93
|
/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */
|
|
103
94
|
interface FocusKeySource {
|
|
104
95
|
wasPressed(code: string): boolean;
|
|
@@ -112,9 +103,7 @@ interface FocusKeyboardDriverOptions {
|
|
|
112
103
|
prev?: readonly string[];
|
|
113
104
|
activate?: readonly string[];
|
|
114
105
|
}
|
|
115
|
-
declare function createFocusKeyboardDriver(manager: FocusManager, keys: FocusKeySource, options?: FocusKeyboardDriverOptions): FocusKeyboardDriver;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/focus-provider.d.ts
|
|
106
|
+
export declare function createFocusKeyboardDriver(manager: FocusManager, keys: FocusKeySource, options?: FocusKeyboardDriverOptions): FocusKeyboardDriver;
|
|
118
107
|
interface FocusProviderProps {
|
|
119
108
|
manager?: FocusManager;
|
|
120
109
|
/**
|
|
@@ -133,9 +122,7 @@ interface FocusProviderProps {
|
|
|
133
122
|
* { manager, focusedId } as context state so consumers re-render on focus
|
|
134
123
|
* moves.
|
|
135
124
|
*/
|
|
136
|
-
declare function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode;
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/hud-bar.d.ts
|
|
125
|
+
export declare function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode;
|
|
139
126
|
type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';
|
|
140
127
|
interface HUDBarProps {
|
|
141
128
|
label: string;
|
|
@@ -147,9 +134,7 @@ interface HUDBarProps {
|
|
|
147
134
|
/** Override bar fill color. */
|
|
148
135
|
fillColor?: string;
|
|
149
136
|
}
|
|
150
|
-
declare function HUDBar({ label, value, max, kind, showNumbers, fillColor }: HUDBarProps): ReactNode;
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/label.d.ts
|
|
137
|
+
export declare function HUDBar({ label, value, max, kind, showNumbers, fillColor }: HUDBarProps): ReactNode;
|
|
153
138
|
type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
154
139
|
type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';
|
|
155
140
|
interface LabelProps {
|
|
@@ -163,9 +148,7 @@ interface LabelProps {
|
|
|
163
148
|
adjustsFontSizeToFit?: boolean;
|
|
164
149
|
minimumFontScale?: number;
|
|
165
150
|
}
|
|
166
|
-
declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region src/layout.d.ts
|
|
151
|
+
export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
|
|
169
152
|
/**
|
|
170
153
|
* Minimal flex-like layout resolver.
|
|
171
154
|
*
|
|
@@ -209,9 +192,7 @@ interface LayoutRect {
|
|
|
209
192
|
width: number;
|
|
210
193
|
height: number;
|
|
211
194
|
}
|
|
212
|
-
declare function resolveLayout(container: LayoutContainer, children: readonly LayoutChild[]): LayoutRect[];
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region src/list.d.ts
|
|
195
|
+
export declare function resolveLayout(container: LayoutContainer, children: readonly LayoutChild[]): LayoutRect[];
|
|
215
196
|
interface ListProps {
|
|
216
197
|
children?: ReactNode;
|
|
217
198
|
/** Gap between items in pixels. Defaults to theme.spacing.sm. */
|
|
@@ -223,9 +204,7 @@ interface ListProps {
|
|
|
223
204
|
* Vertical (or horizontal) stack with consistent gap. Thin container; the
|
|
224
205
|
* focus manager handles navigation between interactive children.
|
|
225
206
|
*/
|
|
226
|
-
declare function List({ children, gap, direction, style }: ListProps): ReactNode;
|
|
227
|
-
//#endregion
|
|
228
|
-
//#region src/main-menu-kit.d.ts
|
|
207
|
+
export declare function List({ children, gap, direction, style }: ListProps): ReactNode;
|
|
229
208
|
interface MainMenuItem {
|
|
230
209
|
/** Stable id — used as focus id + React key. */
|
|
231
210
|
readonly id: string;
|
|
@@ -256,9 +235,7 @@ interface MainMenuKitProps {
|
|
|
256
235
|
* Save-slot / settings / credits panels are built on top of this kit by the
|
|
257
236
|
* consumer; the kit itself is a pure title-menu primitive.
|
|
258
237
|
*/
|
|
259
|
-
declare function MainMenuKit({ title, subtitle, items, footer, style }: MainMenuKitProps): ReactNode;
|
|
260
|
-
//#endregion
|
|
261
|
-
//#region src/modal.d.ts
|
|
238
|
+
export declare function MainMenuKit({ title, subtitle, items, footer, style }: MainMenuKitProps): ReactNode;
|
|
262
239
|
interface ModalProps {
|
|
263
240
|
visible: boolean;
|
|
264
241
|
children?: ReactNode;
|
|
@@ -272,9 +249,7 @@ interface ModalProps {
|
|
|
272
249
|
* responsible for controlling visibility and (if desired) focus trapping via
|
|
273
250
|
* the shared FocusManager.
|
|
274
251
|
*/
|
|
275
|
-
declare function Modal({ visible, children, onBackdropPress, backdropOpacity }: ModalProps): ReactNode;
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/panel.d.ts
|
|
252
|
+
export declare function Modal({ visible, children, onBackdropPress, backdropOpacity }: ModalProps): ReactNode;
|
|
278
253
|
interface PanelProps {
|
|
279
254
|
children?: ReactNode;
|
|
280
255
|
/** Visual style: surface (default) or elevated (surfaceAlt + border). */
|
|
@@ -285,9 +260,7 @@ interface PanelProps {
|
|
|
285
260
|
radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
|
|
286
261
|
style?: StyleProp<ViewStyle>;
|
|
287
262
|
}
|
|
288
|
-
declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/progress-bar.d.ts
|
|
263
|
+
export declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
|
|
291
264
|
interface ProgressBarProps {
|
|
292
265
|
/** Progress in [0, 1]. Values outside are clamped. */
|
|
293
266
|
value: number;
|
|
@@ -299,9 +272,7 @@ interface ProgressBarProps {
|
|
|
299
272
|
fillColor?: string;
|
|
300
273
|
style?: StyleProp<ViewStyle>;
|
|
301
274
|
}
|
|
302
|
-
declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region src/theme.d.ts
|
|
275
|
+
export declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
|
|
305
276
|
interface ThemeColors {
|
|
306
277
|
bg: string;
|
|
307
278
|
surface: string;
|
|
@@ -346,14 +317,13 @@ interface Theme {
|
|
|
346
317
|
typography: ThemeTypography;
|
|
347
318
|
radii: ThemeRadii;
|
|
348
319
|
}
|
|
349
|
-
declare const darkTheme: Theme;
|
|
350
|
-
declare const lightTheme: Theme;
|
|
320
|
+
export declare const darkTheme: Theme;
|
|
321
|
+
export declare const lightTheme: Theme;
|
|
351
322
|
interface ThemeProviderProps {
|
|
352
323
|
theme?: Theme;
|
|
353
324
|
children: ReactNode;
|
|
354
325
|
}
|
|
355
|
-
declare function ThemeProvider({ theme, children }: ThemeProviderProps): ReactNode;
|
|
356
|
-
declare function useTheme(): Theme;
|
|
357
|
-
|
|
358
|
-
export { type AlignItems, Button, type ButtonProps, type ButtonVariant, type DialogueChoice, DialoguePanel, type DialoguePanelProps, type FlexDirection, FocusContext, type FocusContextValue, type FocusKeySource, type FocusKeyboardDriver, type FocusKeyboardDriverOptions, type FocusManager, type FocusNode, FocusProvider, type FocusProviderProps, HUDBar, type HUDBarKind, type HUDBarProps, type JustifyContent, Label, type LabelProps, type LabelTone, type LabelVariant, type LayoutChild, type LayoutContainer, type LayoutRect, List, type ListProps, type MainMenuItem, MainMenuKit, type MainMenuKitProps, Modal, type ModalProps, type Padding, Panel, type PanelProps, ProgressBar, type ProgressBarProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeRadii, type ThemeSpacing, type ThemeTypography, createFocusKeyboardDriver, createFocusManager, darkTheme, lightTheme, resolveLayout, useFocusManager, useFocusedId, useTheme };
|
|
326
|
+
export declare function ThemeProvider({ theme, children }: ThemeProviderProps): ReactNode;
|
|
327
|
+
export declare function useTheme(): Theme;
|
|
328
|
+
export type { AlignItems, ButtonProps, ButtonVariant, DialogueChoice, DialoguePanelProps, FlexDirection, FocusContextValue, FocusKeySource, FocusKeyboardDriver, FocusKeyboardDriverOptions, FocusManager, FocusNode, FocusProviderProps, HUDBarKind, HUDBarProps, JustifyContent, LabelProps, LabelTone, LabelVariant, LayoutChild, LayoutContainer, LayoutRect, ListProps, MainMenuItem, MainMenuKitProps, ModalProps, Padding, PanelProps, ProgressBarProps, Theme, ThemeColors, ThemeProviderProps, ThemeRadii, ThemeSpacing, ThemeTypography };
|
|
359
329
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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/theme.ts"],"mappings":"
|
|
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/theme.ts"],"mappings":";;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;wBAUb,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;;wBAOP,sBAAsB;UCvCrB;EACf,SAAS;EACT;;qBAGW,8BAAY,QAAA;wBAET,mBAAmB;wBAKnB;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;wBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;wBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;wBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ,UAAU;EAClB;EACA,gBAAgB;EAChB;EACA;;wBAGc,QACd,UACA,SACA,MACA,MACA,OACA,eACA,eACA,sBACA,oBACC,aAAa;;;;;;;;;;;;KCjBJ;KACA;KAOA;UAEK;EACf;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,WAAW;EACX;EACA,UAAU,QAAQ;EAClB,iBAAiB;EACjB,aAAa;;UAGE;EACf;EACA;EACA;EACA;;wBAec,cACd,WAAW,iBACX,mBAAmB,gBAClB;UClEc;EACf,WAAW;;EAEX;EACA;EACA,QAAQ,UAAU;;;;;;wBAOJ,OAAO,UAAU,KAAK,WAAsB,SAAS,YAAY;UCVhE;;WAEN;;WAEA;WACA;WACA,UAAU;WACV;;UAGM;;WAEN;;WAEA;;WAEA,gBAAgB;;;;;WAKhB,SAAS;WACT,QAAQ,UAAU;;;;;;;;;wBAUb,cACd,OACA,UACA,OACA,QACA,SACC,mBAAmB;UCxCL;EACf;EACA,WAAW;;EAEX;;EAEA;;;;;;;wBAQc,QACd,SACA,UACA,iBACA,mBACC,aAAa;UCnBC;EACf,WAAW;;EAEX;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,QACd,UACA,SACA,SACA,QACA,SACC,aAAa;UCjBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;UCpBL;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;qBAGI,WAAW;qBA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;wBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;wBAIpE,YAAY"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { StyleProp, TextProps, TextStyle, ViewStyle } from "react-native";
|
|
3
|
-
//#region src/button.d.ts
|
|
4
3
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
4
|
interface ButtonProps {
|
|
6
5
|
label: string;
|
|
@@ -13,9 +12,7 @@ interface ButtonProps {
|
|
|
13
12
|
focusId?: string;
|
|
14
13
|
style?: StyleProp<ViewStyle>;
|
|
15
14
|
}
|
|
16
|
-
declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/dialogue-panel.d.ts
|
|
15
|
+
export declare function Button({ label, onPress, variant, disabled, tabIndex, focusId, style }: ButtonProps): ReactNode;
|
|
19
16
|
interface DialogueChoice {
|
|
20
17
|
/** Display label (already localized by the caller). */
|
|
21
18
|
readonly label: string;
|
|
@@ -49,9 +46,7 @@ interface DialoguePanelProps {
|
|
|
49
46
|
*
|
|
50
47
|
* Portrait resolution is caller-owned so the UI kit stays asset-agnostic.
|
|
51
48
|
*/
|
|
52
|
-
declare function DialoguePanel({ speaker, text, portrait, choices, onAdvance, style }: DialoguePanelProps): ReactNode;
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/focus.d.ts
|
|
49
|
+
export declare function DialoguePanel({ speaker, text, portrait, choices, onAdvance, style }: DialoguePanelProps): ReactNode;
|
|
55
50
|
/**
|
|
56
51
|
* Keyboard + (future) gamepad focus navigation.
|
|
57
52
|
*
|
|
@@ -87,18 +82,14 @@ interface FocusManager {
|
|
|
87
82
|
getOrder(): readonly string[];
|
|
88
83
|
subscribe(listener: (focusedId: string | null) => void): () => void;
|
|
89
84
|
}
|
|
90
|
-
declare function createFocusManager(): FocusManager;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/focus-context.d.ts
|
|
85
|
+
export declare function createFocusManager(): FocusManager;
|
|
93
86
|
interface FocusContextValue {
|
|
94
87
|
manager: FocusManager;
|
|
95
88
|
focusedId: string | null;
|
|
96
89
|
}
|
|
97
|
-
declare const FocusContext: import("react").Context<FocusContextValue | null>;
|
|
98
|
-
declare function useFocusManager(): FocusManager | null;
|
|
99
|
-
declare function useFocusedId(): string | null;
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region src/focus-keyboard-driver.d.ts
|
|
90
|
+
export declare const FocusContext: import("react").Context<FocusContextValue | null>;
|
|
91
|
+
export declare function useFocusManager(): FocusManager | null;
|
|
92
|
+
export declare function useFocusedId(): string | null;
|
|
102
93
|
/** Structural key source — createKeyboard() from @flare-engine/input is assignable; no hard dep. */
|
|
103
94
|
interface FocusKeySource {
|
|
104
95
|
wasPressed(code: string): boolean;
|
|
@@ -112,9 +103,7 @@ interface FocusKeyboardDriverOptions {
|
|
|
112
103
|
prev?: readonly string[];
|
|
113
104
|
activate?: readonly string[];
|
|
114
105
|
}
|
|
115
|
-
declare function createFocusKeyboardDriver(manager: FocusManager, keys: FocusKeySource, options?: FocusKeyboardDriverOptions): FocusKeyboardDriver;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/focus-provider.d.ts
|
|
106
|
+
export declare function createFocusKeyboardDriver(manager: FocusManager, keys: FocusKeySource, options?: FocusKeyboardDriverOptions): FocusKeyboardDriver;
|
|
118
107
|
interface FocusProviderProps {
|
|
119
108
|
manager?: FocusManager;
|
|
120
109
|
/**
|
|
@@ -133,9 +122,7 @@ interface FocusProviderProps {
|
|
|
133
122
|
* { manager, focusedId } as context state so consumers re-render on focus
|
|
134
123
|
* moves.
|
|
135
124
|
*/
|
|
136
|
-
declare function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode;
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/hud-bar.d.ts
|
|
125
|
+
export declare function FocusProvider({ manager, autoFocus, children }: FocusProviderProps): ReactNode;
|
|
139
126
|
type HUDBarKind = 'hp' | 'mp' | 'xp' | 'custom';
|
|
140
127
|
interface HUDBarProps {
|
|
141
128
|
label: string;
|
|
@@ -147,9 +134,7 @@ interface HUDBarProps {
|
|
|
147
134
|
/** Override bar fill color. */
|
|
148
135
|
fillColor?: string;
|
|
149
136
|
}
|
|
150
|
-
declare function HUDBar({ label, value, max, kind, showNumbers, fillColor }: HUDBarProps): ReactNode;
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/label.d.ts
|
|
137
|
+
export declare function HUDBar({ label, value, max, kind, showNumbers, fillColor }: HUDBarProps): ReactNode;
|
|
153
138
|
type LabelVariant = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
154
139
|
type LabelTone = 'default' | 'muted' | 'accent' | 'danger' | 'success' | 'warning';
|
|
155
140
|
interface LabelProps {
|
|
@@ -163,9 +148,7 @@ interface LabelProps {
|
|
|
163
148
|
adjustsFontSizeToFit?: boolean;
|
|
164
149
|
minimumFontScale?: number;
|
|
165
150
|
}
|
|
166
|
-
declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region src/layout.d.ts
|
|
151
|
+
export declare function Label({ children, variant, tone, mono, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }: LabelProps): ReactNode;
|
|
169
152
|
/**
|
|
170
153
|
* Minimal flex-like layout resolver.
|
|
171
154
|
*
|
|
@@ -209,9 +192,7 @@ interface LayoutRect {
|
|
|
209
192
|
width: number;
|
|
210
193
|
height: number;
|
|
211
194
|
}
|
|
212
|
-
declare function resolveLayout(container: LayoutContainer, children: readonly LayoutChild[]): LayoutRect[];
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region src/list.d.ts
|
|
195
|
+
export declare function resolveLayout(container: LayoutContainer, children: readonly LayoutChild[]): LayoutRect[];
|
|
215
196
|
interface ListProps {
|
|
216
197
|
children?: ReactNode;
|
|
217
198
|
/** Gap between items in pixels. Defaults to theme.spacing.sm. */
|
|
@@ -223,9 +204,7 @@ interface ListProps {
|
|
|
223
204
|
* Vertical (or horizontal) stack with consistent gap. Thin container; the
|
|
224
205
|
* focus manager handles navigation between interactive children.
|
|
225
206
|
*/
|
|
226
|
-
declare function List({ children, gap, direction, style }: ListProps): ReactNode;
|
|
227
|
-
//#endregion
|
|
228
|
-
//#region src/main-menu-kit.d.ts
|
|
207
|
+
export declare function List({ children, gap, direction, style }: ListProps): ReactNode;
|
|
229
208
|
interface MainMenuItem {
|
|
230
209
|
/** Stable id — used as focus id + React key. */
|
|
231
210
|
readonly id: string;
|
|
@@ -256,9 +235,7 @@ interface MainMenuKitProps {
|
|
|
256
235
|
* Save-slot / settings / credits panels are built on top of this kit by the
|
|
257
236
|
* consumer; the kit itself is a pure title-menu primitive.
|
|
258
237
|
*/
|
|
259
|
-
declare function MainMenuKit({ title, subtitle, items, footer, style }: MainMenuKitProps): ReactNode;
|
|
260
|
-
//#endregion
|
|
261
|
-
//#region src/modal.d.ts
|
|
238
|
+
export declare function MainMenuKit({ title, subtitle, items, footer, style }: MainMenuKitProps): ReactNode;
|
|
262
239
|
interface ModalProps {
|
|
263
240
|
visible: boolean;
|
|
264
241
|
children?: ReactNode;
|
|
@@ -272,9 +249,7 @@ interface ModalProps {
|
|
|
272
249
|
* responsible for controlling visibility and (if desired) focus trapping via
|
|
273
250
|
* the shared FocusManager.
|
|
274
251
|
*/
|
|
275
|
-
declare function Modal({ visible, children, onBackdropPress, backdropOpacity }: ModalProps): ReactNode;
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/panel.d.ts
|
|
252
|
+
export declare function Modal({ visible, children, onBackdropPress, backdropOpacity }: ModalProps): ReactNode;
|
|
278
253
|
interface PanelProps {
|
|
279
254
|
children?: ReactNode;
|
|
280
255
|
/** Visual style: surface (default) or elevated (surfaceAlt + border). */
|
|
@@ -285,9 +260,7 @@ interface PanelProps {
|
|
|
285
260
|
radius?: 'none' | 'sm' | 'md' | 'lg' | 'pill';
|
|
286
261
|
style?: StyleProp<ViewStyle>;
|
|
287
262
|
}
|
|
288
|
-
declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/progress-bar.d.ts
|
|
263
|
+
export declare function Panel({ children, variant, padding, radius, style }: PanelProps): ReactNode;
|
|
291
264
|
interface ProgressBarProps {
|
|
292
265
|
/** Progress in [0, 1]. Values outside are clamped. */
|
|
293
266
|
value: number;
|
|
@@ -299,9 +272,7 @@ interface ProgressBarProps {
|
|
|
299
272
|
fillColor?: string;
|
|
300
273
|
style?: StyleProp<ViewStyle>;
|
|
301
274
|
}
|
|
302
|
-
declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region src/theme.d.ts
|
|
275
|
+
export declare function ProgressBar({ value, height, trackColor, fillColor, style }: ProgressBarProps): ReactNode;
|
|
305
276
|
interface ThemeColors {
|
|
306
277
|
bg: string;
|
|
307
278
|
surface: string;
|
|
@@ -346,14 +317,13 @@ interface Theme {
|
|
|
346
317
|
typography: ThemeTypography;
|
|
347
318
|
radii: ThemeRadii;
|
|
348
319
|
}
|
|
349
|
-
declare const darkTheme: Theme;
|
|
350
|
-
declare const lightTheme: Theme;
|
|
320
|
+
export declare const darkTheme: Theme;
|
|
321
|
+
export declare const lightTheme: Theme;
|
|
351
322
|
interface ThemeProviderProps {
|
|
352
323
|
theme?: Theme;
|
|
353
324
|
children: ReactNode;
|
|
354
325
|
}
|
|
355
|
-
declare function ThemeProvider({ theme, children }: ThemeProviderProps): ReactNode;
|
|
356
|
-
declare function useTheme(): Theme;
|
|
357
|
-
|
|
358
|
-
export { type AlignItems, Button, type ButtonProps, type ButtonVariant, type DialogueChoice, DialoguePanel, type DialoguePanelProps, type FlexDirection, FocusContext, type FocusContextValue, type FocusKeySource, type FocusKeyboardDriver, type FocusKeyboardDriverOptions, type FocusManager, type FocusNode, FocusProvider, type FocusProviderProps, HUDBar, type HUDBarKind, type HUDBarProps, type JustifyContent, Label, type LabelProps, type LabelTone, type LabelVariant, type LayoutChild, type LayoutContainer, type LayoutRect, List, type ListProps, type MainMenuItem, MainMenuKit, type MainMenuKitProps, Modal, type ModalProps, type Padding, Panel, type PanelProps, ProgressBar, type ProgressBarProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ThemeRadii, type ThemeSpacing, type ThemeTypography, createFocusKeyboardDriver, createFocusManager, darkTheme, lightTheme, resolveLayout, useFocusManager, useFocusedId, useTheme };
|
|
326
|
+
export declare function ThemeProvider({ theme, children }: ThemeProviderProps): ReactNode;
|
|
327
|
+
export declare function useTheme(): Theme;
|
|
328
|
+
export type { AlignItems, ButtonProps, ButtonVariant, DialogueChoice, DialoguePanelProps, FlexDirection, FocusContextValue, FocusKeySource, FocusKeyboardDriver, FocusKeyboardDriverOptions, FocusManager, FocusNode, FocusProviderProps, HUDBarKind, HUDBarProps, JustifyContent, LabelProps, LabelTone, LabelVariant, LayoutChild, LayoutContainer, LayoutRect, ListProps, MainMenuItem, MainMenuKitProps, ModalProps, Padding, PanelProps, ProgressBarProps, Theme, ThemeColors, ThemeProviderProps, ThemeRadii, ThemeSpacing, ThemeTypography };
|
|
359
329
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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/theme.ts"],"mappings":"
|
|
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/theme.ts"],"mappings":";;KAKY;UAEK;EACf;EACA;EACA,UAAU;EACV;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,SACd,OACA,SACA,SACA,UACA,UACA,SACA,SACC,cAAc;UCpBA;;WAEN;;WAEA;WACA;;UAGM;;WAEN;;WAEA;;;;;WAKA,WAAW;;;;;WAKX,mBAAmB;;WAEnB;WACA,QAAQ,UAAU;;;;;;;;;wBAUb,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;;wBAOP,sBAAsB;UCvCrB;EACf,SAAS;EACT;;qBAGW,8BAAY,QAAA;wBAET,mBAAmB;wBAKnB;;UCZC;EACf,WAAW;;UAGI;;EAEf;;UAGe;EACf;EACA;EACA;;wBAOc,0BACd,SAAS,cACT,MAAM,gBACN,UAAU,6BACT;UCtBc;EACf,UAAU;;;;;;;;;EASV;EACA,UAAU;;;;;;;wBAQI,gBAAgB,SAAS,WAAW,YAAY,qBAAqB;KCjBzE;UAEK;EACf;EACA;EACA;EACA,OAAO;;EAEP;;EAEA;;wBAGc,SACd,OACA,OACA,KACA,MACA,aACA,aACC,cAAc;KCtBL;KACA;UAEK;EACf,WAAW;EACX,UAAU;EACV,OAAO;EACP;EACA,QAAQ,UAAU;EAClB;EACA,gBAAgB;EAChB;EACA;;wBAGc,QACd,UACA,SACA,MACA,MACA,OACA,eACA,eACA,sBACA,oBACC,aAAa;;;;;;;;;;;;KCjBJ;KACA;KAOA;UAEK;EACf;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA,WAAW;EACX;EACA,UAAU,QAAQ;EAClB,iBAAiB;EACjB,aAAa;;UAGE;EACf;EACA;EACA;EACA;;wBAec,cACd,WAAW,iBACX,mBAAmB,gBAClB;UClEc;EACf,WAAW;;EAEX;EACA;EACA,QAAQ,UAAU;;;;;;wBAOJ,OAAO,UAAU,KAAK,WAAsB,SAAS,YAAY;UCVhE;;WAEN;;WAEA;WACA;WACA,UAAU;WACV;;UAGM;;WAEN;;WAEA;;WAEA,gBAAgB;;;;;WAKhB,SAAS;WACT,QAAQ,UAAU;;;;;;;;;wBAUb,cACd,OACA,UACA,OACA,QACA,SACC,mBAAmB;UCxCL;EACf;EACA,WAAW;;EAEX;;EAEA;;;;;;;wBAQc,QACd,SACA,UACA,iBACA,mBACC,aAAa;UCnBC;EACf,WAAW;;EAEX;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,QACd,UACA,SACA,SACA,QACA,SACC,aAAa;UCjBC;;EAEf;;EAEA;;EAEA;;EAEA;EACA,QAAQ,UAAU;;wBAGJ,cACd,OACA,QACA,YACA,WACA,SACC,mBAAmB;UCpBL;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,OAAO;;qBAGI,WAAW;qBA2BX,YAAY;UA6BR;EACf,QAAQ;EACR,UAAU;;wBAGI,gBAAgB,OAAmB,YAAY,qBAAqB;wBAIpE,YAAY"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let react_native = require("react-native");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
|
|
5
|
+
// src/focus-context.ts
|
|
6
6
|
const FocusContext = (0, react.createContext)(null);
|
|
7
7
|
function useFocusManager() {
|
|
8
8
|
const ctx = (0, react.useContext)(FocusContext);
|
|
@@ -12,8 +12,7 @@ function useFocusedId() {
|
|
|
12
12
|
const ctx = (0, react.useContext)(FocusContext);
|
|
13
13
|
return ctx ? ctx.focusedId : null;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
//#region src/theme.ts
|
|
15
|
+
// src/theme.ts
|
|
17
16
|
const darkTheme = {
|
|
18
17
|
name: "dark",
|
|
19
18
|
colors: {
|
|
@@ -97,8 +96,7 @@ function ThemeProvider({ theme = darkTheme, children }) {
|
|
|
97
96
|
function useTheme() {
|
|
98
97
|
return (0, react.useContext)(ThemeContext);
|
|
99
98
|
}
|
|
100
|
-
|
|
101
|
-
//#region src/button.tsx
|
|
99
|
+
// src/button.tsx
|
|
102
100
|
function Button({ label, onPress, variant = "primary", disabled = false, tabIndex = 0, focusId, style }) {
|
|
103
101
|
const theme = useTheme();
|
|
104
102
|
const manager = useFocusManager();
|
|
@@ -146,7 +144,6 @@ function Button({ label, onPress, variant = "primary", disabled = false, tabInde
|
|
|
146
144
|
bg = theme.colors.danger;
|
|
147
145
|
fg = theme.colors.accentText;
|
|
148
146
|
border = theme.colors.danger;
|
|
149
|
-
break;
|
|
150
147
|
}
|
|
151
148
|
const container = {
|
|
152
149
|
backgroundColor: bg,
|
|
@@ -190,8 +187,7 @@ const styles = react_native.StyleSheet.create({ wrap: {
|
|
|
190
187
|
alignItems: "center",
|
|
191
188
|
justifyContent: "center"
|
|
192
189
|
} });
|
|
193
|
-
|
|
194
|
-
//#region src/label.tsx
|
|
190
|
+
// src/label.tsx
|
|
195
191
|
function Label({ children, variant = "md", tone = "default", mono = false, style, numberOfLines, ellipsizeMode, adjustsFontSizeToFit, minimumFontScale }) {
|
|
196
192
|
const theme = useTheme();
|
|
197
193
|
const sizeMap = {
|
|
@@ -201,43 +197,43 @@ function Label({ children, variant = "md", tone = "default", mono = false, style
|
|
|
201
197
|
lg: theme.typography.sizeLg,
|
|
202
198
|
xl: theme.typography.sizeXl
|
|
203
199
|
};
|
|
200
|
+
const base = {
|
|
201
|
+
color: {
|
|
202
|
+
default: theme.colors.text,
|
|
203
|
+
muted: theme.colors.textMuted,
|
|
204
|
+
accent: theme.colors.accent,
|
|
205
|
+
danger: theme.colors.danger,
|
|
206
|
+
success: theme.colors.success,
|
|
207
|
+
warning: theme.colors.warning
|
|
208
|
+
}[tone],
|
|
209
|
+
fontSize: sizeMap[variant],
|
|
210
|
+
fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily
|
|
211
|
+
};
|
|
204
212
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
205
213
|
numberOfLines,
|
|
206
214
|
ellipsizeMode,
|
|
207
215
|
adjustsFontSizeToFit,
|
|
208
216
|
minimumFontScale,
|
|
209
|
-
style: [
|
|
210
|
-
color: {
|
|
211
|
-
default: theme.colors.text,
|
|
212
|
-
muted: theme.colors.textMuted,
|
|
213
|
-
accent: theme.colors.accent,
|
|
214
|
-
danger: theme.colors.danger,
|
|
215
|
-
success: theme.colors.success,
|
|
216
|
-
warning: theme.colors.warning
|
|
217
|
-
}[tone],
|
|
218
|
-
fontSize: sizeMap[variant],
|
|
219
|
-
fontFamily: mono ? theme.typography.fontFamilyMono : theme.typography.fontFamily
|
|
220
|
-
}, style],
|
|
217
|
+
style: [base, style],
|
|
221
218
|
children
|
|
222
219
|
});
|
|
223
220
|
}
|
|
224
|
-
|
|
225
|
-
//#region src/panel.tsx
|
|
221
|
+
// src/panel.tsx
|
|
226
222
|
function Panel({ children, variant = "surface", padding = "md", radius = "md", style }) {
|
|
227
223
|
const theme = useTheme();
|
|
224
|
+
const base = {
|
|
225
|
+
backgroundColor: variant === "elevated" ? theme.colors.surfaceAlt : theme.colors.surface,
|
|
226
|
+
padding: padding === "none" ? 0 : theme.spacing[padding],
|
|
227
|
+
borderRadius: theme.radii[radius],
|
|
228
|
+
borderWidth: variant === "elevated" ? 1 : 0,
|
|
229
|
+
borderColor: theme.colors.border
|
|
230
|
+
};
|
|
228
231
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
229
|
-
style: [
|
|
230
|
-
backgroundColor: variant === "elevated" ? theme.colors.surfaceAlt : theme.colors.surface,
|
|
231
|
-
padding: padding === "none" ? 0 : theme.spacing[padding],
|
|
232
|
-
borderRadius: theme.radii[radius],
|
|
233
|
-
borderWidth: variant === "elevated" ? 1 : 0,
|
|
234
|
-
borderColor: theme.colors.border
|
|
235
|
-
}, style],
|
|
232
|
+
style: [base, style],
|
|
236
233
|
children
|
|
237
234
|
});
|
|
238
235
|
}
|
|
239
|
-
|
|
240
|
-
//#region src/dialogue-panel.tsx
|
|
236
|
+
// src/dialogue-panel.tsx
|
|
241
237
|
/**
|
|
242
238
|
* Dialogue panel with a portrait slot. Pairs with `@flare-engine/dialogue`
|
|
243
239
|
* — subscribe to `runner.onLine` and pass `speakerPortraitKey` → your
|
|
@@ -299,8 +295,7 @@ function DialoguePanel({ speaker, text, portrait, choices, onAdvance, style }) {
|
|
|
299
295
|
})
|
|
300
296
|
});
|
|
301
297
|
}
|
|
302
|
-
|
|
303
|
-
//#region src/focus.ts
|
|
298
|
+
// src/focus.ts
|
|
304
299
|
function createFocusManager() {
|
|
305
300
|
const nodes = /* @__PURE__ */ new Map();
|
|
306
301
|
let seqCounter = 0;
|
|
@@ -393,8 +388,7 @@ function createFocusManager() {
|
|
|
393
388
|
}
|
|
394
389
|
};
|
|
395
390
|
}
|
|
396
|
-
|
|
397
|
-
//#region src/focus-keyboard-driver.ts
|
|
391
|
+
// src/focus-keyboard-driver.ts
|
|
398
392
|
const DEFAULT_NEXT = [
|
|
399
393
|
"ArrowDown",
|
|
400
394
|
"ArrowRight",
|
|
@@ -421,8 +415,7 @@ function createFocusKeyboardDriver(manager, keys, options) {
|
|
|
421
415
|
}
|
|
422
416
|
} };
|
|
423
417
|
}
|
|
424
|
-
|
|
425
|
-
//#region src/focus-provider.tsx
|
|
418
|
+
// src/focus-provider.tsx
|
|
426
419
|
/**
|
|
427
420
|
* Instantiates a FocusManager (or uses the one provided) and publishes
|
|
428
421
|
* { manager, focusedId } as context state so consumers re-render on focus
|
|
@@ -446,8 +439,7 @@ function FocusProvider({ manager, autoFocus, children }) {
|
|
|
446
439
|
}), [mgr, focusedId]);
|
|
447
440
|
return (0, react.createElement)(FocusContext.Provider, { value }, children);
|
|
448
441
|
}
|
|
449
|
-
|
|
450
|
-
//#region src/progress-bar.tsx
|
|
442
|
+
// src/progress-bar.tsx
|
|
451
443
|
function ProgressBar({ value, height = 8, trackColor, fillColor, style }) {
|
|
452
444
|
const theme = useTheme();
|
|
453
445
|
const clamped = Number.isNaN(value) ? 0 : Math.max(0, Math.min(1, value));
|
|
@@ -466,8 +458,7 @@ function ProgressBar({ value, height = 8, trackColor, fillColor, style }) {
|
|
|
466
458
|
} })
|
|
467
459
|
});
|
|
468
460
|
}
|
|
469
|
-
|
|
470
|
-
//#region src/hud-bar.tsx
|
|
461
|
+
// src/hud-bar.tsx
|
|
471
462
|
function HUDBar({ label, value, max, kind = "custom", showNumbers = true, fillColor }) {
|
|
472
463
|
const theme = useTheme();
|
|
473
464
|
const ratio = max <= 0 ? 0 : value / max;
|
|
@@ -505,8 +496,7 @@ function HUDBar({ label, value, max, kind = "custom", showNumbers = true, fillCo
|
|
|
505
496
|
fillColor: color
|
|
506
497
|
})] });
|
|
507
498
|
}
|
|
508
|
-
|
|
509
|
-
//#region src/layout.ts
|
|
499
|
+
// src/layout.ts
|
|
510
500
|
const ZERO_PAD = {
|
|
511
501
|
top: 0,
|
|
512
502
|
right: 0,
|
|
@@ -571,13 +561,11 @@ function resolveLayout(container, children) {
|
|
|
571
561
|
spacing = gap + s;
|
|
572
562
|
}
|
|
573
563
|
break;
|
|
574
|
-
case "space-evenly":
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
break;
|
|
564
|
+
case "space-evenly": if (n >= 0) {
|
|
565
|
+
const s = free / (n + 1);
|
|
566
|
+
cursor = mainStart + s;
|
|
567
|
+
spacing = gap + s;
|
|
568
|
+
}
|
|
581
569
|
}
|
|
582
570
|
const out = new Array(n);
|
|
583
571
|
for (let i = 0; i < n; i++) {
|
|
@@ -595,13 +583,13 @@ function resolveLayout(container, children) {
|
|
|
595
583
|
case "center":
|
|
596
584
|
crossOffset = (crossSize - crossLen) / 2;
|
|
597
585
|
break;
|
|
598
|
-
case "stretch":
|
|
599
|
-
crossOffset = 0;
|
|
600
|
-
break;
|
|
586
|
+
case "stretch": crossOffset = 0;
|
|
601
587
|
}
|
|
588
|
+
const x = isRow ? cursor : crossStart + crossOffset;
|
|
589
|
+
const y = isRow ? crossStart + crossOffset : cursor;
|
|
602
590
|
out[i] = {
|
|
603
|
-
x
|
|
604
|
-
y
|
|
591
|
+
x,
|
|
592
|
+
y,
|
|
605
593
|
width: isRow ? mainLen : crossLen,
|
|
606
594
|
height: isRow ? crossLen : mainLen
|
|
607
595
|
};
|
|
@@ -609,8 +597,7 @@ function resolveLayout(container, children) {
|
|
|
609
597
|
}
|
|
610
598
|
return out;
|
|
611
599
|
}
|
|
612
|
-
|
|
613
|
-
//#region src/list.tsx
|
|
600
|
+
// src/list.tsx
|
|
614
601
|
/**
|
|
615
602
|
* Vertical (or horizontal) stack with consistent gap. Thin container; the
|
|
616
603
|
* focus manager handles navigation between interactive children.
|
|
@@ -634,8 +621,7 @@ function List({ children, gap, direction = "column", style }) {
|
|
|
634
621
|
children: items
|
|
635
622
|
});
|
|
636
623
|
}
|
|
637
|
-
|
|
638
|
-
//#region src/main-menu-kit.tsx
|
|
624
|
+
// src/main-menu-kit.tsx
|
|
639
625
|
/**
|
|
640
626
|
* Title-screen kit: headline, optional subtitle, vertical button list,
|
|
641
627
|
* optional footer slot. All strings are caller-supplied (localized upstream).
|
|
@@ -690,8 +676,7 @@ function MainMenuKit({ title, subtitle, items, footer, style }) {
|
|
|
690
676
|
]
|
|
691
677
|
});
|
|
692
678
|
}
|
|
693
|
-
|
|
694
|
-
//#region src/modal.tsx
|
|
679
|
+
// src/modal.tsx
|
|
695
680
|
/**
|
|
696
681
|
* Overlay modal that renders a centered `Panel` with its children. Parent is
|
|
697
682
|
* responsible for controlling visibility and (if desired) focus trapping via
|
|
@@ -731,7 +716,6 @@ function Modal({ visible, children, onBackdropPress, backdropOpacity = .6 }) {
|
|
|
731
716
|
})]
|
|
732
717
|
});
|
|
733
718
|
}
|
|
734
|
-
//#endregion
|
|
735
719
|
exports.Button = Button;
|
|
736
720
|
exports.DialoguePanel = DialoguePanel;
|
|
737
721
|
exports.FocusContext = FocusContext;
|