@tastic/hud 0.25.1 → 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,96 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { SeedColor } from '@rific/auto-paper';
4
+ import { Profile } from '@tastic/profile';
5
+ import { P as PopoverHost, A as AlignResult, a as PopoverRotation, u as useAutoAlign } from './usePopoverHost-T8QWb2_A.js';
6
+ import { StyleProp, ViewStyle } from 'react-native';
7
+
8
+ interface MenuOption<T extends string | number> {
9
+ value: T;
10
+ label: string;
11
+ description?: string;
12
+ icon?: string;
13
+ iconSize?: number;
14
+ }
15
+
16
+ declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
17
+ declare function getLabeledDropdownContentHeight(optionCount: number): number;
18
+ interface LabeledDropdownOption<T extends string> {
19
+ value: T;
20
+ label: string;
21
+ icon?: string;
22
+ }
23
+ interface Props$2<T extends string> {
24
+ id: string;
25
+ host: PopoverHost;
26
+ options: LabeledDropdownOption<T>[];
27
+ value: T;
28
+ onChange: (value: T) => void;
29
+ color: string;
30
+ dark: boolean;
31
+ align?: 'left' | 'right' | 'center';
32
+ alignOverride?: AlignResult;
33
+ }
34
+ declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
35
+
36
+ declare function getColorPopoverId(idPrefix: string): string;
37
+ declare function getProfilePopoverId(idPrefix: string): string;
38
+ declare function getCpuDifficultyPopoverId(idPrefix: string): string;
39
+ interface PlayerSetupPanelProps<C extends string = string> {
40
+ idPrefix: string;
41
+ host?: PopoverHost;
42
+ label?: string;
43
+ labelFontFamily?: string;
44
+ color: string;
45
+ onColorChange: (hex: string) => void;
46
+ swatches: SeedColor[];
47
+ takenColor?: string;
48
+ allowSwapTaken?: boolean;
49
+ colorCaption?: string;
50
+ showColor?: boolean;
51
+ colorAlignOverride?: AlignResult;
52
+ colorRotation?: PopoverRotation;
53
+ isHuman: boolean;
54
+ secondPicker?: ReactNode;
55
+ secondPickerId?: string;
56
+ ready?: boolean;
57
+ onToggleReady?: () => void;
58
+ dark: boolean;
59
+ showReadyButton?: boolean;
60
+ profiles?: Profile[];
61
+ selectedProfileId?: string | null;
62
+ takenProfileId?: string | null;
63
+ guestLabel?: string;
64
+ onProfileSelect?: (profile: Profile | null) => void;
65
+ onManageProfiles?: () => void;
66
+ cpuDifficulty?: C;
67
+ cpuDifficultyOptions?: LabeledDropdownOption<C>[];
68
+ onCpuDifficultyChange?: (value: C) => void;
69
+ humanIcon?: string;
70
+ cpuIcon?: string;
71
+ }
72
+ declare function PlayerSetupPanel<C extends string = string>({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon, cpuIcon }: PlayerSetupPanelProps<C>): react.JSX.Element;
73
+
74
+ interface Props$1 {
75
+ color: string;
76
+ ready: boolean;
77
+ onToggleReady: () => void;
78
+ style?: StyleProp<ViewStyle>;
79
+ labelFontFamily?: string;
80
+ }
81
+ declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$1): react.JSX.Element;
82
+
83
+ interface Props {
84
+ onBack: () => void;
85
+ onSettings: () => void;
86
+ onRandomize?: () => void;
87
+ onReset?: () => void;
88
+ fg: string;
89
+ popoverOpen: boolean;
90
+ children: ReactNode;
91
+ }
92
+ declare function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }: Props): react.JSX.Element;
93
+
94
+ declare function useZoneClampedAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): ReturnType<typeof useAutoAlign>;
95
+
96
+ export { LABELED_DROPDOWN_POPOVER_WIDTH as L, type MenuOption as M, PlayerSetupPanel as P, ReadyButton as R, SharedActionBand as S, LabeledDropdown as a, type LabeledDropdownOption as b, type PlayerSetupPanelProps as c, getCpuDifficultyPopoverId as d, getLabeledDropdownContentHeight as e, getProfilePopoverId as f, getColorPopoverId as g, useZoneClampedAlign as u };
package/dist/index.d.mts CHANGED
@@ -1,13 +1,15 @@
1
- import { PopoverHost, AlignResult, PopoverRotation, useAutoAlign } from './chrome/index.mjs';
2
- export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverAlign, PopoverBody, PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, ViewInstance, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors } from './chrome/index.mjs';
1
+ export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverBody, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors } from './chrome/index.mjs';
3
2
  import * as react from 'react';
