Commit 26a6133
committed
feat: integra @mriqbox/ui-kit + accent suite-wide via convar mri:color
Fase 1 da integracao com a suite MRI. Sem mudanca visual, prepara o
terreno: ui-kit instalado, tokens shadcn alinhados, accent global
reagindo a convar mri:color em runtime.
Frontend (web/):
- package.json: dep @mriqbox/ui-kit ^4.10.1
- src/index.css: import do CSS do kit + tokens shadcn completos
(--primary/--ring/--card/etc). Default --primary = 160 100% 45%
(#00E699, accent canonico da suite). Legados --ps-hud-* mantidos
ate migracao dos componentes do menu antigo.
- tailwind.config: darkMode class, tokens consumindo CSS vars,
content path incluindo node_modules/@mriqbox/ui-kit/dist (JIT
pega classes usadas dentro do kit)
- stores/themeStore.ts (novo): zustand store com accentColor + setter
validador (so aceita hex #RRGGBB ou #RRGGBBAA)
- hooks/useAccentColor.ts (novo): converte hex -> HSL e aplica em
--primary + --ring. Padrao identico ao Qspawn/Qadmin/Qappearance.
- App.tsx: wire useThemeStore + useAccentColor no root
- utils/eventHandler.ts: 'updateUISettings' agora chama
themeStore.setAccentColor se data.accentColor estiver presente
(funciona tanto pra payload completo quanto so com accent)
Lua (client/main.lua):
- getMriAccent() le convar mri:color (default #00E699), valida hex
- sendUIUpdateMessage inclui accentColor em todo payload
- AddConvarChangeListener('mri:color') broadcasta updateUISettings
parcial com novo accent, sem precisar restart do resource
- Event handler 'mri:color:changed' tambem suportado (compat com
emissor externo)
Build artifacts (html/index.css cresce de ~14kb pra ~85kb por causa
dos tokens + tailwind base + CSS do kit — esperado).
Proximos passos (separados): migrar componentes do menu antigo pra
MriButton/MriCard/MriSwitch do kit (Fase 2, opcional).1 parent c3df847 commit 26a6133
12 files changed
Lines changed: 963 additions & 26 deletions
File tree
- client
- html
- web
- src
- hooks
- stores
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| 134 | + | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| |||
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
135 | 156 | | |
136 | 157 | | |
137 | 158 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments