xertica-ui 1.8.1 → 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.
Files changed (245) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/components/assistant/modern-chat-input/ModernChatInput.tsx +84 -57
  3. package/components/assistant/modern-chat-input/modern-chat-input.mdx +33 -0
  4. package/components/assistant/modern-chat-input/modern-chat-input.stories.tsx +78 -0
  5. package/components/assistant/xertica-assistant/xertica-assistant.mdx +30 -1
  6. package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +98 -0
  7. package/components/assistant/xertica-assistant/xertica-assistant.tsx +126 -59
  8. package/components/examples/SidebarLogoExample.tsx +1 -1
  9. package/components/layout/header/header.mdx +53 -9
  10. package/components/layout/header/header.stories.tsx +73 -12
  11. package/components/layout/header/header.tsx +78 -34
  12. package/components/layout/sidebar/sidebar.tsx +24 -7
  13. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +1 -1
  14. package/components/pages/forgot-password-page/forgot-password-page.test.tsx +1 -1
  15. package/components/pages/home-content/HomeContent.tsx +10 -5
  16. package/components/pages/home-page/HomePage.tsx +12 -3
  17. package/components/pages/home-page/home-page.test.tsx +1 -1
  18. package/components/pages/login-page/LoginPage.tsx +1 -1
  19. package/components/pages/login-page/login-page.test.tsx +1 -1
  20. package/components/pages/reset-password-page/ResetPasswordPage.tsx +1 -1
  21. package/components/pages/template-content/TemplateContent.tsx +10 -27
  22. package/components/pages/template-page/TemplatePage.tsx +12 -3
  23. package/components/pages/template-page/template-page.test.tsx +1 -1
  24. package/components/pages/verify-email-page/VerifyEmailPage.tsx +1 -1
  25. package/components/ui/checkbox/checkbox.mdx +7 -0
  26. package/components/ui/checkbox/checkbox.stories.tsx +32 -8
  27. package/components/ui/checkbox/checkbox.test.tsx +11 -0
  28. package/components/ui/checkbox/checkbox.tsx +42 -18
  29. package/components/ui/input/input.mdx +7 -0
  30. package/components/ui/input/input.stories.tsx +43 -13
  31. package/components/ui/input-otp/input-otp.mdx +7 -0
  32. package/components/ui/input-otp/input-otp.stories.tsx +45 -0
  33. package/components/ui/input-otp/input-otp.test.tsx +43 -20
  34. package/components/ui/input-otp/input-otp.tsx +16 -1
  35. package/components/ui/label/label.mdx +7 -0
  36. package/components/ui/label/label.stories.tsx +28 -2
  37. package/components/ui/label/label.test.tsx +26 -2
  38. package/components/ui/label/label.tsx +21 -3
  39. package/components/ui/radio-group/radio-group.mdx +7 -0
  40. package/components/ui/radio-group/radio-group.stories.tsx +49 -1
  41. package/components/ui/radio-group/radio-group.test.tsx +26 -2
  42. package/components/ui/radio-group/radio-group.tsx +56 -32
  43. package/components/ui/search/search.mdx +5 -4
  44. package/components/ui/search/search.stories.tsx +68 -7
  45. package/components/ui/search/search.test.tsx +15 -2
  46. package/components/ui/search/search.tsx +39 -5
  47. package/components/ui/select/select.mdx +7 -0
  48. package/components/ui/select/select.stories.tsx +51 -2
  49. package/components/ui/select/select.test.tsx +40 -0
  50. package/components/ui/select/select.tsx +38 -24
  51. package/components/ui/switch/switch.mdx +7 -0
  52. package/components/ui/switch/switch.stories.tsx +27 -0
  53. package/components/ui/switch/switch.test.tsx +13 -2
  54. package/components/ui/switch/switch.tsx +46 -21
  55. package/components/ui/textarea/textarea.mdx +7 -0
  56. package/components/ui/textarea/textarea.stories.tsx +35 -3
  57. package/components/ui/textarea/textarea.test.tsx +18 -5
  58. package/components/ui/textarea/textarea.tsx +29 -6
  59. package/dist/components/assistant/modern-chat-input/ModernChatInput.d.ts +11 -1
  60. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +36 -1
  61. package/dist/components/layout/header/header.d.ts +48 -7
  62. package/dist/components/layout/sidebar/sidebar.d.ts +6 -2
  63. package/dist/components/pages/home-content/HomeContent.d.ts +8 -1
  64. package/dist/components/pages/template-content/TemplateContent.d.ts +8 -1
  65. package/dist/components/ui/checkbox/checkbox.d.ts +11 -1
  66. package/dist/components/ui/input-otp/input-otp.d.ts +8 -1
  67. package/dist/components/ui/label/label.d.ts +11 -1
  68. package/dist/components/ui/radio-group/radio-group.d.ts +11 -1
  69. package/dist/components/ui/search/search.d.ts +9 -1
  70. package/dist/components/ui/select/select.d.ts +7 -1
  71. package/dist/components/ui/switch/switch.d.ts +11 -1
  72. package/dist/components/ui/textarea/textarea.d.ts +18 -2
  73. package/dist/index.es.js +337 -2229
  74. package/dist/index.umd.js +340 -2233
  75. package/dist/xertica-ui.css +1 -1
  76. package/docs/components/assistant.md +48 -0
  77. package/docs/components/checkbox.md +2 -0
  78. package/docs/components/header.md +116 -18
  79. package/docs/components/input-otp.md +5 -3
  80. package/docs/components/input.md +14 -0
  81. package/docs/components/label.md +6 -4
  82. package/docs/components/radio-group.md +7 -5
  83. package/docs/components/search.md +5 -3
  84. package/docs/components/select.md +6 -4
  85. package/docs/components/switch.md +3 -1
  86. package/docs/components/textarea.md +4 -0
  87. package/docs/form-sizing.md +154 -0
  88. package/docs/installation.md +1 -1
  89. package/guidelines/Guidelines.md +2 -2
  90. package/package.json +1 -1
  91. package/styles/xertica/theme-map.css +91 -91
  92. package/templates/package.json +2 -2
  93. package/templates/src/app/App.d.ts +1 -0
  94. package/templates/src/app/App.js +70 -0
  95. package/templates/src/app/pages/CrudTemplate.d.ts +1 -0
  96. package/templates/src/app/pages/CrudTemplate.js +6 -0
  97. package/templates/src/app/pages/DashboardTemplate.d.ts +1 -0
  98. package/templates/src/app/pages/DashboardTemplate.js +9 -0
  99. package/templates/src/app/pages/ForgotPassword/ForgotPasswordContent.d.ts +1 -0
  100. package/templates/src/app/pages/ForgotPassword/ForgotPasswordContent.js +21 -0
  101. package/templates/src/app/pages/ForgotPasswordPage.d.ts +1 -0
  102. package/templates/src/app/pages/ForgotPasswordPage.js +5 -0
  103. package/templates/src/app/pages/FormTemplate.d.ts +1 -0
  104. package/templates/src/app/pages/FormTemplate.js +23 -0
  105. package/templates/src/app/pages/Home/HomeContent.d.ts +1 -0
  106. package/templates/src/app/pages/Home/HomeContent.js +24 -0
  107. package/templates/src/app/pages/HomePage.d.ts +8 -0
  108. package/templates/src/app/pages/HomePage.js +24 -0
  109. package/templates/src/app/pages/Login/LoginContent.d.ts +5 -0
  110. package/templates/src/app/pages/Login/LoginContent.js +28 -0
  111. package/templates/src/app/pages/LoginPage.d.ts +5 -0
  112. package/templates/src/app/pages/LoginPage.js +5 -0
  113. package/templates/src/app/pages/LoginTemplate.d.ts +1 -0
  114. package/templates/src/app/pages/LoginTemplate.js +6 -0
  115. package/templates/src/app/pages/ResetPassword/ResetPasswordContent.d.ts +1 -0
  116. package/templates/src/app/pages/ResetPassword/ResetPasswordContent.js +73 -0
  117. package/templates/src/app/pages/ResetPasswordPage.d.ts +1 -0
  118. package/templates/src/app/pages/ResetPasswordPage.js +5 -0
  119. package/templates/src/app/pages/Template/TemplateContent.d.ts +1 -0
  120. package/templates/src/app/pages/Template/TemplateContent.js +75 -0
  121. package/templates/src/app/pages/TemplatePage.d.ts +8 -0
  122. package/templates/src/app/pages/TemplatePage.js +11 -0
  123. package/templates/src/app/pages/VerifyEmail/VerifyEmailContent.d.ts +1 -0
  124. package/templates/src/app/pages/VerifyEmail/VerifyEmailContent.js +24 -0
  125. package/templates/src/app/pages/VerifyEmailPage.d.ts +1 -0
  126. package/templates/src/app/pages/VerifyEmailPage.js +5 -0
  127. package/templates/src/app/routes.d.ts +10 -0
  128. package/templates/src/app/routes.js +22 -0
  129. package/templates/src/main.d.ts +1 -0
  130. package/templates/src/main.js +6 -0
  131. package/templates/tsconfig.json +16 -6
  132. package/templates/tsconfig.node.json +1 -1
  133. package/templates/tsconfig.node.tsbuildinfo +1 -1
  134. package/templates/tsconfig.tsbuildinfo +1 -1
  135. package/templates/vite.config.d.ts +2 -0
  136. package/templates/vite.config.js +6 -0
  137. package/utils/demo-responses.test.ts +2 -2
  138. package/utils/demo-responses.ts +1 -1
  139. package/dist/AssistantChart-BkwfdilF.js +0 -22
  140. package/dist/AssistantChart-G8I1Kfu4.js +0 -22
  141. package/dist/components/AssistenteXertica.d.ts +0 -17
  142. package/dist/components/AudioPlayer.d.ts +0 -35
  143. package/dist/components/CodeBlock.d.ts +0 -28
  144. package/dist/components/DocumentEditor.d.ts +0 -26
  145. package/dist/components/ForgotPasswordPage.d.ts +0 -13
  146. package/dist/components/FormattedDocument.d.ts +0 -25
  147. package/dist/components/Header.d.ts +0 -72
  148. package/dist/components/HomeContent.d.ts +0 -20
  149. package/dist/components/HomePage.d.ts +0 -26
  150. package/dist/components/LanguageSelector.d.ts +0 -26
  151. package/dist/components/LoginPage.d.ts +0 -25
  152. package/dist/components/MarkdownMessage.d.ts +0 -24
  153. package/dist/components/ModernChatInput.d.ts +0 -44
  154. package/dist/components/PodcastPlayer.d.ts +0 -41
  155. package/dist/components/ResetPasswordPage.d.ts +0 -14
  156. package/dist/components/Sidebar.d.ts +0 -126
  157. package/dist/components/TemplateContent.d.ts +0 -19
  158. package/dist/components/TemplatePage.d.ts +0 -24
  159. package/dist/components/ThemeToggle.d.ts +0 -26
  160. package/dist/components/VerifyEmailPage.d.ts +0 -14
  161. package/dist/components/XerticaLogo.d.ts +0 -24
  162. package/dist/components/XerticaOrbe.d.ts +0 -23
  163. package/dist/components/XerticaProvider.d.ts +0 -35
  164. package/dist/components/XerticaXLogo.d.ts +0 -23
  165. package/dist/components/assistant-utils.d.ts +0 -21
  166. package/dist/components/layout-constants.d.ts +0 -8
  167. package/dist/components/media/AudioPlayer.d.ts +0 -9
  168. package/dist/components/media/VideoPlayer.d.ts +0 -8
  169. package/dist/components/ui/AssistantChart.d.ts +0 -7
  170. package/dist/components/ui/accordion.d.ts +0 -20
  171. package/dist/components/ui/alert-dialog.d.ts +0 -26
  172. package/dist/components/ui/alert.d.ts +0 -25
  173. package/dist/components/ui/aspect-ratio.d.ts +0 -14
  174. package/dist/components/ui/avatar.d.ts +0 -20
  175. package/dist/components/ui/badge.d.ts +0 -22
  176. package/dist/components/ui/breadcrumb.d.ts +0 -23
  177. package/dist/components/ui/button.d.ts +0 -37
  178. package/dist/components/ui/calendar.d.ts +0 -20
  179. package/dist/components/ui/card.d.ts +0 -21
  180. package/dist/components/ui/carousel.d.ts +0 -31
  181. package/dist/components/ui/chart.d.ts +0 -55
  182. package/dist/components/ui/checkbox.d.ts +0 -16
  183. package/dist/components/ui/collapsible.d.ts +0 -16
  184. package/dist/components/ui/command.d.ts +0 -29
  185. package/dist/components/ui/context-menu.d.ts +0 -37
  186. package/dist/components/ui/dialog.d.ts +0 -33
  187. package/dist/components/ui/drawer.d.ts +0 -26
  188. package/dist/components/ui/dropdown-menu.d.ts +0 -37
  189. package/dist/components/ui/empty.d.ts +0 -22
  190. package/dist/components/ui/file-upload.d.ts +0 -24
  191. package/dist/components/ui/form.d.ts +0 -37
  192. package/dist/components/ui/google-maps-loader.d.ts +0 -33
  193. package/dist/components/ui/hover-card.d.ts +0 -18
  194. package/dist/components/ui/input-otp.d.ts +0 -23
  195. package/dist/components/ui/input.d.ts +0 -25
  196. package/dist/components/ui/label.d.ts +0 -15
  197. package/dist/components/ui/map-config.d.ts +0 -12
  198. package/dist/components/ui/map-layers.d.ts +0 -48
  199. package/dist/components/ui/map.d.ts +0 -82
  200. package/dist/components/ui/map.exports.d.ts +0 -25
  201. package/dist/components/ui/menubar.d.ts +0 -39
  202. package/dist/components/ui/navigation-menu.d.ts +0 -26
  203. package/dist/components/ui/notification-badge.d.ts +0 -24
  204. package/dist/components/ui/page-header.d.ts +0 -76
  205. package/dist/components/ui/pagination.d.ts +0 -25
  206. package/dist/components/ui/popover.d.ts +0 -19
  207. package/dist/components/ui/progress.d.ts +0 -15
  208. package/dist/components/ui/radio-group.d.ts +0 -17
  209. package/dist/components/ui/rating.d.ts +0 -24
  210. package/dist/components/ui/resizable.d.ts +0 -39
  211. package/dist/components/ui/route-map.d.ts +0 -41
  212. package/dist/components/ui/scroll-area.d.ts +0 -16
  213. package/dist/components/ui/search.d.ts +0 -20
  214. package/dist/components/ui/select.d.ts +0 -27
  215. package/dist/components/ui/separator.d.ts +0 -15
  216. package/dist/components/ui/sheet.d.ts +0 -26
  217. package/dist/components/ui/sidebar.d.ts +0 -69
  218. package/dist/components/ui/simple-map.d.ts +0 -57
  219. package/dist/components/ui/skeleton.d.ts +0 -14
  220. package/dist/components/ui/slider.d.ts +0 -16
  221. package/dist/components/ui/sonner.d.ts +0 -15
  222. package/dist/components/ui/stats-card.d.ts +0 -29
  223. package/dist/components/ui/stepper.d.ts +0 -31
  224. package/dist/components/ui/switch.d.ts +0 -15
  225. package/dist/components/ui/table.d.ts +0 -22
  226. package/dist/components/ui/tabs.d.ts +0 -19
  227. package/dist/components/ui/textarea.d.ts +0 -15
  228. package/dist/components/ui/timeline.d.ts +0 -24
  229. package/dist/components/ui/toggle-group.d.ts +0 -24
  230. package/dist/components/ui/toggle.d.ts +0 -23
  231. package/dist/components/ui/tooltip.d.ts +0 -19
  232. package/dist/components/ui/tree-view.d.ts +0 -28
  233. package/dist/components/ui/use-mobile.d.ts +0 -2
  234. package/dist/components/ui/utils.d.ts +0 -2
  235. package/dist/components/ui/xertica-assistant.d.ts +0 -241
  236. package/dist/contexts/ApiKeyContext.d.ts +0 -15
  237. package/dist/contexts/BrandColorsContext.d.ts +0 -19
  238. package/dist/contexts/LanguageContext.d.ts +0 -11
  239. package/dist/contexts/ThemeContext.d.ts +0 -16
  240. package/dist/contexts/index.d.ts +0 -7
  241. package/dist/contexts/theme-data.d.ts +0 -81
  242. package/dist/index-D6V_7QbH.js +0 -99663
  243. package/dist/index-DHlP-IBS.js +0 -99663
  244. package/dist/utils/demo-responses.d.ts +0 -2
  245. package/dist/utils/gemini.d.ts +0 -8
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
@@ -35,6 +35,16 @@ interface ModernChatInputProps {
35
35
  onVoiceRecording?: (transcript: string) => void;
36
36
  /** Whether the input is being used in a full-page view (affects layout) */
37
37
  isFullPage?: boolean;
38
+ /** Whether to show audio input (voice recording). @default true */
39
+ enableAudioInput?: boolean;
40
+ /** Whether to show the file attachment button. @default true */
41
+ enableFileAttachment?: boolean;
42
+ /** Whether to show the "Create document" action. @default true */
43
+ enableDocumentCreation?: boolean;
44
+ /** Whether to show the "Generate podcast" action. @default true */
45
+ enablePodcastGeneration?: boolean;
46
+ /** Whether to show the "Search" action. @default true */
47
+ enableSearch?: boolean;
38
48
  }