4
- import { ReactNode } from 'react';
5
3
  import { AchievementTier } from '@tastic/achievements';
6
4
  import { Profile } from '@tastic/profile';
7
- import { ViewStyle, StyleProp } from 'react-native';
5
+ import { ViewStyle } from 'react-native';
6
+ import { M as MenuOption } from './index-Bz4j509X.mjs';
7
+ export { L as LABELED_DROPDOWN_POPOVER_WIDTH, a as LabeledDropdown, b as LabeledDropdownOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, e as getLabeledDropdownContentHeight, f as getProfilePopoverId, u as useZoneClampedAlign } from './index-Bz4j509X.mjs';
8
+ import { P as PopoverHost, A as AlignResult, a as PopoverRotation } from './usePopoverHost-T8QWb2_A.mjs';
9
+ export { b as PopoverAlign, c as PopoverVerticalAlign, V as ViewInstance, u as useAutoAlign, d as usePopoverHost } from './usePopoverHost-T8QWb2_A.mjs';
8
10
  export { loadSkiaWeb, locateSkiaWebFile } from './skia/index.mjs';
9
- import { SeedColor } from '@rific/auto-paper';
10
11
  import '@tastic/core';
12
+ import '@rific/auto-paper';
11
13
  import '@rific/feedback-press';
12
14
 
13
15
  interface UnlockedAchievement {
@@ -20,7 +22,7 @@ interface AchievementUnlockOwner {
20
22
  profile?: Profile | null;
21
23
  color: string;
22
24
  }
23
- interface Props$4<Seat extends number> {
25
+ interface Props$1<Seat extends number> {
24
26
  unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
25
27
  seats: readonly Seat[];
26
28
  owners: Record<Seat, AchievementUnlockOwner>;
@@ -28,15 +30,8 @@ interface Props$4<Seat extends number> {
28
30
  fg?: string;
29
31
  style?: ViewStyle;
30
32
  }
31
- declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$4<Seat>): react.JSX.Element | null;
33
+ declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$1<Seat>): react.JSX.Element | null;
32
34
 
33
- interface MenuOption<T extends string | number> {
34
- value: T;
35
- label: string;
36
- description?: string;
37
- icon?: string;
38
- iconSize?: number;
39
- }
40
35
  interface SingleSelectSection<T extends string | number> {
41
36
  kind: 'single';
42
37
  id: string;
@@ -54,7 +49,7 @@ interface MultiSelectSection<T extends string | number> {
54
49
  allClear?: boolean;
55
50
  }
56
51
  type MenuSection = SingleSelectSection<any> | MultiSelectSection<any>;
57
- interface Props$3 {
52
+ interface Props {
58
53
  id: string;
59
54
  host: PopoverHost;
60
55
  icon: string;
@@ -74,7 +69,7 @@ interface Props$3 {
74
69
  clear: string;
75
70
  };
76
71
  }
77
- declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props$3): react.JSX.Element;
72
+ declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props): react.JSX.Element;
78
73
 
79
74
  interface ControlSchemePickerProps<T extends string | number> {
80
75
  id: string;
@@ -106,84 +101,6 @@ interface CornerStatusBadgesProps {
106
101
  }
107
102
  declare function CornerStatusBadges({ orientationMode, p1OnRight, p1, p2 }: CornerStatusBadgesProps): react.JSX.Element;
108
103
 
109
- declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
110
- declare function getLabeledDropdownContentHeight(optionCount: number): number;
111
- interface LabeledDropdownOption<T extends string> {
112
- value: T;
113
- label: string;
114
- icon?: string;
115
- }
116
- interface Props$2<T extends string> {
117
- id: string;
118
- host: PopoverHost;
119
- options: LabeledDropdownOption<T>[];
120
- value: T;
121
- onChange: (value: T) => void;
122
- color: string;
123
- dark: boolean;
124
- align?: 'left' | 'right' | 'center';
125
- alignOverride?: AlignResult;
126
- }
127
- declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
128
-
129
- declare function getColorPopoverId(idPrefix: string): string;
130
- declare function getProfilePopoverId(idPrefix: string): string;
131
- declare function getCpuDifficultyPopoverId(idPrefix: string): string;
132
- interface PlayerSetupPanelProps<C extends string = string> {
133
- idPrefix: string;
134
- host?: PopoverHost;
135
- label?: string;
136
- labelFontFamily?: string;
137
- color: string;
138
- onColorChange: (hex: string) => void;
139
- swatches: SeedColor[];
140
- takenColor?: string;
141
- allowSwapTaken?: boolean;
142
- colorCaption?: string;
143
- showColor?: boolean;
144
- colorAlignOverride?: AlignResult;
145
- colorRotation?: PopoverRotation;
146
- isHuman: boolean;
147
- secondPicker?: ReactNode;
148
- secondPickerId?: string;
149
- ready?: boolean;
150
- onToggleReady?: () => void;
151
- dark: boolean;
152
- showReadyButton?: boolean;
153
- profiles?: Profile[];
154
- selectedProfileId?: string | null;
155
- takenProfileId?: string | null;
156
- guestLabel?: string;
157
- onProfileSelect?: (profile: Profile | null) => void;
158
- onManageProfiles?: () => void;
159
- cpuDifficulty?: C;
160
- cpuDifficultyOptions?: LabeledDropdownOption<C>[];
161
- onCpuDifficultyChange?: (value: C) => void;
162
- humanIcon?: string;
163
- cpuIcon?: string;
164
- }
165
- declare function PlayerSetupPanel<C extends string = string>({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon, cpuIcon }: PlayerSetupPanelProps<C>): react.JSX.Element;
166
-
167
- interface Props$1 {
168
- color: string;
169
- ready: boolean;
170
- onToggleReady: () => void;
171
- style?: StyleProp<ViewStyle>;
172
- labelFontFamily?: string;
173
- }
174
- declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$1): react.JSX.Element;
175
-
176
- interface Props {
177
- onBack: () => void;
178
- onSettings: () => void;
179
- onRandomize?: () => void;
180
- onReset?: () => void;
181
- fg: string;
182
- popoverOpen: boolean;
183
- children: ReactNode;
184
- }
185
- declare function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }: Props): react.JSX.Element;
186
-
187
104
  interface TriggerGaugeProps {
188
105
  segments: number;
189
106
  litIndices: number[];
@@ -207,6 +124,4 @@ interface QuitConfirmation {
207
124
  }
208
125
  declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack: () => void): QuitConfirmation;
