xertica-ui 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +184 -184
  3. package/components/assistant/code-block/CodeBlock.tsx +262 -262
  4. package/components/assistant/code-block/code-block.stories.tsx +57 -57
  5. package/components/assistant/modern-chat-input/ModernChatInput.tsx +84 -57
  6. package/components/assistant/modern-chat-input/modern-chat-input.mdx +71 -38
  7. package/components/assistant/modern-chat-input/modern-chat-input.stories.tsx +131 -53
  8. package/components/assistant/xertica-assistant/xertica-assistant.mdx +66 -37
  9. package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +201 -103
  10. package/components/assistant/xertica-assistant/xertica-assistant.tsx +126 -59
  11. package/components/layout/header/header.mdx +117 -73
  12. package/components/layout/header/header.stories.tsx +165 -104
  13. package/components/layout/header/header.tsx +78 -34
  14. package/components/media/video-player/VideoPlayer.test.tsx +73 -73
  15. package/components/ui/button/button.tsx +4 -4
  16. package/components/ui/card/card.tsx +1 -1
  17. package/components/ui/checkbox/checkbox.mdx +7 -0
  18. package/components/ui/checkbox/checkbox.stories.tsx +83 -59
  19. package/components/ui/checkbox/checkbox.test.tsx +11 -0
  20. package/components/ui/checkbox/checkbox.tsx +42 -18
  21. package/components/ui/input/input.mdx +7 -0
  22. package/components/ui/input/input.stories.tsx +108 -78
  23. package/components/ui/input-otp/input-otp.mdx +7 -0
  24. package/components/ui/input-otp/input-otp.stories.tsx +120 -75
  25. package/components/ui/input-otp/input-otp.test.tsx +79 -56
  26. package/components/ui/input-otp/input-otp.tsx +16 -1
  27. package/components/ui/label/label.mdx +7 -0
  28. package/components/ui/label/label.stories.tsx +73 -47
  29. package/components/ui/label/label.test.tsx +27 -3
  30. package/components/ui/label/label.tsx +21 -3
  31. package/components/ui/radio-group/radio-group.mdx +7 -0
  32. package/components/ui/radio-group/radio-group.stories.tsx +105 -57
  33. package/components/ui/radio-group/radio-group.test.tsx +78 -54
  34. package/components/ui/radio-group/radio-group.tsx +56 -32
  35. package/components/ui/rich-text-editor/rich-text-editor.test.tsx +49 -49
  36. package/components/ui/search/search.mdx +5 -4
  37. package/components/ui/search/search.stories.tsx +107 -46
  38. package/components/ui/search/search.test.tsx +15 -2
  39. package/components/ui/search/search.tsx +39 -5
  40. package/components/ui/select/select.mdx +7 -0
  41. package/components/ui/select/select.stories.tsx +148 -99
  42. package/components/ui/select/select.test.tsx +41 -1
  43. package/components/ui/select/select.tsx +38 -24
  44. package/components/ui/switch/switch.mdx +7 -0
  45. package/components/ui/switch/switch.stories.tsx +67 -40
  46. package/components/ui/switch/switch.test.tsx +14 -3
  47. package/components/ui/switch/switch.tsx +46 -21
  48. package/components/ui/textarea/textarea.mdx +7 -0
  49. package/components/ui/textarea/textarea.stories.tsx +66 -34
  50. package/components/ui/textarea/textarea.test.tsx +41 -28
  51. package/components/ui/textarea/textarea.tsx +29 -6
  52. package/dist/components/assistant/modern-chat-input/ModernChatInput.d.ts +11 -1
  53. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +36 -1
  54. package/dist/components/layout/header/header.d.ts +48 -7
  55. package/dist/components/ui/checkbox/checkbox.d.ts +11 -1
  56. package/dist/components/ui/input-otp/input-otp.d.ts +8 -1
  57. package/dist/components/ui/label/label.d.ts +11 -1
  58. package/dist/components/ui/radio-group/radio-group.d.ts +11 -1
  59. package/dist/components/ui/search/search.d.ts +9 -1
  60. package/dist/components/ui/select/select.d.ts +7 -1
  61. package/dist/components/ui/switch/switch.d.ts +11 -1
  62. package/dist/components/ui/textarea/textarea.d.ts +18 -2
  63. package/dist/contexts/BrandColorsContext.d.ts +19 -19
  64. package/dist/index.es.js +250 -143
  65. package/dist/index.umd.js +250 -143
  66. package/dist/xertica-ui.css +1 -1
  67. package/docs/components/assistant.md +48 -0
  68. package/docs/components/checkbox.md +2 -0
  69. package/docs/components/header.md +214 -116
  70. package/docs/components/input-otp.md +5 -3
  71. package/docs/components/input.md +14 -0
  72. package/docs/components/label.md +6 -4
  73. package/docs/components/radio-group.md +7 -5
  74. package/docs/components/search.md +5 -3
  75. package/docs/components/select.md +6 -4
  76. package/docs/components/switch.md +3 -1
  77. package/docs/components/textarea.md +4 -0
  78. package/docs/form-sizing.md +154 -0
  79. package/package.json +1 -1
  80. package/scripts/a11y-audit.mjs +162 -162
  81. package/styles/xertica/theme-map.css +3 -0
  82. package/templates/.env.example +2 -2
  83. package/templates/eslint.config.js +29 -29
  84. package/templates/package.json +1 -1
  85. package/templates/postcss.config.js +6 -6
  86. package/templates/src/main.tsx +10 -10
  87. package/templates/src/styles/index.css +4 -0
  88. package/templates/tsconfig.json +21 -21
  89. package/templates/tsconfig.node.json +12 -12
  90. package/templates/vite-env.d.ts +1 -1
  91. package/templates/vite.config.ts +7 -7
