From 2422ca44b0362e44081064c54d0dad243f716557 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 14 Aug 2026 23:58:14 +0300 Subject: [PATCH] refactor(frontend): complete BEM design system --- frontend/package.json | 2 +- frontend/src/components/AccountsList.tsx | 34 ++++---- frontend/src/components/CategoriesList.tsx | 16 ++-- frontend/src/components/CategoryChart.tsx | 31 ++++--- frontend/src/components/ClearHistoryModal.tsx | 18 ++--- frontend/src/components/DataSection.tsx | 38 ++++----- frontend/src/components/DeleteImportModal.tsx | 10 +-- .../src/components/EditTransactionModal.tsx | 24 +++--- frontend/src/components/ImportModal.tsx | 50 ++++++------ frontend/src/components/Layout.tsx | 6 +- frontend/src/components/RulesList.tsx | 28 +++---- frontend/src/components/TimeseriesChart.tsx | 18 ++--- .../src/components/TransactionFilters.tsx | 18 ++--- frontend/src/components/TransactionTable.tsx | 26 +++--- frontend/src/pages/AnalyticsPage.tsx | 8 +- frontend/src/pages/HistoryPage.tsx | 2 +- frontend/src/pages/LoginPage.tsx | 10 +-- frontend/src/styles/index.css | 80 +++++++++++-------- package-lock.json | 2 +- 19 files changed, 222 insertions(+), 199 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 0c09d1a..fc07db7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "@family-budget/frontend", - "version": "0.8.6", + "version": "0.8.7", "private": true, "type": "module", "scripts": { diff --git a/frontend/src/components/AccountsList.tsx b/frontend/src/components/AccountsList.tsx index 1f70a33..27ee12d 100644 --- a/frontend/src/components/AccountsList.tsx +++ b/frontend/src/components/AccountsList.tsx @@ -42,22 +42,22 @@ export function AccountsList() { return (
- - - - - - - + + + + + + + - + {accounts.map((a) => ( - - - - - + + + + - - + diff --git a/frontend/src/components/CategoriesList.tsx b/frontend/src/components/CategoriesList.tsx index e6a2871..248f056 100644 --- a/frontend/src/components/CategoriesList.tsx +++ b/frontend/src/components/CategoriesList.tsx @@ -27,17 +27,17 @@ export function CategoriesList() { return (
БанкНомер счётаВалютаАлиас
БанкНомер счётаВалютаАлиас
{a.bank}{a.accountNumberMasked}{a.currency} +
{a.bank}{a.accountNumberMasked}{a.currency} {editingId === a.id ? ( ) : ( a.alias || ( - не задан + не задан ) )} + {editingId === a.id ? (
+
Нет счетов. Импортируйте выписку.
- - - - + + + + - + {categories.map((c) => ( - - - + +
КатегорияТип
КатегорияТип
{c.name} +
{c.name} {TYPE_LABELS[c.type] ?? c.type} diff --git a/frontend/src/components/CategoryChart.tsx b/frontend/src/components/CategoryChart.tsx index b43fb52..55b162d 100644 --- a/frontend/src/components/CategoryChart.tsx +++ b/frontend/src/components/CategoryChart.tsx @@ -14,9 +14,14 @@ interface Props { } const COLORS = [ - '#2563eb', '#e85d3f', '#0f9f7f', '#d89b17', '#7c5cdb', - '#c8558f', '#1495a3', '#79a92f', '#e06d2f', '#4f6fd7', - '#1c9a8a', '#d43d5c', '#277bbd', '#9b59b6', '#2f9f63', + 'var(--color-chart-1)', 'var(--color-chart-2)', + 'var(--color-chart-3)', 'var(--color-chart-4)', + 'var(--color-chart-5)', 'var(--color-chart-6)', + 'var(--color-chart-7)', 'var(--color-chart-8)', + 'var(--color-chart-9)', 'var(--color-chart-10)', + 'var(--color-chart-11)', 'var(--color-chart-12)', + 'var(--color-chart-13)', 'var(--color-chart-14)', + 'var(--color-chart-15)', ]; const rubFormatter = new Intl.NumberFormat('ru-RU', { @@ -70,18 +75,18 @@ export function CategoryChart({ data }: Props) { - - - - - - + + + + + + - + {data.map((item, idx) => ( - - + - +
КатегорияСуммаОперацийДоля
КатегорияСуммаОперацийДоля
+
{item.categoryName} {formatAmount(item.amount)}{formatAmount(item.amount)} {item.txCount} {(item.share * 100).toFixed(1)}% diff --git a/frontend/src/components/ClearHistoryModal.tsx b/frontend/src/components/ClearHistoryModal.tsx index dcdbd51..57b01a5 100644 --- a/frontend/src/components/ClearHistoryModal.tsx +++ b/frontend/src/components/ClearHistoryModal.tsx @@ -32,14 +32,14 @@ export function ClearHistoryModal({ onClose, onDone }: Props) { return (
{ if (e.target === e.currentTarget) onClose(); }} > -
e.stopPropagation()}> +
e.stopPropagation()}>
-

Очистить историю операций

+

Очистить историю операций

@@ -53,8 +53,8 @@ export function ClearHistoryModal({ onClose, onDone }: Props) { {error &&
{error}
} -
-