xertica-ui 2.0.2 → 2.0.4
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 +8 -0
- package/README.md +1 -1
- package/bin/cli.ts +2 -1
- package/components/assistant/markdown-message/markdown-message.mdx +1 -1
- package/components/brand/language-selector/language-selector.mdx +1 -1
- package/components/brand/theme-toggle/theme-toggle.mdx +1 -1
- package/components/brand/xertica-logo/xertica-logo.mdx +1 -1
- package/components/brand/xertica-provider/xertica-provider.mdx +1 -1
- package/components/brand/xertica-xlogo/xertica-xlogo.mdx +1 -1
- package/components/index.ts +6 -0
- package/components/layout/header/header.mdx +1 -1
- package/components/layout/sidebar/sidebar.mdx +2 -1
- package/components/media/floating-media-wrapper.mdx +2 -2
- package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +2 -4
- package/components/pages/home-content/HomeContent.tsx +1 -1
- package/components/pages/home-content/home-content.mdx +1 -1
- package/components/pages/home-page/HomePage.stories.tsx +39 -0
- package/components/pages/home-page/HomePage.tsx +2 -3
- package/components/pages/home-page/home-page.mdx +56 -0
- package/components/pages/login-page/LoginPage.tsx +2 -5
- package/components/pages/reset-password-page/reset-password-page.mdx +6 -2
- package/components/pages/template-page/TemplatePage.stories.tsx +39 -0
- package/components/pages/template-page/TemplatePage.tsx +3 -1
- package/components/pages/template-page/template-page.mdx +54 -0
- package/components/pages/verify-email-page/VerifyEmailPage.tsx +2 -4
- package/components/ui/accordion/accordion.stories.tsx +27 -1
- package/components/ui/alert-dialog/alert-dialog.stories.tsx +30 -0
- package/components/ui/button/button.stories.tsx +23 -0
- package/components/ui/checkbox/checkbox.stories.tsx +20 -1
- package/components/ui/dialog/dialog.stories.tsx +30 -0
- package/components/ui/google-maps-loader/google-maps-loader.mdx +1 -1
- package/components/ui/input/input.stories.tsx +24 -0
- package/components/ui/switch/switch.stories.tsx +20 -1
- package/components/ui/tabs/tabs.stories.tsx +26 -1
- package/components.json +1507 -530
- package/dist/cli.js +3 -2
- package/dist/components/index.d.ts +6 -0
- package/dist/index.cjs.js +1233 -484
- package/dist/index.es.js +778 -28
- package/dist/ui.cjs.js +178 -178
- package/dist/ui.es.js +1 -1
- package/dist/use-mobile-CaENcqm-.js +4508 -0
- package/dist/use-mobile-DMOvImGQ.cjs +4542 -0
- package/dist/xertica-ui.css +1 -1
- package/docs/decision-tree.md +287 -0
- package/guidelines/Guidelines.md +250 -657
- package/llms-compact.txt +327 -0
- package/llms.txt +160 -71
- package/package.json +193 -192
- package/templates/CLAUDE.md +160 -0
- package/templates/guidelines/Guidelines.md +245 -99
- package/templates/package.json +3 -3
package/llms-compact.txt
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# Xertica UI — Compact Reference
|
|
2
|
+
|
|
3
|
+
> 97-component React design system. Tailwind CSS v4 + Radix UI + Lucide Icons.
|
|
4
|
+
> Full docs: llms-full.txt | Component index: llms.txt | Decision guide: docs/decision-tree.md
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## CRITICAL RULES
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
NEVER raw <button>/<input>/<select> → use <Button>/<Input>/<Select>
|
|
12
|
+
NEVER raw colors bg-blue-500 → use bg-primary, bg-muted, bg-destructive
|
|
13
|
+
NEVER hardcoded radius rounded-lg → use rounded-[var(--radius)]
|
|
14
|
+
NEVER <h1>/<h2> for page headers → use <PageHeader><PageHeaderHeading>
|
|
15
|
+
NEVER manage sidebar state locally → use useLayout() from xertica-ui/hooks
|
|
16
|
+
NEVER render <Toaster> manually → auto-injected by XerticaProvider
|
|
17
|
+
NEVER icons from xertica-ui → use lucide-react exclusively
|
|
18
|
+
ALWAYS wrap app in <XerticaProvider> → required for theme, toasts, tooltips
|
|
19
|
+
ALWAYS import style.css at root → import 'xertica-ui/style.css'
|
|
20
|
+
ALWAYS confirm destructive actions → pair with <AlertDialog> before executing
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## IMPORTS
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Button, Card, Input, Badge, Table,
|
|
29
|
+
Dialog, AlertDialog, Select, Checkbox,
|
|
30
|
+
Tabs, Sheet, Popover, Tooltip, Toast,
|
|
31
|
+
PageHeader, PageHeaderHeading,
|
|
32
|
+
Progress, Skeleton, Empty, ScrollArea,
|
|
33
|
+
Separator, Form, Label, Textarea } from 'xertica-ui/ui';
|
|
34
|
+
|
|
35
|
+
import { Sidebar, Header } from 'xertica-ui/layout';
|
|
36
|
+
import { XerticaProvider, XerticaLogo,
|
|
37
|
+
ThemeToggle, LanguageSelector } from 'xertica-ui/brand';
|
|
38
|
+
import { XerticaAssistant,
|
|
39
|
+
generateDemoResponse } from 'xertica-ui/assistant';
|
|
40
|
+
import { VideoPlayer, AudioPlayer } from 'xertica-ui/media';
|
|
41
|
+
import { useLayout, useTheme } from 'xertica-ui/hooks';
|
|
42
|
+
import 'xertica-ui/style.css'; // once, at root only
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## DESIGN TOKENS (always use these, never raw colors)
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
bg-background / text-foreground page bg + body text
|
|
51
|
+
bg-card / text-card-foreground card surface
|
|
52
|
+
bg-muted / text-muted-foreground subdued bg + secondary text
|
|
53
|
+
bg-primary / text-primary-foreground brand primary
|
|
54
|
+
bg-destructive danger/error
|
|
55
|
+
bg-accent / text-accent-foreground hover states
|
|
56
|
+
bg-success / bg-info / bg-warning semantic states
|
|
57
|
+
border-border standard borders
|
|
58
|
+
border-input form borders
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## APP STRUCTURE
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
// main.tsx
|
|
67
|
+
import { XerticaProvider } from 'xertica-ui/brand';
|
|
68
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
69
|
+
import 'xertica-ui/style.css';
|
|
70
|
+
|
|
71
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
72
|
+
<XerticaProvider>
|
|
73
|
+
<BrowserRouter><App /></BrowserRouter>
|
|
74
|
+
</XerticaProvider>
|
|
75
|
+
);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## PAGE STRUCTURE (every page must follow this)
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { PageHeader, PageHeaderHeading, Button } from 'xertica-ui/ui';
|
|
84
|
+
|
|
85
|
+
export function MyPage() {
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<PageHeader>
|
|
89
|
+
<PageHeaderHeading>Title</PageHeaderHeading>
|
|
90
|
+
<Button>Primary Action</Button>
|
|
91
|
+
</PageHeader>
|
|
92
|
+
<div className="p-6 space-y-6">{/* content */}</div>
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## LAYOUT SYSTEM
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { useLayout } from 'xertica-ui/hooks';
|
|
104
|
+
|
|
105
|
+
const { sidebarExpanded, sidebarWidth, toggleSidebar,
|
|
106
|
+
assistenteExpanded, toggleAssistente } = useLayout();
|
|
107
|
+
|
|
108
|
+
// Content container must offset for sidebar:
|
|
109
|
+
<div style={{ paddingLeft: sidebarExpanded ? `${sidebarWidth}px` : '80px' }}>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## MOST-USED COMPONENTS
|
|
115
|
+
|
|
116
|
+
### Button — 9 variants
|
|
117
|
+
```tsx
|
|
118
|
+
<Button variant="default">Save</Button>
|
|
119
|
+
<Button variant="destructive">Delete</Button> // always pair with AlertDialog
|
|
120
|
+
<Button variant="outline">Cancel</Button>
|
|
121
|
+
<Button variant="ghost" size="icon" aria-label="Settings"><Settings /></Button>
|
|
122
|
+
<Button asChild><Link to="/page">Go</Link></Button> // router navigation
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Card
|
|
126
|
+
```tsx
|
|
127
|
+
<Card>
|
|
128
|
+
<CardHeader><CardTitle>Title</CardTitle></CardHeader>
|
|
129
|
+
<CardContent>Content</CardContent>
|
|
130
|
+
<CardFooter><Button>Action</Button></CardFooter>
|
|
131
|
+
</Card>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Input + Label (form field)
|
|
135
|
+
```tsx
|
|
136
|
+
<div className="space-y-2">
|
|
137
|
+
<Label htmlFor="email">Email</Label>
|
|
138
|
+
<Input id="email" type="email" placeholder="you@company.com" />
|
|
139
|
+
</div>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Dialog
|
|
143
|
+
```tsx
|
|
144
|
+
<Dialog>
|
|
145
|
+
<DialogTrigger asChild><Button>Open</Button></DialogTrigger>
|
|
146
|
+
<DialogContent>
|
|
147
|
+
<DialogHeader><DialogTitle>Title</DialogTitle></DialogHeader>
|
|
148
|
+
<DialogBody>Content</DialogBody> {/* scrollable */}
|
|
149
|
+
<DialogFooter><Button type="submit">Save</Button></DialogFooter>
|
|
150
|
+
</DialogContent>
|
|
151
|
+
</Dialog>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### AlertDialog (destructive confirmation)
|
|
155
|
+
```tsx
|
|
156
|
+
<AlertDialog>
|
|
157
|
+
<AlertDialogTrigger asChild>
|
|
158
|
+
<Button variant="destructive">Delete</Button>
|
|
159
|
+
</AlertDialogTrigger>
|
|
160
|
+
<AlertDialogContent>
|
|
161
|
+
<AlertDialogHeader>
|
|
162
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
163
|
+
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
164
|
+
</AlertDialogHeader>
|
|
165
|
+
<AlertDialogFooter>
|
|
166
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
167
|
+
<AlertDialogAction onClick={handleDelete}>Delete</AlertDialogAction>
|
|
168
|
+
</AlertDialogFooter>
|
|
169
|
+
</AlertDialogContent>
|
|
170
|
+
</AlertDialog>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Table (CRUD list)
|
|
174
|
+
```tsx
|
|
175
|
+
<Table>
|
|
176
|
+
<TableHeader>
|
|
177
|
+
<TableRow><TableHead>Name</TableHead><TableHead>Status</TableHead></TableRow>
|
|
178
|
+
</TableHeader>
|
|
179
|
+
<TableBody>
|
|
180
|
+
{items.map(item => (
|
|
181
|
+
<TableRow key={item.id}>
|
|
182
|
+
<TableCell>{item.name}</TableCell>
|
|
183
|
+
<TableCell><Badge variant="success">{item.status}</Badge></TableCell>
|
|
184
|
+
</TableRow>
|
|
185
|
+
))}
|
|
186
|
+
</TableBody>
|
|
187
|
+
</Table>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Toast (via sonner)
|
|
191
|
+
```tsx
|
|
192
|
+
import { toast } from 'sonner';
|
|
193
|
+
|
|
194
|
+
toast.success('Saved!');
|
|
195
|
+
toast.error('Failed to save');
|
|
196
|
+
toast.info('Processing...');
|
|
197
|
+
// Never render <Toaster> — auto-injected by XerticaProvider
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Select
|
|
201
|
+
```tsx
|
|
202
|
+
<Select onValueChange={setValue}>
|
|
203
|
+
<SelectTrigger><SelectValue placeholder="Choose..." /></SelectTrigger>
|
|
204
|
+
<SelectContent>
|
|
205
|
+
<SelectItem value="a">Option A</SelectItem>
|
|
206
|
+
<SelectItem value="b">Option B</SelectItem>
|
|
207
|
+
</SelectContent>
|
|
208
|
+
</Select>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Sidebar
|
|
212
|
+
```tsx
|
|
213
|
+
import { Sidebar } from 'xertica-ui/layout';
|
|
214
|
+
import { useLayout } from 'xertica-ui/hooks';
|
|
215
|
+
import { useNavigate, useLocation } from 'react-router-dom';
|
|
216
|
+
|
|
217
|
+
function AppSidebar({ user, onLogout }) {
|
|
218
|
+
const { sidebarExpanded, sidebarWidth, toggleSidebar } = useLayout();
|
|
219
|
+
return (
|
|
220
|
+
<Sidebar
|
|
221
|
+
expanded={sidebarExpanded}
|
|
222
|
+
onToggle={toggleSidebar}
|
|
223
|
+
width={sidebarWidth}
|
|
224
|
+
navigate={useNavigate()}
|
|
225
|
+
location={useLocation()}
|
|
226
|
+
routes={[
|
|
227
|
+
{ path: '/home', label: 'Home', icon: Home },
|
|
228
|
+
{ path: '/settings', label: 'Settings', icon: Settings },
|
|
229
|
+
]}
|
|
230
|
+
user={user}
|
|
231
|
+
onLogout={onLogout}
|
|
232
|
+
/>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Header
|
|
238
|
+
```tsx
|
|
239
|
+
import { Header } from 'xertica-ui/layout';
|
|
240
|
+
|
|
241
|
+
<Header
|
|
242
|
+
breadcrumbs={[{ label: 'Home', href: '/home' }, { label: 'Settings' }]}
|
|
243
|
+
user={user}
|
|
244
|
+
onLogout={onLogout}
|
|
245
|
+
/>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Empty state
|
|
249
|
+
```tsx
|
|
250
|
+
<Empty>
|
|
251
|
+
<EmptyIcon><FileX className="size-12 text-muted-foreground" /></EmptyIcon>
|
|
252
|
+
<EmptyTitle>No results</EmptyTitle>
|
|
253
|
+
<EmptyDescription>Try adjusting your filters.</EmptyDescription>
|
|
254
|
+
<EmptyAction><Button>Clear filters</Button></EmptyAction>
|
|
255
|
+
</Empty>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### StatsCard (dashboard KPI)
|
|
259
|
+
```tsx
|
|
260
|
+
<StatsCard
|
|
261
|
+
title="Total Users"
|
|
262
|
+
value="12,430"
|
|
263
|
+
trend={8.2}
|
|
264
|
+
icon={<Users className="size-4" />}
|
|
265
|
+
/>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## QUICK COMPONENT SELECTION
|
|
271
|
+
|
|
272
|
+
| Need | Use |
|
|
273
|
+
|---|---|
|
|
274
|
+
| User must confirm before proceeding | `AlertDialog` |
|
|
275
|
+
| Form or detail view in overlay | `Dialog` |
|
|
276
|
+
| Wide form from the side | `Sheet` |
|
|
277
|
+
| Mobile overlay from bottom | `Drawer` |
|
|
278
|
+
| Anchored interactive panel | `Popover` |
|
|
279
|
+
| Short hover hint | `Tooltip` |
|
|
280
|
+
| Rich hover preview | `HoverCard` |
|
|
281
|
+
| Ephemeral message | `toast()` (sonner) |
|
|
282
|
+
| Persistent inline message | `Alert` |
|
|
283
|
+
| Loading state | `Skeleton` |
|
|
284
|
+
| No data | `Empty` |
|
|
285
|
+
| Multi-step flow | `Stepper` |
|
|
286
|
+
| Tab switching | `Tabs` |
|
|
287
|
+
| Collapsible FAQ/list | `Accordion` |
|
|
288
|
+
| Single expandable | `Collapsible` |
|
|
289
|
+
| Date input | `Calendar` + `Popover` |
|
|
290
|
+
| Numeric range | `Slider` |
|
|
291
|
+
| One of many options | `RadioGroup` or `Select` |
|
|
292
|
+
| On/off setting | `Switch` |
|
|
293
|
+
| Multi-select list | `Checkbox` group |
|
|
294
|
+
| Search/filter | `Search` or `Command` |
|
|
295
|
+
| Row actions | `DropdownMenu` |
|
|
296
|
+
| Right-click actions | `ContextMenu` |
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## FORM PATTERN (react-hook-form + zod)
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { useForm } from 'react-hook-form';
|
|
304
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
305
|
+
import { z } from 'zod';
|
|
306
|
+
import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from 'xertica-ui/ui';
|
|
307
|
+
|
|
308
|
+
const schema = z.object({ name: z.string().min(2) });
|
|
309
|
+
|
|
310
|
+
function MyForm() {
|
|
311
|
+
const form = useForm({ resolver: zodResolver(schema) });
|
|
312
|
+
return (
|
|
313
|
+
<Form {...form}>
|
|
314
|
+
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
|
315
|
+
<FormField control={form.control} name="name" render={({ field }) => (
|
|
316
|
+
<FormItem>
|
|
317
|
+
<FormLabel>Name</FormLabel>
|
|
318
|
+
<FormControl><Input {...field} /></FormControl>
|
|
319
|
+
<FormMessage />
|
|
320
|
+
</FormItem>
|
|
321
|
+
)} />
|
|
322
|
+
<Button type="submit">Submit</Button>
|
|
323
|
+
</form>
|
|
324
|
+
</Form>
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
```
|
package/llms.txt
CHANGED
|
@@ -1,71 +1,160 @@
|
|
|
1
|
-
# Xertica UI
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
# Xertica UI
|
|
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).
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
- [Getting Started](docs/getting-started.md): Provider setup, theming, routing integration, and subpath import patterns.
|
|
10
|
+
- [Installation](docs/installation.md): Peer dependencies, CSS import, and provider setup steps.
|
|
11
|
+
- [AI Usage Rules](docs/ai-usage.md): Mandatory rules for AI agents — what is permitted, what is forbidden.
|
|
12
|
+
- [Compact Reference](llms-full.txt): Complete documentation of all 97 components in a single file (large context LLMs).
|
|
13
|
+
- [Compact Quick-Reference](llms-compact.txt): ~4K token summary — import patterns, critical rules, most-used components.
|
|
14
|
+
- [Component Selection Guide](docs/decision-tree.md): Decision trees for Dialog vs Sheet, Tooltip vs HoverCard, etc.
|
|
15
|
+
|
|
16
|
+
## Critical Rules (read before generating any code)
|
|
17
|
+
|
|
18
|
+
1. **Never use raw HTML elements** — `<button>`, `<input>`, `<select>` → always use library components.
|
|
19
|
+
2. **Never use raw colors** — `bg-blue-500`, `#3b82f6` → always use semantic tokens (`bg-primary`, `bg-muted`).
|
|
20
|
+
3. **Never use hardcoded radii** — `rounded-lg` → always `rounded-[var(--radius)]`.
|
|
21
|
+
4. **Every page requires `<PageHeader>`** — never use `<h1>` or `<h2>` for page titles.
|
|
22
|
+
5. **Wrap the app in `<XerticaProvider>`** — required for theme, toasts, tooltips, and layout context.
|
|
23
|
+
6. **Import `xertica-ui/style.css` once** at the root entry file.
|
|
24
|
+
7. **Icons come from `lucide-react`** — never from `xertica-ui`.
|
|
25
|
+
8. **Layout state from `useLayout()`** — never hardcode sidebar widths.
|
|
26
|
+
9. **Destructive actions require `<AlertDialog>`** — never execute directly on click.
|
|
27
|
+
10. **`<Toaster>` is auto-injected** by `<XerticaProvider>` — never render it manually.
|
|
28
|
+
|
|
29
|
+
## Import Patterns
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Button, Card, Input, Badge, Table, Dialog } from 'xertica-ui/ui';
|
|
33
|
+
import { Sidebar, Header } from 'xertica-ui/layout';
|
|
34
|
+
import { XerticaProvider, XerticaLogo, ThemeToggle } from 'xertica-ui/brand';
|
|
35
|
+
import { XerticaAssistant, generateDemoResponse } from 'xertica-ui/assistant';
|
|
36
|
+
import { VideoPlayer, AudioPlayer } from 'xertica-ui/media';
|
|
37
|
+
import { useLayout, useTheme } from 'xertica-ui/hooks';
|
|
38
|
+
import 'xertica-ui/style.css';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Component Reference — UI Primitives (`xertica-ui/ui`)
|
|
42
|
+
|
|
43
|
+
- [Accordion](docs/components/accordion.md): Vertically stacked collapsible sections. Use for FAQs, settings panels, dense trees.
|
|
44
|
+
- [Alert](docs/components/alert.md): Inline persistent status banner. Use when the message must stay visible.
|
|
45
|
+
- [AlertDialog](docs/components/alert-dialog.md): Blocking confirmation modal. Required before any destructive action.
|
|
46
|
+
- [AspectRatio](docs/components/aspect-ratio.md): Fixed-ratio media container. Prevents layout shifts.
|
|
47
|
+
- [Avatar](docs/components/avatar.md): User identity — photo or initials fallback.
|
|
48
|
+
- [Badge](docs/components/badge.md): Compact non-interactive status label or count chip.
|
|
49
|
+
- [Breadcrumb](docs/components/breadcrumb.md): Hierarchical navigation trail. Rendered inside `Header`.
|
|
50
|
+
- [Button](docs/components/button.md): Primary interaction trigger. 9 variants: default, secondary, outline, ghost, destructive, link, success, info, warning.
|
|
51
|
+
- [Calendar](docs/components/calendar.md): Date picker. Almost always wrapped in `Popover`.
|
|
52
|
+
- [Card](docs/components/card.md): Primary content container. Never recreate with raw `<div>`.
|
|
53
|
+
- [Carousel](docs/components/carousel.md): Horizontal content slider. Built on embla-carousel.
|
|
54
|
+
- [Chart](docs/components/chart.md): Token-aware charts built on Recharts. Use `ChartContainer`.
|
|
55
|
+
- [Checkbox](docs/components/checkbox.md): Boolean toggle or multi-select option.
|
|
56
|
+
- [Collapsible](docs/components/collapsible.md): Single expandable section — no sibling management.
|
|
57
|
+
- [Command](docs/components/command.md): Command palette (⌘K). Searchable action list.
|
|
58
|
+
- [ContextMenu](docs/components/context-menu.md): Right-click menu.
|
|
59
|
+
- [Dialog](docs/components/dialog.md): Modal overlay. Dismissible. Use for forms and detail views.
|
|
60
|
+
- [Drawer](docs/components/drawer.md): Bottom-sliding panel. Mobile-optimized equivalent of Sheet.
|
|
61
|
+
- [DropdownMenu](docs/components/dropdown-menu.md): Triggered contextual action menu.
|
|
62
|
+
- [Empty](docs/components/empty.md): Zero-state container for lists and search results.
|
|
63
|
+
- [FileUpload](docs/components/file-upload.md): Drag-and-drop file input.
|
|
64
|
+
- [Form](docs/components/form.md): react-hook-form integration layer.
|
|
65
|
+
- [HoverCard](docs/components/hover-card.md): Rich floating preview on hover. Use for user profiles, link previews.
|
|
66
|
+
- [Input](docs/components/input.md): Single-line text field.
|
|
67
|
+
- [InputOTP](docs/components/input-otp.md): OTP / PIN code segmented input.
|
|
68
|
+
- [Label](docs/components/label.md): Accessible form field label. Always paired with Input via `htmlFor`.
|
|
69
|
+
- [Menubar](docs/components/menubar.md): Application-style horizontal menu bar.
|
|
70
|
+
- [NavigationMenu](docs/components/navigation-menu.md): Horizontal top-level nav with dropdown sub-menus.
|
|
71
|
+
- [NotificationBadge](docs/components/notification-badge.md): Dot or count overlay on icon buttons.
|
|
72
|
+
- [PageHeader](docs/components/page-header.md): Mandatory page title component. Every page must use it.
|
|
73
|
+
- [Pagination](docs/components/pagination.md): Page navigation controls for data tables.
|
|
74
|
+
- [Popover](docs/components/popover.md): Interactive floating panel anchored to a trigger.
|
|
75
|
+
- [Progress](docs/components/progress.md): Read-only completion bar. 5 semantic variants.
|
|
76
|
+
- [RadioGroup](docs/components/radio-group.md): Mutually exclusive options.
|
|
77
|
+
- [Rating](docs/components/rating.md): Star-based rating input or display.
|
|
78
|
+
- [Resizable](docs/components/resizable.md): Draggable panel splitter.
|
|
79
|
+
- [RichTextEditor](docs/components/rich-text-editor.md): Native WYSIWYG text editor.
|
|
80
|
+
- [ScrollArea](docs/components/scroll-area.md): Custom-styled scrollable container.
|
|
81
|
+
- [Search](docs/components/search.md): Search input with icon and clear button.
|
|
82
|
+
- [Select](docs/components/select.md): Accessible dropdown for single option selection. Never use native `<select>`.
|
|
83
|
+
- [Separator](docs/components/separator.md): Visual divider between sections.
|
|
84
|
+
- [Sheet](docs/components/sheet.md): Edge-anchored slide-in panel (top/right/bottom/left).
|
|
85
|
+
- [Skeleton](docs/components/skeleton.md): Loading placeholder. Use instead of blank space.
|
|
86
|
+
- [Slider](docs/components/slider.md): Range value picker by dragging a thumb.
|
|
87
|
+
- [Sonner](docs/components/sonner.md): Toast notification system. Use `toast()` from `sonner`. Auto-injected by `XerticaProvider`.
|
|
88
|
+
- [StatsCard](docs/components/stats-card.md): KPI metric card with trend indicator.
|
|
89
|
+
- [Stepper](docs/components/stepper.md): Multi-step process indicator / wizard.
|
|
90
|
+
- [Switch](docs/components/switch.md): Prominent on/off toggle. Use for feature flags and settings.
|
|
91
|
+
- [Table](docs/components/table.md): Structured tabular data display.
|
|
92
|
+
- [Tabs](docs/components/tabs.md): Content switcher with tab triggers.
|
|
93
|
+
- [Textarea](docs/components/textarea.md): Multi-line text field.
|
|
94
|
+
- [Timeline](docs/components/timeline.md): Vertical chronological event sequence.
|
|
95
|
+
- [Toggle](docs/components/toggle.md): Pressable on/off button for toolbars.
|
|
96
|
+
- [ToggleGroup](docs/components/toggle-group.md): Set of related toggles — single or multiple selection.
|
|
97
|
+
- [Tooltip](docs/components/tooltip.md): Short hover hint for icon-only buttons and abbreviated text.
|
|
98
|
+
- [TreeView](docs/components/tree-view.md): Hierarchical nested data tree.
|
|
99
|
+
|
|
100
|
+
## Component Reference — Layout (`xertica-ui/layout`)
|
|
101
|
+
|
|
102
|
+
- [Header](docs/components/header.md): Global top bar (64px). Breadcrumbs, language, theme, user profile.
|
|
103
|
+
- [Sidebar](docs/components/sidebar.md): Primary vertical navigation. Default and Assistant variants.
|
|
104
|
+
|
|
105
|
+
## Component Reference — Brand (`xertica-ui/brand`)
|
|
106
|
+
|
|
107
|
+
- [XerticaProvider](docs/components/xertica-provider.md): Mandatory root wrapper. Initializes all contexts.
|
|
108
|
+
- [ThemeToggle](docs/components/theme-toggle.md): Self-contained dark/light mode button. No provider needed.
|
|
109
|
+
- [LanguageSelector](docs/components/language-selector.md): Language dropdown (pt/en/es).
|
|
110
|
+
- [XerticaLogo](docs/components/xertica-logo.md): Full horizontal logotype SVG.
|
|
111
|
+
- [XerticaXLogo](docs/components/xertica-xlogo.md): Compact X-mark logo. Use in collapsed sidebar.
|
|
112
|
+
- [XerticaOrbe](docs/components/xertica-orbe.md): Animated decorative brand orb. For splash screens only.
|
|
113
|
+
|
|
114
|
+
## Component Reference — AI Assistant (`xertica-ui/assistant`)
|
|
115
|
+
|
|
116
|
+
- [XerticaAssistant](docs/components/assistant.md): Full AI chat panel with history, favorites, document workspace.
|
|
117
|
+
- [MarkdownMessage](docs/components/markdown-message.md): Markdown renderer for AI responses.
|
|
118
|
+
- [CodeBlock](docs/components/assistant.md): Syntax-highlighted code display with copy button.
|
|
119
|
+
- [ModernChatInput](docs/components/assistant.md): Enhanced AI chat input with drag-and-drop.
|
|
120
|
+
- [FormattedDocument](docs/components/assistant.md): Structured AI-generated document renderer.
|
|
121
|
+
|
|
122
|
+
## Component Reference — Media (`xertica-ui/media`)
|
|
123
|
+
|
|
124
|
+
- [VideoPlayer](docs/components/video-player.md): Custom video controls with floating mode.
|
|
125
|
+
- [AudioPlayer](docs/components/audio-player.md): Podcast/audio player — card or global bar variant.
|
|
126
|
+
- [FloatingMediaWrapper](docs/components/floating-media-wrapper.md): Draggable portal wrapper for media players.
|
|
127
|
+
|
|
128
|
+
## Component Reference — Maps (`xertica-ui`)
|
|
129
|
+
|
|
130
|
+
- [Map](docs/components/map.md): Google Maps integration with markers, polygons, controls.
|
|
131
|
+
- [RouteMap](docs/components/route-map.md): Route + directions between origin and destination.
|
|
132
|
+
- [SimpleMap](docs/components/simple-map.md): Simplified map for a single marker.
|
|
133
|
+
- [GoogleMapsLoader](docs/components/google-maps-loader.md): Lazy-loads Maps API. Auto-managed by XerticaProvider.
|
|
134
|
+
|
|
135
|
+
## Design Token Reference
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
bg-background / text-foreground page background and body text
|
|
139
|
+
bg-card / text-card-foreground card surfaces
|
|
140
|
+
bg-muted / text-muted-foreground subdued areas, secondary text, placeholders
|
|
141
|
+
bg-primary / text-primary-foreground primary actions, active states
|
|
142
|
+
bg-secondary / text-secondary-fg secondary actions
|
|
143
|
+
bg-destructive danger, delete, error
|
|
144
|
+
bg-accent / text-accent-foreground hover states
|
|
145
|
+
bg-success / bg-info / bg-warning semantic state colors
|
|
146
|
+
border-border standard borders
|
|
147
|
+
border-input form field borders
|
|
148
|
+
ring-ring focus rings
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Composition Patterns
|
|
152
|
+
|
|
153
|
+
- [Form pattern](docs/patterns/form.md): Validated forms with react-hook-form.
|
|
154
|
+
- [CRUD pattern](docs/patterns/crud.md): Table + search + row actions.
|
|
155
|
+
- [Dashboard pattern](docs/patterns/dashboard.md): StatsCard grid + Charts.
|
|
156
|
+
- [Analytics pattern](docs/patterns/analytics.md): Filters + date range + charts.
|
|
157
|
+
|
|
158
|
+
## Machine-Readable Registry
|
|
159
|
+
|
|
160
|
+
- [components.json](components.json): All 97 components with name, category, import path, keywords, related components, source path, and doc path.
|