xertica-ui 1.5.2 → 1.6.0

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 (259) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +129 -269
  3. package/components/AudioPlayer.tsx +30 -7
  4. package/components/CodeBlock.tsx +20 -0
  5. package/components/DocumentEditor.tsx +37 -18
  6. package/components/ForgotPasswordPage.tsx +36 -24
  7. package/components/FormattedDocument.tsx +27 -7
  8. package/components/Header.tsx +164 -7
  9. package/components/HomeContent.tsx +28 -12
  10. package/components/HomePage.tsx +27 -9
  11. package/components/LanguageSelector.tsx +19 -0
  12. package/components/LoginPage.tsx +46 -26
  13. package/components/MarkdownMessage.tsx +29 -11
  14. package/components/ModernChatInput.tsx +46 -22
  15. package/components/PodcastPlayer.tsx +48 -22
  16. package/components/ResetPasswordPage.tsx +39 -26
  17. package/components/Sidebar.tsx +222 -132
  18. package/components/TemplateContent.tsx +263 -105
  19. package/components/TemplatePage.tsx +18 -1
  20. package/components/ThemeToggle.tsx +21 -3
  21. package/components/VerifyEmailPage.tsx +44 -31
  22. package/components/XerticaLogo.tsx +18 -1
  23. package/components/XerticaOrbe.tsx +17 -0
  24. package/components/XerticaProvider.tsx +27 -4
  25. package/components/XerticaXLogo.tsx +17 -1
  26. package/components/assistant-utils.ts +117 -101
  27. package/components/index.ts +7 -0
  28. package/components/layout-constants.ts +8 -4
  29. package/components/media/AudioPlayer.tsx +1 -1
  30. package/components/media/FloatingMediaWrapper.tsx +1 -1
  31. package/components/ui/accordion.tsx +9 -6
  32. package/components/ui/alert-dialog.tsx +8 -6
  33. package/components/ui/alert.tsx +9 -7
  34. package/components/ui/aspect-ratio.tsx +7 -6
  35. package/components/ui/avatar.tsx +8 -6
  36. package/components/ui/badge.tsx +9 -6
  37. package/components/ui/breadcrumb.tsx +8 -6
  38. package/components/ui/button.tsx +17 -18
  39. package/components/ui/calendar.tsx +8 -6
  40. package/components/ui/card.tsx +8 -7
  41. package/components/ui/carousel.tsx +8 -6
  42. package/components/ui/chart.tsx +11 -6
  43. package/components/ui/checkbox.tsx +8 -15
  44. package/components/ui/collapsible.tsx +7 -5
  45. package/components/ui/command.tsx +9 -6
  46. package/components/ui/context-menu.tsx +8 -6
  47. package/components/ui/dialog.tsx +9 -8
  48. package/components/ui/drawer.tsx +8 -6
  49. package/components/ui/dropdown-menu.tsx +8 -8
  50. package/components/ui/empty.tsx +10 -6
  51. package/components/ui/file-upload.tsx +10 -7
  52. package/components/ui/form.tsx +8 -7
  53. package/components/ui/google-maps-loader.tsx +7 -7
  54. package/components/ui/hover-card.tsx +8 -5
  55. package/components/ui/input-otp.tsx +8 -6
  56. package/components/ui/input.tsx +7 -11
  57. package/components/ui/label.tsx +7 -6
  58. package/components/ui/map-layers.tsx +13 -13
  59. package/components/ui/map.tsx +8 -8
  60. package/components/ui/menubar.tsx +9 -6
  61. package/components/ui/navigation-menu.tsx +8 -6
  62. package/components/ui/notification-badge.tsx +9 -6
  63. package/components/ui/page-header.tsx +19 -11
  64. package/components/ui/pagination.tsx +8 -6
  65. package/components/ui/popover.tsx +8 -6
  66. package/components/ui/progress.tsx +7 -6
  67. package/components/ui/radio-group.tsx +8 -6
  68. package/components/ui/rating.tsx +8 -6
  69. package/components/ui/resizable.tsx +8 -6
  70. package/components/ui/route-map.tsx +10 -7
  71. package/components/ui/scroll-area.tsx +7 -6
  72. package/components/ui/search.tsx +8 -6
  73. package/components/ui/select.tsx +9 -5
  74. package/components/ui/separator.tsx +7 -5
  75. package/components/ui/sheet.tsx +8 -5
  76. package/components/ui/simple-map.tsx +26 -20
  77. package/components/ui/skeleton.tsx +8 -6
  78. package/components/ui/slider.tsx +8 -6
  79. package/components/ui/sonner.tsx +8 -7
  80. package/components/ui/stats-card.tsx +11 -6
  81. package/components/ui/stepper.tsx +10 -6
  82. package/components/ui/switch.tsx +7 -5
  83. package/components/ui/table.tsx +8 -7
  84. package/components/ui/tabs.tsx +8 -8
  85. package/components/ui/textarea.tsx +8 -6
  86. package/components/ui/timeline.tsx +8 -6
  87. package/components/ui/toggle-group.tsx +8 -6
  88. package/components/ui/toggle.tsx +7 -5
  89. package/components/ui/tooltip.tsx +8 -6
  90. package/components/ui/tree-view.tsx +9 -6
  91. package/components/ui/xertica-assistant.tsx +66 -65
  92. package/contexts/LayoutContext.tsx +6 -1
  93. package/dist/components/AudioPlayer.d.ts +23 -0
  94. package/dist/components/CodeBlock.d.ts +20 -0
  95. package/dist/components/DocumentEditor.d.ts +19 -0
  96. package/dist/components/ForgotPasswordPage.d.ts +12 -0
  97. package/dist/components/FormattedDocument.d.ts +18 -0
  98. package/dist/components/Header.d.ts +59 -1
  99. package/dist/components/HomeContent.d.ts +16 -0
  100. package/dist/components/HomePage.d.ts +18 -0
  101. package/dist/components/LanguageSelector.d.ts +19 -0
  102. package/dist/components/LoginPage.d.ts +20 -0
  103. package/dist/components/MarkdownMessage.d.ts +18 -0
  104. package/dist/components/ModernChatInput.d.ts +30 -0
  105. package/dist/components/PodcastPlayer.d.ts +26 -0
  106. package/dist/components/ResetPasswordPage.d.ts +13 -0
  107. package/dist/components/Sidebar.d.ts +64 -11
  108. package/dist/components/TemplateContent.d.ts +15 -0
  109. package/dist/components/TemplatePage.d.ts +16 -0
  110. package/dist/components/ThemeToggle.d.ts +18 -0
  111. package/dist/components/VerifyEmailPage.d.ts +13 -0
  112. package/dist/components/XerticaLogo.d.ts +17 -0
  113. package/dist/components/XerticaOrbe.d.ts +17 -0
  114. package/dist/components/XerticaProvider.d.ts +23 -0
  115. package/dist/components/XerticaXLogo.d.ts +16 -0
  116. package/dist/components/assistant-utils.d.ts +17 -0
  117. package/dist/components/index.d.ts +7 -0
  118. package/dist/components/layout-constants.d.ts +4 -0
  119. package/dist/components/ui/accordion.d.ts +7 -4
  120. package/dist/components/ui/alert-dialog.d.ts +6 -4
  121. package/dist/components/ui/alert.d.ts +7 -5
  122. package/dist/components/ui/aspect-ratio.d.ts +5 -4
  123. package/dist/components/ui/avatar.d.ts +6 -4
  124. package/dist/components/ui/badge.d.ts +7 -4
  125. package/dist/components/ui/breadcrumb.d.ts +6 -4
  126. package/dist/components/ui/button.d.ts +13 -14
  127. package/dist/components/ui/calendar.d.ts +6 -4
  128. package/dist/components/ui/card.d.ts +6 -5
  129. package/dist/components/ui/carousel.d.ts +6 -4
  130. package/dist/components/ui/chart.d.ts +9 -4
  131. package/dist/components/ui/checkbox.d.ts +6 -13
  132. package/dist/components/ui/collapsible.d.ts +5 -3
  133. package/dist/components/ui/command.d.ts +7 -4
  134. package/dist/components/ui/context-menu.d.ts +6 -4
  135. package/dist/components/ui/dialog.d.ts +7 -6
  136. package/dist/components/ui/drawer.d.ts +6 -4
  137. package/dist/components/ui/dropdown-menu.d.ts +6 -6
  138. package/dist/components/ui/empty.d.ts +8 -4
  139. package/dist/components/ui/file-upload.d.ts +8 -5
  140. package/dist/components/ui/form.d.ts +7 -6
  141. package/dist/components/ui/hover-card.d.ts +6 -3
  142. package/dist/components/ui/input-otp.d.ts +6 -4
  143. package/dist/components/ui/input.d.ts +7 -11
  144. package/dist/components/ui/label.d.ts +5 -4
  145. package/dist/components/ui/map-layers.d.ts +10 -10
  146. package/dist/components/ui/map.d.ts +6 -6
  147. package/dist/components/ui/menubar.d.ts +7 -4
  148. package/dist/components/ui/navigation-menu.d.ts +6 -4
  149. package/dist/components/ui/notification-badge.d.ts +7 -4
  150. package/dist/components/ui/page-header.d.ts +17 -9
  151. package/dist/components/ui/pagination.d.ts +6 -4
  152. package/dist/components/ui/popover.d.ts +6 -4
  153. package/dist/components/ui/progress.d.ts +5 -4
  154. package/dist/components/ui/radio-group.d.ts +6 -4
  155. package/dist/components/ui/rating.d.ts +6 -4
  156. package/dist/components/ui/resizable.d.ts +6 -4
  157. package/dist/components/ui/route-map.d.ts +8 -5
  158. package/dist/components/ui/scroll-area.d.ts +5 -4
  159. package/dist/components/ui/search.d.ts +6 -4
  160. package/dist/components/ui/select.d.ts +8 -4
  161. package/dist/components/ui/separator.d.ts +5 -3
  162. package/dist/components/ui/sheet.d.ts +6 -3
  163. package/dist/components/ui/simple-map.d.ts +20 -14
  164. package/dist/components/ui/skeleton.d.ts +6 -4
  165. package/dist/components/ui/slider.d.ts +6 -4
  166. package/dist/components/ui/sonner.d.ts +6 -5
  167. package/dist/components/ui/stats-card.d.ts +9 -4
  168. package/dist/components/ui/stepper.d.ts +8 -4
  169. package/dist/components/ui/switch.d.ts +5 -3
  170. package/dist/components/ui/table.d.ts +6 -5
  171. package/dist/components/ui/tabs.d.ts +6 -6
  172. package/dist/components/ui/textarea.d.ts +6 -4
  173. package/dist/components/ui/timeline.d.ts +6 -4
  174. package/dist/components/ui/toggle-group.d.ts +6 -4
  175. package/dist/components/ui/toggle.d.ts +5 -3
  176. package/dist/components/ui/tooltip.d.ts +6 -4
  177. package/dist/components/ui/tree-view.d.ts +7 -4
  178. package/dist/components/ui/xertica-assistant.d.ts +53 -52
  179. package/dist/contexts/LayoutContext.d.ts +2 -0
  180. package/dist/index.es.js +419 -177
  181. package/dist/index.umd.js +418 -176
  182. package/dist/xertica-ui.css +1 -1
  183. package/docs/ai-usage.md +170 -14
  184. package/docs/components/accordion.md +91 -20
  185. package/docs/components/alert-dialog.md +95 -18
  186. package/docs/components/alert.md +99 -21
  187. package/docs/components/aspect-ratio.md +45 -13
  188. package/docs/components/assistant.md +91 -32
  189. package/docs/components/avatar.md +94 -23
  190. package/docs/components/badge.md +63 -18
  191. package/docs/components/breadcrumb.md +77 -20
  192. package/docs/components/button.md +150 -39
  193. package/docs/components/calendar.md +83 -18
  194. package/docs/components/card.md +139 -27
  195. package/docs/components/carousel.md +83 -40
  196. package/docs/components/chart.md +132 -46
  197. package/docs/components/checkbox.md +73 -24
  198. package/docs/components/collapsible.md +77 -24
  199. package/docs/components/command.md +82 -24
  200. package/docs/components/context-menu.md +68 -27
  201. package/docs/components/dialog.md +123 -28
  202. package/docs/components/drawer.md +78 -14
  203. package/docs/components/dropdown-menu.md +107 -27
  204. package/docs/components/empty.md +130 -16
  205. package/docs/components/file-upload.md +75 -19
  206. package/docs/components/form.md +141 -62
  207. package/docs/components/header.md +202 -0
  208. package/docs/components/hover-card.md +65 -20
  209. package/docs/components/input-otp.md +81 -21
  210. package/docs/components/input.md +81 -35
  211. package/docs/components/label.md +56 -13
  212. package/docs/components/map.md +61 -31
  213. package/docs/components/menubar.md +66 -36
  214. package/docs/components/navigation-menu.md +59 -18
  215. package/docs/components/notification-badge.md +48 -15
  216. package/docs/components/page-header.md +164 -38
  217. package/docs/components/pagination.md +92 -27
  218. package/docs/components/popover.md +105 -27
  219. package/docs/components/progress.md +69 -18
  220. package/docs/components/radio-group.md +118 -34
  221. package/docs/components/rating.md +69 -24
  222. package/docs/components/resizable.md +78 -43
  223. package/docs/components/route-map.md +124 -0
  224. package/docs/components/scroll-area.md +49 -24
  225. package/docs/components/search.md +67 -18
  226. package/docs/components/select.md +135 -36
  227. package/docs/components/separator.md +50 -30
  228. package/docs/components/sheet.md +104 -20
  229. package/docs/components/sidebar.md +184 -25
  230. package/docs/components/skeleton.md +83 -21
  231. package/docs/components/slider.md +79 -15
  232. package/docs/components/sonner.md +112 -33
  233. package/docs/components/stats-card.md +109 -14
  234. package/docs/components/stepper.md +112 -39
  235. package/docs/components/switch.md +99 -15
  236. package/docs/components/table.md +113 -29
  237. package/docs/components/tabs.md +103 -29
  238. package/docs/components/textarea.md +77 -12
  239. package/docs/components/timeline.md +73 -26
  240. package/docs/components/toggle-group.md +61 -31
  241. package/docs/components/toggle.md +58 -18
  242. package/docs/components/tooltip.md +101 -31
  243. package/docs/components/tree-view.md +71 -22
  244. package/docs/components/use-mobile.md +100 -0
  245. package/docs/getting-started.md +186 -13
  246. package/docs/guidelines.md +167 -23
  247. package/docs/installation.md +182 -16
  248. package/docs/layout.md +171 -0
  249. package/docs/llms.md +195 -0
  250. package/docs/patterns/analytics.md +196 -50
  251. package/docs/patterns/crud.md +121 -39
  252. package/docs/patterns/dashboard.md +139 -45
  253. package/docs/patterns/form.md +192 -33
  254. package/docs/patterns/login.md +135 -22
  255. package/package.json +4 -3
  256. package/templates/src/app/pages/Home/HomeContent.tsx +2 -2
  257. package/templates/src/app/pages/HomePage.tsx +2 -1
  258. package/templates/src/app/pages/Template/TemplateContent.tsx +6 -4
  259. package/templates/src/app/pages/TemplatePage.tsx +2 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ All notable changes to `xertica-ui` will be documented in this file.
