V13-FE-006: consolidate approved UI and contract hardening
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
import { themeQuartz } from 'ag-grid-community'
|
||||
|
||||
// AG Grid v33+ Theming API adapter. Business modules never import a grid theme directly.
|
||||
export const kbxGridTheme = themeQuartz.withParams({
|
||||
spacing: 4,
|
||||
foregroundColor: 'var(--kbx-color-text)',
|
||||
backgroundColor: 'var(--kbx-color-surface)',
|
||||
accentColor: 'var(--kbx-color-primary)',
|
||||
borderColor: 'var(--kbx-color-border)',
|
||||
headerBackgroundColor: 'var(--kbx-color-surface-subtle)',
|
||||
headerTextColor: 'var(--kbx-color-text)',
|
||||
rowHoverColor: 'var(--kbx-color-surface-hover)',
|
||||
selectedRowBackgroundColor: 'var(--kbx-color-info-surface)',
|
||||
})
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
export type KbxThemeMode = 'light' | 'dark'
|
||||
|
||||
export const KBX_THEME_MODES: readonly KbxThemeMode[] = ['light', 'dark'] as const
|
||||
|
||||
export function normalizeKbxThemeMode(value: unknown): KbxThemeMode {
|
||||
return value === 'dark' ? 'dark' : 'light'
|
||||
}
|
||||
|
||||
export function applyKbxTheme(mode: KbxThemeMode, root: HTMLElement = document.documentElement) {
|
||||
const normalized = normalizeKbxThemeMode(mode)
|
||||
root.dataset.kbxTheme = normalized
|
||||
root.style.colorScheme = normalized
|
||||
return normalized
|
||||
}
|
||||
|
||||
export function nextKbxThemeMode(mode: KbxThemeMode): KbxThemeMode {
|
||||
return mode === 'dark' ? 'light' : 'dark'
|
||||
}
|
||||
Reference in New Issue
Block a user