@tastic/hud 0.21.0 → 0.22.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.
- package/README.md +10 -1
- package/dist/chrome/index.d.mts +15 -3
- package/dist/chrome/index.d.ts +15 -3
- package/dist/chrome/index.js +54 -41
- package/dist/chrome/index.mjs +7 -3
- package/dist/{chunk-UOA35OWJ.mjs → chunk-N7A7W72S.mjs} +35 -26
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -48
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
- package/src/AchievementCatalogSection.tsx +7 -6
- package/src/AchievementRow.tsx +13 -13
- package/src/ActivityStatSection.tsx +10 -5
- package/src/StatRow.tsx +10 -11
- package/src/StatSection.tsx +14 -14
- package/src/chrome/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/wellSurface.ts +30 -0
package/src/index.ts
CHANGED
|
@@ -42,3 +42,4 @@ export { useCompactDialog } from './useCompactDialog'
|
|
|
42
42
|
export { type PopoverHost, usePopoverHost } from './usePopoverHost'
|
|
43
43
|
export { type QuitConfirmation, useQuitConfirmation } from './useQuitConfirmation'
|
|
44
44
|
export { useZoneClampedAlign } from './useZoneClampedAlign'
|
|
45
|
+
export { useWellColors, WELL_SHADOW, type WellColors } from './wellSurface'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useAutoPaperTheme } from '@rific/auto-paper'
|
|
2
|
+
|
|
3
|
+
// A well is a resting card on a screen: a stats section, an achievement row, a game's menu tile. Every well in the
|
|
4
|
+
// fleet is the theme's plain surface (the same surface as the dialogs, OverlayCard and auto-paper's Dialog) lifted off
|
|
5
|
+
// the screen by MD3's level-1 shadow, with no elevation tint (Jay, 2026-10-17: Solitaire's Achievements wells read as
|
|
6
|
+
// a different shade from its Home tiles, and he picked "shadow, no tint" over MD3's tonal elevation, which washes the
|
|
7
|
+
// surface with the primary like the dialogs no longer are).
|
|
8
|
+
//
|
|
9
|
+
// The shadow is what makes a well show on a screen the color of the surface: MD3 (as react-native-paper implements it)
|
|
10
|
+
// gives `background` and `surface` the same tone, and BaseStatsScreen's light-mode #FFFFFF is the same as the light
|
|
11
|
+
// surface to the eye. In dark mode the surface is already lighter than a black screen, and the shadow barely shows.
|
|
12
|
+
|
|
13
|
+
// MD3's level-1 elevation shadow (its web spec's two layers: a tight key shadow and a soft ambient one). boxShadow is
|
|
14
|
+
// drawn outside the view on iOS, Android and web alike, so a well's own background is never darkened by it.
|
|
15
|
+
export const WELL_SHADOW = '0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15)'
|
|
16
|
+
|
|
17
|
+
export interface WellColors {
|
|
18
|
+
// The well's own background.
|
|
19
|
+
bg: string
|
|
20
|
+
// Text on the well: titles and values, then labels and descriptions.
|
|
21
|
+
fg: string
|
|
22
|
+
fgMuted: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// The colors of a well and the text on it, from the app's own theme: the same roles the dialogs' text uses
|
|
26
|
+
// (useOverlayCardColors).
|
|
27
|
+
export function useWellColors(): WellColors {
|
|
28
|
+
const { colors } = useAutoPaperTheme()
|
|
29
|
+
return { bg: colors.surface, fg: colors.onSurface, fgMuted: colors.onSurfaceVariant }
|
|
30
|
+
}
|