xertica-ui 1.5.1 → 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.
- package/CHANGELOG.md +68 -0
- package/README.md +129 -269
- package/components/AudioPlayer.tsx +30 -7
- package/components/CodeBlock.tsx +20 -0
- package/components/DocumentEditor.tsx +37 -18
- package/components/ForgotPasswordPage.tsx +36 -24
- package/components/FormattedDocument.tsx +27 -7
- package/components/Header.tsx +164 -7
- package/components/HomeContent.tsx +28 -12
- package/components/HomePage.tsx +27 -9
- package/components/LanguageSelector.tsx +19 -0
- package/components/LoginPage.tsx +46 -26
- package/components/MarkdownMessage.tsx +29 -11
- package/components/ModernChatInput.tsx +46 -22
- package/components/PodcastPlayer.tsx +48 -22
- package/components/ResetPasswordPage.tsx +39 -26
- package/components/Sidebar.tsx +222 -132
- package/components/TemplateContent.tsx +263 -105
- package/components/TemplatePage.tsx +18 -1
- package/components/ThemeToggle.tsx +21 -3
- package/components/VerifyEmailPage.tsx +44 -31
- package/components/XerticaLogo.tsx +18 -1
- package/components/XerticaOrbe.tsx +17 -0
- package/components/XerticaProvider.tsx +27 -4
- package/components/XerticaXLogo.tsx +17 -1
- package/components/assistant-utils.ts +117 -101
- package/components/index.ts +7 -0
- package/components/layout-constants.ts +8 -4
- package/components/media/AudioPlayer.tsx +1 -1
- package/components/media/FloatingMediaWrapper.tsx +1 -1
- package/components/ui/accordion.tsx +9 -6
- package/components/ui/alert-dialog.tsx +8 -6
- package/components/ui/alert.tsx +9 -7
- package/components/ui/aspect-ratio.tsx +7 -6
- package/components/ui/avatar.tsx +8 -6
- package/components/ui/badge.tsx +9 -6
- package/components/ui/breadcrumb.tsx +8 -6
- package/components/ui/button.tsx +17 -18
- package/components/ui/calendar.tsx +8 -6
- package/components/ui/card.tsx +8 -7
- package/components/ui/carousel.tsx +8 -6
- package/components/ui/chart.tsx +11 -6
- package/components/ui/checkbox.tsx +8 -15
- package/components/ui/collapsible.tsx +7 -5
- package/components/ui/command.tsx +9 -6
- package/components/ui/context-menu.tsx +8 -6
- package/components/ui/dialog.tsx +9 -8
- package/components/ui/drawer.tsx +8 -6
- package/components/ui/dropdown-menu.tsx +8 -8
- package/components/ui/empty.tsx +10 -6
- package/components/ui/file-upload.tsx +10 -7
- package/components/ui/form.tsx +8 -7
- package/components/ui/google-maps-loader.tsx +7 -7
- package/components/ui/hover-card.tsx +8 -5
- package/components/ui/input-otp.tsx +8 -6
- package/components/ui/input.tsx +7 -11
- package/components/ui/label.tsx +7 -6
- package/components/ui/map-layers.tsx +13 -13
- package/components/ui/map.tsx +8 -8
- package/components/ui/menubar.tsx +9 -6
- package/components/ui/navigation-menu.tsx +8 -6
- package/components/ui/notification-badge.tsx +9 -6
- package/components/ui/page-header.tsx +19 -11
- package/components/ui/pagination.tsx +8 -6
- package/components/ui/popover.tsx +8 -6
- package/components/ui/progress.tsx +7 -6
- package/components/ui/radio-group.tsx +8 -6
- package/components/ui/rating.tsx +8 -6
- package/components/ui/resizable.tsx +8 -6
- package/components/ui/route-map.tsx +10 -7
- package/components/ui/scroll-area.tsx +7 -6
- package/components/ui/search.tsx +8 -6
- package/components/ui/select.tsx +9 -5
- package/components/ui/separator.tsx +7 -5
- package/components/ui/sheet.tsx +8 -5
- package/components/ui/simple-map.tsx +26 -20
- package/components/ui/skeleton.tsx +8 -6
- package/components/ui/slider.tsx +8 -6
- package/components/ui/sonner.tsx +8 -7
- package/components/ui/stats-card.tsx +11 -6
- package/components/ui/stepper.tsx +10 -6
- package/components/ui/switch.tsx +7 -5
- package/components/ui/table.tsx +8 -7
- package/components/ui/tabs.tsx +8 -8
- package/components/ui/textarea.tsx +8 -6
- package/components/ui/timeline.tsx +8 -6
- package/components/ui/toggle-group.tsx +8 -6
- package/components/ui/toggle.tsx +7 -5
- package/components/ui/tooltip.tsx +8 -6
- package/components/ui/tree-view.tsx +9 -6
- package/components/ui/xertica-assistant.tsx +66 -65
- package/components.json +350 -0
- package/contexts/LayoutContext.tsx +6 -1
- package/dist/components/AudioPlayer.d.ts +23 -0
- package/dist/components/CodeBlock.d.ts +20 -0
- package/dist/components/DocumentEditor.d.ts +19 -0
- package/dist/components/ForgotPasswordPage.d.ts +12 -0
- package/dist/components/FormattedDocument.d.ts +18 -0
- package/dist/components/Header.d.ts +59 -1
- package/dist/components/HomeContent.d.ts +16 -0
- package/dist/components/HomePage.d.ts +18 -0
- package/dist/components/LanguageSelector.d.ts +19 -0
- package/dist/components/LoginPage.d.ts +20 -0
- package/dist/components/MarkdownMessage.d.ts +18 -0
- package/dist/components/ModernChatInput.d.ts +30 -0
- package/dist/components/PodcastPlayer.d.ts +26 -0
- package/dist/components/ResetPasswordPage.d.ts +13 -0
- package/dist/components/Sidebar.d.ts +64 -11
- package/dist/components/TemplateContent.d.ts +15 -0
- package/dist/components/TemplatePage.d.ts +16 -0
- package/dist/components/ThemeToggle.d.ts +18 -0
- package/dist/components/VerifyEmailPage.d.ts +13 -0
- package/dist/components/XerticaLogo.d.ts +17 -0
- package/dist/components/XerticaOrbe.d.ts +17 -0
- package/dist/components/XerticaProvider.d.ts +23 -0
- package/dist/components/XerticaXLogo.d.ts +16 -0
- package/dist/components/assistant-utils.d.ts +17 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/layout-constants.d.ts +4 -0
- package/dist/components/ui/accordion.d.ts +7 -4
- package/dist/components/ui/alert-dialog.d.ts +6 -4
- package/dist/components/ui/alert.d.ts +7 -5
- package/dist/components/ui/aspect-ratio.d.ts +5 -4
- package/dist/components/ui/avatar.d.ts +6 -4
- package/dist/components/ui/badge.d.ts +7 -4
- package/dist/components/ui/breadcrumb.d.ts +6 -4
- package/dist/components/ui/button.d.ts +13 -14
- package/dist/components/ui/calendar.d.ts +6 -4
- package/dist/components/ui/card.d.ts +6 -5
- package/dist/components/ui/carousel.d.ts +6 -4
- package/dist/components/ui/chart.d.ts +9 -4
- package/dist/components/ui/checkbox.d.ts +6 -13
- package/dist/components/ui/collapsible.d.ts +5 -3
- package/dist/components/ui/command.d.ts +7 -4
- package/dist/components/ui/context-menu.d.ts +6 -4
- package/dist/components/ui/dialog.d.ts +7 -6
- package/dist/components/ui/drawer.d.ts +6 -4
- package/dist/components/ui/dropdown-menu.d.ts +6 -6
- package/dist/components/ui/empty.d.ts +8 -4
- package/dist/components/ui/file-upload.d.ts +8 -5
- package/dist/components/ui/form.d.ts +7 -6
- package/dist/components/ui/hover-card.d.ts +6 -3
- package/dist/components/ui/input-otp.d.ts +6 -4
- package/dist/components/ui/input.d.ts +7 -11
- package/dist/components/ui/label.d.ts +5 -4
- package/dist/components/ui/map-layers.d.ts +10 -10
- package/dist/components/ui/map.d.ts +6 -6
- package/dist/components/ui/menubar.d.ts +7 -4
- package/dist/components/ui/navigation-menu.d.ts +6 -4
- package/dist/components/ui/notification-badge.d.ts +7 -4
- package/dist/components/ui/page-header.d.ts +17 -9
- package/dist/components/ui/pagination.d.ts +6 -4
- package/dist/components/ui/popover.d.ts +6 -4
- package/dist/components/ui/progress.d.ts +5 -4
- package/dist/components/ui/radio-group.d.ts +6 -4
- package/dist/components/ui/rating.d.ts +6 -4
- package/dist/components/ui/resizable.d.ts +6 -4
- package/dist/components/ui/route-map.d.ts +8 -5
- package/dist/components/ui/scroll-area.d.ts +5 -4
- package/dist/components/ui/search.d.ts +6 -4
- package/dist/components/ui/select.d.ts +8 -4
- package/dist/components/ui/separator.d.ts +5 -3
- package/dist/components/ui/sheet.d.ts +6 -3
- package/dist/components/ui/simple-map.d.ts +20 -14
- package/dist/components/ui/skeleton.d.ts +6 -4
- package/dist/components/ui/slider.d.ts +6 -4
- package/dist/components/ui/sonner.d.ts +6 -5
- package/dist/components/ui/stats-card.d.ts +9 -4
- package/dist/components/ui/stepper.d.ts +8 -4
- package/dist/components/ui/switch.d.ts +5 -3
- package/dist/components/ui/table.d.ts +6 -5
- package/dist/components/ui/tabs.d.ts +6 -6
- package/dist/components/ui/textarea.d.ts +6 -4
- package/dist/components/ui/timeline.d.ts +6 -4
- package/dist/components/ui/toggle-group.d.ts +6 -4
- package/dist/components/ui/toggle.d.ts +5 -3
- package/dist/components/ui/tooltip.d.ts +6 -4
- package/dist/components/ui/tree-view.d.ts +7 -4
- package/dist/components/ui/xertica-assistant.d.ts +53 -52
- package/dist/contexts/LayoutContext.d.ts +2 -0
- package/dist/index.es.js +419 -177
- package/dist/index.umd.js +418 -176
- package/dist/xertica-ui.css +1 -1
- package/docs/ai-usage.md +174 -0
- package/docs/components/accordion.md +114 -0
- package/docs/components/alert-dialog.md +127 -0
- package/docs/components/alert.md +114 -0
- package/docs/components/aspect-ratio.md +58 -0
- package/docs/components/assistant.md +100 -0
- package/docs/components/avatar.md +103 -0
- package/docs/components/badge.md +75 -0
- package/docs/components/breadcrumb.md +104 -0
- package/docs/components/button.md +162 -0
- package/docs/components/calendar.md +99 -0
- package/docs/components/card.md +162 -0
- package/docs/components/carousel.md +100 -0
- package/docs/components/chart.md +148 -0
- package/docs/components/checkbox.md +86 -0
- package/docs/components/collapsible.md +91 -0
- package/docs/components/command.md +98 -0
- package/docs/components/context-menu.md +81 -0
- package/docs/components/dialog.md +155 -0
- package/docs/components/drawer.md +107 -0
- package/docs/components/dropdown-menu.md +131 -0
- package/docs/components/empty.md +136 -0
- package/docs/components/file-upload.md +83 -0
- package/docs/components/form.md +150 -0
- package/docs/components/header.md +202 -0
- package/docs/components/hover-card.md +86 -0
- package/docs/components/input-otp.md +102 -0
- package/docs/components/input.md +103 -0
- package/docs/components/label.md +67 -0
- package/docs/components/map.md +76 -0
- package/docs/components/menubar.md +83 -0
- package/docs/components/navigation-menu.md +83 -0
- package/docs/components/notification-badge.md +61 -0
- package/docs/components/page-header.md +170 -0
- package/docs/components/pagination.md +121 -0
- package/docs/components/popover.md +121 -0
- package/docs/components/progress.md +80 -0
- package/docs/components/radio-group.md +127 -0
- package/docs/components/rating.md +77 -0
- package/docs/components/resizable.md +88 -0
- package/docs/components/route-map.md +124 -0
- package/docs/components/scroll-area.md +58 -0
- package/docs/components/search.md +75 -0
- package/docs/components/select.md +148 -0
- package/docs/components/separator.md +58 -0
- package/docs/components/sheet.md +124 -0
- package/docs/components/sidebar.md +205 -0
- package/docs/components/skeleton.md +92 -0
- package/docs/components/slider.md +90 -0
- package/docs/components/sonner.md +118 -0
- package/docs/components/stats-card.md +119 -0
- package/docs/components/stepper.md +122 -0
- package/docs/components/switch.md +111 -0
- package/docs/components/table.md +138 -0
- package/docs/components/tabs.md +117 -0
- package/docs/components/textarea.md +86 -0
- package/docs/components/timeline.md +81 -0
- package/docs/components/toggle-group.md +68 -0
- package/docs/components/toggle.md +66 -0
- package/docs/components/tooltip.md +116 -0
- package/docs/components/tree-view.md +78 -0
- package/docs/components/use-mobile.md +100 -0
- package/docs/getting-started.md +198 -0
- package/docs/guidelines.md +167 -0
- package/docs/installation.md +203 -0
- package/docs/layout.md +171 -0
- package/docs/llms.md +195 -0
- package/docs/patterns/analytics.md +208 -0
- package/docs/patterns/crud.md +158 -0
- package/docs/patterns/dashboard.md +179 -0
- package/docs/patterns/form.md +244 -0
- package/docs/patterns/login.md +167 -0
- package/llms-full.txt +2634 -0
- package/llms.txt +37 -0
- package/mcp/resources.json +22 -0
- package/mcp/tools.json +35 -0
- package/package.json +10 -3
- package/scripts/ai-validator.ts +83 -0
- package/scripts/generate-ai-manifests.ts +64 -0
- package/templates/package.json +1 -1
- package/templates/src/app/pages/Home/HomeContent.tsx +2 -2
- package/templates/src/app/pages/HomePage.tsx +2 -1
- package/templates/src/app/pages/Template/TemplateContent.tsx +6 -4
- 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
|
-
|
|
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
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
|
+
[](./LICENSE)
|
|
6
7
|
|
|
7
|
-
|
|
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
|
-
|
|
10
|
+
## Quick Start — CLI (Recommended)
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
Scaffold a full application in seconds:
|
|
21
13
|
|
|
22
14
|
```bash
|
|
23
|
-
|
|
15
|
+
npx xertica-ui@latest init my-app
|
|
16
|
+
cd my-app
|
|
24
17
|
npm run dev
|
|
25
18
|
```
|
|
26
19
|
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
## Installation as a Library
|
|
43
25
|
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
46
|
+
<YourApp />
|
|
64
47
|
</XerticaProvider>
|
|
65
48
|
);
|
|
66
49
|
}
|
|
67
50
|
```
|
|
68
51
|
|
|
69
|
-
|
|
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
|
|
74
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm install
|
|
89
|
-
```
|
|
70
|
+
## XerticaProvider Props
|
|
90
71
|
|
|
91
|
-
|
|
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
|
-
##
|
|
83
|
+
## Component Catalog
|
|
132
84
|
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
88
|
+
### Surfaces
|
|
89
|
+
`Card` · `CardHeader` · `CardTitle` · `CardDescription` · `CardContent` · `CardFooter` · `Separator` · `ScrollArea` · `AspectRatio` · `ResizablePanelGroup`
|
|
146
90
|
|
|
147
|
-
###
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
```
|
|
94
|
+
### Actions
|
|
95
|
+
`Button` · `Toggle` · `ToggleGroup` · `Rating`
|
|
152
96
|
|
|
153
|
-
|
|
97
|
+
### Data Display
|
|
98
|
+
`Table` · `Badge` · `Avatar` · `Progress` · `Skeleton` · `Empty` · `StatsCard` · `Timeline` · `Stepper` · `TreeView` · `NotificationBadge` · `ChartContainer`
|
|
154
99
|
|
|
155
|
-
###
|
|
100
|
+
### Structure & Utilities
|
|
101
|
+
`Accordion` · `Collapsible` · `Carousel` · `ScrollArea`
|
|
156
102
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
```
|
|
103
|
+
### Overlays & Feedback
|
|
104
|
+
`Dialog` · `AlertDialog` · `Sheet` · `Drawer` · `Popover` · `HoverCard` · `Tooltip` · `Alert` · `Toaster` · `Command`
|
|
160
105
|
|
|
161
|
-
###
|
|
106
|
+
### Menus
|
|
107
|
+
`DropdownMenu` · `ContextMenu` · `Menubar`
|
|
162
108
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
```
|
|
109
|
+
### Maps
|
|
110
|
+
`Map` · `RouteMap`
|
|
166
111
|
|
|
167
|
-
###
|
|
112
|
+
### AI Features
|
|
113
|
+
`XerticaAssistant`
|
|
168
114
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
```
|
|
115
|
+
### Hooks
|
|
116
|
+
`useMobile` · `useIsMobile` · `useLayout`
|
|
172
117
|
|
|
173
|
-
|
|
118
|
+
---
|
|
174
119
|
|
|
175
|
-
|
|
120
|
+
## Design Tokens
|
|
176
121
|
|
|
177
|
-
|
|
122
|
+
Xertica UI uses semantic CSS tokens — **never use raw colors or Tailwind color classes**:
|
|
178
123
|
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
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(
|
|
209
|
-
--radius:
|
|
137
|
+
--primary: rgba(44, 39, 91, 1);
|
|
138
|
+
--radius: 6px;
|
|
139
|
+
--radius-card: 12px;
|
|
210
140
|
}
|
|
211
141
|
```
|
|
212
142
|
|
|
213
|
-
|
|
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
|
-
|
|
267
|
-
Dialog, AlertDialog, Sheet, Drawer, Popover, Tooltip, HoverCard
|
|
145
|
+
## Dark Mode
|
|
268
146
|
|
|
269
|
-
|
|
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
|
-
|
|
273
|
-
Alert, Badge, Progress, Skeleton, Toast (Sonner), NotificationBadge
|
|
274
|
-
|
|
275
|
-
### Data Display
|
|
276
|
-
Avatar, Table, Chart, Empty, StatsCard, Timeline, TreeView
|
|
149
|
+
---
|
|
277
150
|
|
|
278
|
-
|
|
279
|
-
Collapsible, Accordion, ScrollArea, Carousel, Stepper, FileUpload, Rating, Search
|
|
151
|
+
## AI Agent / LLM Usage
|
|
280
152
|
|
|
281
|
-
|
|
282
|
-
Map, RouteMap, SimpleMap (Google Maps integration)
|
|
153
|
+
Xertica UI ships with a comprehensive AI-first documentation layer in `docs/`:
|
|
283
154
|
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
288
|
-
useMobile, useIsMobile
|
|
164
|
+
Point your LLM agent to `docs/llms.md` as the entrypoint.
|
|
289
165
|
|
|
290
|
-
|
|
166
|
+
---
|
|
291
167
|
|
|
292
|
-
|
|
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
|
-
|
|
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
|
-
|
|
182
|
+
---
|
|
306
183
|
|
|
307
|
-
|
|
308
|
-
- Tablet: 768px+
|
|
309
|
-
- Desktop: 1024px+
|
|
184
|
+
## Peer Dependencies
|
|
310
185
|
|
|
311
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
196
|
+
## Scripts
|
|
320
197
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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
|
-
|
|
205
|
+
---
|
|
327
206
|
|
|
328
|
-
|
|
207
|
+
## Troubleshooting
|
|
329
208
|
|
|
330
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 = "
|
|
41
|
-
subtitle = "Podcast
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
208
|
+
<TooltipContent>Update Version</TooltipContent>
|
|
186
209
|
</Tooltip>
|
|
187
210
|
</TooltipProvider>
|
|
188
211
|
|
package/components/CodeBlock.tsx
CHANGED
|
@@ -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',
|