itsm_ysm/mobile/constants/ItmsTheme.ts
itms-merge-dev efc3e66635 feat(itms): 모바일 앱 신규 (Expo, 12화면, OAuth password grant)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 17:10:46 +09:00

74 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ITMS 모바일 디자인 토큰 — WISE(UIMS) 브랜드 정렬.
* 브랜드 그라데이션: 시안 #11c3ff → 블루 #1f29fc.
* 단일 브랜드(BLUE) × 라이트/다크. 하드코딩 hex 회피 위해 useTheme() 로 토큰 조달.
* 이모지 금지 — 아이콘은 @expo/vector-icons(Feather, 선 스타일)로만 표현.
*/
export type ThemeMode = 'dark' | 'light'
export interface ThemeTokens {
bg: string; card: string; cardAlt: string; border: string; text: string; muted: string
brand: string; primary: string; accent: string
success: string; warning: string; danger: string; info: string
white: string
tabActive: string; tabIdle: string
onBrand: string
}
/** WISE 브랜드 컬러(고정). brand=주버튼/헤더, accent=포인트/하이라이트. */
const BRAND = '#1f29fc'
const ACCENT = '#11c3ff'
const darkBase: Omit<ThemeTokens, 'brand' | 'primary' | 'accent' | 'tabActive'> = {
bg: '#0b0f17',
card: '#141a26',
cardAlt: '#1c2433',
border: '#283142',
text: '#e6edf3',
muted: '#8b97a8',
success: '#22c55e',
warning: '#f59e0b',
danger: '#ef4444',
info: '#38bdf8',
white: '#ffffff',
tabIdle: '#6b7686',
onBrand: '#ffffff',
}
const lightBase: Omit<ThemeTokens, 'brand' | 'primary' | 'accent' | 'tabActive'> = {
bg: '#f4f6f9',
card: '#ffffff',
cardAlt: '#f4f6f9',
border: '#e6eaf0',
text: '#252525',
muted: '#6b7280',
success: '#16a34a',
warning: '#d97706',
danger: '#dc2626',
info: '#0284c7',
white: '#ffffff',
tabIdle: '#9aa3b2',
onBrand: '#ffffff',
}
export function makeTheme(mode: ThemeMode): ThemeTokens {
const base = mode === 'dark' ? darkBase : lightBase
return { ...base, brand: BRAND, primary: BRAND, accent: ACCENT, tabActive: BRAND }
}
/**
* SR/인시던트 진행상태 라벨 → 표시 색(양 모드 공통).
* 백엔드 상태코드가 코드값/한글 혼재이므로 라벨 부분일치로 색 매핑, 미지정은 muted.
*/
export function statusColor(label: string | null | undefined, t: ThemeTokens): string {
const s = (label ?? '').toString()
if (/완료|처리완료|종료|승인|정상|해결/.test(s)) return t.success
if (/반려|거부|취소|실패|오류|장애/.test(s)) return t.danger
if (/진행|처리중|접수|검토|대기/.test(s)) return t.info
if (/보류|지연|확인요청/.test(s)) return t.warning
return t.muted
}
export const DEFAULT_THEME = makeTheme('light')