39
49
 
40
50
  /**
@@ -58,7 +68,12 @@ export function ModernChatInput({
58
68
  onFileUpload,
59
69
  onAudioUpload,
60
70
  onVoiceRecording,
61
- isFullPage = false
71
+ isFullPage = false,
72
+ enableAudioInput = true,
73
+ enableFileAttachment = true,
74
+ enableDocumentCreation = true,
75
+ enablePodcastGeneration = true,
76
+ enableSearch = true,
62
77
  }: ModernChatInputProps) {
63
78
  const textareaRef = useRef<HTMLTextAreaElement>(null);
64
79
  const [isFocused, setIsFocused] = useState(false);
@@ -355,6 +370,7 @@ export function ModernChatInput({
355
370
  <div className="flex items-center justify-between">
356
371
  {/* Left Actions */}
357
372
  <div className="flex items-center gap-1">
373
+ {(enableDocumentCreation || enablePodcastGeneration || enableSearch) && (
358
374
  <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>
359
375
  <PopoverTrigger asChild>
360
376
  <Button
@@ -378,54 +394,62 @@ export function ModernChatInput({
378
394
  side="top"
379
395
  >
380
396
  <div className="space-y-1">
381
- <button
382
- onClick={() => handleActionSelect('document')}
383
- className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
384
- >
385
- <div className="w-8 h-8 rounded-full bg-[var(--chart-4)]/20 flex items-center justify-center group-hover:bg-[var(--chart-4)] transition-colors">
386
- <FileText className="w-4 h-4 text-[var(--chart-4)] group-hover:text-white" />
387
- </div>
388
- <div className="flex-1">
389
- <div>Criar documento</div>
390
- <div className="text-xs text-muted-foreground">
391
- Gere um documento completo
397
+ {enableDocumentCreation && (
398
+ <button
399
+ onClick={() => handleActionSelect('document')}
400
+ className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
401
+ >
402
+ <div className="w-8 h-8 rounded-full bg-[var(--chart-4)]/20 flex items-center justify-center group-hover:bg-[var(--chart-4)] transition-colors">
403
+ <FileText className="w-4 h-4 text-[var(--chart-4)] group-hover:text-white" />
392
404
  </div>
393
- </div>
394
- </button>
405
+ <div className="flex-1">
406
+ <div>Criar documento</div>
407
+ <div className="text-xs text-muted-foreground">
408
+ Gere um documento completo
409
+ </div>
410
+ </div>
411
+ </button>
412
+ )}
395
413
 
396
- <button
397
- onClick={() => handleActionSelect('podcast')}
398
- className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
399
- >
400
- <div className="w-8 h-8 rounded-full bg-[var(--chart-1)]/20 flex items-center justify-center group-hover:bg-[var(--chart-1)] transition-colors">
401
- <Radio className="w-4 h-4 text-[var(--chart-1)] group-hover:text-white" />
402
- </div>
403
- <div className="flex-1">
404
- <div>Gerar podcast</div>
405
- <div className="text-xs text-muted-foreground">
406
- Crie um podcast de áudio
414
+ {enablePodcastGeneration && (
415
+ <button
416
+ onClick={() => handleActionSelect('podcast')}
417
+ className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
418
+ >
419
+ <div className="w-8 h-8 rounded-full bg-[var(--chart-1)]/20 flex items-center justify-center group-hover:bg-[var(--chart-1)] transition-colors">
420
+ <Radio className="w-4 h-4 text-[var(--chart-1)] group-hover:text-white" />
421
+ </div>
422
+ <div className="flex-1">
423
+ <div>Gerar podcast</div>
424
+ <div className="text-xs text-muted-foreground">
425
+ Crie um podcast de áudio
426
+ </div>
407
427
  </div>
408
- </div>
409
- </button>
428
+ </button>
429
+ )}
410
430
 
411
- <button
412
- onClick={() => handleActionSelect('search')}
413
- className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
414
- >
415
- <div className="w-8 h-8 rounded-full bg-[var(--chart-2)]/20 flex items-center justify-center group-hover:bg-[var(--chart-2)] transition-colors">
416
- <Search className="w-4 h-4 text-[var(--chart-2)] group-hover:text-white" />
417
- </div>
418
- <div className="flex-1">
419
- <div>Pesquisar</div>
420
- <div className="text-xs text-muted-foreground">
421
- Busque por informações relevantes
431
+ {enableSearch && (
432
+ <button
433
+ onClick={() => handleActionSelect('search')}
434
+ className="w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-accent transition-colors text-left group"
435
+ >
436
+ <div className="w-8 h-8 rounded-full bg-[var(--chart-2)]/20 flex items-center justify-center group-hover:bg-[var(--chart-2)] transition-colors">
437
+ <Search className="w-4 h-4 text-[var(--chart-2)] group-hover:text-white" />
438
+ </div>
439
+ <div className="flex-1">
440
+ <div>Pesquisar</div>
441
+ <div className="text-xs text-muted-foreground">
442
+ Busque por informações relevantes
443
+ </div>
422
444
  </div>
423
- </div>
424
- </button>
445
+ </button>
446
+ )}
425
447
  </div>
426
448
  </PopoverContent>
427
449
  </Popover>
450
+ )}
428
451
 
452
+ {enableFileAttachment && (
429
453
  <motion.div
430
454
  whileHover={{ scale: 1.05 }}
431
455
  whileTap={{ scale: 0.95 }}
@@ -440,29 +464,32 @@ export function ModernChatInput({
440
464
  <Paperclip className="w-4 h-4" />
441
465
  </Button>
442
466
  </motion.div>
467
+ )}
443
468
  </div>
444
469
 
445
470
  {/* Right Actions */}
446
471
  <div className="flex items-center gap-1">
447
472
  {/* Voice Recording Button */}
448
- <motion.div
449
- whileHover={{ scale: 1.05 }}
450
- whileTap={{ scale: 0.95 }}
451
- >
452
- <Button
453
- variant="ghost"
454
- size="sm"
455
- onClick={handleVoiceRecording}
456
- className={`h-8 w-8 p-0 rounded-full transition-all duration-200 ${
457
- isRecording
458
- ? 'bg-destructive hover:bg-destructive/90 text-white animate-pulse'
459
- : 'text-muted-foreground hover:bg-accent hover:text-foreground'
460
- }`}
461
- aria-label={isRecording ? "Parar gravação" : "Sugerir com voz"}
473
+ {enableAudioInput && (
474
+ <motion.div
475
+ whileHover={{ scale: 1.05 }}
476
+ whileTap={{ scale: 0.95 }}
462
477
  >
463
- <Mic className="w-4 h-4" />
464
- </Button>
465
- </motion.div>
478
+ <Button
479
+ variant="ghost"
480
+ size="sm"
481
+ onClick={handleVoiceRecording}
482
+ className={`h-8 w-8 p-0 rounded-full transition-all duration-200 ${
483
+ isRecording
484
+ ? 'bg-destructive hover:bg-destructive/90 text-white animate-pulse'
485
+ : 'text-muted-foreground hover:bg-accent hover:text-foreground'
486
+ }`}
487
+ aria-label={isRecording ? "Parar gravação" : "Sugerir com voz"}
488
+ >
489
+ <Mic className="w-4 h-4" />
490
+ </Button>
491
+ </motion.div>
492
+ )}
466
493
 
467
494
  <AnimatePresence mode="wait">
468
495
  <motion.div
@@ -30,9 +30,42 @@ Adjusts maximum width and alignment for use in standalone chat pages.
30
30
 
31
31
  ---
32
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
+
33
65
  ## AI Best Practices
34
66
 
35
67
  > [!IMPORTANT]
36
68
  > - **Action Workflow** — Handle the `onSubmit` callback's optional `action` parameter to distinguish between standard text messages and intent-driven generations (Documents, Podcasts, Search).
37
69
  > - **State Sync** — Always maintain the `value` in a parent state and update it via `onChange` and `onVoiceRecording` to ensure consistent data binding.
38
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.
@@ -8,6 +8,28 @@ const meta: Meta<typeof ModernChatInput> = {
8
8
  parameters: {
9
9
  layout: 'centered',
10
10
  },
11
+ argTypes: {
12
+ enableAudioInput: {
13
+ control: 'boolean',
14
+ description: 'Whether to show audio input (voice recording).',
15
+ },
16
+ enableFileAttachment: {
17
+ control: 'boolean',
18
+ description: 'Whether to show the file attachment button.',
19
+ },
20
+ enableDocumentCreation: {
21
+ control: 'boolean',
22
+ description: 'Whether to show the "Create document" action.',
23
+ },
24
+ enablePodcastGeneration: {
25
+ control: 'boolean',
26
+ description: 'Whether to show the "Generate podcast" action.',
27
+ },
28
+ enableSearch: {
29
+ control: 'boolean',
30
+ description: 'Whether to show the "Search" action.',
31
+ },
32
+ },
11
33
  };
12
34
 
13
35
  export default meta;
@@ -51,3 +73,59 @@ export const FullPage: Story = {
51
73
  );
52
74
  },
53
75
  };
76
+
77
+ /**
78
+ * Text-only input: all action buttons and extras are disabled.
79
+ * Only the text input and send button remain.
80
+ */
81
+ export const TextOnly: Story = {
82
+ args: {
83
+ enableAudioInput: false,
84
+ enableFileAttachment: false,
85
+ enableDocumentCreation: false,
86
+ enablePodcastGeneration: false,
87
+ enableSearch: false,
88
+ },
89
+ render: (args) => {
90
+ const [value, setValue] = useState("");
91
+ return (
92
+ <div className="w-[600px]">
93
+ <ModernChatInput
94
+ {...args}
95
+ value={value}
96
+ onChange={setValue}
97
+ onSubmit={() => setValue("")}
98
+ />
99
+ </div>
100
+ );
101
+ },
102
+ };
103
+
104
+ /**
105
+ * Selective features: only document creation and search are enabled.
106
+ */
107
+ export const SelectiveActions: Story = {
108
+ args: {
109
+ enableAudioInput: false,
110
+ enableFileAttachment: false,
111
+ enableDocumentCreation: true,
112
+ enablePodcastGeneration: false,
113
+ enableSearch: true,
114
+ },
115
+ render: (args) => {
116
+ const [value, setValue] = useState("");
117
+ return (
118
+ <div className="w-[600px]">
119
+ <ModernChatInput
120
+ {...args}
121
+ value={value}
122
+ onChange={setValue}
123
+ onSubmit={(action) => {
124
+ alert(`Submitted: "${value}" ${action ? `with action: ${action}` : ""}`);
125
+ setValue("");
126
+ }}
127
+ />
128
+ </div>
129
+ );
130
+ },
131
+ };
@@ -12,6 +12,35 @@ import * as AssistantStories from './xertica-assistant.stories';
12
12
 
13
13
  ---
14
14
 
15
+ ## Feature Flags
16
+
17
+ Each assistant capability can be individually toggled on or off via boolean props.
18
+ All flags default to `true` for full backward compatibility.
19
+
20
+ | Prop | Controls | Default |
21
+ |---|---|---|
22
+ | `showHistory` | Conversation history tab and collapsed icon | `true` |
23
+ | `showFavorites` | Favorites tab and collapsed icon | `true` |
24
+ | `enableAudioInput` | Voice recording and audio upload | `true` |
25
+ | `enableFileAttachment` | File attachment button | `true` |
26
+ | `enableDocumentCreation` | "Create document" action in the input menu | `true` |
27
+ | `enablePodcastGeneration` | "Generate podcast" action and per-message button | `true` |
28
+ | `enableSearch` | "Search" action in the input menu | `true` |
29
+
30
+ ### Chat Only
31
+
32
+ All extra features disabled — the assistant provides only a basic text chat.
33
+
34
+ <Canvas of={AssistantStories.ChatOnly} />
35
+
36
+ ### Minimal Input
37
+
38
+ Only document creation and file attachment are enabled — ideal for document-focused workflows.
39
+
40
+ <Canvas of={AssistantStories.MinimalInput} />
41
+
42
+ ---
43
+
15
44
  ## Workspace Integration
16
45
 
17
46
  The assistant features specialized workspaces for different content types.
@@ -34,4 +63,4 @@ For focused work, the assistant can be expanded into a centered full-page layout
34
63
  > - **Layout Context** — Use `useLayout()` to toggle the assistant's visibility and track its state across the application.
35
64
  > - **Demo Mode** — Use `demoMode={true}` for prototyping; it provides rich mock responses for documents, charts, and media.
36
65
  > - **Custom Responses** — Leverage `responseGenerator` to bridge the assistant with your backend or custom LLM logic.
37
-
66
+ > - **Feature Flags** — Pass individual flags like `showHistory={false}` or `enableSearch={false}` to tailor the assistant's capabilities per use-case. Flags can be combined freely.
@@ -28,6 +28,34 @@ const meta: Meta<typeof XerticaAssistant> = {
28
28
  control: 'boolean',
29
29
  description: 'Whether the assistant is initially expanded.',
30
30
  },
31
+ showHistory: {
32
+ control: 'boolean',
33
+ description: 'Whether to show the conversation history tab and collapsed icon.',
34
+ },
35
+ showFavorites: {
36
+ control: 'boolean',
37
+ description: 'Whether to show the favorites tab and collapsed icon.',
38
+ },
39
+ enableAudioInput: {
40
+ control: 'boolean',
41
+ description: 'Whether to enable audio input (voice recording / audio upload) in the chat.',
42
+ },
43
+ enableFileAttachment: {
44
+ control: 'boolean',
45
+ description: 'Whether to enable file attachment in the chat input.',
46
+ },
47
+ enableDocumentCreation: {
48
+ control: 'boolean',
49
+ description: 'Whether to enable the "Create document" action in the chat input.',
50
+ },
51
+ enablePodcastGeneration: {
52
+ control: 'boolean',
53
+ description: 'Whether to enable podcast generation (action chip + per-message button).',
54
+ },
55
+ enableSearch: {
56
+ control: 'boolean',
57
+ description: 'Whether to enable the "Search" action in the chat input.',
58
+ },
31
59
  },
32
60
  };
