import * as react_jsx_runtime from 'react/jsx-runtime'; /** * Support Agent Primitives — WealthX DS * * Atomic building blocks for the Support Agent panel. * Inspired by Jira Rovo's sidebar chat pattern: * - SupportContextChip — shows current backoffice page + entity (Rovo: page context header) * - SupportSuggestedQuestion — clickable question cards (Rovo: conversation starters) * - SupportStepGuideCard — numbered walkthrough with "Show me" DOM highlight (Rovo: message cards) * - SupportArticleCard — help article reference link (Rovo: linked content cards) * * All components are pure display — no state or API calls. * State and event handling are managed by SupportAgentPanel (the parent organism). */ /** Context injected from the current backoffice route. */ interface SupportAgentContext { /** Page label from the current route, e.g. "Loan Applications". */ pageLabel: string; /** Entity currently being viewed, e.g. "John Smith". Optional. */ entityLabel?: string; /** Entity type for semantic use, e.g. "client" | "application" | "contact". */ entityType?: string; } /** A single step inside a SupportStepGuideCard. */ interface SupportAgentStep { id: string; /** Human-readable step instruction. */ label: string; /** * If set, the "Show me" button fires onHighlight(elementId). * The consuming page listens for this and highlights the DOM element * that has data-support-id matching this value. */ elementId?: string; /** Whether the user has marked this step as done. */ completed?: boolean; } /** Rich content embedded inside an assistant message bubble. */ type SupportAgentRichContent = { type: "step-guide"; title: string; steps: SupportAgentStep[]; } | { type: "article"; title: string; excerpt: string; href: string; /** If true, opens in a new tab and shows an external link icon. */ isExternal?: boolean; }; interface SupportContextChipProps { context?: SupportAgentContext; /** Show a skeleton loading placeholder. */ isLoading?: boolean; className?: string; } /** * Pill that shows the current backoffice page and optional entity. * Appears below the panel header to ground the AI conversation in context. * * Variants: * - page-only → "📍 Loan Applications" * - page+entity → "📍 Loan Applications › John Smith" * - loading → skeleton placeholder */ declare function SupportContextChip({ context, isLoading, className, }: SupportContextChipProps): react_jsx_runtime.JSX.Element | null; interface SupportSuggestedQuestionProps { question: string; onSelect: (question: string) => void; className?: string; } /** * Single clickable question card — the Jira Rovo "conversation starter" pattern. * Clicking pre-fills the chat input with the question text. */ declare function SupportSuggestedQuestion({ question, onSelect, className, }: SupportSuggestedQuestionProps): react_jsx_runtime.JSX.Element; interface SupportStepGuideCardProps { title: string; steps: SupportAgentStep[]; /** Called when the user clicks "Show me" on a step that has an elementId. */ onHighlight?: (elementId: string) => void; /** Called when the user marks a step as complete. */ onStepComplete?: (stepId: string) => void; /** Default collapsed if more than 5 steps; otherwise expanded. */ defaultExpanded?: boolean; className?: string; } /** * A numbered walkthrough card embedded inside an AI assistant message bubble. * Inspired by Jira Rovo message cards — bordered container with structured content. * * - Completed steps show a checkmark icon instead of a number. * - Steps with an `elementId` show a "→ Show me" button that fires onHighlight. * - Collapsible when more than 5 steps (default collapsed). */ declare function SupportStepGuideCard({ title, steps, onHighlight, onStepComplete, defaultExpanded, className, }: SupportStepGuideCardProps): react_jsx_runtime.JSX.Element; interface SupportArticleCardProps { title: string; excerpt: string; href: string; /** If true, opens in a new tab with an external link icon. */ isExternal?: boolean; className?: string; } /** * A compact help article reference card embedded inside an AI message bubble. * Inspired by Jira Rovo's linked content cards. * * - Internal links: navigates in the same tab (relative URL). * - External links: opens new tab + shows ExternalLink icon. */ declare function SupportArticleCard({ title, excerpt, href, isExternal, className, }: SupportArticleCardProps): react_jsx_runtime.JSX.Element; /** * SupportAgentFAB — WealthX DS * * Floating action button that opens/closes the Support Agent panel. * Positioned fixed at bottom-right (or bottom-left) of the viewport. * * Features: * - Nudge badge: red dot shown when the agent has a proactive suggestion * - Nudge message: small dismissible tooltip bubble above the button * - Toggles between HelpCircle (closed) and X (open) icon */ interface SupportAgentFABProps { /** Whether the support panel is currently open. */ isOpen?: boolean; /** Called when the FAB is clicked. */ onClick: () => void; /** Show a red nudge dot on the button. */ hasNudge?: boolean; /** Short message shown in a bubble above the FAB when hasNudge is true. */ nudgeMessage?: string; /** Called when the user dismisses the nudge bubble. */ onDismissNudge?: () => void; /** Position of the FAB on the screen. */ position?: "bottom-right" | "bottom-left"; className?: string; } declare function SupportAgentFAB({ isOpen, onClick, hasNudge, nudgeMessage, onDismissNudge, position, className, }: SupportAgentFABProps): react_jsx_runtime.JSX.Element; /** * SupportAgentPanel — WealthX DS (Organism) * * Right-side slide-over panel providing system guidance to backoffice users. * Answers questions about how to use WealthX, optionally grounded in the * current page and entity context (Rovo pattern). * * Follows Jira Rovo's sidebar chat pattern exactly: * — Non-blocking: no overlay, main UI remains interactive behind the panel * — Two header modes: home (bot icon) vs chat (back arrow + conversation title) * — Context chip: optional page+entity label below header (Rovo: context awareness) * — Home state: New Chat CTA button + Recents list + Suggested questions * — Chat state: message thread with optional rich content cards * — Rich messages: AI responses can embed StepGuideCard or ArticleCard * * Pure display component — all state and API calls are managed by the consumer. * Only local state: textarea value (input) and textarea height (auto-resize). * * Layout — Home state: * Header — [Bot icon] Support Assistant [✕] * Content — [✏ New chat] * RECENTS * > Previous conversation title * View all → * SUGGESTED * > Suggested question card * Footer — textarea + send * * Layout — Chat state: * Header — [←] Conversation title [✕] * Content — chat thread (bubbles + optional rich cards) * Footer — textarea + send */ interface SupportAgentMessage { id: string; role: "user" | "assistant"; /** Plain text content always shown. */ content: string; /** * Optional rich content rendered below the text bubble. * Supported: step-guide | article */ richContent?: SupportAgentRichContent; /** True while the assistant response is streaming in. */ isStreaming?: boolean; /** * Status text shown beside the animated dots while the response streams * (e.g. "Checking the help center"). Rendered only while the bubble is empty * and streaming. The trailing "…" animates on its own — do not include dots here. */ streamingLabel?: string; /** True if the message errored. */ isErrored?: boolean; } /** A recent conversation entry shown in the home-state Recents list. */ interface SupportAgentRecentConversation { id: string; /** Short title (first user message or AI-generated summary). */ title: string; } interface SupportAgentPanelProps { open: boolean; onClose: () => void; /** Chat message history. Empty array = show home state. */ messages?: SupportAgentMessage[]; /** * Recent conversations shown in the home state Recents list (Rovo pattern). * Clicking an entry fires onOpenConversation(id). */ recentConversations?: SupportAgentRecentConversation[]; /** * Pre-set help questions shown in the home state (Rovo: conversation starters). * Shown below Recents when provided. */ suggestedQuestions?: string[]; /** * Title shown in the chat-mode header (replaces bot icon row). * Typically the first user message or an AI-generated session title. * Required for the back-arrow chat header to appear. */ conversationTitle?: string; /** * Current backoffice page context — page name and optional entity being viewed. * When provided, renders a SupportContextChip below the panel header so the * AI can ground responses to the user's current location (Rovo pattern). * * Example: { pageLabel: "Loan Applications", entityLabel: "John Smith — #4521" } */ context?: SupportAgentContext; /** True while the assistant is generating a response. */ isStreaming?: boolean; /** True while initial data is loading — shows full-panel spinner. */ isLoading?: boolean; /** Called when the user submits a message. Input is cleared after firing. */ onSendMessage?: (text: string) => void; /** Called when the user selects files via the attachment button. */ onAttachFile?: (files: FileList) => void; /** Called when the user selects images via the image upload button. */ onAttachImage?: (files: FileList) => void; /** Called when the user clicks "New chat" — resets to home state. */ onNewChat?: () => void; /** * Called when the user clicks ← in the chat header to return to the home state. * If not provided, no back button is shown. */ onBack?: () => void; /** Called when the user clicks a recent conversation entry. */ onOpenConversation?: (id: string) => void; /** Called when the user clicks "View all conversations". */ onViewAllConversations?: () => void; /** * Pagination for the all-conversations list. When true, a "Load more" control is * shown at the bottom of the all-conversations view; clicking it fires * {@link onLoadMoreConversations}. The consumer appends the next page to * `recentConversations`. */ hasMoreConversations?: boolean; /** Called when the user requests the next page in the all-conversations view. */ onLoadMoreConversations?: () => void; /** True while the next page is loading — shows a spinner on the "Load more" control. */ isLoadingMoreConversations?: boolean; /** True when older messages can be loaded for the active conversation. */ hasMoreMessages?: boolean; /** True while an `onLoadMoreMessages` request is in flight. */ isLoadingMoreMessages?: boolean; /** Fired when the user scrolls near the top of the chat — fetch older messages. */ onLoadMoreMessages?: () => void; className?: string; } declare function SupportAgentPanel({ open, onClose, messages, recentConversations, suggestedQuestions, conversationTitle, context, isStreaming, isLoading, onSendMessage, onAttachFile, onAttachImage, onNewChat, onBack, onOpenConversation, onViewAllConversations, hasMoreConversations, onLoadMoreConversations, isLoadingMoreConversations, hasMoreMessages, isLoadingMoreMessages, onLoadMoreMessages, className, }: SupportAgentPanelProps): react_jsx_runtime.JSX.Element; export { type SupportAgentContext, SupportAgentFAB, type SupportAgentFABProps, type SupportAgentMessage, SupportAgentPanel, type SupportAgentPanelProps, type SupportAgentRecentConversation, type SupportAgentRichContent, type SupportAgentStep, SupportArticleCard, type SupportArticleCardProps, SupportContextChip, type SupportContextChipProps, SupportStepGuideCard, type SupportStepGuideCardProps, SupportSuggestedQuestion, type SupportSuggestedQuestionProps };