@tastic/hud 0.8.2 → 0.8.3
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 +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +158 -154
- package/dist/index.mjs +83 -81
- package/package.json +2 -2
- package/src/BaseSettingsDialog.tsx +8 -28
- package/src/BaseStatsScreen.tsx +2 -2
- package/src/ConfirmDialog.tsx +18 -31
- package/src/index.ts +1 -0
- package/src/overlayCard.ts +48 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native'
|
|
2
|
+
|
|
3
|
+
export interface OverlayCardColors {
|
|
4
|
+
fg: string
|
|
5
|
+
fgMuted: string
|
|
6
|
+
cardBg: string
|
|
7
|
+
cardBorder: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// The literal-black/white-by-appearance "retro" formula this package's own BaseSettingsDialog and
|
|
11
|
+
// ConfirmDialog each independently re-derived — deliberately NOT auto-paper's own (seed-color-tinted)
|
|
12
|
+
// background role, see either component's own "High-contrast retro look" comment for why. Every
|
|
13
|
+
// fleet app's own Game-Over/Round-Over/Match-Over/Quit-confirmation overlay re-derives this same
|
|
14
|
+
// three-or-four-line formula again, which is what this export exists to replace.
|
|
15
|
+
export function getOverlayCardColors(dark: boolean): OverlayCardColors {
|
|
16
|
+
return {
|
|
17
|
+
fg: dark ? '#FFFFFF' : '#000000',
|
|
18
|
+
fgMuted: dark ? 'rgba(255,255,255,0.4)' : 'rgba(0,0,0,0.4)',
|
|
19
|
+
cardBg: dark ? '#111111' : '#F2F2F2',
|
|
20
|
+
cardBorder: dark ? 'rgba(255,255,255,0.2)' : 'rgba(0,0,0,0.2)'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Only the shell shape every overlay card shares (backdrop + card geometry) — deliberately not the
|
|
25
|
+
// button/title/body styling, which already legitimately varies by consumer (BaseSettingsDialog's
|
|
26
|
+
// single centered OK button vs. ConfirmDialog's two-button flexBasis-wrap row vs. each app's own
|
|
27
|
+
// score/badge/zone content). A consumer applies `{backgroundColor: cardBg, borderColor: cardBorder}`
|
|
28
|
+
// from getOverlayCardColors on top of `card` itself, same as every existing call site already does.
|
|
29
|
+
export const overlayStyles = StyleSheet.create({
|
|
30
|
+
card: {
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
borderRadius: 20,
|
|
33
|
+
borderWidth: 1,
|
|
34
|
+
gap: 16,
|
|
35
|
+
maxWidth: 360,
|
|
36
|
+
padding: 32
|
|
37
|
+
},
|
|
38
|
+
overlay: {
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
backgroundColor: 'rgba(0,0,0,0.72)',
|
|
41
|
+
bottom: 0,
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
left: 0,
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
right: 0,
|
|
46
|
+
top: 0
|
|
47
|
+
}
|
|
48
|
+
})
|