33
61
 
@@ -101,3 +129,73 @@ export const DocumentEditing: Story = {
101
129
  },
102
130
  };
103
131
 
132
+ /**
133
+ * Chat-only mode: hides history, favorites, audio, file attachments,
134
+ * document creation, podcast generation, and search.
135
+ * Only the basic text chat remains.
136
+ */
137
+ export const ChatOnly: Story = {
138
+ decorators: [
139
+ (Story) => {
140
+ return (
141
+ <div className="h-screen w-full flex relative overflow-hidden bg-muted/30">
142
+ <div className="flex-1 flex flex-col p-8 gap-4">
143
+ <h1 className="text-2xl font-bold text-foreground">Chat Only Mode</h1>
144
+ <p className="text-muted-foreground">
145
+ All extra features are disabled. The assistant provides only a plain text chat interface.
146
+ </p>
147
+ </div>
148
+ <Story />
149
+ </div>
150
+ );
151
+ },
152
+ ],
153
+ args: {
154
+ mode: 'expanded',
155
+ isExpanded: true,
156
+ userName: 'Jane Smith',
157
+ demoMode: true,
158
+ showHistory: false,
159
+ showFavorites: false,
160
+ enableAudioInput: false,
161
+ enableFileAttachment: false,
162
+ enableDocumentCreation: false,
163
+ enablePodcastGeneration: false,
164
+ enableSearch: false,
165
+ },
166
+ };
167
+
168
+ /**
169
+ * Minimal input mode: only document creation and file attachment are enabled.
170
+ * No audio input, no podcast generation, no search, no history, no favorites.
171
+ */
172
+ export const MinimalInput: Story = {
173
+ decorators: [
174
+ (Story) => {
175
+ return (
176
+ <div className="h-screen w-full flex relative overflow-hidden bg-muted/30">
177
+ <div className="flex-1 flex flex-col p-8 gap-4">
178
+ <h1 className="text-2xl font-bold text-foreground">Minimal Input Mode</h1>
179
+ <p className="text-muted-foreground">
180
+ Only document creation and file attachment are enabled — ideal for a focused document-generation workflow.
181
+ </p>
182
+ </div>
183
+ <Story />
184
+ </div>
185
+ );
186
+ },
187
+ ],
188
+ args: {
189
+ mode: 'expanded',
190
+ isExpanded: true,
191
+ userName: 'Jane Smith',
192
+ demoMode: true,
193
+ showHistory: false,
194
+ showFavorites: false,
195
+ enableAudioInput: false,
196
+ enableFileAttachment: true,
197
+ enableDocumentCreation: true,
198
+ enablePodcastGeneration: false,
199
+ enableSearch: false,
200
+ },
201
+ };