xertica-ui 2.5.0 → 2.5.1
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 +22 -0
- package/README.md +58 -17
- package/bin/cli.ts +14 -2
- package/bin/generate-tokens.ts +3 -3
- package/dist/cli.js +14 -5
- package/llms-compact.txt +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/templates/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,28 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## [2.5.1] — 2026-06-22
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **CLI `update → Theme` — tema atual não era pré-selecionado** — o prompt de seleção de tema sempre iniciava no índice 0 (`xertica-original`), independente do tema instalado. Corrigido lendo `themeId` do `.xertica.json` e calculando o índice inicial correspondente. O nome do tema atual é exibido antes da seleção.
|
|
19
|
+
- **CLI `update → Theme` — `themeId` não era persistido** — após trocar o tema, o `.xertica.json` não era atualizado com o novo `themeId`, fazendo com que execuções futuras continuassem sem memória da escolha. Corrigido com `writeXerticaConfig(targetDir, { themeId: selectedTheme.id })` após a escrita do `tokens.css`.
|
|
20
|
+
- **CLI `init` — `themeId` não era salvo em `.xertica.json`** — o tema escolhido durante `init` não era persistido no arquivo de configuração do projeto. Corrigido passando `themeId: response.theme` ao `writeXerticaConfig`.
|
|
21
|
+
- **`generate-tokens.ts` — `--sidebar-border` no dark mode estava hardcoded** — o valor `rgba(65, 61, 107, 1)` (indigo fixo) era usado para todos os temas. Corrigido usando `colors.darkBorder` para que cada tema utilize sua própria cor de borda tingida.
|
|
22
|
+
- **`XerticaConfig` — campo `themeId` faltando na interface** — adicionado campo opcional `themeId?: string` à interface `XerticaConfig` em `bin/cli.ts`.
|
|
23
|
+
- **Erros de TypeScript do `recharts` 3.x** — atualização da biblioteca quebrou os tipos de `ChartTooltipContent` e `ChartLegendContent`. Corrigido:
|
|
24
|
+
- `ChartTooltipContent`: migrado de `React.ComponentProps<typeof Tooltip>` (que omite `payload`/`label` no recharts 3) para tipos explícitos usando `RechartsPrimitive.TooltipPayload` e `DefaultTooltipContentProps['formatter']`
|
|
25
|
+
- `ChartLegendContent`: substituído `Pick<LegendProps, 'payload' | 'verticalAlign'>` por `{ payload?: LegendPayload[]; verticalAlign?: ... }` (recharts 3 removeu `payload` de `LegendProps`)
|
|
26
|
+
- `DonutBreakdownChart`: removida prop `activeIndex` do `<Pie>` (não existe mais no recharts 3)
|
|
27
|
+
- `PieMetricChart`: adicionado guard `if (midAngle == null || percent == null) return null` no callback de label
|
|
28
|
+
- `chart.test.tsx`: adicionado `graphicalItemId` obrigatório ao mock de payload
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **CLI `update → Theme`** — exibe o tema atual antes do prompt de seleção com `chalk.gray('Current theme: ...')`.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
14
36
|
## [2.5.0] — 2026-06-22
|
|
15
37
|
|
|
16
38
|
### Added
|
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
|
---
|
|
@@ -353,30 +353,71 @@ Xertica UI uses semantic CSS tokens. **Never use raw colors or generic Tailwind
|
|
|
353
353
|
|
|
354
354
|
### Color Themes
|
|
355
355
|
|
|
356
|
-
Nine built-in color
|
|
356
|
+
Nine built-in themes — each sets the primary color, sidebar, chart palette, and dark-mode surface hue. Select at `init` time or change later with `npx xertica-ui update → Theme only`.
|
|
357
357
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
358
|
+
```
|
|
359
|
+
┌────────────────────────────────────────────────────────────────────────────┐
|
|
360
|
+
│ Theme ID Primary Sidebar Dark bg │
|
|
361
|
+
├────────────────────────────────────────────────────────────────────────────┤
|
|
362
|
+
│ 🟣 Xertica xertica-original #2C275B #2C275B #05050d │
|
|
363
|
+
│ ⚫ Zinc zinc #18181B #18181B #05050d │
|
|
364
|
+
│ 🌑 Slate slate #0F172A #0F172A #05050d │
|
|
365
|
+
│ 🔵 Blue blue #2563EB #1E3A8A #03050f │
|
|
366
|
+
│ 🟣 Violet violet #7C3AED #4C1D95 #07040f │
|
|
367
|
+
│ 🌹 Rose rose #BE123C #881337 #0f0305 │
|
|
368
|
+
│ 🟢 Emerald emerald #047857 #064E3B #030f08 │
|
|
369
|
+
│ 🟡 Amber amber #B45309 #78350F #0f0a03 │
|
|
370
|
+
│ 🟠 Orange orange #C2410C #7C2D12 #0f0703 │
|
|
371
|
+
└────────────────────────────────────────────────────────────────────────────┘
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**CLI — Select at project creation:**
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
npx xertica-ui@latest init my-app
|
|
378
|
+
# → "Select the default color theme" prompt appears during init
|
|
379
|
+
```
|
|
369
380
|
|
|
370
|
-
|
|
381
|
+
**CLI — Change theme in an existing project:**
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
npx xertica-ui update
|
|
385
|
+
# → choose "Theme only"
|
|
386
|
+
# → select any of the 9 themes
|
|
387
|
+
# → src/styles/xertica/tokens.css is fully regenerated
|
|
388
|
+
# → .xertica.json is updated with the new themeId for future updates
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Code — Select theme in `XerticaProvider`:**
|
|
371
392
|
|
|
372
393
|
```tsx
|
|
373
|
-
// Full
|
|
394
|
+
// Full preset — sets primary, sidebar, charts AND hue-tinted dark surfaces
|
|
374
395
|
<XerticaProvider defaultColorTheme="blue">
|
|
375
|
-
|
|
376
|
-
|
|
396
|
+
<XerticaProvider defaultColorTheme="rose">
|
|
397
|
+
<XerticaProvider defaultColorTheme="emerald">
|
|
398
|
+
<XerticaProvider defaultColorTheme="violet">
|
|
399
|
+
<XerticaProvider defaultColorTheme="amber">
|
|
400
|
+
<XerticaProvider defaultColorTheme="orange">
|
|
401
|
+
<XerticaProvider defaultColorTheme="xertica-original"> {/* default */}
|
|
402
|
+
|
|
403
|
+
// Custom hex — sets primary only; dark surfaces use the neutral default
|
|
377
404
|
<XerticaProvider primaryColor="#7C3AED">
|
|
378
405
|
```
|
|
379
406
|
|
|
407
|
+
**What each theme changes:**
|
|
408
|
+
|
|
409
|
+
| Token category | Controlled by theme |
|
|
410
|
+
| -------------------- | ------------------- |
|
|
411
|
+
| `--primary` | ✅ Light + dark variant |
|
|
412
|
+
| `--sidebar` | ✅ Light + dark variant |
|
|
413
|
+
| `--chart-1..5` | ✅ Brand-matched palette |
|
|
414
|
+
| `--gradient-diagonal`| ✅ Brand-matched gradient |
|
|
415
|
+
| `--background` | ✅ Dark mode only (hue-tinted) |
|
|
416
|
+
| `--card`, `--popover`| ✅ Dark mode only (hue-tinted) |
|
|
417
|
+
| `--muted`, `--accent`| ✅ Dark mode only (hue-tinted) |
|
|
418
|
+
| `--border`, `--input`| ✅ Dark mode only (hue-tinted) |
|
|
419
|
+
| Light mode surfaces | ❌ Always white/zinc (unchanged) |
|
|
420
|
+
|
|
380
421
|
### Mobile Content Padding
|
|
381
422
|
|
|
382
423
|
The CSS token `--mobile-content-padding` (default `1.25rem`) controls the horizontal padding of content areas on small screens (`< 768px`). To adjust it globally, override it in your project's `src/styles/xertica/tokens.css`:
|
package/bin/cli.ts
CHANGED
|
@@ -30,6 +30,7 @@ interface XerticaConfig {
|
|
|
30
30
|
version: 1;
|
|
31
31
|
hasAssistant: boolean;
|
|
32
32
|
disableDarkMode?: boolean;
|
|
33
|
+
themeId?: string;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
async function readXerticaConfig(targetDir: string): Promise<XerticaConfig | null> {
|
|
@@ -453,7 +454,7 @@ program
|
|
|
453
454
|
await writeLanguagesConfig(targetDir, selectedLanguages);
|
|
454
455
|
|
|
455
456
|
// 6.5 Persist project feature flags (.xertica.json)
|
|
456
|
-
await writeXerticaConfig(targetDir, { hasAssistant, disableDarkMode });
|
|
457
|
+
await writeXerticaConfig(targetDir, { hasAssistant, disableDarkMode, themeId: response.theme });
|
|
457
458
|
|
|
458
459
|
// 6.4 Copy context
|
|
459
460
|
await fs.ensureDir(path.join(targetDir, 'src', 'app', 'context'));
|
|
@@ -641,6 +642,15 @@ program
|
|
|
641
642
|
|
|
642
643
|
// ── Theme update ─────────────────────────────────────────────────────────
|
|
643
644
|
if (updateType === 'theme') {
|
|
645
|
+
const currentThemeId = currentConfig?.themeId ?? 'xertica-original';
|
|
646
|
+
const currentThemeIndex = Math.max(
|
|
647
|
+
0,
|
|
648
|
+
colorThemes.findIndex(t => t.id === currentThemeId)
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
const currentThemeName = colorThemes[currentThemeIndex]?.name ?? 'Xertica';
|
|
652
|
+
console.log(chalk.gray(` Current theme: ${currentThemeName}`));
|
|
653
|
+
|
|
644
654
|
const { theme } = await prompts({
|
|
645
655
|
type: 'select',
|
|
646
656
|
name: 'theme',
|
|
@@ -650,7 +660,7 @@ program
|
|
|
650
660
|
description: t.description,
|
|
651
661
|
value: t.id,
|
|
652
662
|
})),
|
|
653
|
-
initial:
|
|
663
|
+
initial: currentThemeIndex,
|
|
654
664
|
});
|
|
655
665
|
|
|
656
666
|
if (!theme) return;
|
|
@@ -662,7 +672,9 @@ program
|
|
|
662
672
|
if (selectedTheme) {
|
|
663
673
|
await fs.ensureDir(path.dirname(tokensPath));
|
|
664
674
|
await fs.writeFile(tokensPath, generateTokensCss(selectedTheme));
|
|
675
|
+
await writeXerticaConfig(targetDir, { themeId: selectedTheme.id });
|
|
665
676
|
spinner.succeed(`Theme updated to "${selectedTheme.name}" successfully!`);
|
|
677
|
+
console.log(chalk.gray(' File updated: src/styles/xertica/tokens.css'));
|
|
666
678
|
} else {
|
|
667
679
|
spinner.fail('Theme not found.');
|
|
668
680
|
}
|
package/bin/generate-tokens.ts
CHANGED
|
@@ -232,10 +232,10 @@ export const generateTokensCss = (theme: ColorTheme): string => {
|
|
|
232
232
|
--sidebar: ${rgba(colors.sidebarDark)};
|
|
233
233
|
--sidebar-foreground: rgba(250, 250, 250, 1);
|
|
234
234
|
--sidebar-primary: rgba(255, 255, 255, 1);
|
|
235
|
-
--sidebar-primary-foreground: ${rgba(colors.primary)};
|
|
236
|
-
--sidebar-accent: rgba(
|
|
235
|
+
--sidebar-primary-foreground: ${rgba(colors.primary)};
|
|
236
|
+
--sidebar-accent: rgba(255, 255, 255, 0.08);
|
|
237
237
|
--sidebar-accent-foreground: rgba(250, 250, 250, 1);
|
|
238
|
-
--sidebar-border: rgba(
|
|
238
|
+
--sidebar-border: ${rgba(colors.darkBorder)};
|
|
239
239
|
--sidebar-ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
240
240
|
|
|
241
241
|
/* Gradients */
|
package/dist/cli.js
CHANGED
|
@@ -537,10 +537,10 @@ var generateTokensCss = (theme) => {
|
|
|
537
537
|
--sidebar: ${rgba(colors.sidebarDark)};
|
|
538
538
|
--sidebar-foreground: rgba(250, 250, 250, 1);
|
|
539
539
|
--sidebar-primary: rgba(255, 255, 255, 1);
|
|
540
|
-
--sidebar-primary-foreground: ${rgba(colors.primary)};
|
|
541
|
-
--sidebar-accent: rgba(
|
|
540
|
+
--sidebar-primary-foreground: ${rgba(colors.primary)};
|
|
541
|
+
--sidebar-accent: rgba(255, 255, 255, 0.08);
|
|
542
542
|
--sidebar-accent-foreground: rgba(250, 250, 250, 1);
|
|
543
|
-
--sidebar-border: rgba(
|
|
543
|
+
--sidebar-border: ${rgba(colors.darkBorder)};
|
|
544
544
|
--sidebar-ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
545
545
|
|
|
546
546
|
/* Gradients */
|
|
@@ -1133,7 +1133,7 @@ program.command("init").description("Initialize a new Xertica UI project").argum
|
|
|
1133
1133
|
);
|
|
1134
1134
|
await syncLocaleFiles(templatesDir, targetDir, selectedLanguages, { pruneOthers: true });
|
|
1135
1135
|
await writeLanguagesConfig(targetDir, selectedLanguages);
|
|
1136
|
-
await writeXerticaConfig(targetDir, { hasAssistant, disableDarkMode });
|
|
1136
|
+
await writeXerticaConfig(targetDir, { hasAssistant, disableDarkMode, themeId: response.theme });
|
|
1137
1137
|
await fs2.ensureDir(path2.join(targetDir, "src", "app", "context"));
|
|
1138
1138
|
await fs2.copy(
|
|
1139
1139
|
path2.join(templatesDir, "src", "app", "context", "AuthContext.tsx"),
|
|
@@ -1287,6 +1287,13 @@ program.command("update").alias("update-theme").description("Update theme or pro
|
|
|
1287
1287
|
});
|
|
1288
1288
|
if (!updateType) return;
|
|
1289
1289
|
if (updateType === "theme") {
|
|
1290
|
+
const currentThemeId = currentConfig?.themeId ?? "xertica-original";
|
|
1291
|
+
const currentThemeIndex = Math.max(
|
|
1292
|
+
0,
|
|
1293
|
+
colorThemes.findIndex((t) => t.id === currentThemeId)
|
|
1294
|
+
);
|
|
1295
|
+
const currentThemeName = colorThemes[currentThemeIndex]?.name ?? "Xertica";
|
|
1296
|
+
console.log(chalk.gray(` Current theme: ${currentThemeName}`));
|
|
1290
1297
|
const { theme } = await prompts({
|
|
1291
1298
|
type: "select",
|
|
1292
1299
|
name: "theme",
|
|
@@ -1296,7 +1303,7 @@ program.command("update").alias("update-theme").description("Update theme or pro
|
|
|
1296
1303
|
description: t.description,
|
|
1297
1304
|
value: t.id
|
|
1298
1305
|
})),
|
|
1299
|
-
initial:
|
|
1306
|
+
initial: currentThemeIndex
|
|
1300
1307
|
});
|
|
1301
1308
|
if (!theme) return;
|
|
1302
1309
|
const spinner2 = ora("Updating theme...").start();
|
|
@@ -1306,7 +1313,9 @@ program.command("update").alias("update-theme").description("Update theme or pro
|
|
|
1306
1313
|
if (selectedTheme) {
|
|
1307
1314
|
await fs2.ensureDir(path2.dirname(tokensPath));
|
|
1308
1315
|
await fs2.writeFile(tokensPath, generateTokensCss(selectedTheme));
|
|
1316
|
+
await writeXerticaConfig(targetDir, { themeId: selectedTheme.id });
|
|
1309
1317
|
spinner2.succeed(`Theme updated to "${selectedTheme.name}" successfully!`);
|
|
1318
|
+
console.log(chalk.gray(" File updated: src/styles/xertica/tokens.css"));
|
|
1310
1319
|
} else {
|
|
1311
1320
|
spinner2.fail("Theme not found.");
|
|
1312
1321
|
}
|
package/llms-compact.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Xertica UI — Compact Reference
|
|
2
2
|
|
|
3
|
-
> 97-component React design system. Tailwind CSS v4 + Radix UI + Lucide Icons. v2.5.
|
|
3
|
+
> 97-component React design system. Tailwind CSS v4 + Radix UI + Lucide Icons. v2.5.1
|
|
4
4
|
> Full docs: llms-full.txt | Component index: llms.txt | Decision guide: docs/decision-tree.md
|
|
5
5
|
|
|
6
6
|
---
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Xertica UI
|
|
2
2
|
|
|
3
|
-
> Enterprise-grade React design system — 97 components built on Tailwind CSS v4, Radix UI, and Lucide Icons. Designed to be consumed directly by AI coding agents (LLMs, Cursor, Claude Code, Copilot). v2.5.
|
|
3
|
+
> Enterprise-grade React design system — 97 components built on Tailwind CSS v4, Radix UI, and Lucide Icons. Designed to be consumed directly by AI coding agents (LLMs, Cursor, Claude Code, Copilot). v2.5.1
|
|
4
4
|
|
|
5
5
|
Xertica UI ships with full source, typed declarations, Storybook stories, and structured documentation inside `node_modules/xertica-ui/`. AI agents should read this file first, then follow links for component-specific detail.
|
|
6
6
|
|
package/package.json
CHANGED
package/templates/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xertica-ui-template",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"react-i18next": "^17.0.8",
|
|
25
25
|
"react-router-dom": "^7.1.3",
|
|
26
26
|
"sonner": "^1.7.3",
|
|
27
|
-
"xertica-ui": "^2.5.
|
|
27
|
+
"xertica-ui": "^2.5.1",
|
|
28
28
|
"zustand": "^5.0.13"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|