@brimveyn/aimux 1.9.5 → 1.9.6
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/package.json +1 -1
- package/src/app.tsx +4 -5
- package/src/pty/terminal-snapshot.ts +7 -7
- package/src/ui/components/git/diff-renderer/fold-strip.tsx +7 -7
- package/src/ui/components/git/diff-renderer/pierre-diff.tsx +3 -3
- package/src/ui/components/git/diff-renderer/split-view.tsx +18 -17
- package/src/ui/components/git/diff-renderer/stacked-view.tsx +13 -13
- package/src/ui/components/git/git-panel.tsx +42 -39
- package/src/ui/components/git/git-view.tsx +20 -20
- package/src/ui/components/layout/session-bar.tsx +13 -13
- package/src/ui/components/layout/sidebar/sidebar.tsx +26 -28
- package/src/ui/components/layout/sidebar/tab-item.tsx +21 -21
- package/src/ui/components/layout/split-layout.tsx +2 -2
- package/src/ui/components/layout/status-bar.tsx +12 -12
- package/src/ui/components/layout/terminal-pane.tsx +19 -31
- package/src/ui/components/modals/app/ai-usage-modal.tsx +21 -21
- package/src/ui/components/modals/app/help-modal.tsx +5 -6
- package/src/ui/components/modals/app/update-available-modal.tsx +3 -3
- package/src/ui/components/modals/git/git-commit-modal.tsx +17 -17
- package/src/ui/components/modals/sessions/create-session-modal.tsx +8 -8
- package/src/ui/components/modals/sessions/session-picker-modal.tsx +6 -6
- package/src/ui/components/modals/shared/form.tsx +4 -4
- package/src/ui/components/modals/shared/modal-keybinds-overlay.tsx +4 -4
- package/src/ui/components/modals/shared/modal-shell.tsx +6 -6
- package/src/ui/components/modals/shared/picker.tsx +6 -6
- package/src/ui/components/modals/snippets/snippet-picker-modal.tsx +5 -5
- package/src/ui/components/modals/tabs/new-tab-modal.tsx +6 -6
- package/src/ui/components/modals/themes/theme-picker-modal.tsx +17 -20
- package/src/ui/components/overlays/ai-usage/ai-usage-indicator.tsx +12 -12
- package/src/ui/components/overlays/context-menu/context-menu-overlay.tsx +6 -6
- package/src/ui/components/overlays/pending-chord-overlay.tsx +5 -5
- package/src/ui/components/primitives/bare-input.tsx +5 -5
- package/src/ui/components/primitives/input-field.tsx +5 -5
- package/src/ui/components/primitives/list-item.tsx +27 -22
- package/src/ui/components/primitives/surface.tsx +12 -9
- package/src/ui/filter-themes.ts +9 -8
- package/src/ui/root.tsx +5 -4
- package/src/ui/shiki.ts +8 -11
- package/src/ui/theme-store.ts +48 -118
- package/src/ui/theme.ts +8 -8
- package/src/ui/themes.ts +9 -20
package/src/ui/theme-store.ts
CHANGED
|
@@ -1,114 +1,74 @@
|
|
|
1
|
-
import { useStore } from 'zustand'
|
|
2
|
-
import { createStore } from 'zustand/vanilla'
|
|
3
|
-
|
|
4
1
|
import {
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
computeSurfaces,
|
|
9
|
-
diffAddBg,
|
|
10
|
-
diffDeleteBg,
|
|
11
|
-
extendPalette,
|
|
2
|
+
migrateThemeId,
|
|
3
|
+
type ResolvedTuiTheme,
|
|
4
|
+
resolveTuiTheme,
|
|
12
5
|
type ThemeId,
|
|
13
6
|
type ThemeMode,
|
|
14
|
-
|
|
15
|
-
} from '
|
|
7
|
+
TUI_THEMES,
|
|
8
|
+
} from '@brimveyn/aimux-config'
|
|
9
|
+
import { useStore } from 'zustand'
|
|
10
|
+
import { createStore } from 'zustand/vanilla'
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
/** `accent` with `primary` fallback. */
|
|
19
|
-
accent: string
|
|
20
|
-
/** App-level background surface (derived from palette.neutral seed via OKLCH). */
|
|
21
|
-
bg: string
|
|
22
|
-
/** Subtle border between panels. */
|
|
23
|
-
border: string
|
|
24
|
-
/** Background tint for inserted diff lines. */
|
|
25
|
-
diffAddBg: string
|
|
26
|
-
/** Background tint for removed diff lines. */
|
|
27
|
-
diffDeleteBg: string
|
|
28
|
-
/** Surface a notch above the base background — sidebars, headers. */
|
|
29
|
-
elevated: string
|
|
30
|
-
/** Fainter still — line numbers, placeholders, disabled. */
|
|
31
|
-
faint: string
|
|
32
|
-
/** Hover/highlight surface (line highlight, list hover). */
|
|
33
|
-
hover: string
|
|
34
|
-
/** Half-way between background and ink — labels, captions, paths. */
|
|
35
|
-
muted: string
|
|
36
|
-
palette: AimuxPalette
|
|
37
|
-
/** Selected/active row surface. */
|
|
38
|
-
selected: string
|
|
39
|
-
}
|
|
12
|
+
const DEFAULT_ID: ThemeId = 'aimux'
|
|
40
13
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
bg: surfaces.bg,
|
|
46
|
-
border: surfaces.border,
|
|
47
|
-
diffAddBg: diffAddBg(palette),
|
|
48
|
-
diffDeleteBg: diffDeleteBg(palette),
|
|
49
|
-
elevated: surfaces.elevated,
|
|
50
|
-
faint: surfaces.faint,
|
|
51
|
-
hover: surfaces.hover,
|
|
52
|
-
muted: surfaces.muted,
|
|
53
|
-
palette,
|
|
54
|
-
selected: surfaces.selected,
|
|
55
|
-
}
|
|
14
|
+
interface ThemeStore {
|
|
15
|
+
id: ThemeId
|
|
16
|
+
mode: ThemeMode
|
|
17
|
+
transparent: boolean
|
|
56
18
|
}
|
|
57
19
|
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
const themeStore = createStore<ThemeStore>(() => ({
|
|
21
|
+
id: DEFAULT_ID,
|
|
22
|
+
mode: 'dark',
|
|
23
|
+
transparent: false,
|
|
24
|
+
}))
|
|
25
|
+
|
|
26
|
+
let cachedId: ThemeId | null = null
|
|
60
27
|
let cachedMode: ThemeMode | null = null
|
|
61
|
-
let
|
|
28
|
+
let cachedResolved: ResolvedTuiTheme | null = null
|
|
62
29
|
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
65
|
-
|
|
30
|
+
function derive(id: ThemeId, mode: ThemeMode): ResolvedTuiTheme {
|
|
31
|
+
if (cachedResolved && cachedId === id && cachedMode === mode) return cachedResolved
|
|
32
|
+
cachedId = id
|
|
66
33
|
cachedMode = mode
|
|
67
|
-
|
|
68
|
-
|
|
34
|
+
const json = TUI_THEMES[id] ?? TUI_THEMES.aimux
|
|
35
|
+
if (!json) throw new Error(`No theme JSON for ${id}`)
|
|
36
|
+
cachedResolved = resolveTuiTheme(json, mode)
|
|
37
|
+
return cachedResolved
|
|
69
38
|
}
|
|
70
39
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
40
|
+
/** Subscribe to the resolved TUI theme for the active id+mode. */
|
|
41
|
+
export function useTheme(): ResolvedTuiTheme {
|
|
42
|
+
return useStore(themeStore, (s) => derive(s.id, s.mode))
|
|
74
43
|
}
|
|
75
44
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
45
|
+
/** Synchronous snapshot of the resolved theme for non-React callers. */
|
|
46
|
+
export function getCurrentTheme(): ResolvedTuiTheme {
|
|
47
|
+
const s = themeStore.getState()
|
|
48
|
+
return derive(s.id, s.mode)
|
|
49
|
+
}
|
|
80
50
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return useStore(themeStore, (s) => deriveTokens(s.theme.palette, s.theme.mode))
|
|
51
|
+
export function getCurrentThemeId(): ThemeId {
|
|
52
|
+
return themeStore.getState().id
|
|
84
53
|
}
|
|
85
54
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const s = themeStore.getState()
|
|
89
|
-
return deriveTokens(s.theme.palette, s.theme.mode)
|
|
55
|
+
export function getCurrentMode(): ThemeMode {
|
|
56
|
+
return themeStore.getState().mode
|
|
90
57
|
}
|
|
91
58
|
|
|
92
|
-
/**
|
|
93
|
-
export function
|
|
94
|
-
|
|
59
|
+
/** Swap the active theme by id. Falls back via migrateThemeId for legacy ids. */
|
|
60
|
+
export function applyTheme(id: string): void {
|
|
61
|
+
const next = migrateThemeId(id)
|
|
62
|
+
if (themeStore.getState().id === next) return
|
|
63
|
+
themeStore.setState({ id: next })
|
|
95
64
|
}
|
|
96
65
|
|
|
97
|
-
/**
|
|
98
|
-
export function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const palette = extendPalette(entry.palette, paletteOverrides)
|
|
102
|
-
const merged: AimuxTheme = {
|
|
103
|
-
...entry,
|
|
104
|
-
bg: palette.neutral,
|
|
105
|
-
fg: palette.ink,
|
|
106
|
-
palette,
|
|
107
|
-
}
|
|
108
|
-
themeStore.setState({ theme: merged })
|
|
66
|
+
/** Toggle between dark and light. Plumbed but not yet wired to UI controls. */
|
|
67
|
+
export function setMode(mode: ThemeMode): void {
|
|
68
|
+
if (themeStore.getState().mode === mode) return
|
|
69
|
+
themeStore.setState({ mode })
|
|
109
70
|
}
|
|
110
71
|
|
|
111
|
-
/** Subscribe to the transparent-mode flag. */
|
|
112
72
|
export function useTransparent(): boolean {
|
|
113
73
|
return useStore(themeStore, (s) => s.transparent)
|
|
114
74
|
}
|
|
@@ -121,33 +81,3 @@ export function setTransparent(value: boolean): void {
|
|
|
121
81
|
if (themeStore.getState().transparent === value) return
|
|
122
82
|
themeStore.setState({ transparent: value })
|
|
123
83
|
}
|
|
124
|
-
|
|
125
|
-
export type SurfaceToken = 'base' | 'elevated' | 'hover' | 'selected' | 'border'
|
|
126
|
-
|
|
127
|
-
function resolveSurface(palette: AimuxPalette, mode: ThemeMode, token: SurfaceToken): string {
|
|
128
|
-
const surfaces = computeSurfaces(palette, mode)
|
|
129
|
-
switch (token) {
|
|
130
|
-
case 'base':
|
|
131
|
-
return surfaces.bg
|
|
132
|
-
case 'elevated':
|
|
133
|
-
return surfaces.elevated
|
|
134
|
-
case 'hover':
|
|
135
|
-
return surfaces.hover
|
|
136
|
-
case 'selected':
|
|
137
|
-
return surfaces.selected
|
|
138
|
-
case 'border':
|
|
139
|
-
return surfaces.border
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Resolve a surface color through the transparent-mode flag. Returns
|
|
145
|
-
* `undefined` for the base surface when transparent mode is on, letting the
|
|
146
|
-
* terminal emulator's own background show through.
|
|
147
|
-
*/
|
|
148
|
-
export function useBg(token: SurfaceToken): string | undefined {
|
|
149
|
-
return useStore(themeStore, (s) => {
|
|
150
|
-
if (s.transparent && token === 'base') return undefined
|
|
151
|
-
return resolveSurface(s.theme.palette, s.theme.mode, token)
|
|
152
|
-
})
|
|
153
|
-
}
|
package/src/ui/theme.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// Back-compat shim: the theme singleton
|
|
2
|
-
//
|
|
3
|
-
// `getCurrentTheme()
|
|
1
|
+
// Back-compat shim: the theme singleton lives in `theme-store.ts`. React
|
|
2
|
+
// components use `useTheme` for the resolved TUI token map; non-React callers
|
|
3
|
+
// use `getCurrentTheme()`.
|
|
4
4
|
|
|
5
|
+
export type { ResolvedTuiTheme, TuiColorToken } from './themes'
|
|
5
6
|
export {
|
|
6
7
|
applyTheme,
|
|
8
|
+
getCurrentMode,
|
|
7
9
|
getCurrentTheme,
|
|
8
|
-
|
|
10
|
+
getCurrentThemeId,
|
|
9
11
|
getTransparent,
|
|
12
|
+
setMode,
|
|
10
13
|
setTransparent,
|
|
11
|
-
|
|
12
|
-
type ThemeTokens,
|
|
13
|
-
useBg,
|
|
14
|
-
useTokens,
|
|
14
|
+
useTheme,
|
|
15
15
|
useTransparent,
|
|
16
16
|
} from './theme-store'
|
package/src/ui/themes.ts
CHANGED
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
// Thin runtime re-export
|
|
2
|
-
// palette-to-Shiki generator all live in `@brimveyn/aimux-config`.
|
|
1
|
+
// Thin runtime re-export of the TUI theme namespace.
|
|
3
2
|
|
|
4
3
|
export type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
AimuxThemeConfig,
|
|
8
|
-
Theme,
|
|
4
|
+
ResolvedTuiTheme,
|
|
5
|
+
RGBA,
|
|
9
6
|
ThemeId,
|
|
10
7
|
ThemeMode,
|
|
8
|
+
TuiColorToken,
|
|
9
|
+
TuiColorValue,
|
|
10
|
+
TuiThemeJson,
|
|
11
11
|
} from '@brimveyn/aimux-config'
|
|
12
12
|
|
|
13
13
|
export {
|
|
14
|
-
accent,
|
|
15
|
-
border,
|
|
16
|
-
computeSurfaces,
|
|
17
|
-
diffAddBg,
|
|
18
|
-
diffDeleteBg,
|
|
19
|
-
elevated,
|
|
20
|
-
extendPalette,
|
|
21
|
-
faint,
|
|
22
|
-
hover,
|
|
23
14
|
isKnownThemeId,
|
|
24
15
|
migrateThemeId,
|
|
25
|
-
|
|
26
|
-
muted,
|
|
27
|
-
paletteToShikiTheme,
|
|
28
|
-
selected,
|
|
16
|
+
resolveTuiTheme,
|
|
29
17
|
THEME_IDS,
|
|
30
|
-
|
|
18
|
+
TUI_COLOR_TOKENS,
|
|
19
|
+
TUI_THEMES,
|
|
31
20
|
} from '@brimveyn/aimux-config'
|