@accounter/client 0.0.8-alpha-20251021150615-800574fc6d416cd319de216c97b431643d8958a2 → 0.0.8-alpha-20251021163440-2ab1a9ffaec95fd99fac5495c3a392b97429ce77

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/dist/assets/index-B2UYAO1O.css +1 -0
  3. package/dist/assets/index-BexxGuN6.js +1224 -0
  4. package/dist/assets/{index.es-DHwHzag1.js → index.es-CWwhWGxX.js} +1 -1
  5. package/dist/index.html +2 -2
  6. package/package.json +6 -5
  7. package/src/app.tsx +35 -25
  8. package/src/components/business/business-header.tsx +68 -0
  9. package/src/components/business/charges-section.tsx +82 -0
  10. package/src/components/business/charts-section.tsx +115 -0
  11. package/src/components/business/configurations-section.tsx +885 -0
  12. package/src/components/business/contact-info-section.tsx +536 -0
  13. package/src/components/business/contracts-section.tsx +196 -0
  14. package/src/components/business/documents-section.tsx +26 -0
  15. package/src/components/business/index.tsx +171 -0
  16. package/src/components/business/integrations-section.tsx +477 -0
  17. package/src/components/business/transactions-section.tsx +26 -0
  18. package/src/components/business-transactions/business-extended-info.tsx +11 -15
  19. package/src/components/business-transactions/business-transactions-single.tsx +1 -1
  20. package/src/components/business-transactions/index.tsx +1 -1
  21. package/src/components/charges/charge-extended-info-menu.tsx +27 -21
  22. package/src/components/charges/charges-row.tsx +12 -10
  23. package/src/components/charges/charges-table.tsx +15 -9
  24. package/src/components/clients/contracts/modify-contract-dialog.tsx +464 -0
  25. package/src/components/clients/modify-client-dialog.tsx +276 -0
  26. package/src/components/common/documents/issue-document/index.tsx +3 -3
  27. package/src/components/common/documents/issue-document/{recent-client-docs.tsx → recent-business-docs.tsx} +19 -13
  28. package/src/components/common/forms/business-card.tsx +1 -0
  29. package/src/components/common/forms/modify-business-fields.tsx +2 -19
  30. package/src/components/common/inputs/combo-box.tsx +1 -1
  31. package/src/components/layout/sidelinks.tsx +3 -3
  32. package/src/components/reports/trial-balance-report/trial-balance-report-group.tsx +4 -6
  33. package/src/components/reports/trial-balance-report/trial-balance-report-sort-code.tsx +8 -11
  34. package/src/components/screens/businesses/business.tsx +44 -0
  35. package/src/components/screens/documents/issue-documents/edit-issue-document-modal.tsx +4 -4
  36. package/src/components/ui/progress.tsx +25 -0
  37. package/src/components/ui/skeleton.tsx +12 -0
  38. package/src/gql/gql.ts +93 -9
  39. package/src/gql/graphql.ts +289 -9
  40. package/src/helpers/contracts.ts +22 -0
  41. package/src/helpers/currency.ts +5 -0
  42. package/src/helpers/index.ts +2 -0
  43. package/src/helpers/pcn874.ts +17 -0
  44. package/src/hooks/use-add-sort-code.ts +1 -1
  45. package/src/hooks/use-add-tag.ts +1 -1
  46. package/src/hooks/use-create-contract.ts +62 -0
  47. package/src/hooks/use-delete-contract.ts +64 -0
  48. package/src/hooks/use-delete-tag.ts +1 -1
  49. package/src/hooks/use-get-all-contracts.ts +0 -1
  50. package/src/hooks/use-insert-client.ts +80 -0
  51. package/src/hooks/use-merge-businesses.ts +1 -1
  52. package/src/hooks/use-merge-charges.ts +1 -1
  53. package/src/hooks/use-update-client.ts +75 -0
  54. package/src/hooks/use-update-contract.ts +69 -0
  55. package/dist/assets/index-0eCf1BcD.css +0 -1
  56. package/dist/assets/index-DHTbHvtz.js +0 -1188