209
126
 
210
- declare function useZoneClampedAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): ReturnType<typeof useAutoAlign>;
211
-
212
- export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, LABELED_DROPDOWN_POPOVER_WIDTH, LabeledDropdown, type LabeledDropdownOption, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PlayerSetupPanel, type PlayerSetupPanelProps, PopoverHost, PopoverRotation, type QuitConfirmation, ReadyButton, SectionedDropdown, SharedActionBand, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, getColorPopoverId, getCpuDifficultyPopoverId, getLabeledDropdownContentHeight, getProfilePopoverId, useAutoAlign, useQuitConfirmation, useZoneClampedAlign };
127
+ export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PopoverHost, PopoverRotation, type QuitConfirmation, SectionedDropdown, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, useQuitConfirmation };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
- import { PopoverHost, AlignResult, PopoverRotation, useAutoAlign } from './chrome/index.js';
2
- export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverAlign, PopoverBody, PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, ViewInstance, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors } from './chrome/index.js';
1
+ export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverBody, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors } from './chrome/index.js';
3
2
  import * as react from 'react';
4
- import { ReactNode } from 'react';
5
3
  import { AchievementTier } from '@tastic/achievements';
6
4
  import { Profile } from '@tastic/profile';
7
- import { ViewStyle, StyleProp } from 'react-native';
5
+ import { ViewStyle } from 'react-native';
6
+ import { M as MenuOption } from './index-DW0PsGCE.js';
7
+ export { L as LABELED_DROPDOWN_POPOVER_WIDTH, a as LabeledDropdown, b as LabeledDropdownOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, e as getLabeledDropdownContentHeight, f as getProfilePopoverId, u as useZoneClampedAlign } from './index-DW0PsGCE.js';
8
+ import { P as PopoverHost, A as AlignResult, a as PopoverRotation } from './usePopoverHost-T8QWb2_A.js';
9
+ export { b as PopoverAlign, c as PopoverVerticalAlign, V as ViewInstance, u as useAutoAlign, d as usePopoverHost } from './usePopoverHost-T8QWb2_A.js';
8
10
  export { loadSkiaWeb, locateSkiaWebFile } from './skia/index.js';
