xertica-ui 2.1.6 → 2.1.7

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 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.7] — 2026-05-19
11
+
12
+ ### Fixed
13
+
14
+ - **`templates/TemplateContent.tsx` — wrapper raiz não era SPA-router-aware** — o `paddingLeft` manual foi substituído por `<PageContent>` (wrapper compartilhado de `shared/ui/PageContent.tsx`) eliminando código duplicado e garantindo que a lógica de offset do sidebar fique em um único lugar.
15
+ - **`templates/TemplateContent.tsx` — `renderLink` tipado como `any`** — corrigido para `Record<string, unknown>` prevenindo erros silenciosos de tipos no spread `{...props}`.
16
+ - **`templates/TemplateContent.tsx` — imports mortos removidos** — `Menu`, `ChevronRight`, `Trash2`, `Archive`, `ArrowRightLeft`, `History`, `FileEdit`, `Filter`, `Map` estavam no import mas não eram usados (ou eram usados mas faltavam). Sincronizado imports com uso real.
17
+ - **`templates/TemplateContent.tsx` — `<h2>` raw na página** — substituído por `<PageHeader title=... subtitle=... />` para consistência com as regras do projeto.
18
+ - **`templates/TemplatePage.tsx` — `user` tipado como `{ email: string }` em vez de `User`** — tipo corrigido para `User | null`; `onEvaluation` migrado de `console.log` para `toast.success/info`; componente agora usa `generateDemoResponse`, `richSuggestions`, `feedbackOptions` e `userName` dinâmico.
19
+ - **`templates/HomePage.tsx` + `templates/AssistantPage.tsx` — `user` tipado como `{ email: string }`** — tipo corrigido para `User | null` em ambas as páginas.
20
+ - **`templates/AssistantPage.tsx` — `userName="Ariel Santos"` hardcoded** — substituído por `user?.name ?? 'Usuário'` para usar o dado real do usuário autenticado.
21
+
22
+ ---
23
+
10
24
  ## [2.1.6] — 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