@@ -0,0 +1,115 @@
1
+ import { DollarSign, TrendingUp } from 'lucide-react';
2
+ import { CartesianGrid, Line, LineChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
3
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card.js';
4
+ import { ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart.js';
5
+
6
+ const revenueData = [
7
+ { month: 'Jan', revenue: 12_500, expenses: 8200 },
8
+ { month: 'Feb', revenue: 15_800, expenses: 9100 },
9
+ { month: 'Mar', revenue: 18_200, expenses: 10_500 },
10
+ { month: 'Apr', revenue: 16_900, expenses: 9800 },
11
+ { month: 'May', revenue: 21_300, expenses: 11_200 },
12
+ { month: 'Jun', revenue: 24_500, expenses: 12_800 },
13
+ { month: 'Jul', revenue: 22_800, expenses: 11_900 },
14
+ { month: 'Aug', revenue: 26_100, expenses: 13_500 },
15
+ { month: 'Sep', revenue: 28_900, expenses: 14_200 },
16
+ { month: 'Oct', revenue: 31_200, expenses: 15_100 },
17
+ ];
18
+
19
+ export function ChartsSection() {
20
+ const totalRevenue = revenueData.reduce((sum, item) => sum + item.revenue, 0);
21
+ const avgRevenue = totalRevenue / revenueData.length;
22
+
23
+ return (
24
+ <Card>
25
+ <CardHeader>
26
+ <CardTitle>Revenue Analytics</CardTitle>
27
+ <CardDescription>Revenue and expenses over time</CardDescription>
28
+ </CardHeader>
29
+ <CardContent>
30
+ <div className="grid gap-4 md:grid-cols-3 mb-6">
31
+ <div className="rounded-lg border p-4 space-y-2">
32
+ <div className="flex items-center gap-2 text-sm text-muted-foreground">
33
+ <DollarSign className="h-4 w-4" />
34
+ Total Revenue
35
+ </div>
36
+ <p className="text-2xl font-bold">${totalRevenue.toLocaleString()}</p>
37
+ <div className="flex items-center gap-1 text-sm text-green-600">
38
+ <TrendingUp className="h-3 w-3" />
39
+ <span>+24.5% from last period</span>
40
+ </div>
41
+ </div>
42
+
43
+ <div className="rounded-lg border p-4 space-y-2">
44
+ <div className="flex items-center gap-2 text-sm text-muted-foreground">
45
+ <DollarSign className="h-4 w-4" />
46
+ Average Monthly
47
+ </div>
48
+ <p className="text-2xl font-bold">
49
+ ${avgRevenue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
50
+ </p>
51
+ <div className="flex items-center gap-1 text-sm text-green-600">
52
+ <TrendingUp className="h-3 w-3" />
53
+ <span>+18.2% growth rate</span>
54
+ </div>
55
+ </div>
56
+
57
+ <div className="rounded-lg border p-4 space-y-2">
58
+ <div className="flex items-center gap-2 text-sm text-muted-foreground">
59
+ <DollarSign className="h-4 w-4" />
60
+ Current Month
61
+ </div>
62
+ <p className="text-2xl font-bold">
63
+ ${revenueData[revenueData.length - 1].revenue.toLocaleString()}
64
+ </p>
65
+ <div className="flex items-center gap-1 text-sm text-green-600">
66
+ <TrendingUp className="h-3 w-3" />
67
+ <span>+8.0% from last month</span>
68
+ </div>
69
+ </div>
70
+ </div>
71
+
72
+ <ChartContainer
73
+ config={{
74
+ revenue: {
75
+ label: 'Revenue',
76
+ color: 'hsl(var(--chart-1))',
77
+ },
78
+ expenses: {
79
+ label: 'Expenses',
80
+ color: 'hsl(var(--chart-2))',
81
+ },
82
+ }}
83
+ className="h-[400px]"
84
+ >
85
+ <ResponsiveContainer width="100%" height="100%">
86
+ <LineChart data={revenueData} margin={{ top: 5, right: 10, left: 10, bottom: 5 }}>
87
+ <CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
88
+ <XAxis
89
+ dataKey="month"
90
+ className="text-xs"
91
+ tick={{ fill: 'hsl(var(--muted-foreground))' }}
92
+ />
93
+ <YAxis className="text-xs" tick={{ fill: 'hsl(var(--muted-foreground))' }} />
94
+ <ChartTooltip content={<ChartTooltipContent />} />
95
+ <Line
96
+ type="monotone"
97
+ dataKey="revenue"
98
+ stroke="var(--color-revenue)"
99
+ strokeWidth={2}
100
+ dot={{ fill: 'var(--color-revenue)', r: 4 }}
101
+ />
102
+ <Line
103
+ type="monotone"
104
+ dataKey="expenses"
105
+ stroke="var(--color-expenses)"
106
+ strokeWidth={2}
107
+ dot={{ fill: 'var(--color-expenses)', r: 4 }}
108
+ />
109
+ </LineChart>
110
+ </ResponsiveContainer>
111
+ </ChartContainer>
112
+ </CardContent>
113
+ </Card>
114
+ );
115
+ }