9
- import { SeedColor } from '@rific/auto-paper';
10
11
  import '@tastic/core';
12
+ import '@rific/auto-paper';
11
13
  import '@rific/feedback-press';
12
14
 
13
15
  interface UnlockedAchievement {
@@ -20,7 +22,7 @@ interface AchievementUnlockOwner {
20
22
  profile?: Profile | null;
21
23
  color: string;
22
24
  }
23
- interface Props$4<Seat extends number> {
25
+ interface Props$1<Seat extends number> {
24
26
  unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
25
27
  seats: readonly Seat[];
26
28
  owners: Record<Seat, AchievementUnlockOwner>;
@@ -28,15 +30,8 @@ interface Props$4<Seat extends number> {
28
30
  fg?: string;
29
31
  style?: ViewStyle;
30
32
  }
31
- declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$4<Seat>): react.JSX.Element | null;
33
+ declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$1<Seat>): react.JSX.Element | null;
32
34
 
33
- interface MenuOption<T extends string | number> {
34
- value: T;
35
- label: string;
36
- description?: string;
37
- icon?: string;
38
- iconSize?: number;
39
- }
40
35
  interface SingleSelectSection<T extends string | number> {
41
36
  kind: 'single';
42
37
  id: string;
@@ -54,7 +49,7 @@ interface MultiSelectSection<T extends string | number> {
54
49
  allClear?: boolean;
55
50
  }
56
51
  type MenuSection = SingleSelectSection<any> | MultiSelectSection<any>;
57
- interface Props$3 {
52
+ interface Props {
58
53
  id: string;
59
54
  host: PopoverHost;
60
55
  icon: string;
@@ -74,7 +69,7 @@ interface Props$3 {
74
69
  clear: string;
75
70
  };
76
71
  }
77
- declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props$3): react.JSX.Element;
72
+ declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props): react.JSX.Element;
78
73
 
79
74
  interface ControlSchemePickerProps<T extends string | number> {
80
75
  id: string;
@@ -106,84 +101,6 @@ interface CornerStatusBadgesProps {
106
101
  }
107
102
  declare function CornerStatusBadges({ orientationMode, p1OnRight, p1, p2 }: CornerStatusBadgesProps): react.JSX.Element;
108
103
 
109
- declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
110
- declare function getLabeledDropdownContentHeight(optionCount: number): number;
111
- interface LabeledDropdownOption<T extends string> {
112
- value: T;
113
- label: string;
114
- icon?: string;
115
- }
116
- interface Props$2<T extends string> {
117
- id: string;
118
- host: PopoverHost;
119
- options: LabeledDropdownOption<T>[];
120
- value: T;
121
- onChange: (value: T) => void;
122
- color: string;
123
- dark: boolean;
124
- align?: 'left' | 'right' | 'center';
125
- alignOverride?: AlignResult;
126
- }
127
- declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
128
-
129
- declare function getColorPopoverId(idPrefix: string): string;
130
- declare function getProfilePopoverId(idPrefix: string): string;
131
- declare function getCpuDifficultyPopoverId(idPrefix: string): string;
132
- interface PlayerSetupPanelProps<C extends string = string> {
133
- idPrefix: string;
134
- host?: PopoverHost;
135
- label?: string;
136
- labelFontFamily?: string;
137
- color: string;
138
- onColorChange: (hex: string) => void;
139
- swatches: SeedColor[];
140
- takenColor?: string;
141
- allowSwapTaken?: boolean;
142
- colorCaption?: string;
143
- showColor?: boolean;
144
- colorAlignOverride?: AlignResult;
145
- colorRotation?: PopoverRotation;
146
- isHuman: boolean;
147
- secondPicker?: ReactNode;
148
- secondPickerId?: string;
149
- ready?: boolean;
150
- onToggleReady?: () => void;
151
- dark: boolean;
152
- showReadyButton?: boolean;
153
- profiles?: Profile[];
154
- selectedProfileId?: string | null;
155
- takenProfileId?: string | null;
156
- guestLabel?: string;
157
- onProfileSelect?: (profile: Profile | null) => void;
158
- onManageProfiles?: () => void;
159
- cpuDifficulty?: C;
160
- cpuDifficultyOptions?: LabeledDropdownOption<C>[];
161
- onCpuDifficultyChange?: (value: C) => void;
162
- humanIcon?: string;
163
- cpuIcon?: string;
164
- }
165
- declare function PlayerSetupPanel<C extends string = string>({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon, cpuIcon }: PlayerSetupPanelProps<C>): react.JSX.Element;
166
-
167
- interface Props$1 {
168
- color: string;
169
- ready: boolean;
170
- onToggleReady: () => void;
171
- style?: StyleProp<ViewStyle>;
172
- labelFontFamily?: string;
173
- }
174
- declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$1): react.JSX.Element;
175
-
176
- interface Props {
177
- onBack: () => void;
178
- onSettings: () => void;
179
- onRandomize?: () => void;
180
- onReset?: () => void;
181
- fg: string;
182
- popoverOpen: boolean;
183
- children: ReactNode;
184
- }
185
- declare function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }: Props): react.JSX.Element;
186
-
187
104
  interface TriggerGaugeProps {
188
105
  segments: number;
189
106
  litIndices: number[];
@@ -207,6 +124,4 @@ interface QuitConfirmation {
207
124
  }
208
125
  declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack: () => void): QuitConfirmation;