4
+
5
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [1.6.0] — 2026-04-20
11
+
12
+ ### Added
13
+ - **`docs/llms.md`** — Master LLM/AI-agent entrypoint index with full component catalog, token quick reference, and reading order guide.
14
+ - **`docs/layout.md`** — Complete `LayoutContext` and `useLayout()` API reference.
15
+ - **`docs/components/route-map.md`** — New documentation for `RouteMap` component.
16
+ - **`docs/components/use-mobile.md`** — New documentation for `useMobile` / `useIsMobile` hooks.
17
+ - **`Header`** — New props: `user` (profile with avatar, name, email, and dropdown menu items), `actions` (custom icon action buttons), `showSettings` / `onSettingsClick`, `showLogout` / `onLogoutClick`. Fixed render order: Language → Theme → Actions → Settings → User → Logout.
18
+ - **`Sidebar`** — New `width` prop (`expandedWidth: number`) for configuring the expanded sidebar pixel width. Width is now read and stored via `LayoutContext.sidebarWidth`.
19
+
20
+ ### Changed
21
+ - **Documentation** — All 61 component docs, 5 pattern docs, and 6 root docs fully rewritten in English with standardized structure (Overview, When to Use, Anatomy, Props table, Examples, AI Rules, Related Components).
22
+ - **JSDoc** — All Portuguese JSDoc comments in `components/ui/` translated to English and enriched with accurate `@ai-rules`.
23
+ - **`README.md`** — Complete rewrite in English, restructured for npm page quality (quick start, install guide, component catalog, token reference, AI agent entrypoint, troubleshooting).
24
+ - **`package.json`** — Version bumped to `1.6.0`. Description translated to English.
25
+
26
+ ### Fixed
27
+ - **`docs/components/page-header.md`** — Was documenting a wrong API (`title/description/actions`). Now correctly documents the real API: `breadcrumbs[]`, `showLanguageSelector`, `rightContent`, `PageHeaderHeading`, `PageHeaderDescription`.
28
+ - **`docs/components/stepper.md`** — Was documenting a `steps[]` array prop. Now correctly documents the composable `<Stepper currentStep> + <Step step label>` API (1-indexed).
29
+ - **`docs/components/empty.md`** — Was documenting single-prop component. Now correctly documents the composable sub-component pattern: `Empty > EmptyIcon > EmptyTitle > EmptyDescription > EmptyAction`.
30
+ - **`docs/components/stats-card.md`** — `trend` was documented as a string. Now correctly documented as `{ value: number; label?: string }`.
31
+ - **`docs/components/chart.md`** — Was documenting raw Recharts usage. Now correctly documents the `ChartContainer + ChartConfig + var(--color-*)` pattern.
32
+
33
+ ---
34
+
35
+ ## [1.5.2] — 2026-04-15
36
+
37
+ ### Fixed
38
+ - Resolved regression where modal components (Dialog/AlertDialog) failed to render in projects initialized via the CLI.
39
+ - Implemented robust CSS integration using Tailwind v4 theme mappings.
40
+ - Ensured Radix UI portals correctly inherit theme variables.
41
+
42
+ ---
43
+
44
+ ## [1.5.1] — 2026-04-14
45
+
46
+ ### Changed
47
+ - Sidebar: Added `assistente` variant with fixed areas, searchable navigation, and grouped navigation structures.
48
+ - Template page updated to demonstrate the assistant sidebar variant.
49
+
50
+ ---
51
+
52
+ ## [1.5.0] — 2026-04-13
53
+
54
+ ### Added
55
+ - `Sidebar` — `width` / `expandedWidth` prop for configurable expanded sidebar width.
56
+ - `LayoutContext` — `sidebarWidth` and `setSidebarWidth` for global sidebar width management.
57
+ - `Header` — User profile section with avatar, dropdown menu, settings button, and logout button.
58
+ - `StatsCard` — KPI metric card component.
59
+ - `Timeline` — Chronological event list with dot variants.
60
+ - `TreeView` — Hierarchical tree navigation.
61
+ - `Rating` — Star-based rating input.
62
+ - `FileUpload` — Drag-and-drop file input.
63
+ - `Search` — Pre-built search input with icon and clear button.
64
+ - `NotificationBadge` — Dot/count badge overlay.
65
+ - `RouteMap` — Google Maps route display and direction calculation.
66
+ - `Stepper` — Multi-step progress indicator.
67
+ - `Map` — Advanced Google Maps integration with markers, circles, polygons, and layers.
68
+ - `XerticaAssistant` — Embedded Gemini AI assistant panel.
package/README.md CHANGED
@@ -1,367 +1,227 @@
1
1
  # Xertica UI