- [![npm version](https://img.shields.io/badge/npm-2.1.6-blue)](https://www.npmjs.com/package/xertica-ui)
5
+ [![npm version](https://img.shields.io/badge/npm-2.1.7-blue)](https://www.npmjs.com/package/xertica-ui)
6
6
  [![license](https://img.shields.io/badge/license-proprietary-red)](./LICENSE)
7
7
 
8
8
  ---
package/bin/cli.ts CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name('xertica-ui')
20
20
  .description('CLI to initialize Xertica UI projects')
21
- .version('2.1.6');
21
+ .version('2.1.7');
22
22
 
23
23
  program
24
24
  .command('init')
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.6");
537
+ program.name("xertica-ui").description("CLI to initialize Xertica UI projects").version("2.1.7");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xertica-ui",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Xertica UI — Enterprise-grade React design system with Tailwind CSS v4, Radix UI, and AI-first documentation.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xertica-ui-template",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
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.6",
22
+ "xertica-ui": "^2.1.7",
23
23
  "zod": "^3.24.1"
24
24
  },
25
25
  "devDependencies": {
@@ -59,6 +59,7 @@ import { Header, Sidebar } from 'xertica-ui/layout';
59
59
  import { useLayout } from 'xertica-ui/hooks';
60
60
  import { toast } from 'sonner';
61
61
  import { Link } from 'react-router-dom';
62
+ import { PageContent } from '../../../shared/ui/PageContent';
62
63
  import {
63
64
  Settings,
64
65
  User,
@@ -67,23 +68,19 @@ import {
67
68
  Calendar,
68
69
  Search,
69
70
  PanelLeft,
70
- Menu,
71
- ChevronRight,
72
71
  Home,
73
72
  Users,
74
73
  Plus,
74
+ Clock,
75
75
  Trash2,
76
76
  Archive,
77
77
  ArrowRightLeft,
78
- History,
79
78
  FileEdit,
80
- Filter,
81
- Clock,
82
79
  Map,
83
80
  } from 'lucide-react';
84
81
 
85
82
  export function TemplateContent() {
86
- const { sidebarExpanded, sidebarWidth, toggleSidebar } = useLayout();
83
+ const { sidebarWidth } = useLayout();
87
84
  const [progress, setProgress] = useState(45);
88
85
  const [sliderValue, setSliderValue] = useState([50]);
89
86
  const [switchEnabled, setSwitchEnabled] = useState(false);
@@ -94,12 +91,7 @@ export function TemplateContent() {
94
91
  };
95
92
 
96
93
  return (
97
- <div
98
- style={{
99
- paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px',
100
- }}
101
- className="flex-1 flex flex-col overflow-hidden transition-all duration-300"
102
- >
94
+ <PageContent>
103
95
  <Header
104
96
  showThemeToggle={true}
105
97
  showLanguageSelector={true}
@@ -107,19 +99,17 @@ export function TemplateContent() {
107
99
  { label: 'Design System', href: '/home' },
108
100
  { label: 'Página de Template' },
109
101
  ]}
110
- renderLink={(href: string, props: any) => <Link to={href} {...props} />}
102
+ renderLink={(href: string, props: Record<string, unknown>) => <Link to={href} {...props} />}
111
103
  />
112
104
 
113
105
  <main className="flex-1 overflow-hidden bg-muted">
114
106
  <ScrollArea className="h-full">
115
107
  <div className="p-2 sm:p-4 md:p-6">
116
108
  <div className="max-w-6xl mx-auto space-y-8">
117
- <div className="space-y-2">
118
- <h2>Template Page</h2>
119
- <p className="text-muted-foreground">
120
- Template completo com componentes do Xertica UI Design System
121
- </p>
122
- </div>
109
+ <PageHeader
110
+ title="Template Page"
111
+ subtitle="Template completo com componentes do Xertica UI Design System"
112
+ />
123
113
 
124
114
  {/* Alert Examples */}
125
115
  <section>
@@ -865,6 +855,6 @@ export function TemplateContent() {
865
855
  </div>
866
856
  </ScrollArea>
867
857
  </main>
868
- </div>
858
+ </PageContent>
869
859
  );
870
860
  }
@@ -1,6 +1,7 @@
1
1
  import { useState, useMemo, useEffect } from 'react';
2
2
  import { toast } from 'sonner';
3
3
  import { useNavigate, Link } from 'react-router-dom';
4
+ import type { User } from '../shared/types/auth';
4
5
  import { XerticaAssistant, generateDemoResponse } from 'xertica-ui/assistant';
5
6
  import { useLayout } from 'xertica-ui/hooks';
6
7
  import { Header } from 'xertica-ui/layout';
@@ -140,7 +141,7 @@ const GROUP_CONFIG = [
140
141
  // ─── Component ───────────────────────────────────────────────────────────────
141
142
 
142
143
  interface AssistantPageProps {
143
- user: { email: string } | null;
144
+ user: User | null;
144
145
  onLogout: () => void;
145
146
  }
146
147
 
@@ -271,7 +272,7 @@ export function AssistantPage({ user, onLogout }: AssistantPageProps) {
271
272
  key={selectedId ?? 'new'}
272
273
  mode="fullPage"
273
274
  demoMode={true}
274
- userName="Ariel Santos"
275
+ userName={user?.name ?? 'Usuário'}
275
276
  responseGenerator={generateDemoResponse}
276
277
  initialMessages={selectedConversation?.messages as any}
277
278
  richSuggestions={richSuggestions}
@@ -8,7 +8,7 @@ import { HomeContent } from '../features/home';
8
8
  import { richSuggestions, feedbackOptions } from '../shared/config/assistant';
9
9
 
10
10
  interface HomePageProps {
11
- user: { email: string } | null;
11
+ user: import('../shared/types/auth').User | null;
12
12
  onLogout: () => void;
13
13
  }
14
14
 
@@ -1,16 +1,21 @@
1
1
  import React from 'react';
2
- import { XerticaAssistant } from 'xertica-ui/assistant';
2
+ import { XerticaAssistant, generateDemoResponse } from 'xertica-ui/assistant';
3
3
  import { useLayout } from 'xertica-ui/hooks';
4
+ import { useNavigate } from 'react-router-dom';
5
+ import { toast } from 'sonner';
4
6
  import { AppLayout } from '../app/components/AppLayout';
5
7
  import { TemplateContent } from '../features/template';
8
+ import { richSuggestions, feedbackOptions } from '../shared/config/assistant';
9
+ import type { User } from '../shared/types/auth';
6
10
 
7
11
  interface TemplatePageProps {
8
- user: { email: string } | null;
12
+ user: User | null;
9
13
  onLogout: () => void;
10
14
  }
11
15
 
12
16
  export function TemplatePage({ user, onLogout }: TemplatePageProps) {
13
17
  const { assistenteExpanded, toggleAssistente } = useLayout();
18
+ const navigate = useNavigate();
14
19
 
15
20
  return (
16
21
  <AppLayout
@@ -20,7 +25,20 @@ export function TemplatePage({ user, onLogout }: TemplatePageProps) {
20
25
  <XerticaAssistant
21
26
  isExpanded={assistenteExpanded}
22
27
  onToggle={toggleAssistente}
23
- onEvaluation={(id, type, reason) => console.log('Feedback:', id, type, reason)}
28
+ defaultTab="chat"
29
+ demoMode={true}
30
+ userName={user?.name ?? 'Usuário'}
31
+ responseGenerator={generateDemoResponse}
32
+ richSuggestions={richSuggestions}
33
+ feedbackOptions={feedbackOptions}
34
+ showHistory={false}
35
+ showFavorites={false}
36
+ onNavigateSettings={() => navigate('/settings')}
37
+ onNavigateFullPage={() => navigate('/assistente')}
38
+ onEvaluation={(_messageId, type, _reason) => {
39
+ if (type === 'like') toast.success('Obrigado pelo feedback positivo!');
40
+ else toast.info('Obrigado! Seu feedback nos ajuda a melhorar.');
41
+ }}
24
42
  />
25
43
  }
26
44
  >