209
126
 
210
- declare function useZoneClampedAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): ReturnType<typeof useAutoAlign>;
211
-
212
- export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, LABELED_DROPDOWN_POPOVER_WIDTH, LabeledDropdown, type LabeledDropdownOption, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PlayerSetupPanel, type PlayerSetupPanelProps, PopoverHost, PopoverRotation, type QuitConfirmation, ReadyButton, SectionedDropdown, SharedActionBand, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, getColorPopoverId, getCpuDifficultyPopoverId, getLabeledDropdownContentHeight, getProfilePopoverId, useAutoAlign, useQuitConfirmation, useZoneClampedAlign };
127
+ export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PopoverHost, PopoverRotation, type QuitConfirmation, SectionedDropdown, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, useQuitConfirmation };
package/dist/index.mjs CHANGED
@@ -7,10 +7,7 @@ import {
7
7
  ConfirmDialog,
8
8
  ContentGutter,
9
9
  CornerActionButtons,
10
- InlineColorPicker,
11
10
  LOCKED_BADGE_COLOR,
12
- MONO_FONT,
13
- PopoverBody,
14
11
  PressAwayOverlay,
15
12
  RotatedFrame,
16
13
  StaggeredWord,
@@ -18,13 +15,10 @@ import {
18
15
  StatSection,
19
16
  UpdateDialog,
20
17
  WELL_SHADOW,
21
- getInlineColorPickerContentSize,
22
18
  getStaggeredWordDuration,
23
- useAutoAlign,
24
19
  useCompactDialog,
25
- usePopoverHost,
26
20
  useWellColors
27
- } from "./chunk-AJD4FMG5.mjs";
21
+ } from "./chunk-33MWHPPH.mjs";
28
22
  import {
29
23
  COMPACT_DIALOG_HEIGHT,
30
24
  DialogHeader,
@@ -36,6 +30,23 @@ import {
36
30
  overlayStyles,
37
31
  useOverlayCardColors
38
32
  } from "./chunk-CBH7GQKI.mjs";
33
+ import {
34
+ PlayerSetupPanel,
35
+ ReadyButton,
36
+ SharedActionBand,
37
+ getColorPopoverId,
38
+ getCpuDifficultyPopoverId,
39
+ getProfilePopoverId,
40
+ useZoneClampedAlign
41
+ } from "./chunk-UO2V5C2U.mjs";
42
+ import {
43
+ InlineColorPicker,
44
+ MONO_FONT,
45
+ PopoverBody,
46
+ getInlineColorPickerContentSize,
47
+ useAutoAlign,
48
+ usePopoverHost
49
+ } from "./chunk-FOJLQMKA.mjs";
39
50
  import {
40
51
  loadSkiaWeb,
41
52
  locateSkiaWebFile
@@ -437,177 +448,16 @@ var styles4 = StyleSheet4.create({
437
448
  }
438
449
  });
439
450
 
440
- // src/PlayerSetupPanel.tsx
441
- import { getOptionPickerContentSize, getProfilePickerContentSize, OptionPicker, ProfilePicker } from "@tastic/profile";
442
- import { StyleSheet as StyleSheet6, View as View5 } from "react-native";
443
- import { Text as Text5 } from "react-native-paper";
444
-
445
- // src/ReadyButton.tsx
446
- import { TouchableRipple as TouchableRipple3 } from "@rific/feedback-press";
447
- import { StyleSheet as StyleSheet5 } from "react-native";
448
- import { Text as Text4 } from "react-native-paper";
449
- import { jsx as jsx7 } from "react/jsx-runtime";
450
- function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily = MONO_FONT }) {
451
- const readyButtonStyle = [styles5.readyButton, { borderColor: color }, ready && { backgroundColor: color }, style];
452
- const labelTextStyle = { fontFamily: labelFontFamily, fontWeight: "bold" };
453
- const labelColorStyle = { color: ready ? "#000000" : color };
454
- return /* @__PURE__ */ jsx7(TouchableRipple3, { onPress: onToggleReady, borderless: true, style: readyButtonStyle, children: /* @__PURE__ */ jsx7(Text4, { variant: "labelLarge", style: [labelTextStyle, labelColorStyle], children: ready ? "READY \u2713" : "READY?" }) });
455
- }
456
- var styles5 = StyleSheet5.create({
457
- readyButton: {
458
- alignItems: "center",
459
- borderRadius: 12,
460
- borderWidth: 1,
461
- justifyContent: "center",
462
- minWidth: 120,
463
- paddingHorizontal: 16,
464
- paddingVertical: 10
465
- }
466
- });
467
-
468
- // src/useZoneClampedAlign.ts
469
- import { useZoneBounds } from "@tastic/split-screen";
470
- import { useEffect, useState } from "react";
471
- import { useWindowDimensions } from "react-native";
472
- import { useSafeAreaInsets } from "react-native-safe-area-context";
473
- var EDGE_MARGIN = 12;
474
- function useZoneClampedAlign(open, contentWidth, contentHeight, rotation = 0) {
475
- const auto = useAutoAlign(open, contentWidth, contentHeight, rotation);
476
- const zone = useZoneBounds();
477
- const { height: windowHeight } = useWindowDimensions();
478
- const insets = useSafeAreaInsets();
479
- const shouldMeasure = open && auto.measured && zone !== null;
480
- const [ownBounds, setOwnBounds] = useState(null);
481
- const [prevShouldMeasure, setPrevShouldMeasure] = useState(shouldMeasure);
482
- if (shouldMeasure !== prevShouldMeasure) {
483
- setPrevShouldMeasure(shouldMeasure);
484
- setOwnBounds(null);
485
- }
486
- useEffect(() => {
487
- if (!shouldMeasure) return;
488
- auto.triggerRef.current?.measureInWindow((_x, y, _width, height) => {
489
- const belowShared = zone.zoneSide === "belowShared";
490
- const awayRoom = belowShared ? windowHeight - insets.bottom - (y + height) - EDGE_MARGIN : y - insets.top - EDGE_MARGIN;
491
- const towardRoom = belowShared ? y - zone.sharedEdgeY - EDGE_MARGIN : zone.sharedEdgeY - (y + height) - EDGE_MARGIN;
492
- const useToward = contentHeight > awayRoom && towardRoom > awayRoom;
493
- let awaySide = belowShared ? "below" : "above";
494
- let towardSide = belowShared ? "above" : "below";
495
- if (zone.rotated) {
496
- awaySide = awaySide === "above" ? "below" : "above";
497
- towardSide = towardSide === "above" ? "below" : "above";
498
- }
499
- setOwnBounds({ maxHeight: Math.max(useToward ? towardRoom : awayRoom, 0), verticalAlign: useToward ? towardSide : awaySide });
500
- });
501
- }, [shouldMeasure, zone, auto.triggerRef, contentHeight, windowHeight, insets.top, insets.bottom]);
502
- if (!zone) return auto;
503
- if (!ownBounds) return { ...auto, measured: false };
504
- return { ...auto, maxHeight: ownBounds.maxHeight, measured: auto.measured, verticalAlign: ownBounds.verticalAlign };
505
- }
506
-
507
- // src/PlayerSetupPanel.tsx
508
- import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
509
- function getColorPopoverId(idPrefix) {
510
- return `${idPrefix}-color`;
511
- }
512
- function getProfilePopoverId(idPrefix) {
513
- return `${idPrefix}-profile`;
514
- }
515
- function getCpuDifficultyPopoverId(idPrefix) {
516
- return `${idPrefix}-difficulty`;
517
- }
518
- function PlayerSetupPanel({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor = true, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton = true, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon = "face-man", cpuIcon = "robot" }) {
519
- const ownHost = usePopoverHost();
520
- const popover = host ?? ownHost;
521
- const ownPopoverOpen = popover.openId?.startsWith(`${idPrefix}-`) ?? false;
522
- const pickerRowPopoverOpen = popover.openId === getColorPopoverId(idPrefix) || secondPickerId !== void 0 && popover.openId === secondPickerId;
523
- const showProfilePicker = isHuman && profiles !== void 0 && !!onProfileSelect;
524
- const showCpuDifficulty = !isHuman && cpuDifficulty !== void 0 && cpuDifficultyOptions !== void 0 && !!onCpuDifficultyChange;
525
- const seatButton = showProfilePicker || showCpuDifficulty;
526
- const selectedProfile = profiles?.find((p) => p.id === selectedProfileId) ?? null;
527
- const colorSection = showColor ? { value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, caption: showProfilePicker && selectedProfile ? colorCaption : void 0 } : void 0;
528
- const seatPickerId = showProfilePicker ? getProfilePopoverId(idPrefix) : getCpuDifficultyPopoverId(idPrefix);
529
- const seatPickerSize = showProfilePicker ? getProfilePickerContentSize(profiles.length, !!onManageProfiles, colorSection) : getOptionPickerContentSize(cpuDifficultyOptions?.length ?? 0, colorSection);
530
- const seatPickerAlign = useZoneClampedAlign(seatButton && popover.openId === seatPickerId, seatPickerSize.width, seatPickerSize.height);
531
- return /* @__PURE__ */ jsxs5(View5, { style: [styles6.panel, ownPopoverOpen && styles6.panelOpen], children: [
532
- showProfilePicker ? /* @__PURE__ */ jsx8(ProfilePicker, { idPrefix, host: popover, profiles, selectedId: selectedProfileId ?? null, takenId: takenProfileId, color, dark, guestLabel: guestLabel ?? "GUEST", onSelect: (profile) => onProfileSelect?.(profile), onManage: onManageProfiles, colorSection, alignOverride: seatPickerAlign }) : showCpuDifficulty ? /* @__PURE__ */ jsx8(OptionPicker, { id: getCpuDifficultyPopoverId(idPrefix), host: popover, options: cpuDifficultyOptions, value: cpuDifficulty, onChange: onCpuDifficultyChange, color, dark, icon: cpuIcon, colorSection, alignOverride: seatPickerAlign }) : label && /* @__PURE__ */ jsx8(Text5, { variant: "labelSmall", style: { color, fontFamily: labelFontFamily }, children: label }),
533
- (!seatButton || secondPicker) && /* @__PURE__ */ jsxs5(View5, { style: [styles6.pickerRow, pickerRowPopoverOpen && styles6.pickerRowOpen], children: [
534
- !seatButton && /* @__PURE__ */ jsx8(InlineColorPicker, { id: getColorPopoverId(idPrefix), host: popover, value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, alignOverride: colorAlignOverride, rotation: colorRotation, dark, tag: isHuman ? selectedProfile?.tag : void 0, icon: isHuman ? humanIcon : cpuIcon }),
535
- secondPicker
536
- ] }),
537
- isHuman && showReadyButton && onToggleReady && /* @__PURE__ */ jsx8(ReadyButton, { color, ready: ready ?? false, onToggleReady })
538
- ] });
539
- }
540
- var styles6 = StyleSheet6.create({
541
- panel: {
542
- alignItems: "center",
543
- gap: 12
544
- },
545
- // See SectionedDropdown's anchorOpen comment - this panel is typically a sibling of another
546
- // panel (and/or a shared-controls row), so a popover escaping this panel's bounds needs the panel
547
- // itself elevated, not just the popover content, to paint above a later sibling.
548
- panelOpen: {
549
- zIndex: 100
550
- },
551
- // Same gap as `panel`'s own vertical rhythm, reused horizontally - the fallback color swatch and
552
- // (when present) secondPicker sit side by side within this row instead of stacked in the panel's
553
- // own column.
554
- pickerRow: {
555
- alignItems: "center",
556
- flexDirection: "row",
557
- gap: 12
558
- },
559
- // A popover is an absolutely-positioned sibling of its own trigger - so a tall one (the color
560
- // swatch grid) can extend down far enough to overlap the ReadyButton below, which paints on top of
561
- // it by default DOM order since it's a later sibling within `panel`. `panel`'s own panelOpen
562
- // elevation only helps this panel paint above OTHER panels (see its own comment) - it does nothing
563
- // for stacking *within* this panel, since React Native Web gives each View its own stacking
564
- // context. This is what actually fixes that: elevate pickerRow itself above its own later sibling
565
- // whenever one of its own popovers is open.
566
- pickerRowOpen: {
567
- zIndex: 100
568
- }
569
- });
570
-
571
- // src/SharedActionBand.tsx
572
- import { IconButton as IconButton2 } from "@rific/feedback-press";
573
- import { StyleSheet as StyleSheet7, View as View6 } from "react-native";
574
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
575
- function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }) {
576
- return /* @__PURE__ */ jsxs6(View6, { style: [styles7.column, popoverOpen && styles7.columnOpen], children: [
577
- /* @__PURE__ */ jsxs6(View6, { style: styles7.actionsRow, children: [
578
- /* @__PURE__ */ jsx9(IconButton2, { icon: "arrow-left", iconColor: fg, size: 20, onPress: onBack, accessibilityLabel: "Back" }),
579
- onRandomize && /* @__PURE__ */ jsx9(IconButton2, { icon: "dice-multiple", iconColor: fg, size: 18, onPress: onRandomize, accessibilityLabel: "Randomize match settings" }),
580
- onReset && /* @__PURE__ */ jsx9(IconButton2, { icon: "restore", iconColor: fg, size: 18, onPress: onReset, accessibilityLabel: "Reset match settings to defaults" }),
581
- /* @__PURE__ */ jsx9(IconButton2, { icon: "cog", iconColor: fg, size: 20, onPress: onSettings, accessibilityLabel: "Settings" })
582
- ] }),
583
- children
584
- ] });
585
- }
586
- var styles7 = StyleSheet7.create({
587
- actionsRow: {
588
- alignItems: "center",
589
- flexDirection: "row",
590
- gap: 16
591
- },
592
- column: {
593
- alignItems: "center",
594
- gap: 8
595
- },
596
- columnOpen: {
597
- zIndex: 100
598
- }
599
- });
600
-
601
451
  // src/useQuitConfirmation.ts