2
2
 
3
- Design System completo com componentes React e Tailwind CSS v4.0, construído com TypeScript seguindo arquitetura CLI-first (modelo Shadcn).
3
+ > **Enterprise-grade React design system** built on Tailwind CSS v4, Radix UI, and Lucide Icons — with an AI-first documentation layer for accurate LLM-driven composition.
4
4
 
5
- ## 🚀 Início Rápido (CLI)
5
+ [![npm version](https://img.shields.io/npm/v/xertica-ui)](https://www.npmjs.com/package/xertica-ui)
6
+ [![license](https://img.shields.io/badge/license-proprietary-red)](./LICENSE)
6
7
 
7
- Para criar um novo projeto utilizando o Xertica UI:
8
-
9
- ```bash
10
- npx xertica-ui init meu-projeto
11
- ```
12
-
13
- O CLI irá guiá-lo através da configuração:
14
- 1. **Componentes**: Escolha quais componentes incluir.
15
- 2. **Páginas**: Opte por incluir ou não Login, Home e Template.
16
- 3. **Instalação**: Dependências são instaladas automaticamente.
8
+ ---
17
9
 
18
- ### Desenvolvimento no Projeto Clona
10
+ ## Quick Start CLI (Recommended)
19
11
 
20
- Após a inicialização:
12
+ Scaffold a full application in seconds:
21
13
 
22
14
  ```bash
23
- cd meu-projeto
15
+ npx xertica-ui@latest init my-app
16
+ cd my-app
24
17
  npm run dev
25
18
  ```
26
19
 
27
- Acesse: **http://localhost:5173**
28
- Login padrão: Use qualquer email e senha.
29
-
30
- ## 📋 Pré-requisitos
20
+ The CLI scaffolds a complete Vite + React + TypeScript project with routing, authentication pages, a sidebar layout, and all Xertica UI components pre-configured.
31
21
 
32
- - Node.js 18+ instalado
33
- - npm, yarn ou pnpm
34
-
35
- ## 🔧 Instalação
36
-
37
- O método recomendado é usar o CLI:
38
- ```bash
39
- npx xertica-ui init meu-app
40
- ```
22
+ ---
41
23
 
42
- ### Instalação como Biblioteca
24
+ ## Installation as a Library
43
25
 
44
- Se você deseja usar os componentes em um projeto React existente:
26
+ To add Xertica UI to an existing React project:
45
27
 
46
- 1. Instale o pacote:
47
28
  ```bash
48
29
  npm install xertica-ui
49
30
  ```
50
31
 
51
- 2. Importe o CSS (obrigatório) no seu arquivo `main.tsx` ou `App.tsx`:
32
+ **1. Import the stylesheet** in your entry file (`main.tsx` or `App.tsx`):
33
+
52
34
  ```tsx
53
35
  import 'xertica-ui/style.css';
54
36
  ```
55
37
 
56
- 3. Envolva sua aplicação com o `XerticaProvider`:
38
+ **2. Wrap your app** with `XerticaProvider`:
39
+
57
40
  ```tsx
58
41
  import { XerticaProvider } from 'xertica-ui';
59
42
 
60
43
  function App() {
61
44
  return (
62
45
  <XerticaProvider>
63
- <SeuApp />
46
+ <YourApp />
64
47
  </XerticaProvider>
65
48
  );
66
49
  }
67
50
  ```
68
51
 
69
- 4. Comece a usar os componentes:
52
+ **3. Use components:**
53
+
70
54
  ```tsx
71
- import { Button } from 'xertica-ui';
55
+ import { Button, Card, CardContent } from 'xertica-ui';
72
56
 
73
- export function MeuComponente() {
74
- return <Button>Clique aqui</Button>;
57
+ export function Example() {
58
+ return (
59
+ <Card>
60
+ <CardContent>
61
+ <Button>Get Started</Button>
62
+ </CardContent>
63
+ </Card>
64
+ );
75
65
  }
76
66
  ```
77
67
 
78
- ### Desenvolvimento do Projeto (Contribuição)
79
- Para desenvolvimento do próprio pacote/biblioteca:
80
- 1. Clone o repositório:
81
- ```bash
82
- git clone [URL_DO_REPOSITORIO]
83
- cd xertica-ui
84
- ```
68
+ ---
85
69
 
86
- 2. Instale as dependências:
87
- ```bash
88
- npm install
89
- ```
70
+ ## XerticaProvider Props
90
71
 
91
- ## 📁 Estrutura do Projeto
72
+ | Prop | Type | Description |
73
+ |---|---|---|
74
+ | `apiKey` | `string` | Google Gemini API key for the AI assistant |
75
+ | `googleMapsApiKey` | `string` | Google Maps JavaScript API key |
76
+ | `primaryColor` | `string` | Override the primary brand color |
77
+ | `defaultBrandTheme` | `string` | Preset brand theme name |
78
+ | `useCustomTokens` | `boolean` | Use local `tokens.css` instead of library defaults |
79
+ | `disableDarkMode` | `boolean` | Disables dark mode support |
92
80
 
93
- ```
94
- xertica-ui/
95
- ├── components/
96
- │ ├── ui/ # 156 componentes do Design System
97
- │ │ ├── index.ts # Export central
98
- │ │ ├── button.tsx
99
- │ │ ├── card.tsx
100
- │ │ ├── alert.tsx
101
- │ │ ├── map.tsx
102
- │ │ ├── xertica-assistant.tsx
103
- │ │ └── ... (todos os componentes)
104
- │ │
105
- │ ├── examples/ # Exemplos de uso (Maps)
106
- │ ├── figma/ # Componentes Figma
107
- │ ├── media/ # Players de áudio/vídeo
108
- │ │
109
- │ ├── HomePage.tsx # Página Home
110
- │ ├── TemplatePage.tsx # Template completo
111
- │ ├── LoginPage.tsx # Login
112
- │ └── ... (componentes auxiliares)
113
-
114
- ├── contexts/ # Contextos React
115
- │ ├── ThemeContext.tsx
116
- │ ├── LanguageContext.tsx
117
- │ └── ...
118
-
119
- ├── styles/
120
- │ └── xertica/
121
- │ ├── tokens.css # Design Tokens (Source of Truth)
122
- │ ├── base.css # Base styles + Tailwind
123
- │ ├── theme-map.css # Theme mapping
124
- │ └── integrations/ # CSS overrides
125
-
126
- ├── App.tsx # Componente raiz
127
- ├── routes.tsx # Configuração de rotas
128
- └── package.json # Dependências
129
- ```
81
+ ---
130
82
 
131
- ## 🚀 Tecnologias
83
+ ## Component Catalog
132
84
 
133
- - **React 18.3** - Biblioteca JavaScript para interfaces
134
- - **TypeScript 5.7** - Superset tipado do JavaScript
135
- - **Tailwind CSS v4.0** - Framework CSS utility-first
136
- - **Vite 6.0** - Build tool e dev server ultrarrápido
137
- - **React Router 7** - Roteamento client-side
138
- - **Radix UI** - Componentes acessíveis e não estilizados
139
- - **Shadcn/ui** - Modelo CLI-first para componentes
140
- - **Lucide React** - Ícones SVG
141
- - **Sonner** - Toast notifications elegantes
142
- - **Recharts** - Gráficos e visualizações de dados
143
- - **Google Generative AI** - Integração com Gemini
85
+ ### Layout & Navigation
86
+ `Header` · `Sidebar` · `PageHeader` · `PageHeaderHeading` · `PageHeaderDescription` · `Breadcrumb` · `NavigationMenu` · `Tabs` · `Pagination`
144
87
 
145
- ## 🏃 Executando o Projeto
88
+ ### Surfaces
89
+ `Card` · `CardHeader` · `CardTitle` · `CardDescription` · `CardContent` · `CardFooter` · `Separator` · `ScrollArea` · `AspectRatio` · `ResizablePanelGroup`
146
90
 
147
- ### Modo de Desenvolvimento
91
+ ### Form & Input
92
+ `Form` · `FormField` · `FormItem` · `FormLabel` · `FormControl` · `FormMessage` · `Input` · `Textarea` · `Label` · `Checkbox` · `RadioGroup` · `Switch` · `Slider` · `Select` · `Calendar` · `InputOTP` · `FileUpload` · `Search`
148
93
 
149
- ```bash
150
- npm run dev
151
- ```
94
+ ### Actions
95
+ `Button` · `Toggle` · `ToggleGroup` · `Rating`
152
96
 
153
- O projeto será aberto automaticamente em `http://localhost:5173`
97
+ ### Data Display
98
+ `Table` · `Badge` · `Avatar` · `Progress` · `Skeleton` · `Empty` · `StatsCard` · `Timeline` · `Stepper` · `TreeView` · `NotificationBadge` · `ChartContainer`
154
99
 
155
- ### Build de Produção
100
+ ### Structure & Utilities
101
+ `Accordion` · `Collapsible` · `Carousel` · `ScrollArea`
156
102
 
157
- ```bash
158
- npm run build
159
- ```
103
+ ### Overlays & Feedback
104
+ `Dialog` · `AlertDialog` · `Sheet` · `Drawer` · `Popover` · `HoverCard` · `Tooltip` · `Alert` · `Toaster` · `Command`
160
105
 
161
- ### Preview da Build de Produção
106
+ ### Menus
107
+ `DropdownMenu` · `ContextMenu` · `Menubar`
162
108
 
163
- ```bash
164
- npm run preview
165
- ```
109
+ ### Maps
110
+ `Map` · `RouteMap`
166
111
 
167
- ### Type Check
112
+ ### AI Features
113
+ `XerticaAssistant`
168
114
 
169
- ```bash
170
- npm run type-check
171
- ```
115
+ ### Hooks
116
+ `useMobile` · `useIsMobile` · `useLayout`
172
117
 
173
- ## 🎨 Design System
118
+ ---
174
119
 
175
- ### Sistema de Tokens CSS
120
+ ## Design Tokens
176
121
 
177
- Todos os estilos são baseados em variáveis CSS definidas em `/styles/xertica/tokens.css`:
122
+ Xertica UI uses semantic CSS tokens **never use raw colors or Tailwind color classes**:
178
123
 
179
- ```css
180
- /* Cores */
181
- --primary: rgba(44, 39, 91, 1);
182
- --background: rgba(255, 255, 255, 1);
183
- --foreground: rgba(9, 9, 11, 1);
184
-
185
- /* Tipografia */
186
- --text-h1: 2rem;
187
- --text-h2: 1.75rem;
188
- --text-stats: 2.25rem;
189
- --font-weight-medium: 500;
190
- --font-weight-bold: 700;
191
-
192
- /* Radius */
193
- --radius: 6px;
194
- --radius-button: 12px;
195
- --radius-card: 12px;
196
-
197
- /* Spacing */
198
- --spacing-4: 1rem;
199
- --spacing-8: 2rem;
124
+ ```
125
+ Background: bg-background text-foreground
126
+ Card surface: bg-card text-card-foreground
127
+ Muted area: bg-muted text-muted-foreground
128
+ Primary action: bg-primary text-primary-foreground
129
+ Destructive: bg-destructive text-destructive-foreground
130
+ Border: border-border
200
131
  ```
201
132
 
202
- ### Customização
203
-
204
- Edite `/styles/xertica/tokens.css` e todo o sistema se adapta automaticamente:
133
+ Tokens are defined in `styles/xertica/tokens.css` and customizable per project:
205
134
 
206
135
  ```css
207
136
  :root {
208
- --primary: rgba(255, 0, 0, 1); /* Vermelho customizado */
209
- --radius: 16px; /* Bordas mais arredondadas */
137
+ --primary: rgba(44, 39, 91, 1);
138
+ --radius: 6px;
139
+ --radius-card: 12px;
210
140
  }
211
141
  ```
212
142
 
213
- ### Tipografia
214
-
215
- - **Fonte**: Roboto (400, 500, 600, 700, 800)
216
- - **Tamanhos**: Definidos via variáveis CSS (`--text-*`)
217
- - **Zero classes Tailwind** de font-size ou font-weight hardcoded
218
-
219
- ## 🌓 Dark Mode
220
-
221
- Suporte completo a Dark Mode com toggle manual. A preferência é salva em `localStorage`.
222
-
223
- Troca via atributo `data-mode="dark"` ou classe `.dark`
224
-
225
- ## 🔐 Autenticação
226
-
227
- Sistema de autenticação simulada que aceita qualquer credencial não vazia:
228
-
229
- - **Email**: qualquer@email.com
230
- - **Senha**: qualquer senha
231
-
232
- ## 🗺️ Rotas
233
-
234
- - `/login` - Página de login
235
- - `/forgot-password` - Recuperação de senha
236
- - `/verify-email` - Verificação de email
237
- - `/reset-password` - Redefinição de senha
238
- - `/home` - Página principal (protegida)
239
- - `/template` - Template com todos os componentes (protegida)
240
-
241
- ## 🤖 Integração com Gemini AI
242
-
243
- O assistente Xertica usa Google Gemini AI. Configure a API Key:
244
-
245
- 1. Acesse o assistente AI
246
- 2. Clique em "Configurar API Key"
247
- 3. Insira sua chave da API do Google Gemini
248
- 4. A chave é salva localmente no navegador
249
-
250
- **Obter API Key**: [Google AI Studio](https://aistudio.google.com/app/apikey)
251
-
252
- ## 📦 Componentes UI (156 total)
253
-
254
- ### Layout & Structure
255
- Card, Separator, AspectRatio, Resizable
256
-
257
- ### Navigation
258
- Tabs, Breadcrumb, NavigationMenu, Sidebar, Pagination
259
-
260
- ### Buttons & Interactions
261
- Button, Toggle, ToggleGroup
262
-
263
- ### Forms & Inputs
264
- Input, Textarea, Label, Checkbox, RadioGroup, Switch, Slider, Select, InputOTP, Form, Calendar
143
+ ---
265
144
 
266
- ### Overlays & Dialogs
267
- Dialog, AlertDialog, Sheet, Drawer, Popover, Tooltip, HoverCard
145
+ ## Dark Mode
268
146
 
269
- ### Menus
270
- DropdownMenu, ContextMenu, Menubar, Command
147
+ Full dark mode support via `data-mode="dark"` attribute or `.dark` class, managed automatically by `XerticaProvider`. User preference is persisted to `localStorage`.
271
148
 
272
- ### Feedback & Notifications
273
- Alert, Badge, Progress, Skeleton, Toast (Sonner), NotificationBadge
274
-
275
- ### Data Display
276
- Avatar, Table, Chart, Empty, StatsCard, Timeline, TreeView
149
+ ---
277
150
 
278
- ### Utility Components
279
- Collapsible, Accordion, ScrollArea, Carousel, Stepper, FileUpload, Rating, Search
151
+ ## AI Agent / LLM Usage
280
152
 
281
- ### Maps
282
- Map, RouteMap, SimpleMap (Google Maps integration)
153
+ Xertica UI ships with a comprehensive AI-first documentation layer in `docs/`:
283
154
 
284
- ### Xertica Custom
285
- XerticaAssistant, PageHeader
155
+ | File | Purpose |
156
+ |---|---|
157
+ | `docs/llms.md` | **Start here** — master index for AI agents |
158
+ | `docs/ai-usage.md` | Mandatory rules for LLM-driven code generation |
159
+ | `docs/guidelines.md` | Design token semantics and composition rules |
160
+ | `docs/layout.md` | `LayoutContext` and `useLayout` API reference |
161
+ | `docs/components/*.md` | Per-component reference with props, examples, and AI rules |
162
+ | `docs/patterns/*.md` | Full page composition patterns (dashboard, CRUD, form, etc.) |
286
163
 
287
- ### Hooks
288
- useMobile, useIsMobile
164
+ Point your LLM agent to `docs/llms.md` as the entrypoint.
289
165
 
290
- ## 🎯 Funcionalidades
166
+ ---
291
167
 
292
- - Sistema de autenticação completo
293
- - ✅ 156 componentes CLI-ready
294
- - ✅ Design System baseado em variáveis CSS
295
- - ✅ Dark mode completo
296
- - ✅ Assistente AI integrado
297
- - ✅ Sistema de notificações (toast)
298
- - ✅ Design responsivo
299
- - ✅ Arquitetura CLI-first (modelo Shadcn)
300
- - ✅ TypeScript completo
301
- - ✅ Zero CSS oculto
168
+ ## Tech Stack
302
169
 
303
- ## 📱 Responsividade
170
+ | Technology | Version |
171
+ |---|---|
172
+ | React | 18.3 |
173
+ | TypeScript | 5.7 |
174
+ | Tailwind CSS | 4.0 |
175
+ | Vite | 6.0 |
176
+ | Radix UI | latest |
177
+ | Recharts | 2.x |
178
+ | Lucide React | 0.469+ |
179
+ | react-hook-form | 7.x |
180
+ | zod | 3.x |
304
181
 
305
- Totalmente responsivo com breakpoints:
182
+ ---
306
183
 
307
- - Mobile: 320px+
308
- - Tablet: 768px+
309
- - Desktop: 1024px+
184
+ ## Peer Dependencies
310
185
 
311
- ## 🔄 Scripts Disponíveis
186
+ ```json
187
+ {
188
+ "react": "^18.3.1",
189
+ "react-dom": "^18.3.1",
190
+ "react-router-dom": "^7.1.3"
191
+ }
192
+ ```
312
193
 
313
- - `npm run dev` - Inicia servidor de desenvolvimento
314
- - `npm run build` - Cria build de produção
315
- - `npm run preview` - Preview da build
316
- - `npm run type-check` - Verifica tipos TypeScript
317
- - `npm run lint` - Executa linter
194
+ ---
318
195
 
319
- ## 📝 Convenções de Código
196
+ ## Scripts
320
197
 
321
- - **Componentes**: PascalCase (ex: `LoginPage.tsx`)
322
- - **Utilitários**: camelCase (ex: `utils.ts`)
323
- - **Contextos**: PascalCase com sufixo Context (ex: `ThemeContext.tsx`)
324
- - **CSS**: Variáveis CSS em vez de classes Tailwind para tipografia
198
+ | Command | Description |
199
+ |---|---|
200
+ | `npm run dev` | Start development server |
201
+ | `npm run build` | Production bundle |
202
+ | `npm run type-check` | TypeScript validation |
203
+ | `npm run lint` | ESLint check |
325
204
 
326
- ## 🐛 Troubleshooting
205
+ ---
327
206
 
328
- ### CSS não carrega
207
+ ## Troubleshooting
329
208
 
330
- 1. Verifique se todas as dependências estão instaladas:
209
+ **CSS not loading:**
331
210
  ```bash
332
211
  npm install
333
- ```
334
-
335
- 2. Limpe o cache do Vite:
336
- ```bash
337
212
  rm -rf node_modules/.vite
338
213
  npm run dev
339
214
  ```
340
215
 
341
- ### Erros de TypeScript
342
-
343
- Execute a verificação de tipos:
216
+ **TypeScript errors:**
344
217
  ```bash
345
218
  npm run type-check
346
219
  ```
347
220
 
348
- ### Porta em uso
349
-
350
- Altere a porta em `vite.config.ts`:
351
- ```ts
352
- server: {
353
- port: 3001,
354
- }
355
- ```
356
-
357
- ## 📄 Licença
358
-
359
- Este projeto é privado e proprietário.
360
-
361
- ## 👥 Autor
362
-
363
- Xertica AI Team
221
+ **Maps not rendering:** Ensure `googleMapsApiKey` is passed to `<XerticaProvider>` and the Maps JavaScript API + Directions API are enabled in your Google Cloud project.
364
222
 
365
223
  ---
366
224
 
367
- **Nota**: Este é um projeto de demonstração. Para uso em produção, implemente autenticação real, validação de segurança e testes adequados.
225
+ ## License
226
+
227
+ Proprietary — Xertica AI Team.
@@ -23,22 +23,45 @@ import {
23
23
  } from './ui/tooltip';
24
24
  import { cn } from './ui/utils';
25
25
 
26
+ /**
27
+ * Props for the AudioPlayer component.
28
+ */
26
29
  interface AudioPlayerProps {
30
+ /** Whether the player is currently visible and open */
27
31
  isOpen: boolean;
32
+ /** Callback to close the player bar */
28
33
  onClose: () => void;
34
+ /** Pass sidebar expansion state to adjust layout positioning */
29
35
  sidebarExpanded: boolean;
36
+ /** Title of the audio track/podcast */
30
37
  title?: string;
38
+ /** Subtitle or source information */
31
39
  subtitle?: string;
32
- duration?: number; // in seconds
40
+ /** Total duration in seconds */
41
+ duration?: number;
42
+ /** Initial or current playback time in seconds */
33
43
  currentTime?: number;
34
44
  }
35
45
 
46
+ /**
47
+ * Global floating Audio Player bar.
48
+ *
49
+ * @description
50
+ * A fixed-position playback bar that handles audio progress, volume,
51
+ * and specific podcast actions (reset, speed, info, refresh).
52
+ * It transitions smoothly from the bottom of the screen.
53
+ *
54
+ * @ai-rules
55
+ * 1. Placement: This component should typically be rendered once at the top level (e.g., in a Layout) and controlled via global state.
56
+ * 2. Positional logic: It automatically offsets itself based on `sidebarExpanded` to avoid overlapping navigation.
57
+ * 3. Use `duration` and `currentTime` to synchronize with external audio state if needed.
58
+ */
36
59
  export function AudioPlayer({
37
60
  isOpen,
38
61
  onClose,
39
62
  sidebarExpanded,
40
- title = "Processo 50002396220258210104",
41
- subtitle = "Podcast atualizado até Evento 26",
63
+ title = "Process 50002396220258210104",
64
+ subtitle = "Podcast updated to Event 26",
42
65
  duration = 1200, // 20:00
43
66
  currentTime = 0
44
67
  }: AudioPlayerProps) {
@@ -147,7 +170,7 @@ export function AudioPlayer({
147
170
  <RotateCcw className="w-4 h-4" />
148
171
  </Button>
149
172
  </TooltipTrigger>
150
- <TooltipContent>Reiniciar</TooltipContent>
173
+ <TooltipContent>Restart</TooltipContent>
151
174
  </Tooltip>
152
175
  </TooltipProvider>
153
176
 
@@ -158,7 +181,7 @@ export function AudioPlayer({
158
181
  <Gauge className="w-4 h-4" />
159
182
  </Button>
160
183
  </TooltipTrigger>
161
- <TooltipContent>Velocidade (1.0x)</TooltipContent>
184
+ <TooltipContent>Speed (1.0x)</TooltipContent>
162
185
  </Tooltip>
163
186
  </TooltipProvider>
164
187
 
@@ -170,7 +193,7 @@ export function AudioPlayer({
170
193
  </Button>
171
194
  </TooltipTrigger>
172
195
  <TooltipContent className="max-w-[300px] bg-popover text-popover-foreground">
173
- <p>Identificamos a entrada de novos eventos neste processo desde a última atualização deste podcast.</p>
196
+ <p>We identified new events in this process since the last podcast update.</p>
174
197
  </TooltipContent>
175
198
  </Tooltip>
176
199
  </TooltipProvider>
@@ -182,7 +205,7 @@ export function AudioPlayer({
182
205
  <RefreshCw className="w-4 h-4" />
183
206
  </Button>
184
207
  </TooltipTrigger>
185
- <TooltipContent>Atualizar Versão</TooltipContent>
208
+ <TooltipContent>Update Version</TooltipContent>
186
209
  </Tooltip>
187
210
  </TooltipProvider>
188
211
 
@@ -130,13 +130,33 @@ const elegantTheme = {
130
130
  },
131
131
  };
132
132
 
133
+ /**
134
+ * Props for the CodeBlock component.
135
+ */
133
136
  interface CodeBlockProps {
137
+ /** The code string to be displayed */
134
138
  code: string;
139
+ /** Programming language for syntax highlighting */
135
140
  language?: 'typescript' | 'tsx' | 'css' | 'bash' | 'jsx';
141
+ /** Optional filename to display in the header */
136
142
  filename?: string;
143
+ /** Whether to show line numbers */
137
144
  showLineNumbers?: boolean;
138
145
  }
139
146
 
147
+ /**
148
+ * Enhanced Syntax Highlighter component with "Copy to Clipboard" functionality.
149
+ *
150
+ * @description
151
+ * Uses `react-syntax-highlighter` with a custom "Elegant" theme inspired by Xertica's
152
+ * design tokens. It includes a fallback mechanism for the Clipboard API and
153
+ * optionally displays a header with the filename and language.
154
+ *
155
+ * @ai-rules
156
+ * 1. Theme: Uses a custom `elegantTheme` that maps to system CSS variables. Avoid overriding these colors manually.
157
+ * 2. Clipboard: The copy functionality is robust with multiple fallback methods.
158
+ * 3. Content: Ensure `code` is passed as a raw string without pre-formatting indentation if possible.
159
+ */
140
160
  export const CodeBlock = ({
141
161
  code,
142
162
  language = 'tsx',