xertica-ui 1.9.0 → 1.9.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/README.md +184 -184
- package/components/assistant/modern-chat-input/modern-chat-input.mdx +71 -71
- package/components/assistant/modern-chat-input/modern-chat-input.stories.tsx +131 -131
- package/components/assistant/xertica-assistant/xertica-assistant.mdx +66 -66
- package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +201 -201
- package/components/examples/SidebarLogoExample.tsx +1 -1
- package/components/layout/header/header.mdx +117 -117
- package/components/layout/header/header.stories.tsx +165 -165
- package/components/layout/sidebar/sidebar.tsx +24 -7
- package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +1 -1
- package/components/pages/forgot-password-page/forgot-password-page.test.tsx +1 -1
- package/components/pages/home-content/HomeContent.tsx +10 -5
- package/components/pages/home-page/HomePage.tsx +12 -3
- package/components/pages/home-page/home-page.test.tsx +1 -1
- package/components/pages/login-page/LoginPage.tsx +1 -1
- package/components/pages/login-page/login-page.test.tsx +1 -1
- package/components/pages/reset-password-page/ResetPasswordPage.tsx +1 -1
- package/components/pages/template-content/TemplateContent.tsx +10 -27
- package/components/pages/template-page/TemplatePage.tsx +12 -3
- package/components/pages/template-page/template-page.test.tsx +1 -1
- package/components/pages/verify-email-page/VerifyEmailPage.tsx +1 -1
- package/components/ui/checkbox/checkbox.stories.tsx +83 -83
- package/components/ui/input/input.stories.tsx +108 -108
- package/components/ui/input-otp/input-otp.stories.tsx +120 -120
- package/components/ui/input-otp/input-otp.test.tsx +79 -79
- package/components/ui/label/label.stories.tsx +73 -73
- package/components/ui/label/label.test.tsx +1 -1
- package/components/ui/radio-group/radio-group.stories.tsx +105 -105
- package/components/ui/radio-group/radio-group.test.tsx +78 -78
- package/components/ui/search/search.stories.tsx +107 -107
- package/components/ui/select/select.stories.tsx +148 -148
- package/components/ui/select/select.test.tsx +1 -1
- package/components/ui/switch/switch.stories.tsx +67 -67
- package/components/ui/switch/switch.test.tsx +1 -1
- package/components/ui/textarea/textarea.stories.tsx +66 -66
- package/components/ui/textarea/textarea.test.tsx +41 -41
- package/dist/components/layout/sidebar/sidebar.d.ts +6 -2
- package/dist/components/pages/home-content/HomeContent.d.ts +8 -1
- package/dist/components/pages/template-content/TemplateContent.d.ts +8 -1
- package/dist/index.es.js +44 -2043
- package/dist/index.umd.js +47 -2047
- package/docs/components/header.md +214 -214
- package/docs/form-sizing.md +154 -154
- package/docs/installation.md +1 -1
- package/guidelines/Guidelines.md +2 -2
- package/package.json +1 -1
- package/styles/xertica/theme-map.css +91 -91
- package/templates/package.json +2 -2
- package/templates/src/app/App.d.ts +1 -0
- package/templates/src/app/App.js +70 -0
- package/templates/src/app/pages/CrudTemplate.d.ts +1 -0
- package/templates/src/app/pages/CrudTemplate.js +6 -0
- package/templates/src/app/pages/DashboardTemplate.d.ts +1 -0
- package/templates/src/app/pages/DashboardTemplate.js +9 -0
- package/templates/src/app/pages/ForgotPassword/ForgotPasswordContent.d.ts +1 -0
- package/templates/src/app/pages/ForgotPassword/ForgotPasswordContent.js +21 -0
- package/templates/src/app/pages/ForgotPasswordPage.d.ts +1 -0
- package/templates/src/app/pages/ForgotPasswordPage.js +5 -0
- package/templates/src/app/pages/FormTemplate.d.ts +1 -0
- package/templates/src/app/pages/FormTemplate.js +23 -0
- package/templates/src/app/pages/Home/HomeContent.d.ts +1 -0
- package/templates/src/app/pages/Home/HomeContent.js +24 -0
- package/templates/src/app/pages/HomePage.d.ts +8 -0
- package/templates/src/app/pages/HomePage.js +24 -0
- package/templates/src/app/pages/Login/LoginContent.d.ts +5 -0
- package/templates/src/app/pages/Login/LoginContent.js +28 -0
- package/templates/src/app/pages/LoginPage.d.ts +5 -0
- package/templates/src/app/pages/LoginPage.js +5 -0
- package/templates/src/app/pages/LoginTemplate.d.ts +1 -0
- package/templates/src/app/pages/LoginTemplate.js +6 -0
- package/templates/src/app/pages/ResetPassword/ResetPasswordContent.d.ts +1 -0
- package/templates/src/app/pages/ResetPassword/ResetPasswordContent.js +73 -0
- package/templates/src/app/pages/ResetPasswordPage.d.ts +1 -0
- package/templates/src/app/pages/ResetPasswordPage.js +5 -0
- package/templates/src/app/pages/Template/TemplateContent.d.ts +1 -0
- package/templates/src/app/pages/Template/TemplateContent.js +75 -0
- package/templates/src/app/pages/TemplatePage.d.ts +8 -0
- package/templates/src/app/pages/TemplatePage.js +11 -0
- package/templates/src/app/pages/VerifyEmail/VerifyEmailContent.d.ts +1 -0
- package/templates/src/app/pages/VerifyEmail/VerifyEmailContent.js +24 -0
- package/templates/src/app/pages/VerifyEmailPage.d.ts +1 -0
- package/templates/src/app/pages/VerifyEmailPage.js +5 -0
- package/templates/src/app/routes.d.ts +10 -0
- package/templates/src/app/routes.js +22 -0
- package/templates/src/main.d.ts +1 -0
- package/templates/src/main.js +6 -0
- package/templates/tsconfig.json +16 -6
- package/templates/tsconfig.node.json +1 -1
- package/templates/tsconfig.node.tsbuildinfo +1 -1
- package/templates/tsconfig.tsbuildinfo +1 -1
- package/templates/vite.config.d.ts +2 -0
- package/templates/vite.config.js +6 -0
- package/utils/demo-responses.test.ts +2 -2
- package/utils/demo-responses.ts +1 -1
- package/dist/AssistantChart-BkwfdilF.js +0 -22
- package/dist/AssistantChart-G8I1Kfu4.js +0 -22
- package/dist/components/AssistenteXertica.d.ts +0 -17
- package/dist/components/AudioPlayer.d.ts +0 -35
- package/dist/components/CodeBlock.d.ts +0 -28
- package/dist/components/DocumentEditor.d.ts +0 -26
- package/dist/components/ForgotPasswordPage.d.ts +0 -13
- package/dist/components/FormattedDocument.d.ts +0 -25
- package/dist/components/Header.d.ts +0 -72
- package/dist/components/HomeContent.d.ts +0 -20
- package/dist/components/HomePage.d.ts +0 -26
- package/dist/components/LanguageSelector.d.ts +0 -26
- package/dist/components/LoginPage.d.ts +0 -25
- package/dist/components/MarkdownMessage.d.ts +0 -24
- package/dist/components/ModernChatInput.d.ts +0 -44
- package/dist/components/PodcastPlayer.d.ts +0 -41
- package/dist/components/ResetPasswordPage.d.ts +0 -14
- package/dist/components/Sidebar.d.ts +0 -126
- package/dist/components/TemplateContent.d.ts +0 -19
- package/dist/components/TemplatePage.d.ts +0 -24
- package/dist/components/ThemeToggle.d.ts +0 -26
- package/dist/components/VerifyEmailPage.d.ts +0 -14
- package/dist/components/XerticaLogo.d.ts +0 -24
- package/dist/components/XerticaOrbe.d.ts +0 -23
- package/dist/components/XerticaProvider.d.ts +0 -35
- package/dist/components/XerticaXLogo.d.ts +0 -23
- package/dist/components/assistant-utils.d.ts +0 -21
- package/dist/components/layout-constants.d.ts +0 -8
- package/dist/components/media/AudioPlayer.d.ts +0 -9
- package/dist/components/media/VideoPlayer.d.ts +0 -8
- package/dist/components/ui/AssistantChart.d.ts +0 -7
- package/dist/components/ui/accordion.d.ts +0 -20
- package/dist/components/ui/alert-dialog.d.ts +0 -26
- package/dist/components/ui/alert.d.ts +0 -25
- package/dist/components/ui/aspect-ratio.d.ts +0 -14
- package/dist/components/ui/avatar.d.ts +0 -20
- package/dist/components/ui/badge.d.ts +0 -22
- package/dist/components/ui/breadcrumb.d.ts +0 -23
- package/dist/components/ui/button.d.ts +0 -37
- package/dist/components/ui/calendar.d.ts +0 -20
- package/dist/components/ui/card.d.ts +0 -21
- package/dist/components/ui/carousel.d.ts +0 -31
- package/dist/components/ui/chart.d.ts +0 -55
- package/dist/components/ui/checkbox.d.ts +0 -16
- package/dist/components/ui/collapsible.d.ts +0 -16
- package/dist/components/ui/command.d.ts +0 -29
- package/dist/components/ui/context-menu.d.ts +0 -37
- package/dist/components/ui/dialog.d.ts +0 -33
- package/dist/components/ui/drawer.d.ts +0 -26
- package/dist/components/ui/dropdown-menu.d.ts +0 -37
- package/dist/components/ui/empty.d.ts +0 -22
- package/dist/components/ui/file-upload.d.ts +0 -24
- package/dist/components/ui/form.d.ts +0 -37
- package/dist/components/ui/google-maps-loader.d.ts +0 -33
- package/dist/components/ui/hover-card.d.ts +0 -18
- package/dist/components/ui/input-otp.d.ts +0 -23
- package/dist/components/ui/input.d.ts +0 -25
- package/dist/components/ui/label.d.ts +0 -15
- package/dist/components/ui/map-config.d.ts +0 -12
- package/dist/components/ui/map-layers.d.ts +0 -48
- package/dist/components/ui/map.d.ts +0 -82
- package/dist/components/ui/map.exports.d.ts +0 -25
- package/dist/components/ui/menubar.d.ts +0 -39
- package/dist/components/ui/navigation-menu.d.ts +0 -26
- package/dist/components/ui/notification-badge.d.ts +0 -24
- package/dist/components/ui/page-header.d.ts +0 -76
- package/dist/components/ui/pagination.d.ts +0 -25
- package/dist/components/ui/popover.d.ts +0 -19
- package/dist/components/ui/progress.d.ts +0 -15
- package/dist/components/ui/radio-group.d.ts +0 -17
- package/dist/components/ui/rating.d.ts +0 -24
- package/dist/components/ui/resizable.d.ts +0 -39
- package/dist/components/ui/route-map.d.ts +0 -41
- package/dist/components/ui/scroll-area.d.ts +0 -16
- package/dist/components/ui/search.d.ts +0 -20
- package/dist/components/ui/select.d.ts +0 -27
- package/dist/components/ui/separator.d.ts +0 -15
- package/dist/components/ui/sheet.d.ts +0 -26
- package/dist/components/ui/sidebar.d.ts +0 -69
- package/dist/components/ui/simple-map.d.ts +0 -57
- package/dist/components/ui/skeleton.d.ts +0 -14
- package/dist/components/ui/slider.d.ts +0 -16
- package/dist/components/ui/sonner.d.ts +0 -15
- package/dist/components/ui/stats-card.d.ts +0 -29
- package/dist/components/ui/stepper.d.ts +0 -31
- package/dist/components/ui/switch.d.ts +0 -15
- package/dist/components/ui/table.d.ts +0 -22
- package/dist/components/ui/tabs.d.ts +0 -19
- package/dist/components/ui/textarea.d.ts +0 -15
- package/dist/components/ui/timeline.d.ts +0 -24
- package/dist/components/ui/toggle-group.d.ts +0 -24
- package/dist/components/ui/toggle.d.ts +0 -23
- package/dist/components/ui/tooltip.d.ts +0 -19
- package/dist/components/ui/tree-view.d.ts +0 -28
- package/dist/components/ui/use-mobile.d.ts +0 -2
- package/dist/components/ui/utils.d.ts +0 -2
- package/dist/components/ui/xertica-assistant.d.ts +0 -241
- package/dist/contexts/ApiKeyContext.d.ts +0 -15
- package/dist/contexts/BrandColorsContext.d.ts +0 -19
- package/dist/contexts/LanguageContext.d.ts +0 -11
- package/dist/contexts/ThemeContext.d.ts +0 -16
- package/dist/contexts/index.d.ts +0 -7
- package/dist/contexts/theme-data.d.ts +0 -81
- package/dist/index-D6V_7QbH.js +0 -99663
- package/dist/index-DHlP-IBS.js +0 -99663
- package/dist/utils/demo-responses.d.ts +0 -2
- package/dist/utils/gemini.d.ts +0 -8
package/README.md
CHANGED
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
# Xertica UI
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
|
-
[](./LICENSE)
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 🤖 AI-First Single Source of Truth
|
|
11
|
-
|
|
12
|
-
Xertica UI is specifically designed to be consumed by AI Agents (LLMs, code assistants, autonomous agents). We provide dedicated entry points for AI context:
|
|
13
|
-
|
|
14
|
-
| File | Purpose |
|
|
15
|
-
|---|---|
|
|
16
|
-
| [`llms.txt`](./llms.txt) | Standard index for AI crawlers and context-aware agents. |
|
|
17
|
-
| [`llms-full.txt`](./llms-full.txt) | **Complete documentation** of all 96 components in a single file for large-context LLMs. |
|
|
18
|
-
| `docs/llms.md` | Master index for agents to navigate the documentation folder. |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 🚀 Quick Start — CLI (Recommended)
|
|
23
|
-
|
|
24
|
-
Scaffold a full application with pre-configured routing, layout, and components:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npx xertica-ui@latest init my-app
|
|
28
|
-
cd my-app
|
|
29
|
-
npm run dev
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
The CLI scaffolds a complete Vite + React + TypeScript project with Portuguese UI localization and English AI-ready documentation.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## 📦 Installation as a Library
|
|
37
|
-
|
|
38
|
-
To add Xertica UI to an existing React project:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install xertica-ui
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**1. Import the stylesheet** in your entry file (`main.tsx` or `App.tsx`):
|
|
45
|
-
|
|
46
|
-
```tsx
|
|
47
|
-
import 'xertica-ui/style.css';
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**2. Wrap your app** with `XerticaProvider`:
|
|
51
|
-
|
|
52
|
-
```tsx
|
|
53
|
-
import { XerticaProvider } from 'xertica-ui';
|
|
54
|
-
|
|
55
|
-
function App() {
|
|
56
|
-
return (
|
|
57
|
-
<XerticaProvider>
|
|
58
|
-
<YourApp />
|
|
59
|
-
</XerticaProvider>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 🛠️ The Layout System
|
|
67
|
-
|
|
68
|
-
Xertica UI features an autonomous layout system managed by `LayoutContext`.
|
|
69
|
-
|
|
70
|
-
### Mandatory Page Structure
|
|
71
|
-
Every page **must** use the `<PageHeader>` component for its title and primary actions. Never use raw `h1` or `div` for headers.
|
|
72
|
-
|
|
73
|
-
```tsx
|
|
74
|
-
import { PageHeader, PageHeaderHeading, Button } from 'xertica-ui';
|
|
75
|
-
|
|
76
|
-
export function MyPage() {
|
|
77
|
-
return (
|
|
78
|
-
<>
|
|
79
|
-
<PageHeader>
|
|
80
|
-
<PageHeaderHeading>Dashboard</PageHeaderHeading>
|
|
81
|
-
<Button>Action</Button>
|
|
82
|
-
</PageHeader>
|
|
83
|
-
<div className="p-6">
|
|
84
|
-
{/* Page Content */}
|
|
85
|
-
</div>
|
|
86
|
-
</>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### `useLayout()` Hook
|
|
92
|
-
Access the sidebar state, width, and toggle functions anywhere in the component tree:
|
|
93
|
-
```tsx
|
|
94
|
-
const { sidebarWidth, isSidebarOpen, toggleSidebar } = useLayout();
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## 🧩 Component Catalog (96 Components)
|
|
100
|
-
|
|
101
|
-
### Layout & Navigation
|
|
102
|
-
`Header` · `Sidebar` · `PageHeader` · `Breadcrumb` · `NavigationMenu` · `Tabs` · `Pagination` · `Accordion` · `Collapsible`
|
|
103
|
-
|
|
104
|
-
### Core Surfaces
|
|
105
|
-
`Card` · `Separator` · `ScrollArea` · `AspectRatio` · `Resizable` · `Skeleton` · `Empty`
|
|
106
|
-
|
|
107
|
-
### Forms & Inputs
|
|
108
|
-
`Form` · `Input` · `Textarea` · `RichTextEditor` · `Label` · `Checkbox` · `RadioGroup` · `Switch` · `Select` · `Slider` · `Calendar` · `InputOTP` · `FileUpload` · `Search`
|
|
109
|
-
|
|
110
|
-
### Actions & Data
|
|
111
|
-
`Button` · `Toggle` · `ToggleGroup` · `Rating` · `Table` · `Badge` · `Avatar` · `Progress` · `StatsCard` · `Timeline` · `Stepper` · `TreeView` · `NotificationBadge` · `Chart`
|
|
112
|
-
|
|
113
|
-
### Overlays & Feedback
|
|
114
|
-
`Dialog` · `AlertDialog` · `Sheet` · `Drawer` · `Popover` · `HoverCard` · `Tooltip` · `Alert` · `Sonner (Toast)` · `Command`
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## 🌟 Specialized Modules
|
|
119
|
-
|
|
120
|
-
### 🤖 AI Assistant
|
|
121
|
-
Integrated AI chat panel with workspace support.
|
|
122
|
-
- `XerticaAssistant` · `MarkdownMessage` · `CodeBlock` · `AssistantChart`
|
|
123
|
-
|
|
124
|
-
### 🗺️ Maps & Geolocation
|
|
125
|
-
First-class Google Maps integration.
|
|
126
|
-
- `Map` · `RouteMap` · `SimpleMap` · `GoogleMapsLoader`
|
|
127
|
-
|
|
128
|
-
### 🎙️ Media
|
|
129
|
-
- `AudioPlayer` · `VideoPlayer` · `FloatingMediaWrapper`
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## 🎨 Design Tokens
|
|
134
|
-
|
|
135
|
-
Xertica UI uses semantic CSS tokens. **Never use raw colors or generic Tailwind color classes**:
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
Background: bg-background text-foreground
|
|
139
|
-
Card surface: bg-card text-card-foreground
|
|
140
|
-
Muted area: bg-muted text-muted-foreground
|
|
141
|
-
Primary action: bg-primary text-primary-foreground
|
|
142
|
-
Destructive: bg-destructive text-destructive-foreground
|
|
143
|
-
Border: border-border
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## 🌍 Localization
|
|
149
|
-
|
|
150
|
-
- **UI Components**: Fully localized in **Portuguese (pt-BR)** for end-users.
|
|
151
|
-
- **Documentation/Code**: Strictly maintained in **English** for AI Agent compatibility and global developer standard.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## 💻 Tech Stack
|
|
156
|
-
|
|
157
|
-
| Technology | Version |
|
|
158
|
-
|---|---|
|
|
159
|
-
| React | 18.3 |
|
|
160
|
-
| TypeScript | 5.7 |
|
|
161
|
-
| Tailwind CSS | 4.0 |
|
|
162
|
-
| Vite | 6.0 |
|
|
163
|
-
| Radix UI | Latest |
|
|
164
|
-
| Lucide React | 0.469+ |
|
|
165
|
-
| Vitest | 4.1 |
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## 📜 Scripts
|
|
170
|
-
|
|
171
|
-
| Command | Description |
|
|
172
|
-
|---|---|
|
|
173
|
-
| `npm run dev` | Start development server |
|
|
174
|
-
| `npm run build` | Production bundle |
|
|
175
|
-
| `npm run storybook` | Launch component library documentation |
|
|
176
|
-
| `npm run test` | Run unit tests via Vitest |
|
|
177
|
-
| `npm run type-check` | TypeScript validation |
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## ⚖️ License
|
|
182
|
-
|
|
183
|
-
Proprietary — Xertica AI Team.
|
|
184
|
-
|
|
1
|
+
# Xertica UI
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🤖 AI-First Single Source of Truth
|
|
11
|
+
|
|
12
|
+
Xertica UI is specifically designed to be consumed by AI Agents (LLMs, code assistants, autonomous agents). We provide dedicated entry points for AI context:
|
|
13
|
+
|
|
14
|
+
| File | Purpose |
|
|
15
|
+
|---|---|
|
|
16
|
+
| [`llms.txt`](./llms.txt) | Standard index for AI crawlers and context-aware agents. |
|
|
17
|
+
| [`llms-full.txt`](./llms-full.txt) | **Complete documentation** of all 96 components in a single file for large-context LLMs. |
|
|
18
|
+
| `docs/llms.md` | Master index for agents to navigate the documentation folder. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🚀 Quick Start — CLI (Recommended)
|
|
23
|
+
|
|
24
|
+
Scaffold a full application with pre-configured routing, layout, and components:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx xertica-ui@latest init my-app
|
|
28
|
+
cd my-app
|
|
29
|
+
npm run dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The CLI scaffolds a complete Vite + React + TypeScript project with Portuguese UI localization and English AI-ready documentation.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📦 Installation as a Library
|
|
37
|
+
|
|
38
|
+
To add Xertica UI to an existing React project:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install xertica-ui
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**1. Import the stylesheet** in your entry file (`main.tsx` or `App.tsx`):
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import 'xertica-ui/style.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**2. Wrap your app** with `XerticaProvider`:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { XerticaProvider } from 'xertica-ui';
|
|
54
|
+
|
|
55
|
+
function App() {
|
|
56
|
+
return (
|
|
57
|
+
<XerticaProvider>
|
|
58
|
+
<YourApp />
|
|
59
|
+
</XerticaProvider>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🛠️ The Layout System
|
|
67
|
+
|
|
68
|
+
Xertica UI features an autonomous layout system managed by `LayoutContext`.
|
|
69
|
+
|
|
70
|
+
### Mandatory Page Structure
|
|
71
|
+
Every page **must** use the `<PageHeader>` component for its title and primary actions. Never use raw `h1` or `div` for headers.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { PageHeader, PageHeaderHeading, Button } from 'xertica-ui';
|
|
75
|
+
|
|
76
|
+
export function MyPage() {
|
|
77
|
+
return (
|
|
78
|
+
<>
|
|
79
|
+
<PageHeader>
|
|
80
|
+
<PageHeaderHeading>Dashboard</PageHeaderHeading>
|
|
81
|
+
<Button>Action</Button>
|
|
82
|
+
</PageHeader>
|
|
83
|
+
<div className="p-6">
|
|
84
|
+
{/* Page Content */}
|
|
85
|
+
</div>
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### `useLayout()` Hook
|
|
92
|
+
Access the sidebar state, width, and toggle functions anywhere in the component tree:
|
|
93
|
+
```tsx
|
|
94
|
+
const { sidebarWidth, isSidebarOpen, toggleSidebar } = useLayout();
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 🧩 Component Catalog (96 Components)
|
|
100
|
+
|
|
101
|
+
### Layout & Navigation
|
|
102
|
+
`Header` · `Sidebar` · `PageHeader` · `Breadcrumb` · `NavigationMenu` · `Tabs` · `Pagination` · `Accordion` · `Collapsible`
|
|
103
|
+
|
|
104
|
+
### Core Surfaces
|
|
105
|
+
`Card` · `Separator` · `ScrollArea` · `AspectRatio` · `Resizable` · `Skeleton` · `Empty`
|
|
106
|
+
|
|
107
|
+
### Forms & Inputs
|
|
108
|
+
`Form` · `Input` · `Textarea` · `RichTextEditor` · `Label` · `Checkbox` · `RadioGroup` · `Switch` · `Select` · `Slider` · `Calendar` · `InputOTP` · `FileUpload` · `Search`
|
|
109
|
+
|
|
110
|
+
### Actions & Data
|
|
111
|
+
`Button` · `Toggle` · `ToggleGroup` · `Rating` · `Table` · `Badge` · `Avatar` · `Progress` · `StatsCard` · `Timeline` · `Stepper` · `TreeView` · `NotificationBadge` · `Chart`
|
|
112
|
+
|
|
113
|
+
### Overlays & Feedback
|
|
114
|
+
`Dialog` · `AlertDialog` · `Sheet` · `Drawer` · `Popover` · `HoverCard` · `Tooltip` · `Alert` · `Sonner (Toast)` · `Command`
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 🌟 Specialized Modules
|
|
119
|
+
|
|
120
|
+
### 🤖 AI Assistant
|
|
121
|
+
Integrated AI chat panel with workspace support.
|
|
122
|
+
- `XerticaAssistant` · `MarkdownMessage` · `CodeBlock` · `AssistantChart`
|
|
123
|
+
|
|
124
|
+
### 🗺️ Maps & Geolocation
|
|
125
|
+
First-class Google Maps integration.
|
|
126
|
+
- `Map` · `RouteMap` · `SimpleMap` · `GoogleMapsLoader`
|
|
127
|
+
|
|
128
|
+
### 🎙️ Media
|
|
129
|
+
- `AudioPlayer` · `VideoPlayer` · `FloatingMediaWrapper`
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 🎨 Design Tokens
|
|
134
|
+
|
|
135
|
+
Xertica UI uses semantic CSS tokens. **Never use raw colors or generic Tailwind color classes**:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Background: bg-background text-foreground
|
|
139
|
+
Card surface: bg-card text-card-foreground
|
|
140
|
+
Muted area: bg-muted text-muted-foreground
|
|
141
|
+
Primary action: bg-primary text-primary-foreground
|
|
142
|
+
Destructive: bg-destructive text-destructive-foreground
|
|
143
|
+
Border: border-border
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🌍 Localization
|
|
149
|
+
|
|
150
|
+
- **UI Components**: Fully localized in **Portuguese (pt-BR)** for end-users.
|
|
151
|
+
- **Documentation/Code**: Strictly maintained in **English** for AI Agent compatibility and global developer standard.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 💻 Tech Stack
|
|
156
|
+
|
|
157
|
+
| Technology | Version |
|
|
158
|
+
|---|---|
|
|
159
|
+
| React | 18.3 |
|
|
160
|
+
| TypeScript | 5.7 |
|
|
161
|
+
| Tailwind CSS | 4.0 |
|
|
162
|
+
| Vite | 6.0 |
|
|
163
|
+
| Radix UI | Latest |
|
|
164
|
+
| Lucide React | 0.469+ |
|
|
165
|
+
| Vitest | 4.1 |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 📜 Scripts
|
|
170
|
+
|
|
171
|
+
| Command | Description |
|
|
172
|
+
|---|---|
|
|
173
|
+
| `npm run dev` | Start development server |
|
|
174
|
+
| `npm run build` | Production bundle |
|
|
175
|
+
| `npm run storybook` | Launch component library documentation |
|
|
176
|
+
| `npm run test` | Run unit tests via Vitest |
|
|
177
|
+
| `npm run type-check` | TypeScript validation |
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## ⚖️ License
|
|
182
|
+
|
|
183
|
+
Proprietary — Xertica AI Team.
|
|
184
|
+
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import * as ModernChatInputStories from './modern-chat-input.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ModernChatInputStories} />
|
|
5
|
-
|
|
6
|
-
<Title />
|
|
7
|
-
<Subtitle>An advanced, high-performance chat input for the Xertica Assistant.</Subtitle>
|
|
8
|
-
|
|
9
|
-
<Description />
|
|
10
|
-
|
|
11
|
-
<Primary />
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Usage Patterns
|
|
16
|
-
|
|
17
|
-
### Standard Floating Input
|
|
18
|
-
Optimized for chat interfaces with multi-line support, voice recording, and action chips.
|
|
19
|
-
|
|
20
|
-
<Canvas>
|
|
21
|
-
<ModernChatInputStories.Default />
|
|
22
|
-
</Canvas>
|
|
23
|
-
|
|
24
|
-
### Full-Page Variant
|
|
25
|
-
Adjusts maximum width and alignment for use in standalone chat pages.
|
|
26
|
-
|
|
27
|
-
<Canvas>
|
|
28
|
-
<ModernChatInputStories.FullPage />
|
|
29
|
-
</Canvas>
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Feature Flags
|
|
34
|
-
|
|
35
|
-
Each input capability can be individually toggled via boolean props.
|
|
36
|
-
All flags default to `true` for full backward compatibility.
|
|
37
|
-
|
|
38
|
-
| Prop | Controls | Default |
|
|
39
|
-
|---|---|---|
|
|
40
|
-
| `enableAudioInput` | Voice recording button | `true` |
|
|
41
|
-
| `enableFileAttachment` | File attachment (paperclip) button | `true` |
|
|
42
|
-
| `enableDocumentCreation` | "Create document" menu item | `true` |
|
|
43
|
-
| `enablePodcastGeneration` | "Generate podcast" menu item | `true` |
|
|
44
|
-
| `enableSearch` | "Search" menu item | `true` |
|
|
45
|
-
|
|
46
|
-
> [!NOTE]
|
|
47
|
-
> When all three action types (`enableDocumentCreation`, `enablePodcastGeneration`, `enableSearch`) are set to `false`, the "+" menu button is completely hidden.
|
|
48
|
-
|
|
49
|
-
### Text Only
|
|
50
|
-
All action buttons disabled — only the text input and send button remain.
|
|
51
|
-
|
|
52
|
-
<Canvas>
|
|
53
|
-
<ModernChatInputStories.TextOnly />
|
|
54
|
-
</Canvas>
|
|
55
|
-
|
|
56
|
-
### Selective Actions
|
|
57
|
-
Only document creation and search are enabled for a focused workflow.
|
|
58
|
-
|
|
59
|
-
<Canvas>
|
|
60
|
-
<ModernChatInputStories.SelectiveActions />
|
|
61
|
-
</Canvas>
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## AI Best Practices
|
|
66
|
-
|
|
67
|
-
> [!IMPORTANT]
|
|
68
|
-
> - **Action Workflow** — Handle the `onSubmit` callback's optional `action` parameter to distinguish between standard text messages and intent-driven generations (Documents, Podcasts, Search).
|
|
69
|
-
> - **State Sync** — Always maintain the `value` in a parent state and update it via `onChange` and `onVoiceRecording` to ensure consistent data binding.
|
|
70
|
-
> - **Dynamic Sizing** — The input automatically expands up to 100px based on content; ensure the parent container can accommodate these height changes without layout shift.
|
|
71
|
-
> - **Feature Flags** — Pass flags like `enableSearch={false}` or `enableAudioInput={false}` to tailor input capabilities per use-case. Flags are independent and can be combined freely.
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as ModernChatInputStories from './modern-chat-input.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={ModernChatInputStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
<Subtitle>An advanced, high-performance chat input for the Xertica Assistant.</Subtitle>
|
|
8
|
+
|
|
9
|
+
<Description />
|
|
10
|
+
|
|
11
|
+
<Primary />
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Usage Patterns
|
|
16
|
+
|
|
17
|
+
### Standard Floating Input
|
|
18
|
+
Optimized for chat interfaces with multi-line support, voice recording, and action chips.
|
|
19
|
+
|
|
20
|
+
<Canvas>
|
|
21
|
+
<ModernChatInputStories.Default />
|
|
22
|
+
</Canvas>
|
|
23
|
+
|
|
24
|
+
### Full-Page Variant
|
|
25
|
+
Adjusts maximum width and alignment for use in standalone chat pages.
|
|
26
|
+
|
|
27
|
+
<Canvas>
|
|
28
|
+
<ModernChatInputStories.FullPage />
|
|
29
|
+
</Canvas>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Feature Flags
|
|
34
|
+
|
|
35
|
+
Each input capability can be individually toggled via boolean props.
|
|
36
|
+
All flags default to `true` for full backward compatibility.
|
|
37
|
+
|
|
38
|
+
| Prop | Controls | Default |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| `enableAudioInput` | Voice recording button | `true` |
|
|
41
|
+
| `enableFileAttachment` | File attachment (paperclip) button | `true` |
|
|
42
|
+
| `enableDocumentCreation` | "Create document" menu item | `true` |
|
|
43
|
+
| `enablePodcastGeneration` | "Generate podcast" menu item | `true` |
|
|
44
|
+
| `enableSearch` | "Search" menu item | `true` |
|
|
45
|
+
|
|
46
|
+
> [!NOTE]
|
|
47
|
+
> When all three action types (`enableDocumentCreation`, `enablePodcastGeneration`, `enableSearch`) are set to `false`, the "+" menu button is completely hidden.
|
|
48
|
+
|
|
49
|
+
### Text Only
|
|
50
|
+
All action buttons disabled — only the text input and send button remain.
|
|
51
|
+
|
|
52
|
+
<Canvas>
|
|
53
|
+
<ModernChatInputStories.TextOnly />
|
|
54
|
+
</Canvas>
|
|
55
|
+
|
|
56
|
+
### Selective Actions
|
|
57
|
+
Only document creation and search are enabled for a focused workflow.
|
|
58
|
+
|
|
59
|
+
<Canvas>
|
|
60
|
+
<ModernChatInputStories.SelectiveActions />
|
|
61
|
+
</Canvas>
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## AI Best Practices
|
|
66
|
+
|
|
67
|
+
> [!IMPORTANT]
|
|
68
|
+
> - **Action Workflow** — Handle the `onSubmit` callback's optional `action` parameter to distinguish between standard text messages and intent-driven generations (Documents, Podcasts, Search).
|
|
69
|
+
> - **State Sync** — Always maintain the `value` in a parent state and update it via `onChange` and `onVoiceRecording` to ensure consistent data binding.
|
|
70
|
+
> - **Dynamic Sizing** — The input automatically expands up to 100px based on content; ensure the parent container can accommodate these height changes without layout shift.
|
|
71
|
+
> - **Feature Flags** — Pass flags like `enableSearch={false}` or `enableAudioInput={false}` to tailor input capabilities per use-case. Flags are independent and can be combined freely.
|