602
- import { useCallback, useEffect as useEffect2, useRef, useState as useState2 } from "react";
452
+ import { useCallback, useEffect, useRef, useState } from "react";
603
453
  function useQuitConfirmation(hasProgress, onConfirmedBack) {
604
- const [confirmVisible, setConfirmVisible] = useState2(false);
454
+ const [confirmVisible, setConfirmVisible] = useState(false);
605
455
  const hasProgressRef = useRef(hasProgress);
606
- useEffect2(() => {
456
+ useEffect(() => {
607
457
  hasProgressRef.current = hasProgress;
608
458
  });
609
459
  const onConfirmedBackRef = useRef(onConfirmedBack);
610
- useEffect2(() => {
460
+ useEffect(() => {
611
461
  onConfirmedBackRef.current = onConfirmedBack;
612
462
  });
613
463
  const requestBack = useCallback(() => {
@@ -0,0 +1,7 @@
1
+ export { M as MenuOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, f as getProfilePopoverId, u as useZoneClampedAlign } from '../index-Bz4j509X.mjs';
2
+ import 'react';
3
+ import '@rific/auto-paper';
4
+ import '@tastic/profile';
5
+ import '../usePopoverHost-T8QWb2_A.mjs';
6
+ import '@tastic/core';
7
+ import 'react-native';
@@ -0,0 +1,7 @@
1
+ export { M as MenuOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, f as getProfilePopoverId, u as useZoneClampedAlign } from '../index-DW0PsGCE.js';
2
+ import 'react';
3
+ import '@rific/auto-paper';
4
+ import '@tastic/profile';
5
+ import '../usePopoverHost-T8QWb2_A.js';
6
+ import '@tastic/core';
7
+ import 'react-native';