xertica-ui 2.1.5 → 2.1.6
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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/bin/cli.ts +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/templates/package.json +2 -2
- package/templates/src/features/home/ui/HomeContent.tsx +6 -1
- package/templates/src/features/settings/ui/SettingsContent.tsx +5 -9
- package/templates/src/features/template/ui/DashboardTemplate.tsx +33 -21
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [2.1.6] — 2026-05-19
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`templates/HomeContent.tsx` — JSX malformado causava crash da página** — tags `</div>`, `</ScrollArea>` e `</main>` estavam faltando após refatoração para `<PageContent>`, fazendo a página Home quebrar completamente ao renderizar.
|
|
15
|
+
- **`templates/DashboardTemplate.tsx` — `StatsCard.trend` com tipo errado** — `trend` recebia um `number` primitivo (`trend={20.1}`) mas o prop exige um objeto `{ value: number; label?: string }`. Corrigido para `trend={{ value: 20.1, label: 'vs mês anterior' }}` em todos os 4 cards.
|
|
16
|
+
- **`templates/DashboardTemplate.tsx` — `DonutBreakdownChart` com chaves acentuadas** — o `channelConfig` usava chaves como `Orgânico` que falhavam no lookup interno do chart. Renomeadas para ASCII (`organico`, `pago`, `social`, `direto`) com labels legíveis mantidas via `label:`.
|
|
17
|
+
- **`templates/DashboardTemplate.tsx` — cast de `Badge.variant` sem type safety** — `event.status as 'default' | ...` foi substituído por um mapa `EVENT_BADGE_VARIANT` com tipagem `EventStatus` explícita.
|
|
18
|
+
- **`templates/SettingsContent.tsx` — imports duplicados de `xertica-ui/hooks`** — `useTheme` e `useLayout` eram importados em duas linhas separadas do mesmo módulo. Unificados em um único import.
|
|
19
|
+
- **`templates/SettingsContent.tsx` — `Separator`, `Badge` e `useNavigate` importados mas nunca usados** — removidos para evitar erros de lint/build.
|
|
20
|
+
- **`templates/SettingsContent.tsx` — `Switch.onCheckedChange` com tipo incompatível** — `toggleTheme` é `() => void` mas `onCheckedChange` exige `(checked: boolean) => void`. Corrigido com wrapper arrow `() => toggleTheme()`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
10
24
|
## [2.1.5] — 2026-05-19
|
|
11
25
|
|
|
12
26
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Enterprise-grade React design system** built on Tailwind CSS v4, Radix UI, and Lucide Icons — with a robust AI-first documentation layer for precise LLM-driven composition and autonomous agent interaction.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
8
8
|
---
|
package/bin/cli.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -534,7 +534,7 @@ var generateTokensCss = (theme) => {
|
|
|
534
534
|
var __filename = fileURLToPath(import.meta.url);
|
|
535
535
|
var __dirname = path.dirname(__filename);
|
|
536
536
|
var program = new Command();
|
|
537
|
-
program.name("xertica-ui").description("CLI to initialize Xertica UI projects").version("2.1.
|
|
537
|
+
program.name("xertica-ui").description("CLI to initialize Xertica UI projects").version("2.1.6");
|
|
538
538
|
program.command("init").description("Initialize a new Xertica UI project").argument("[directory]", "Directory to initialize in", ".").action(async (directory) => {
|
|
539
539
|
const targetDir = path.resolve(process.cwd(), directory);
|
|
540
540
|
const templatesDir = path.resolve(__dirname, "../templates");
|
package/package.json
CHANGED
package/templates/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xertica-ui-template",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-hook-form": "^7.54.2",
|
|
20
20
|
"react-router-dom": "^7.1.3",
|
|
21
21
|
"sonner": "^1.7.3",
|
|
22
|
-
"xertica-ui": "^2.1.
|
|
22
|
+
"xertica-ui": "^2.1.6",
|
|
23
23
|
"zod": "^3.24.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
Button,
|
|
10
10
|
Input,
|
|
11
11
|
Label,
|
|
12
|
-
Separator,
|
|
13
12
|
Switch,
|
|
14
|
-
|
|
13
|
+
ScrollArea,
|
|
15
14
|
Form,
|
|
16
15
|
FormField,
|
|
17
16
|
FormItem,
|
|
@@ -20,15 +19,12 @@ import {
|
|
|
20
19
|
FormDescription,
|
|
21
20
|
FormMessage,
|
|
22
21
|
} from 'xertica-ui/ui';
|
|
23
|
-
import {
|
|
22
|
+
import { Header } from 'xertica-ui/layout';
|
|
23
|
+
import { useLayout, useTheme } from 'xertica-ui/hooks';
|
|
24
24
|
import { useForm } from 'react-hook-form';
|
|
25
25
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
26
26
|
import { z } from 'zod';
|
|
27
27
|
import { toast } from 'sonner';
|
|
28
|
-
import { useNavigate } from 'react-router-dom';
|
|
29
|
-
import { useLayout } from 'xertica-ui/hooks';
|
|
30
|
-
import { Header } from 'xertica-ui/layout';
|
|
31
|
-
import { ScrollArea } from 'xertica-ui/ui';
|
|
32
28
|
import { Link } from 'react-router-dom';
|
|
33
29
|
import type { User } from '../../../shared/types/auth';
|
|
34
30
|
|
|
@@ -53,7 +49,6 @@ interface SettingsContentProps {
|
|
|
53
49
|
export function SettingsContent({ user, onLogout }: SettingsContentProps) {
|
|
54
50
|
const { sidebarExpanded, sidebarWidth } = useLayout();
|
|
55
51
|
const { theme, toggleTheme } = useTheme();
|
|
56
|
-
const navigate = useNavigate();
|
|
57
52
|
const [notificationsEnabled, setNotificationsEnabled] = useState(true);
|
|
58
53
|
|
|
59
54
|
const form = useForm<ProfileValues>({
|
|
@@ -157,9 +152,10 @@ export function SettingsContent({ user, onLogout }: SettingsContentProps) {
|
|
|
157
152
|
Alterna entre tema claro e escuro.
|
|
158
153
|
</p>
|
|
159
154
|
</div>
|
|
155
|
+
{/* toggleTheme is () => void; Switch.onCheckedChange expects (checked: boolean) => void */}
|
|
160
156
|
<Switch
|
|
161
157
|
checked={theme === 'dark'}
|
|
162
|
-
onCheckedChange={toggleTheme}
|
|
158
|
+
onCheckedChange={() => toggleTheme()}
|
|
163
159
|
/>
|
|
164
160
|
</div>
|
|
165
161
|
</CardContent>
|
|
@@ -45,18 +45,28 @@ const accessConfig = {
|
|
|
45
45
|
acessos: { label: 'Acessos', color: 'var(--chart-2)' },
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
// Keys without accents so the chart's internal config lookup is reliable
|
|
48
49
|
const channelData = [
|
|
49
|
-
{ name: '
|
|
50
|
-
{ name: '
|
|
51
|
-
{ name: '
|
|
52
|
-
{ name: '
|
|
50
|
+
{ name: 'organico', value: 42 },
|
|
51
|
+
{ name: 'pago', value: 28 },
|
|
52
|
+
{ name: 'social', value: 18 },
|
|
53
|
+
{ name: 'direto', value: 12 },
|
|
53
54
|
];
|
|
54
55
|
|
|
55
56
|
const channelConfig = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
organico: { label: 'Orgânico', color: 'var(--chart-1)' },
|
|
58
|
+
pago: { label: 'Pago', color: 'var(--chart-2)' },
|
|
59
|
+
social: { label: 'Social', color: 'var(--chart-3)' },
|
|
60
|
+
direto: { label: 'Direto', color: 'var(--chart-4)' },
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Explicit Badge variant map — avoids unsafe string casts
|
|
64
|
+
type EventStatus = 'info' | 'success' | 'destructive' | 'default';
|
|
65
|
+
const EVENT_BADGE_VARIANT: Record<EventStatus, EventStatus> = {
|
|
66
|
+
info: 'info',
|
|
67
|
+
success: 'success',
|
|
68
|
+
destructive: 'destructive',
|
|
69
|
+
default: 'default',
|
|
60
70
|
};
|
|
61
71
|
|
|
62
72
|
// ─── Component ────────────────────────────────────────────────────────────────
|
|
@@ -75,30 +85,30 @@ export function DashboardTemplate() {
|
|
|
75
85
|
}
|
|
76
86
|
/>
|
|
77
87
|
|
|
78
|
-
{/* ── KPI cards —
|
|
88
|
+
{/* ── KPI cards — StatsCard.trend expects { value: number } not a raw number ── */}
|
|
79
89
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
|
80
90
|
<StatsCard
|
|
81
91
|
title="Receita Total"
|
|
82
92
|
value="R$ 45.231,89"
|
|
83
|
-
trend={20.1}
|
|
93
|
+
trend={{ value: 20.1, label: 'vs mês anterior' }}
|
|
84
94
|
icon={<DollarSign className="size-4" />}
|
|
85
95
|
/>
|
|
86
96
|
<StatsCard
|
|
87
97
|
title="Usuários Ativos"
|
|
88
98
|
value="2.350"
|
|
89
|
-
trend={8.4}
|
|
99
|
+
trend={{ value: 8.4, label: 'vs mês anterior' }}
|
|
90
100
|
icon={<Users className="size-4" />}
|
|
91
101
|
/>
|
|
92
102
|
<StatsCard
|
|
93
103
|
title="Vendas"
|
|
94
104
|
value="12.234"
|
|
95
|
-
trend={19.2}
|
|
105
|
+
trend={{ value: 19.2, label: 'vs mês anterior' }}
|
|
96
106
|
icon={<Activity className="size-4" />}
|
|
97
107
|
/>
|
|
98
108
|
<StatsCard
|
|
99
109
|
title="Taxa de Retenção"
|
|
100
110
|
value="89,3%"
|
|
101
|
-
trend={1.2}
|
|
111
|
+
trend={{ value: 1.2, label: 'vs mês anterior' }}
|
|
102
112
|
icon={<TrendingUp className="size-4" />}
|
|
103
113
|
/>
|
|
104
114
|
</div>
|
|
@@ -165,17 +175,19 @@ export function DashboardTemplate() {
|
|
|
165
175
|
</CardHeader>
|
|
166
176
|
<CardContent>
|
|
167
177
|
<div className="space-y-4">
|
|
168
|
-
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
{(
|
|
179
|
+
[
|
|
180
|
+
{ time: '09:00', label: 'Login de João Silva', status: 'info' },
|
|
181
|
+
{ time: '10:45', label: 'Fatura #INV004 paga', status: 'success' },
|
|
182
|
+
{ time: '11:30', label: 'Usuário bloqueado', status: 'destructive' },
|
|
183
|
+
{ time: '13:15', label: 'Relatório gerado', status: 'default' },
|
|
184
|
+
{ time: '15:00', label: 'Deploy v2.1.5', status: 'success' },
|
|
185
|
+
] as Array<{ time: string; label: string; status: EventStatus }>
|
|
186
|
+
).map(event => (
|
|
175
187
|
<div key={event.time} className="flex items-center gap-3 text-sm">
|
|
176
188
|
<Badge variant="outline" className="font-mono shrink-0">{event.time}</Badge>
|
|
177
189
|
<span className="flex-1 text-muted-foreground">{event.label}</span>
|
|
178
|
-
<Badge variant={event.status
|
|
190
|
+
<Badge variant={EVENT_BADGE_VARIANT[event.status]} className="text-[10px]">
|
|
179
191
|
{event.status}
|
|
180
192
|
</Badge>
|
|
181
193
|
</div>
|