xertica-ui 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +1 -1
- package/bin/cli.ts +1 -1
- package/bin/generate-tokens.ts +13 -7
- package/components/assistant/xertica-assistant/index.ts +2 -0
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +97 -0
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -0
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -0
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +86 -0
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +77 -0
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +573 -0
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +65 -0
- package/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.tsx +41 -0
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +98 -0
- package/components/assistant/xertica-assistant/parts/index.ts +16 -0
- package/components/assistant/xertica-assistant/types.ts +139 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +559 -0
- package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +198 -1460
- package/components/brand/theme-toggle/ThemeToggle.tsx +8 -27
- package/components/hooks/index.ts +3 -0
- package/components/hooks/use-layout-shortcuts.ts +46 -0
- package/components/layout/sidebar/index.ts +2 -0
- package/components/layout/sidebar/sidebar.stories.tsx +160 -8
- package/components/layout/sidebar/sidebar.tsx +606 -497
- package/components/layout/sidebar/use-sidebar.ts +104 -0
- package/components/media/audio-player/AudioPlayer.tsx +131 -206
- package/components/media/audio-player/use-audio-player.ts +298 -0
- package/components/pages/home-page/HomePage.tsx +1 -1
- package/components/pages/template-content/TemplateContent.tsx +5 -5
- package/components/pages/template-page/TemplatePage.tsx +5 -5
- package/components/shared/CustomTooltipContent.tsx +52 -0
- package/components/shared/layout-constants.ts +1 -1
- package/components/ui/chart/chart.stories.tsx +966 -7
- package/components/ui/chart/chart.tsx +918 -45
- package/components/ui/file-upload/file-upload.stories.tsx +100 -0
- package/components/ui/file-upload/file-upload.tsx +14 -74
- package/components/ui/file-upload/index.ts +1 -0
- package/components/ui/file-upload/use-file-upload.ts +181 -0
- package/components/ui/pagination/index.ts +2 -0
- package/components/ui/pagination/pagination.stories.tsx +94 -0
- package/components/ui/pagination/use-pagination.ts +194 -0
- package/components/ui/rich-text-editor/index.ts +2 -0
- package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
- package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
- package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
- package/components/ui/stepper/index.ts +3 -1
- package/components/ui/stepper/stepper.stories.tsx +116 -0
- package/components/ui/stepper/stepper.tsx +4 -4
- package/components/ui/stepper/use-stepper.ts +137 -0
- package/components/ui/tree-view/index.ts +4 -1
- package/components/ui/tree-view/tree-view.stories.tsx +110 -4
- package/components/ui/tree-view/tree-view.tsx +17 -125
- package/components/ui/tree-view/use-tree-view.ts +229 -0
- package/contexts/AssistenteContext.tsx +17 -54
- package/contexts/BrandColorsContext.tsx +6 -17
- package/contexts/LayoutContext.tsx +5 -31
- package/dist/AssistantChart-BAudAfne.cjs +3591 -0
- package/dist/AssistantChart-BP8upjMk.js +3565 -0
- package/dist/AudioPlayer-1ypwE2Wh.cjs +936 -0
- package/dist/AudioPlayer-DuKXrCfy.js +937 -0
- package/dist/CustomTooltipContent-DHjkY0ww.js +40 -0
- package/dist/CustomTooltipContent-c_K-DWRr.cjs +56 -0
- package/dist/LanguageContext-BwhwC3G2.js +657 -0
- package/dist/LanguageContext-DvUt5jBg.cjs +656 -0
- package/dist/LayoutContext-BDmcZfMH.cjs +84 -0
- package/dist/LayoutContext-dbQvdC4O.js +85 -0
- package/dist/ThemeContext-RTy1m2Uq.js +82 -0
- package/dist/ThemeContext-bSzuOit2.cjs +81 -0
- package/dist/VerifyEmailPage-C_ihbcth.js +2828 -0
- package/dist/VerifyEmailPage-Dt7zgA4w.cjs +2827 -0
- package/dist/XerticaProvider-CW9hpCdF.cjs +39 -0
- package/dist/XerticaProvider-siSt9uG2.js +40 -0
- package/dist/XerticaXLogo-D8jf0SNv.cjs +214 -0
- package/dist/XerticaXLogo-fAJMy3H4.js +215 -0
- package/dist/assistant.cjs.js +2 -1
- package/dist/assistant.es.js +3 -2
- package/dist/brand.cjs.js +2 -2
- package/dist/brand.es.js +2 -2
- package/dist/cli.js +14 -8
- package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +19 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +11 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +29 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +4 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/index.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/types.d.ts +106 -0
- package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +125 -0
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +8 -97
- package/dist/components/hooks/index.d.ts +3 -0
- package/dist/components/hooks/use-layout-shortcuts.d.ts +22 -0
- package/dist/components/layout/sidebar/index.d.ts +2 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
- package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
- package/dist/components/media/audio-player/AudioPlayer.d.ts +4 -1
- package/dist/components/media/audio-player/use-audio-player.d.ts +72 -0
- package/dist/components/shared/CustomTooltipContent.d.ts +20 -0
- package/dist/components/shared/layout-constants.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/chart/chart.d.ts +162 -5
- package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
- package/dist/components/ui/file-upload/index.d.ts +1 -0
- package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
- package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
- package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
- package/dist/components/ui/stepper/index.d.ts +3 -1
- package/dist/components/ui/stepper/stepper.d.ts +2 -2
- package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
- package/dist/components/ui/tree-view/index.d.ts +4 -1
- package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
- package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -0
- package/dist/contexts/AssistenteContext.d.ts +10 -49
- package/dist/hooks.cjs.js +30 -10
- package/dist/hooks.es.js +25 -4
- package/dist/index.cjs.js +20 -9
- package/dist/index.es.js +38 -27
- package/dist/layout.cjs.js +82 -1
- package/dist/layout.es.js +83 -2
- package/dist/media.cjs.js +1 -1
- package/dist/media.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/rich-text-editor-BmsjY03B.js +2949 -0
- package/dist/rich-text-editor-GS2kpTAK.cjs +2966 -0
- package/dist/sidebar-CVUGHOS_.cjs +756 -0
- package/dist/sidebar-CmvwjnVb.js +757 -0
- package/dist/ui.cjs.js +12 -2
- package/dist/ui.es.js +24 -14
- package/dist/use-audio-player-Bkh23vQ3.js +177 -0
- package/dist/use-audio-player-Dn1NR9xN.cjs +176 -0
- package/dist/utils/color-utils.d.ts +51 -0
- package/dist/xertica-assistant-BMqdyRVi.js +2082 -0
- package/dist/xertica-assistant-Bj3vBCq_.cjs +2081 -0
- package/dist/xertica-ui.css +1 -1
- package/docs/ai-usage.md +28 -10
- package/docs/architecture-improvements.md +463 -0
- package/docs/architecture.md +77 -1
- package/docs/components/assistant-chart.md +1 -1
- package/docs/components/assistant.md +159 -0
- package/docs/components/audio-player.md +46 -0
- package/docs/components/branding.md +251 -0
- package/docs/components/chart.md +354 -39
- package/docs/components/code-block.md +108 -0
- package/docs/components/file-upload.md +119 -2
- package/docs/components/formatted-document.md +113 -0
- package/docs/components/hooks.md +430 -0
- package/docs/components/image-with-fallback.md +106 -0
- package/docs/components/map-layers.md +140 -0
- package/docs/components/modern-chat-input.md +163 -0
- package/docs/components/pages.md +351 -0
- package/docs/components/pagination.md +187 -0
- package/docs/components/rich-text-editor.md +164 -0
- package/docs/components/sidebar.md +153 -4
- package/docs/components/stepper.md +157 -12
- package/docs/components/tree-view.md +164 -6
- package/docs/doc-audit.md +223 -0
- package/docs/getting-started.md +155 -1
- package/docs/guidelines.md +14 -8
- package/docs/layout.md +2 -2
- package/docs/llms.md +29 -9
- package/docs/patterns/detail-page.md +276 -0
- package/docs/patterns/settings.md +346 -0
- package/docs/patterns/wizard.md +217 -0
- package/guidelines/Guidelines.md +5 -3
- package/llms.txt +1 -1
- package/package.json +10 -10
- package/styles/xertica/tokens.css +41 -12
- package/templates/CLAUDE.md +16 -6
- package/templates/guidelines/Guidelines.md +16 -4
- package/templates/package.json +3 -3
- package/templates/src/styles/xertica/tokens.css +39 -10
- package/utils/color-utils.ts +72 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface EditingDocument {
|
|
2
|
+
content: string;
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
interface AssistantDocumentEditorProps {
|
|
6
|
+
document: EditingDocument;
|
|
7
|
+
isMobile: boolean;
|
|
8
|
+
containerWidth: string;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onChange: (doc: EditingDocument) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* AssistantDocumentEditor — Overlay panel with a rich text editor for editing documents
|
|
14
|
+
* generated by the assistant. Slides in from the left of the assistant panel.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AssistantDocumentEditor({ document, isMobile, containerWidth, onClose, onChange, }: AssistantDocumentEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface EvaluationState {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
messageId: string | null;
|
|
4
|
+
type?: 'dislike' | null;
|
|
5
|
+
category?: string | null;
|
|
6
|
+
reason: string;
|
|
7
|
+
}
|
|
8
|
+
interface AssistantFeedbackDialogProps {
|
|
9
|
+
state: EvaluationState;
|
|
10
|
+
onReasonChange: (reason: string) => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onSubmit: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* AssistantFeedbackDialog — Modal dialog for collecting negative feedback (dislike) on messages.
|
|
16
|
+
* Supports both categorized feedback (from feedbackOptions) and free-text input.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AssistantFeedbackDialog({ state, onReasonChange, onClose, onSubmit, }: AssistantFeedbackDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface AssistantHeaderProps {
|
|
2
|
+
isExpanded: boolean;
|
|
3
|
+
onToggle: () => void;
|
|
4
|
+
onNavigateFullPage?: () => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* AssistantHeader — Top bar shown in expanded/collapsed (non-fullPage) mode.
|
|
8
|
+
* Contains the Xertica Orbe logo, title, expand-to-full-page button, and toggle button.
|
|
9
|
+
*/
|
|
10
|
+
export declare function AssistantHeader({ isExpanded, onToggle, onNavigateFullPage, }: AssistantHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Message, SearchResult } from '../types';
|
|
2
|
+
interface AssistantMessageBubbleProps {
|
|
3
|
+
msg: Message;
|
|
4
|
+
copiedId: string | null;
|
|
5
|
+
generatingPodcastId: string | null;
|
|
6
|
+
executingCommand: string | null;
|
|
7
|
+
savedSearches: string[];
|
|
8
|
+
enablePodcastGeneration: boolean;
|
|
9
|
+
feedbackOptions?: string[];
|
|
10
|
+
onCopyMessage: (content: string, id: string) => void;
|
|
11
|
+
onToggleFavorite: (id: string) => void;
|
|
12
|
+
onGeneratePodcast: (id: string, content: string) => void;
|
|
13
|
+
onDownloadDocument: (content: string, fileName: string) => void;
|
|
14
|
+
onDownloadPodcast: (audioUrl: string, fileName: string) => void;
|
|
15
|
+
onEditDocument: (content: string, title: string) => void;
|
|
16
|
+
onOpenSearchResult: (result: SearchResult) => void;
|
|
17
|
+
onExecuteSearchCommand: (commandId: string, query: string, results: SearchResult[], messageId: string) => void;
|
|
18
|
+
onEvaluationClick: (id: string, type: 'like' | 'dislike') => void;
|
|
19
|
+
onOpenFeedbackDialog: (id: string, category: string | null) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* AssistantMessageBubble — Renders a single chat message with all supported content types:
|
|
23
|
+
* plain text, Markdown, charts, tables, documents, podcasts, and search results.
|
|
24
|
+
*
|
|
25
|
+
* Handles both user and assistant message styles, plus per-message action buttons
|
|
26
|
+
* (copy, like/dislike, podcast generation).
|
|
27
|
+
*/
|
|
28
|
+
export declare function AssistantMessageBubble({ msg, copiedId, generatingPodcastId, executingCommand, savedSearches, enablePodcastGeneration, feedbackOptions, onCopyMessage, onToggleFavorite, onGeneratePodcast, onDownloadDocument, onDownloadPodcast, onEditDocument, onOpenSearchResult, onExecuteSearchCommand, onEvaluationClick, onOpenFeedbackDialog, }: AssistantMessageBubbleProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AssistantTab } from '../types';
|
|
2
|
+
interface AssistantTabBarProps {
|
|
3
|
+
activeTab: AssistantTab;
|
|
4
|
+
showHistory: boolean;
|
|
5
|
+
showFavorites: boolean;
|
|
6
|
+
onTabChange: (tab: AssistantTab) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* AssistantTabBar — Navigation tabs for Chat, History, and Favorites.
|
|
10
|
+
* Only rendered in expanded (non-fullPage) mode when at least one secondary tab is enabled.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AssistantTabBar({ activeTab, showHistory, showFavorites, onTabChange, }: AssistantTabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Suggestion } from '../types';
|
|
2
|
+
interface AssistantWelcomeScreenProps {
|
|
3
|
+
userName: string;
|
|
4
|
+
welcomeMessage: string;
|
|
5
|
+
suggestions: Suggestion[];
|
|
6
|
+
richSuggestions: Suggestion[];
|
|
7
|
+
showMoreSuggestions: boolean;
|
|
8
|
+
onSetShowMoreSuggestions: (show: boolean) => void;
|
|
9
|
+
onSendSuggestion: (text: string) => void;
|
|
10
|
+
onRichSuggestionClick: (suggestion: Suggestion) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* AssistantWelcomeScreen — Empty state shown when there are no messages yet.
|
|
14
|
+
* Displays the Xertica Orbe, a greeting, and suggestion chips.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AssistantWelcomeScreen({ userName, welcomeMessage, suggestions, richSuggestions, showMoreSuggestions, onSetShowMoreSuggestions, onSendSuggestion, onRichSuggestionClick, }: AssistantWelcomeScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-components for XerticaAssistant.
|
|
3
|
+
*
|
|
4
|
+
* These are internal building blocks — not part of the public library API.
|
|
5
|
+
* Import them only from within the `xertica-assistant` directory.
|
|
6
|
+
*/
|
|
7
|
+
export { AssistantCollapsedView } from './AssistantCollapsedView';
|
|
8
|
+
export { AssistantHeader } from './AssistantHeader';
|
|
9
|
+
export { AssistantTabBar } from './AssistantTabBar';
|
|
10
|
+
export { AssistantWelcomeScreen } from './AssistantWelcomeScreen';
|
|
11
|
+
export { AssistantMessageBubble } from './AssistantMessageBubble';
|
|
12
|
+
export { AssistantTypingIndicator } from './AssistantTypingIndicator';
|
|
13
|
+
export { AssistantConversationList } from './AssistantConversationList';
|
|
14
|
+
export { AssistantFeedbackDialog } from './AssistantFeedbackDialog';
|
|
15
|
+
export { AssistantDocumentEditor } from './AssistantDocumentEditor';
|
|
16
|
+
export type { EvaluationState } from './AssistantFeedbackDialog';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @file types.ts
|
|
4
|
+
* Shared TypeScript types for the XerticaAssistant component and related hooks/contexts.
|
|
5
|
+
*
|
|
6
|
+
* These types are the single source of truth — imported by:
|
|
7
|
+
* - `xertica-assistant.tsx`
|
|
8
|
+
* - `use-assistant.ts`
|
|
9
|
+
* - `contexts/AssistenteContext.tsx`
|
|
10
|
+
*/
|
|
11
|
+
/** Supported message sender types in the assistant */
|
|
12
|
+
export type MessageType = 'user' | 'assistant' | 'system';
|
|
13
|
+
/** Supported attachment types that can be included in messages */
|
|
14
|
+
export type AttachmentType = 'file' | 'audio' | 'image' | 'video' | 'document' | 'podcast' | 'search';
|
|
15
|
+
/** Supported search result categories */
|
|
16
|
+
export type SearchResultType = 'document' | 'project' | 'conversation' | 'file' | 'contact';
|
|
17
|
+
/** Layout mode for the assistant panel */
|
|
18
|
+
export type AssistantMode = 'collapsed' | 'expanded' | 'fullPage';
|
|
19
|
+
/** Available tabs in the assistant panel */
|
|
20
|
+
export type AssistantTab = 'chat' | 'historico' | 'favoritos';
|
|
21
|
+
/**
|
|
22
|
+
* Individual search result item returned by an assistant search query.
|
|
23
|
+
*/
|
|
24
|
+
export interface SearchResult {
|
|
25
|
+
id: string;
|
|
26
|
+
type: SearchResultType;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
path: string;
|
|
30
|
+
relevance: number;
|
|
31
|
+
lastModified?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Metadata about a search source (e.g., a document repository or knowledge base).
|
|
35
|
+
*/
|
|
36
|
+
export interface SearchSource {
|
|
37
|
+
name: string;
|
|
38
|
+
count: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A quick-action command shown below a search result message.
|
|
42
|
+
*/
|
|
43
|
+
export interface SearchCommand {
|
|
44
|
+
id: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
label: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A single chat message in the assistant conversation.
|
|
51
|
+
*/
|
|
52
|
+
export interface Message {
|
|
53
|
+
id: string;
|
|
54
|
+
type: MessageType;
|
|
55
|
+
content: string;
|
|
56
|
+
timestamp: Date;
|
|
57
|
+
isFavorite?: boolean;
|
|
58
|
+
attachmentType?: AttachmentType;
|
|
59
|
+
attachmentName?: string;
|
|
60
|
+
documentContent?: string;
|
|
61
|
+
documentTitle?: string;
|
|
62
|
+
audioUrl?: string;
|
|
63
|
+
searchResults?: SearchResult[];
|
|
64
|
+
searchSources?: SearchSource[];
|
|
65
|
+
searchCommands?: SearchCommand[];
|
|
66
|
+
chartData?: any[];
|
|
67
|
+
chartConfig?: any;
|
|
68
|
+
tableData?: {
|
|
69
|
+
caption?: string;
|
|
70
|
+
headers: string[];
|
|
71
|
+
rows: (string | ReactNode)[][];
|
|
72
|
+
};
|
|
73
|
+
evaluation?: 'like' | 'dislike';
|
|
74
|
+
evaluationReason?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A saved conversation entry shown in the history panel.
|
|
78
|
+
*/
|
|
79
|
+
export interface Conversation {
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
lastMessage?: string;
|
|
83
|
+
timestamp: string;
|
|
84
|
+
isFavorite: boolean;
|
|
85
|
+
messages: Message[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A suggested prompt shown to the user in the chat input area.
|
|
89
|
+
*/
|
|
90
|
+
export interface Suggestion {
|
|
91
|
+
id: string;
|
|
92
|
+
text: string;
|
|
93
|
+
icon?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A mock response entry used in demo mode.
|
|
97
|
+
* Matches a user message via `trigger` and returns a predefined `response`.
|
|
98
|
+
*/
|
|
99
|
+
export interface MockResponse {
|
|
100
|
+
/** String or regex to match against the user's message */
|
|
101
|
+
trigger: string | RegExp;
|
|
102
|
+
/** Response content — either a plain string or a partial Message object */
|
|
103
|
+
response: string | Partial<Message>;
|
|
104
|
+
/** Optional delay in milliseconds before the response appears */
|
|
105
|
+
delay?: number;
|
|
106
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { Message, Conversation, Suggestion, AssistantTab, AssistantMode, SearchResult, MockResponse } from './types';
|
|
2
|
+
export interface UseAssistantProps {
|
|
3
|
+
/** Layout mode for the assistant panel */
|
|
4
|
+
mode?: AssistantMode;
|
|
5
|
+
/** Controlled expansion state */
|
|
6
|
+
isExpanded?: boolean;
|
|
7
|
+
/** Toggle callback for controlled expansion */
|
|
8
|
+
onToggle?: () => void;
|
|
9
|
+
/** Initially selected tab */
|
|
10
|
+
defaultTab?: AssistantTab;
|
|
11
|
+
/** Enables demo mode with mock AI responses */
|
|
12
|
+
demoMode?: boolean;
|
|
13
|
+
/** Custom mock responses for demo mode */
|
|
14
|
+
customResponses?: MockResponse[];
|
|
15
|
+
/** Pre-loaded messages to hydrate an existing conversation */
|
|
16
|
+
initialMessages?: Message[];
|
|
17
|
+
/** Previously saved conversations */
|
|
18
|
+
savedConversations?: Conversation[];
|
|
19
|
+
/** Suggested prompts shown in the empty state */
|
|
20
|
+
suggestions?: Suggestion[];
|
|
21
|
+
/** Callback fired when the user sends a message */
|
|
22
|
+
onSendMessage?: (message: string) => void;
|
|
23
|
+
/** Whether the assistant is currently processing a response */
|
|
24
|
+
isProcessing?: boolean;
|
|
25
|
+
/** Custom response generator — overrides demo mode defaults */
|
|
26
|
+
responseGenerator?: (message: string) => Promise<string | Partial<Message>> | string | Partial<Message>;
|
|
27
|
+
/** Extended suggestions shown when the user clicks "More suggestions" */
|
|
28
|
+
richSuggestions?: Suggestion[];
|
|
29
|
+
/** Callback fired when the user clicks a rich suggestion */
|
|
30
|
+
onRichAction?: (actionId: string, actionText: string) => void;
|
|
31
|
+
/** Callback fired when the user rates a message */
|
|
32
|
+
onEvaluation?: (messageId: string, type: 'like' | 'dislike', reason?: string) => void;
|
|
33
|
+
/** Negative feedback categories shown in the dislike dropdown */
|
|
34
|
+
feedbackOptions?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface UseAssistantReturn {
|
|
37
|
+
isFullPage: boolean;
|
|
38
|
+
isExpanded: boolean;
|
|
39
|
+
isMobile: boolean;
|
|
40
|
+
abaSelecionada: AssistantTab;
|
|
41
|
+
setAbaSelecionada: (tab: AssistantTab) => void;
|
|
42
|
+
mensagens: Message[];
|
|
43
|
+
setMensagens: React.Dispatch<React.SetStateAction<Message[]>>;
|
|
44
|
+
mensagem: string;
|
|
45
|
+
setMensagem: (value: string) => void;
|
|
46
|
+
conversas: Conversation[];
|
|
47
|
+
conversaAtual: string | null;
|
|
48
|
+
conversasFiltradas: Conversation[];
|
|
49
|
+
copiedId: string | null;
|
|
50
|
+
generatingPodcastId: string | null;
|
|
51
|
+
executingCommand: string | null;
|
|
52
|
+
savedSearches: string[];
|
|
53
|
+
editingDocument: {
|
|
54
|
+
content: string;
|
|
55
|
+
title: string;
|
|
56
|
+
} | null;
|
|
57
|
+
setEditingDocument: (doc: {
|
|
58
|
+
content: string;
|
|
59
|
+
title: string;
|
|
60
|
+
} | null) => void;
|
|
61
|
+
showMoreSuggestions: boolean;
|
|
62
|
+
setShowMoreSuggestions: (show: boolean) => void;
|
|
63
|
+
evaluationState: {
|
|
64
|
+
isOpen: boolean;
|
|
65
|
+
messageId: string | null;
|
|
66
|
+
type: 'dislike' | null;
|
|
67
|
+
category?: string | null;
|
|
68
|
+
reason: string;
|
|
69
|
+
};
|
|
70
|
+
setEvaluationState: React.Dispatch<React.SetStateAction<UseAssistantReturn['evaluationState']>>;
|
|
71
|
+
sugestoes: Suggestion[];
|
|
72
|
+
messagesEndRef: React.RefObject<HTMLDivElement>;
|
|
73
|
+
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
74
|
+
audioInputRef: React.RefObject<HTMLInputElement>;
|
|
75
|
+
handleToggle: () => void;
|
|
76
|
+
handleExpandWithTab: (tab: AssistantTab) => void;
|
|
77
|
+
handleEnviarMensagem: (arg?: string | any) => Promise<void>;
|
|
78
|
+
handleToggleFavorite: (messageId: string) => void;
|
|
79
|
+
handleCopyMessage: (content: string, messageId: string) => Promise<void>;
|
|
80
|
+
handleGeneratePodcast: (messageId: string, content: string) => Promise<void>;
|
|
81
|
+
handleDownloadDocument: (content: string, fileName: string) => void;
|
|
82
|
+
handleDownloadPodcast: (audioUrl: string, fileName: string) => void;
|
|
83
|
+
handleEditDocument: (content: string, title: string) => void;
|
|
84
|
+
handleNovaConversa: () => void;
|
|
85
|
+
handleSelecionarConversa: (conversaId: string) => void;
|
|
86
|
+
handleToggleFavoritaConversa: (conversaId: string) => void;
|
|
87
|
+
handleOpenSearchResult: (result: SearchResult) => void;
|
|
88
|
+
handleExecuteSearchCommand: (commandId: string, searchTerm: string, results: SearchResult[], messageId: string) => Promise<void>;
|
|
89
|
+
handleRichSuggestionClick: (suggestion: Suggestion) => void;
|
|
90
|
+
handleEvaluationClick: (messageId: string, type: 'like' | 'dislike') => void;
|
|
91
|
+
openFeedbackDialog: (messageId: string, category: string | null) => void;
|
|
92
|
+
handleSubmitDislike: () => void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `useAssistant` — Headless hook for the XerticaAssistant component.
|
|
96
|
+
*
|
|
97
|
+
* Encapsulates all state management and business logic for the AI assistant panel.
|
|
98
|
+
* Use this hook when you need to build a fully custom assistant UI while reusing
|
|
99
|
+
* the same state logic as the default `XerticaAssistant` component.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* import { useAssistant } from 'xertica-ui/assistant';
|
|
104
|
+
*
|
|
105
|
+
* function MyCustomAssistant() {
|
|
106
|
+
* const {
|
|
107
|
+
* mensagens,
|
|
108
|
+
* mensagem,
|
|
109
|
+
* setMensagem,
|
|
110
|
+
* handleEnviarMensagem,
|
|
111
|
+
* isExpanded,
|
|
112
|
+
* handleToggle,
|
|
113
|
+
* } = useAssistant({ demoMode: true });
|
|
114
|
+
*
|
|
115
|
+
* return (
|
|
116
|
+
* <div>
|
|
117
|
+
* {mensagens.map(msg => <p key={msg.id}>{msg.content}</p>)}
|
|
118
|
+
* <input value={mensagem} onChange={e => setMensagem(e.target.value)} />
|
|
119
|
+
* <button onClick={() => handleEnviarMensagem()}>Send</button>
|
|
120
|
+
* </div>
|
|
121
|
+
* );
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare function useAssistant({ mode, isExpanded: controlledIsExpanded, onToggle, defaultTab, demoMode, customResponses, initialMessages, savedConversations, suggestions: propSuggestions, onSendMessage, isProcessing, responseGenerator, richSuggestions, onRichAction, onEvaluation, }?: UseAssistantProps): UseAssistantReturn;
|
|
@@ -1,99 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
* Supported message sender types in the assistant
|
|
4
|
-
*/
|
|
5
|
-
export type MessageType = 'user' | 'assistant' | 'system';
|
|
6
|
-
/**
|
|
7
|
-
* Supported attachment types that can be included in messages
|
|
8
|
-
*/
|
|
9
|
-
export type AttachmentType = 'file' | 'audio' | 'image' | 'video' | 'document' | 'podcast' | 'search';
|
|
10
|
-
/**
|
|
11
|
-
* Supported search result categories
|
|
12
|
-
*/
|
|
13
|
-
export type SearchResultType = 'document' | 'project' | 'conversation' | 'file' | 'contact';
|
|
14
|
-
/**
|
|
15
|
-
* Individual search result item returned by an assistant search query
|
|
16
|
-
*/
|
|
17
|
-
export interface SearchResult {
|
|
18
|
-
id: string;
|
|
19
|
-
type: SearchResultType;
|
|
20
|
-
title: string;
|
|
21
|
-
description: string;
|
|
22
|
-
path: string;
|
|
23
|
-
relevance: number;
|
|
24
|
-
lastModified?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Metadata about a search source (e.g., a document repository or knowledge base)
|
|
28
|
-
*/
|
|
29
|
-
export interface SearchSource {
|
|
30
|
-
name: string;
|
|
31
|
-
count: number;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* A quick-action command shown below a search result message
|
|
35
|
-
*/
|
|
36
|
-
export interface SearchCommand {
|
|
37
|
-
id: string;
|
|
38
|
-
icon: string;
|
|
39
|
-
label: string;
|
|
40
|
-
description: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A single chat message in the assistant conversation
|
|
44
|
-
*/
|
|
45
|
-
export interface Message {
|
|
46
|
-
id: string;
|
|
47
|
-
type: MessageType;
|
|
48
|
-
content: string;
|
|
49
|
-
timestamp: Date;
|
|
50
|
-
isFavorite?: boolean;
|
|
51
|
-
attachmentType?: AttachmentType;
|
|
52
|
-
attachmentName?: string;
|
|
53
|
-
documentContent?: string;
|
|
54
|
-
documentTitle?: string;
|
|
55
|
-
audioUrl?: string;
|
|
56
|
-
searchResults?: SearchResult[];
|
|
57
|
-
searchSources?: SearchSource[];
|
|
58
|
-
searchCommands?: SearchCommand[];
|
|
59
|
-
chartData?: any[];
|
|
60
|
-
chartConfig?: any;
|
|
61
|
-
tableData?: {
|
|
62
|
-
caption?: string;
|
|
63
|
-
headers: string[];
|
|
64
|
-
rows: (string | React.ReactNode)[][];
|
|
65
|
-
};
|
|
66
|
-
evaluation?: 'like' | 'dislike';
|
|
67
|
-
evaluationReason?: string;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A saved conversation entry shown in the history panel
|
|
71
|
-
*/
|
|
72
|
-
export interface Conversation {
|
|
73
|
-
id: string;
|
|
74
|
-
title: string;
|
|
75
|
-
lastMessage?: string;
|
|
76
|
-
timestamp: string;
|
|
77
|
-
isFavorite: boolean;
|
|
78
|
-
messages: Message[];
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* A suggested prompt shown to the user in the chat input area
|
|
82
|
-
*/
|
|
83
|
-
export interface Suggestion {
|
|
84
|
-
id: string;
|
|
85
|
-
text: string;
|
|
86
|
-
icon?: React.ReactNode;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Layout mode for the assistant panel
|
|
90
|
-
*/
|
|
91
|
-
export type AssistantMode = 'collapsed' | 'expanded' | 'fullPage';
|
|
92
|
-
/**
|
|
93
|
-
* Available tabs in the assistant panel
|
|
94
|
-
*/
|
|
95
|
-
export type AssistantTab = 'chat' | 'historico' | 'favoritos';
|
|
96
|
-
import { type MockResponse } from '../../shared/assistant-utils';
|
|
1
|
+
import type { MessageType, AttachmentType, SearchResultType, AssistantMode, AssistantTab, SearchResult, SearchSource, SearchCommand, Message, Conversation, Suggestion, MockResponse } from './types';
|
|
2
|
+
export type { MessageType, AttachmentType, SearchResultType, AssistantMode, AssistantTab, SearchResult, SearchSource, SearchCommand, Message, Conversation, Suggestion, MockResponse, };
|
|
97
3
|
export interface XerticaAssistantProps {
|
|
98
4
|
/**
|
|
99
5
|
* Layout mode for the assistant panel
|
|
@@ -147,6 +53,11 @@ export interface XerticaAssistantProps {
|
|
|
147
53
|
* Suggested prompts shown to the user in the empty state
|
|
148
54
|
*/
|
|
149
55
|
suggestions?: Suggestion[];
|
|
56
|
+
/**
|
|
57
|
+
* Subtitle shown below the user's name in the empty state.
|
|
58
|
+
* @default 'Como posso ajudar?'
|
|
59
|
+
*/
|
|
60
|
+
welcomeMessage?: string;
|
|
150
61
|
/**
|
|
151
62
|
* Callback fired when the user sends a message
|
|
152
63
|
*/
|
|
@@ -274,4 +185,4 @@ export interface XerticaAssistantProps {
|
|
|
274
185
|
* 2. Use `onSendMessage` to capture user input and `responseGenerator` to provide AI responses in demo mode.
|
|
275
186
|
* 3. Supports automatic Markdown rendering and syntax-highlighted code blocks.
|
|
276
187
|
*/
|
|
277
|
-
export declare function XerticaAssistant({ mode, isExpanded: controlledIsExpanded, onToggle, defaultTab, demoMode, onNavigateSettings, onNavigateFullPage, userName, initialMessages, savedConversations, suggestions: propSuggestions, onSendMessage, onFileAttach, isProcessing, width, height, className, mobileFloating, customResponses, responseGenerator, richSuggestions, onRichAction, onEvaluation, feedbackOptions, showHistory, showFavorites, enableAudioInput, enableFileAttachment, enableDocumentCreation, enablePodcastGeneration, enableSearch, }: XerticaAssistantProps): import("react/jsx-runtime").JSX.Element;
|
|
188
|
+
export declare function XerticaAssistant({ mode, isExpanded: controlledIsExpanded, onToggle, defaultTab, demoMode, onNavigateSettings, onNavigateFullPage, userName, initialMessages, savedConversations, suggestions: propSuggestions, onSendMessage, onFileAttach, isProcessing, width, height, className, mobileFloating, customResponses, responseGenerator, richSuggestions, welcomeMessage, onRichAction, onEvaluation, feedbackOptions, showHistory, showFavorites, enableAudioInput, enableFileAttachment, enableDocumentCreation, enablePodcastGeneration, enableSearch, }: XerticaAssistantProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,3 +5,6 @@ export * from '../../contexts/BrandColorsContext';
|
|
|
5
5
|
export * from '../../contexts/AssistenteContext';
|
|
6
6
|
export * from '../../contexts/ApiKeyContext';
|
|
7
7
|
export { useMobile, useIsMobile } from '../shared/use-mobile';
|
|
8
|
+
export { useLayoutShortcuts } from './use-layout-shortcuts';
|
|
9
|
+
export { useAudioPlayer } from '../media/audio-player/use-audio-player';
|
|
10
|
+
export type { UseAudioPlayerProps, UseAudioPlayerReturn } from '../media/audio-player/use-audio-player';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useLayoutShortcuts` — Registra atalhos de teclado globais para controle de layout.
|
|
3
|
+
*
|
|
4
|
+
* Deve ser usado uma única vez no componente raiz da aplicação (ex: `App.tsx` ou `Layout.tsx`).
|
|
5
|
+
* Extrai a responsabilidade de atalhos de teclado do `LayoutContext`, seguindo o
|
|
6
|
+
* princípio de responsabilidade única.
|
|
7
|
+
*
|
|
8
|
+
* **Atalhos registrados:**
|
|
9
|
+
* - `Ctrl+B` / `Cmd+B` — Alterna a sidebar
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Em App.tsx ou no componente de layout raiz:
|
|
14
|
+
* import { useLayoutShortcuts } from 'xertica-ui/hooks';
|
|
15
|
+
*
|
|
16
|
+
* function AppLayout({ children }: { children: React.ReactNode }) {
|
|
17
|
+
* useLayoutShortcuts(); // registra Ctrl+B para toggle da sidebar
|
|
18
|
+
* return <div>{children}</div>;
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useLayoutShortcuts(): void;
|
|
@@ -33,6 +33,14 @@ export interface RouteConfig {
|
|
|
33
33
|
/** Child routes exposed via contextual menu button at the end of the item */
|
|
34
34
|
children?: RouteConfig[];
|
|
35
35
|
}
|
|
36
|
+
export interface NavigationItem {
|
|
37
|
+
path: string;
|
|
38
|
+
label: string;
|
|
39
|
+
icon?: any;
|
|
40
|
+
active: boolean;
|
|
41
|
+
children?: RouteConfig[];
|
|
42
|
+
actions?: ActionMenuItem[];
|
|
43
|
+
}
|
|
36
44
|
export interface SidebarFilterConfig {
|
|
37
45
|
show: boolean;
|
|
38
46
|
content?: React.ReactNode;
|
|
@@ -116,6 +124,66 @@ export interface SidebarProps {
|
|
|
116
124
|
/** Pixel width when expanded (desktop) */
|
|
117
125
|
width?: number;
|
|
118
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Root container for the Sidebar. Provides context to all sub-components.
|
|
129
|
+
* Use this when building a fully custom sidebar layout.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* <Sidebar.Root expanded={expanded} onToggle={toggle} width={280}>
|
|
133
|
+
* <Sidebar.Header logo={<MyLogo />} />
|
|
134
|
+
* <Sidebar.Nav navigationGroups={groups} />
|
|
135
|
+
* <Sidebar.Footer user={user} onLogout={logout} />
|
|
136
|
+
* </Sidebar.Root>
|
|
137
|
+
*/
|
|
138
|
+
declare function SidebarRoot({ expanded: expandedProp, onToggle: onToggleProp, navigate: navigateProp, location: locationProp, width: widthProp, children, className, }: {
|
|
139
|
+
expanded?: boolean;
|
|
140
|
+
onToggle?: () => void;
|
|
141
|
+
navigate?: (path: string) => void;
|
|
142
|
+
location?: {
|
|
143
|
+
pathname: string;
|
|
144
|
+
};
|
|
145
|
+
width?: number;
|
|
146
|
+
children: React.ReactNode;
|
|
147
|
+
className?: string;
|
|
148
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
/**
|
|
150
|
+
* Toggle button + logo header area for the Sidebar.
|
|
151
|
+
*/
|
|
152
|
+
declare function SidebarHeader({ logo, logoCollapsed, }: {
|
|
153
|
+
logo?: React.ReactNode;
|
|
154
|
+
logoCollapsed?: React.ReactNode;
|
|
155
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
156
|
+
/**
|
|
157
|
+
* Navigation area for the Sidebar (default variant).
|
|
158
|
+
* Renders grouped or flat navigation items with overflow handling.
|
|
159
|
+
*/
|
|
160
|
+
declare function SidebarNav({ navigationGroups, routes, variant, }: {
|
|
161
|
+
navigationGroups?: RouteGroup[];
|
|
162
|
+
routes?: RouteConfig[];
|
|
163
|
+
variant?: "default" | "assistant";
|
|
164
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
165
|
+
/**
|
|
166
|
+
* Assistant-specific search + fixed area header for the Sidebar.
|
|
167
|
+
*/
|
|
168
|
+
declare function SidebarSearch({ fixedArea, search, }: {
|
|
169
|
+
fixedArea?: SidebarFixedAreaConfig;
|
|
170
|
+
search?: SidebarSearchConfig;
|
|
171
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
172
|
+
/**
|
|
173
|
+
* Footer area for the Sidebar with user info, settings, and logout.
|
|
174
|
+
*/
|
|
175
|
+
declare function SidebarFooter({ user, onLogout, onSettingsClick, showUser, showSettings, showLogout, }: {
|
|
176
|
+
user?: {
|
|
177
|
+
name?: string;
|
|
178
|
+
email?: string;
|
|
179
|
+
avatar?: string;
|
|
180
|
+
} | null;
|
|
181
|
+
onLogout?: () => void;
|
|
182
|
+
onSettingsClick?: () => void;
|
|
183
|
+
showUser?: boolean;
|
|
184
|
+
showSettings?: boolean;
|
|
185
|
+
showLogout?: boolean;
|
|
186
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
119
187
|
/**
|
|
120
188
|
* Primary navigation sidebar component.
|
|
121
189
|
*
|
|
@@ -127,9 +195,21 @@ export interface SidebarProps {
|
|
|
127
195
|
* This component is autonomous: it works out-of-the-box using local state or
|
|
128
196
|
* integrates automatically with `LayoutContext` if wrapped in `LayoutProvider`.
|
|
129
197
|
*
|
|
198
|
+
* For advanced customization, use the Compound Component API:
|
|
199
|
+
* `<Sidebar.Root>`, `<Sidebar.Header>`, `<Sidebar.Search>`, `<Sidebar.Nav>`, `<Sidebar.Footer>`
|
|
200
|
+
*
|
|
130
201
|
* @ai-rules
|
|
131
202
|
* 1. NEVER recreate the sidebar with raw Tailwind classes — always use this component.
|
|
132
203
|
* 2. Use `variant="assistant"` for AI/tool sidebars; use `variant="default"` for standard navigation.
|
|
133
204
|
* 3. Supports `Ctrl+B` keyboard shortcut automatically via `LayoutProvider`.
|
|
134
205
|
*/
|
|
135
206
|
export declare function Sidebar({ expanded: expandedProp, onToggle: onToggleProp, user, onLogout, onSettingsClick, location: locationProp, navigate: navigateProp, routes, logo, logoCollapsed, variant, fixedArea, search, navigationGroups, footer, showFooter, width: widthProp, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
207
|
+
export declare namespace Sidebar {
|
|
208
|
+
var Root: typeof SidebarRoot;
|
|
209
|
+
var Header: typeof SidebarHeader;
|
|
210
|
+
var Search: typeof SidebarSearch;
|
|
211
|
+
var Nav: typeof SidebarNav;
|
|
212
|
+
var Footer: typeof SidebarFooter;
|
|
213
|
+
}
|
|
214
|
+
export { useSidebar } from "./use-sidebar";
|
|
215
|
+
export type { UseSidebarProps } from "./use-sidebar";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RouteGroup } from "./sidebar";
|
|
2
|
+
export interface UseSidebarProps {
|
|
3
|
+
defaultExpanded?: boolean;
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
6
|
+
navigationGroups?: RouteGroup[];
|
|
7
|
+
}
|
|
8
|
+
export declare function useSidebar({ defaultExpanded, expanded: controlledExpanded, onExpandedChange, navigationGroups, }?: UseSidebarProps): {
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
setExpanded: (value: boolean | ((prev: boolean) => boolean)) => void;
|
|
11
|
+
toggleExpanded: () => void;
|
|
12
|
+
isMobileViewport: boolean;
|
|
13
|
+
hasOverflow: boolean;
|
|
14
|
+
visibleItems: RouteGroup[];
|
|
15
|
+
overflowItems: RouteGroup[];
|
|
16
|
+
openSubmenu: string | null;
|
|
17
|
+
setOpenSubmenu: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
18
|
+
isFilterOpen: boolean;
|
|
19
|
+
setIsFilterOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
20
|
+
navRef: import("react").RefObject<HTMLElement>;
|
|
21
|
+
navigationGroups: RouteGroup[];
|
|
22
|
+
};
|
|
@@ -32,5 +32,8 @@ export interface AudioPlayerProps {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Unified Audio Player component.
|
|
35
|
+
*
|
|
36
|
+
* All state and logic is managed by the `useAudioPlayer` headless hook.
|
|
37
|
+
* This component is responsible only for rendering.
|
|
35
38
|
*/
|
|
36
|
-
export declare function AudioPlayer({ src, title, artist, subtitle, autoPlay, className, variant, isOpen, onClose, duration: initialDuration, currentTime: initialTime, colorVariant, enableAutoFloat, onCloseFloating }: AudioPlayerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
+
export declare function AudioPlayer({ src, title, artist, subtitle, autoPlay, className, variant, isOpen, onClose, duration: initialDuration, currentTime: initialTime, colorVariant, enableAutoFloat, onCloseFloating, }: AudioPlayerProps): import("react/jsx-runtime").JSX.Element | null;
|