package/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ---
9
9
 
10
+ ## [1.9.0] — 2026-05-05
11
+
12
+ ### Added
13
+ - **Standardized Form Sizing System** — Implemented a unified `size` prop (`sm`, `md`, `lg`) across all form-related components for perfect visual alignment in grid layouts:
14
+ - **Text Components** — `Input`, `SelectTrigger`, `Textarea`, `Search`, and `InputOTPSlot` now share consistent height/padding/font-size tokens.
15
+ - **Toggle Components** — `Checkbox`, `RadioGroupItem`, and `Switch` now feature dynamic sizing for both containers and internal indicators (check icon, dot, thumb).
16
+ - **Labels** — `Label` component now supports `size` to match the text size of the associated input.
17
+ - **Reference Guide** — Added `docs/form-sizing.md` as a comprehensive guide for the standardized sizing scale.
18
+ - **Assistant Individual Controls** — Added granular control props to `XerticaAssistant` to toggle specific features independently:
19
+ - `showHistory`, `showFavorites`, `allowAudioInput`, `allowFileUpload`, `allowDocCreation`, `allowPodcastGen`, `allowResearchGen`.
20
+ - **Header Breadcrumb Navigation** — Standardized `Header` to use breadcrumbs as the default navigation pattern:
21
+ - Added support for `react-router-dom` links in breadcrumbs to prevent page reloads.
22
+ - Configurable hierarchy levels and labels directly via props.
23
+
24
+ ### Changed
25
+ - **Form Component Architecture** — Migrated form elements from legacy tokens to standardized design system tokens (`bg-background`, `border-border`) for better theme consistency.
26
+ - **Documentation & Storybook** — Updated all 9 affected form components with new "Sizes" sections in Storybook (Stories + MDX) and enriched LLM-facing markdown documentation.
27
+ - **Unit Testing** — Updated test suites for `Checkbox`, `RadioGroup`, `Switch`, `InputOTP`, `Label`, `Search`, `Select`, and `Textarea` to verify sizing variant classes.
28
+
29
+ ### Fixed
30
+ - **Search Component** — Removed obsolete `loading` prop which was causing TypeScript errors and was redundant with the current design system patterns.
31
+ - **SelectTrigger Sizing** — Standardized `md` height to `h-10` (40px) to match the rest of the form system.
32
+
33
+ ---
34
+
10
35
  ## [1.8.0] — 2026-04-27
11
36
 
12
37
  ### Added
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
- [![npm version](https://img.shields.io/npm/v/xertica-ui)](https://www.npmjs.com/package/xertica-ui)
6
- [![license](https://img.shields.io/badge/license-proprietary-red)](./LICENSE)
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
+ [![npm version](https://img.shields.io/npm/v/xertica-ui)](https://www.npmjs.com/package/xertica-ui)
6
+ [![license](https://img.shields.io/badge/license-proprietary-red)](./LICENSE)
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
+