@tastic/hud 0.25.0 → 0.26.0

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.
@@ -0,0 +1,13 @@
1
+ // The loadout entry point (`@tastic/hud/lobby`): the pieces a two-seat loadout or lobby screen is built
2
+ // from, reachable without the main barrel, whose TriggerGaugeHost and loadSkiaWeb reach Skia.
3
+ // @tastic/shell's loadout is why it exists: the shell is one barrel, so every app on it loads the
4
+ // loadout, and CardTastic (Solitaire, renamed) has no Skia. Unlike `./chrome`, this entry may use
5
+ // @tastic/profile (PlayerSetupPanel's pickers) and @tastic/split-screen (useZoneClampedAlign), neither
6
+ // of which loads Skia. Everything reachable from this file must stay free of Skia and of the main barrel.
7
+ // SectionedDropdown stays out (TriggerGaugeHost), which is why MenuOption has a module of its own.
8
+ // src/__tests__/lobbyImports.test.ts walks the real import graph from here and enforces all of it.
9
+ export { type MenuOption } from '../menuOption'
10
+ export { getColorPopoverId, getCpuDifficultyPopoverId, getProfilePopoverId, PlayerSetupPanel, type PlayerSetupPanelProps } from '../PlayerSetupPanel'
11
+ export { ReadyButton } from '../ReadyButton'
12
+ export { SharedActionBand } from '../SharedActionBand'
13
+ export { useZoneClampedAlign } from '../useZoneClampedAlign'
@@ -0,0 +1,14 @@
1
+ // One option in a SectionedDropdown section, or in any menu a loadout builds from the same shape (a
2
+ // CPU's difficulty levels). Its own module, free of imports, so `@tastic/hud/lobby` can export it
3
+ // without reaching SectionedDropdown.tsx, which imports TriggerGaugeHost and so Skia.
4
+ export interface MenuOption<T extends string | number> {
5
+ value: T
6
+ label: string
7
+ description?: string
8
+ // Optional per-option icon - when every option in a single-select section has one, the trigger
9
+ // shows the currently selected option's icon instead of the static fallback, so the value is
10
+ // readable at a glance without opening the dropdown. Unused by multi-select sections (there's no
11
+ // single "the" selected option to show on the trigger).
12
+ icon?: string
13
+ iconSize?: number
14
+ }
@@ -104,7 +104,10 @@ export function rotateRect(x: number, y: number, width: number, height: number,
104
104
  // column in a wide window). With it the room on every side is measured to the bounds' edges
105
105
  // instead of the window's (measured and rotated the same way as the trigger). Omit it for the
106
106
  // window, as before.
107
- export function useAutoAlign(open: boolean, contentWidth: number, contentHeight: number, rotation: PopoverRotation = 0, bounds?: RefObject<ViewInstance | null>) {
107
+ // Annotated as AlignResult rather than inferred: the declaration build prints an inferred ref type
108
+ // with the legacy types' name for it (`RefObject<View>`), which the strict types read as a ref to
109
+ // the View function.
110
+ export function useAutoAlign(open: boolean, contentWidth: number, contentHeight: number, rotation: PopoverRotation = 0, bounds?: RefObject<ViewInstance | null>): AlignResult {
108
111
  const triggerRef = useRef<ViewInstance>(null)
109
112
  const { width: windowWidth, height: windowHeight } = useWindowDimensions()
110
113
  const [align, setAlign] = useState<PopoverAlign>('center')