vpschatbotwidget 1.0.0 → 1.0.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 (75) hide show
  1. package/README.md +385 -47
  2. package/dist-lib/types/App.d.ts +2 -0
  3. package/dist-lib/types/chatbot/api/chatbot-api.d.ts +25 -0
  4. package/dist-lib/types/chatbot/api/chatbot-types.d.ts +125 -0
  5. package/dist-lib/types/chatbot/chatbot.test.d.ts +1 -0
  6. package/dist-lib/types/chatbot/config/colors.d.ts +165 -0
  7. package/dist-lib/types/chatbot/config/suggestions.d.ts +3 -0
  8. package/dist-lib/types/chatbot/core/ChatContext.d.ts +28 -0
  9. package/dist-lib/types/chatbot/core/ChatEmptyState.d.ts +2 -0
  10. package/dist-lib/types/chatbot/core/ChatError.d.ts +7 -0
  11. package/dist-lib/types/chatbot/core/ChatHeader.d.ts +22 -0
  12. package/dist-lib/types/chatbot/core/ChatInput.d.ts +8 -0
  13. package/dist-lib/types/chatbot/core/ChatMarkdown.d.ts +4 -0
  14. package/dist-lib/types/chatbot/core/ChatMessage.d.ts +7 -0
  15. package/dist-lib/types/chatbot/core/ChatMessageList.d.ts +2 -0
  16. package/dist-lib/types/chatbot/core/ChatPanel.d.ts +14 -0
  17. package/dist-lib/types/chatbot/core/ChatProvider.d.ts +19 -0
  18. package/dist-lib/types/chatbot/core/ChatSuggestions.d.ts +11 -0
  19. package/dist-lib/types/chatbot/core/ChatTicketConfirmation.d.ts +2 -0
  20. package/dist-lib/types/chatbot/core/ChatTypingIndicator.d.ts +4 -0
  21. package/dist-lib/types/chatbot/core/ticket-intent.d.ts +2 -0
  22. package/dist-lib/types/chatbot/embedded/EmbeddedChatbot.d.ts +27 -0
  23. package/dist-lib/types/chatbot/embedded/EmbeddedChatbotPanel.d.ts +12 -0
  24. package/dist-lib/types/chatbot/embedded/EmbeddedChatbotTrigger.d.ts +6 -0
  25. package/dist-lib/types/chatbot/hooks/useChatbot.d.ts +1 -0
  26. package/dist-lib/types/chatbot/index.d.ts +10 -0
  27. package/dist-lib/types/chatbot/widget/ChatbotWidget.d.ts +26 -0
  28. package/dist-lib/types/chatbot/widget/ChatbotWidgetPanel.d.ts +10 -0
  29. package/dist-lib/types/chatbot/widget/ChatbotWidgetTrigger.d.ts +7 -0
  30. package/dist-lib/types/components/AgentSummaryCard.d.ts +8 -0
  31. package/dist-lib/types/components/ChatHeader.d.ts +20 -0
  32. package/dist-lib/types/components/ChatInput.d.ts +9 -0
  33. package/dist-lib/types/components/ChatWidget.d.ts +14 -0
  34. package/dist-lib/types/components/ConnectingStatus.d.ts +6 -0
  35. package/dist-lib/types/components/EnvBadge.d.ts +31 -0
  36. package/dist-lib/types/components/FeedbackRatingCard.d.ts +7 -0
  37. package/dist-lib/types/components/MessageItem.d.ts +12 -0
  38. package/dist-lib/types/components/MessageList.d.ts +21 -0
  39. package/dist-lib/types/components/OrderTrackingCard.d.ts +13 -0
  40. package/dist-lib/types/components/QuickPrompts.d.ts +11 -0
  41. package/dist-lib/types/components/ResponseIconMapper.d.ts +26 -0
  42. package/dist-lib/types/components/SourceCitations.d.ts +7 -0
  43. package/dist-lib/types/components/ToolCallBadge.d.ts +7 -0
  44. package/dist-lib/types/components/TypingProgressBar.d.ts +21 -0
  45. package/dist-lib/types/components/ui/message-scroller.d.ts +9 -0
  46. package/dist-lib/types/lib/cn.d.ts +1 -0
  47. package/dist-lib/types/lib/gibberishDetector.d.ts +26 -0
  48. package/dist-lib/types/lib/textHighlighter.d.ts +15 -0
  49. package/dist-lib/types/main.d.ts +1 -0
  50. package/dist-lib/types/services/api.d.ts +12 -0
  51. package/dist-lib/types/test/message-scroller-stub.d.ts +36 -0
  52. package/dist-lib/types/test/setup.d.ts +1 -0
  53. package/dist-lib/types/types/chat.d.ts +59 -0
  54. package/dist-lib/vps-chatbot.cjs +101 -0
  55. package/dist-lib/vps-chatbot.js +2179 -0
  56. package/package.json +30 -3
  57. package/src/chatbot/chatbot.test.tsx +87 -0
  58. package/src/chatbot/core/ChatContext.tsx +6 -0
  59. package/src/chatbot/core/ChatProvider.tsx +29 -7
  60. package/src/chatbot/embedded/EmbeddedChatbot.tsx +63 -2
  61. package/src/chatbot/index.ts +25 -5
  62. package/src/chatbot/widget/ChatbotWidget.tsx +64 -2
  63. package/Chatbot.svg +0 -1
  64. package/dist/assets/index-C0fUDi2s.css +0 -1
  65. package/dist/assets/index-foGq5_Av.js +0 -159
  66. package/dist/index.html +0 -17
  67. package/index.html +0 -16
  68. package/src/App.tsx +0 -85
  69. package/src/main.tsx +0 -10
  70. package/src/services/api.ts +0 -74
  71. package/src/test/message-scroller-stub.tsx +0 -60
  72. package/src/test/setup.ts +0 -8
  73. package/src/vite-env.d.ts +0 -14
  74. package/tsconfig.json +0 -21
  75. package/vite.config.ts +0 -28
@@ -0,0 +1,165 @@
1
+ export declare const ColorPalette: {
2
+ readonly Colors: {
3
+ readonly VPS_White: "#fff";
4
+ readonly VPS_Dark_Blue: "#1A1A31";
5
+ readonly VPS_Light_Blue: "#353552";
6
+ readonly VPS_Light_Grey: "#D1D1D6";
7
+ readonly VPS_Orange: "#FF4717";
8
+ readonly Dark_Blue_50: "#F1F5FC";
9
+ readonly Dark_Blue_100: "#E5EBFA";
10
+ readonly Dark_Blue_200: "#D1DAF4";
11
+ readonly Dark_Blue_300: "#B4C2ED";
12
+ readonly Dark_Blue_400: "#96A2E3";
13
+ readonly Dark_Blue_500: "#7C84D8";
14
+ readonly Dark_Blue_600: "#6262C9";
15
+ readonly Dark_Blue_700: "#5351B1";
16
+ readonly Dark_Blue_800: "#44448F";
17
+ readonly Dark_Blue_900: "#3C3D73";
18
+ readonly Dark_Blue_950: "#1A1A31";
19
+ readonly Light_Blue_50: "#F4F6FA";
20
+ readonly Light_Blue_100: "#E6E9F3";
21
+ readonly Light_Blue_200: "#D3D8EA";
22
+ readonly Light_Blue_300: "#B4BEDC";
23
+ readonly Light_Blue_400: "#909DCA";
24
+ readonly Light_Blue_500: "#7580BC";
25
+ readonly Light_Blue_600: "#6369AD";
26
+ readonly Light_Blue_700: "#575A9E";
27
+ readonly Light_Blue_800: "#4B4B82";
28
+ readonly Light_Blue_900: "#404168";
29
+ readonly Light_Blue_950: "#353552";
30
+ readonly Grey_50: "#F6F6F7";
31
+ readonly Grey_100: "#EFEFF0";
32
+ readonly Grey_200: "#E2E1E4";
33
+ readonly Grey_300: "#D1D1D6";
34
+ readonly Grey_400: "#B9B9C0";
35
+ readonly Grey_500: "#A7A6AE";
36
+ readonly Grey_600: "#93919A";
37
+ readonly Grey_700: "#7E7D85";
38
+ readonly Grey_800: "#67666D";
39
+ readonly Grey_900: "#56555A";
40
+ readonly Grey_950: "#323234";
41
+ readonly Orange_50: "#FFF3ED";
42
+ readonly Orange_100: "#FFE4D4";
43
+ readonly Orange_200: "#FFC5A8";
44
+ readonly Orange_300: "#FF9D70";
45
+ readonly Orange_400: "#FF6837";
46
+ readonly Orange_500: "#FF4717";
47
+ readonly Orange_600: "#F02706";
48
+ readonly Orange_700: "#C71807";
49
+ readonly Orange_800: "#9E150E";
50
+ readonly Orange_900: "#7F150F";
51
+ readonly Orange_950: "#450605";
52
+ readonly Success_50: "#F1FCF5";
53
+ readonly Success_100: "#DEFAEA";
54
+ readonly Success_200: "#BEF4D4";
55
+ readonly Success_300: "#8BEAB3";
56
+ readonly Success_400: "#52D689";
57
+ readonly Success_500: "#2ECC71";
58
+ readonly Success_600: "#1D9C53";
59
+ readonly Success_700: "#1B7A43";
60
+ readonly Success_800: "#1A6139";
61
+ readonly Success_900: "#175031";
62
+ readonly Success_950: "#072C18";
63
+ readonly Warning_50: "#FFFEEA";
64
+ readonly Warning_100: "#FFF9C5";
65
+ readonly Warning_200: "#FFF485";
66
+ readonly Warning_300: "#FFE846";
67
+ readonly Warning_400: "#FFD81B";
68
+ readonly Warning_500: "#FFB800";
69
+ readonly Warning_600: "#E28D00";
70
+ readonly Warning_700: "#BB6302";
71
+ readonly Warning_800: "#984C08";
72
+ readonly Warning_900: "#7C3F0B";
73
+ readonly Warning_950: "#482000";
74
+ readonly Error_50: "#FFF1F1";
75
+ readonly Error_100: "#FFDFDF";
76
+ readonly Error_200: "#FFC5C5";
77
+ readonly Error_300: "#FF9D9D";
78
+ readonly Error_400: "#FF6464";
79
+ readonly Error_500: "#FF2E2E";
80
+ readonly Error_600: "#ED1515";
81
+ readonly Error_700: "#C80D0D";
82
+ readonly Error_800: "#A50F0F";
83
+ readonly Error_900: "#881414";
84
+ readonly Error_950: "#4B0404";
85
+ readonly Netural_25: "#FDFDFD";
86
+ readonly Netural_50: "#FAFAFA";
87
+ readonly Netural_100: "#F5F5F5";
88
+ readonly Netural_200: "#E9EAEC";
89
+ readonly Netural_300: "#D6D7DB";
90
+ readonly Netural_400: "#A4A7AE";
91
+ readonly Netural_500: "#727681";
92
+ readonly Netural_600: "#545863";
93
+ readonly Netural_700: "#424651";
94
+ readonly Netural_800: "#252B37";
95
+ readonly Netural_900: "#191D28";
96
+ readonly Netural_950: "#0A0D12";
97
+ readonly Tint_Dark_Blue_100: "#1A1A31";
98
+ readonly Tint_Dark_Blue_90: "#313146";
99
+ readonly Tint_Dark_Blue_80: "#48485A";
100
+ readonly Tint_Dark_Blue_70: "#5F5F6F";
101
+ readonly Tint_Dark_Blue_60: "#767683";
102
+ readonly Tint_Dark_Blue_50: "#8C8C98";
103
+ readonly Tint_Dark_Blue_40: "#A3A3AD";
104
+ readonly Tint_Dark_Blue_30: "#BABAC1";
105
+ readonly Tint_Dark_Blue_20: "#D1D1D6";
106
+ readonly Tint_Dark_Blue_10: "#E8E8EA";
107
+ readonly Tint_Dark_Blue_5: "#F4F4F5";
108
+ readonly Tint_Light_Blue_100: "#353552";
109
+ readonly Tint_Light_Blue_90: "#494963";
110
+ readonly Tint_Light_Blue_80: "#5D5D75";
111
+ readonly Tint_Light_Blue_70: "#727286";
112
+ readonly Tint_Light_Blue_60: "#868697";
113
+ readonly Tint_Light_Blue_50: "#9A9AA8";
114
+ readonly Tint_Light_Blue_40: "#AEAEBA";
115
+ readonly Tint_Light_Blue_30: "#C2C2CB";
116
+ readonly Tint_Light_Blue_20: "#D7D7DC";
117
+ readonly Tint_Light_Blue_10: "#EBEBEE";
118
+ readonly Tint_Light_Blue_5: "#F5F5F6";
119
+ readonly Tint_Grey_100: "#D1D1D6";
120
+ readonly Tint_Grey_90: "#D6D6DA";
121
+ readonly Tint_Grey_80: "#DADADE";
122
+ readonly Tint_Grey_70: "#DFDFE2";
123
+ readonly Tint_Grey_60: "#E3E3E6";
124
+ readonly Tint_Grey_50: "#E8E8EB";
125
+ readonly Tint_Grey_40: "#EDEDEF";
126
+ readonly Tint_Grey_30: "#F1F1F3";
127
+ readonly Tint_Grey_20: "#F6F6F7";
128
+ readonly Tint_Grey_10: "#FAFAFB";
129
+ readonly Tint_Grey_5: "#FDFDFD";
130
+ readonly Tint_Solus_100: "#FF4717";
131
+ readonly Tint_Solus_90: "#FF592E";
132
+ readonly Tint_Solus_80: "#FF6C45";
133
+ readonly Tint_Solus_70: "#FF7E5D";
134
+ readonly Tint_Solus_60: "#FF9174";
135
+ readonly Tint_Solus_50: "#FFA38B";
136
+ readonly Tint_Solus_40: "#FFB5A2";
137
+ readonly Tint_Solus_30: "#FFC8B9";
138
+ readonly Tint_Solus_20: "#FFDAD1";
139
+ readonly Tint_Solus_10: "#FFEDE8";
140
+ readonly Tint_Solus_5: "#FFF6F3";
141
+ readonly Other_Color: "#00ABC9";
142
+ };
143
+ readonly StatusColor: {
144
+ readonly tested: "#3E4784";
145
+ readonly received: "#EE46BC";
146
+ readonly InTransit: "#6938EF";
147
+ readonly registered: "#1570EF";
148
+ readonly reported: "#2ECC71";
149
+ readonly noStatus: "#727681";
150
+ readonly Action: "#FF2E2E";
151
+ readonly Caution: "#FFB800";
152
+ readonly Pass: "#2ECC71";
153
+ readonly No_Rating: "#FF6837";
154
+ readonly Received: "#EE46BC";
155
+ readonly Tested: "#3E4784";
156
+ readonly Reported: "#2ECC71";
157
+ readonly No_Status: "#6938EF";
158
+ readonly Overdue: "#FF2E2E";
159
+ readonly Duesoon: "#FFB800";
160
+ readonly Scheduled: "#1570EF";
161
+ readonly Good: "#2ECC71";
162
+ readonly NotApplicable: "#353552";
163
+ };
164
+ };
165
+ export type ColorPalette = typeof ColorPalette;
@@ -0,0 +1,3 @@
1
+ import type { Suggestion } from "../api/chatbot-types";
2
+ /** Domain prompts derived from the VPS Customer Portal FAQ knowledge base. */
3
+ export declare const DEFAULT_SUGGESTIONS: Suggestion[];
@@ -0,0 +1,28 @@
1
+ import type { ChatMessage, ChatUserContext, Suggestion, Ticket } from "../api/chatbot-types";
2
+ export type ChatUiStatus = "idle" | "connecting" | "awaiting" | "error";
3
+ export interface PendingTicket {
4
+ subject: string;
5
+ description: string;
6
+ }
7
+ export interface ChatContextValue {
8
+ messages: ChatMessage[];
9
+ status: ChatUiStatus;
10
+ error: string | null;
11
+ sessionId: string | null;
12
+ pendingTicket: PendingTicket | null;
13
+ ticketBusy: boolean;
14
+ lastTicket: Ticket | null;
15
+ suggestions: Suggestion[];
16
+ showSuggestions: boolean;
17
+ suggestionBadgesEnabled: boolean;
18
+ userContext: ChatUserContext;
19
+ apiBaseUrl?: string;
20
+ sendMessage: (text: string) => Promise<void>;
21
+ retryLast: () => Promise<void>;
22
+ confirmTicket: (customerIdOrEmail?: string) => Promise<void>;
23
+ cancelTicket: () => void;
24
+ resetConversation: () => Promise<void>;
25
+ }
26
+ export declare const ChatContext: import("react").Context<ChatContextValue | null>;
27
+ export declare function useChatContext(): ChatContextValue;
28
+ export declare function useOptionalChatContext(): ChatContextValue | null;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const ChatEmptyState: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface ChatErrorProps {
3
+ message: string;
4
+ onRetry?: () => void;
5
+ }
6
+ export declare const ChatError: React.FC<ChatErrorProps>;
7
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ interface ChatHeaderProps {
4
+ title?: string;
5
+ subtitle?: string;
6
+ onClose?: () => void;
7
+ onReset?: () => void;
8
+ onBack?: () => void;
9
+ showMinimize?: boolean;
10
+ /** Environment badge stage shown in the header. Omit for production. */
11
+ envStage?: EnvStage;
12
+ /** Whether the status dot pulses. Default: true */
13
+ envPulse?: boolean;
14
+ }
15
+ declare const SVGComponent: (props: React.SVGProps<SVGSVGElement> & {
16
+ width?: string;
17
+ height?: string;
18
+ Color?: string;
19
+ }) => React.JSX.Element;
20
+ export default SVGComponent;
21
+ export declare const ChatHeader: React.FC<ChatHeaderProps>;
22
+ export declare function useRestoreInputFocus(disabled: boolean, inputRef: React.RefObject<HTMLTextAreaElement | null>): void;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface ChatInputProps {
3
+ onSend: (message: string) => void;
4
+ disabled?: boolean;
5
+ placeholder?: string;
6
+ }
7
+ export declare const ChatInput: React.FC<ChatInputProps>;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare function ChatMarkdown({ text }: {
3
+ text: string;
4
+ }): React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { ChatMessage } from "../api/chatbot-types";
3
+ interface ChatMessageProps {
4
+ message: ChatMessage;
5
+ }
6
+ export declare const ChatMessageBubble: React.FC<ChatMessageProps>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const ChatMessageList: React.FC;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ interface ChatPanelProps {
4
+ className?: string;
5
+ onClose?: () => void;
6
+ showMinimize?: boolean;
7
+ title?: string;
8
+ subtitle?: string;
9
+ /** Environment badge stage. Omit for production. */
10
+ envStage?: EnvStage;
11
+ envPulse?: boolean;
12
+ }
13
+ export declare const ChatPanel: React.FC<ChatPanelProps>;
14
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { type ChatApiClient } from "../api/chatbot-api";
3
+ import type { ChatUserContext, Suggestion } from "../api/chatbot-types";
4
+ export interface ChatProviderProps {
5
+ children: React.ReactNode;
6
+ userContext?: ChatUserContext;
7
+ suggestions?: Suggestion[];
8
+ disableSuggestions?: boolean;
9
+ initialMessage?: string;
10
+ /** Backend or proxy API base URL (e.g. "https://vpsai.onrender.com" or "/api"). Defaults to VITE_API_BASE or "" */
11
+ apiBaseUrl?: string;
12
+ /** Alias for apiBaseUrl */
13
+ apiUrl?: string;
14
+ /** Alias for apiBaseUrl */
15
+ proxyUrl?: string;
16
+ /** Optional custom chat API client */
17
+ api?: ChatApiClient;
18
+ }
19
+ export declare const ChatProvider: React.FC<ChatProviderProps>;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import type { Suggestion } from "../api/chatbot-types";
3
+ export declare function filterSuggestions(suggestions: Suggestion[], text: string): Suggestion[];
4
+ interface ChatSuggestionsProps {
5
+ suggestions: Suggestion[];
6
+ onSelect: (suggestion: Suggestion) => void;
7
+ disabled?: boolean;
8
+ variant?: "list" | "badge";
9
+ }
10
+ export declare const ChatSuggestions: React.FC<ChatSuggestionsProps>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const ChatTicketConfirmation: React.FC;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const ChatTypingIndicator: React.FC<{
3
+ className?: string;
4
+ }>;
@@ -0,0 +1,2 @@
1
+ export declare function detectTicketIntent(text: string): boolean;
2
+ export declare function ticketSubjectFromText(text: string): string;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ import type { ChatUserContext, Suggestion } from "../api/chatbot-types";
4
+ export interface EmbeddedChatbotProps {
5
+ defaultOpen?: boolean;
6
+ open?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ showTrigger?: boolean;
9
+ /** Environment badge stage. Omit for production. */
10
+ envStage?: EnvStage;
11
+ envPulse?: boolean;
12
+ /** Backend or proxy API base URL (e.g. "https://vpsai.onrender.com" or "/api") */
13
+ apiBaseUrl?: string;
14
+ /** Alias for apiBaseUrl */
15
+ apiUrl?: string;
16
+ /** Alias for apiBaseUrl */
17
+ proxyUrl?: string;
18
+ /** Optional user context passed to ChatProvider */
19
+ userContext?: ChatUserContext;
20
+ /** Optional custom suggestions */
21
+ suggestions?: Suggestion[];
22
+ /** Disable prompt suggestions */
23
+ disableSuggestions?: boolean;
24
+ /** Initial welcome message to trigger on mount */
25
+ initialMessage?: string;
26
+ }
27
+ export declare const EmbeddedChatbot: React.FC<EmbeddedChatbotProps>;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ interface EmbeddedChatbotPanelProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ subtitle?: string;
7
+ title?: string;
8
+ envStage?: EnvStage;
9
+ envPulse?: boolean;
10
+ }
11
+ export declare const EmbeddedChatbotPanel: React.FC<EmbeddedChatbotPanelProps>;
12
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface EmbeddedChatbotTriggerProps {
3
+ onOpen: () => void;
4
+ }
5
+ export declare const EmbeddedChatbotTrigger: React.FC<EmbeddedChatbotTriggerProps>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useChatbot(): import("../core/ChatContext").ChatContextValue;
@@ -0,0 +1,10 @@
1
+ export { ChatProvider, type ChatProviderProps } from "./core/ChatProvider";
2
+ export { ChatPanel } from "./core/ChatPanel";
3
+ export { useChatbot } from "./hooks/useChatbot";
4
+ export { useChatContext, useOptionalChatContext } from "./core/ChatContext";
5
+ export { ChatbotWidget, type ChatbotWidgetProps } from "./widget/ChatbotWidget";
6
+ export { EmbeddedChatbot, type EmbeddedChatbotProps } from "./embedded/EmbeddedChatbot";
7
+ export { chatApi, createChatApi, buildApiUrl, resolveApiBaseUrl, type ChatApiClient, } from "./api/chatbot-api";
8
+ export { ColorPalette } from "./config/colors";
9
+ export type { ChatUserContext, ChatMessage, Suggestion, Ticket, Source, ToolCall, TokenUsage, ChatRole, MessageStatus, } from "./api/chatbot-types";
10
+ export type { EnvStage } from "../components/EnvBadge";
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ import type { ChatUserContext, Suggestion } from "../api/chatbot-types";
4
+ export interface ChatbotWidgetProps {
5
+ defaultOpen?: boolean;
6
+ open?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ /** Environment badge stage. Omit for production. */
9
+ envStage?: EnvStage;
10
+ envPulse?: boolean;
11
+ /** Backend or proxy API base URL (e.g. "https://vpsai.onrender.com" or "/api") */
12
+ apiBaseUrl?: string;
13
+ /** Alias for apiBaseUrl */
14
+ apiUrl?: string;
15
+ /** Alias for apiBaseUrl */
16
+ proxyUrl?: string;
17
+ /** Optional user context passed to ChatProvider */
18
+ userContext?: ChatUserContext;
19
+ /** Optional custom suggestions */
20
+ suggestions?: Suggestion[];
21
+ /** Disable prompt suggestions */
22
+ disableSuggestions?: boolean;
23
+ /** Initial welcome message to trigger on mount */
24
+ initialMessage?: string;
25
+ }
26
+ export declare const ChatbotWidget: React.FC<ChatbotWidgetProps>;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "../../components/EnvBadge";
3
+ interface ChatbotWidgetPanelProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ envStage?: EnvStage;
7
+ envPulse?: boolean;
8
+ }
9
+ export declare const ChatbotWidgetPanel: React.FC<ChatbotWidgetPanelProps>;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface ChatbotWidgetTriggerProps {
3
+ open: boolean;
4
+ onToggle: () => void;
5
+ }
6
+ export declare const ChatbotWidgetTrigger: React.FC<ChatbotWidgetTriggerProps>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface AgentSummaryCardProps {
3
+ agentName?: string;
4
+ agentInitials?: string;
5
+ duration?: string;
6
+ }
7
+ export declare const AgentSummaryCard: React.FC<AgentSummaryCardProps>;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { EnvStage } from "./EnvBadge";
3
+ export type HeaderMode = "bot" | "agent" | "ended";
4
+ interface ChatHeaderProps {
5
+ headerMode?: HeaderMode;
6
+ ticketId?: string;
7
+ subtitle?: string;
8
+ duration?: string;
9
+ agentInitials?: string;
10
+ onBack?: () => void;
11
+ onReset?: () => void;
12
+ onClose?: () => void;
13
+ isFloating?: boolean;
14
+ /** Environment stage badge — omit for production */
15
+ envStage?: EnvStage;
16
+ /** Whether the status dot inside the badge pulses. Default: true */
17
+ envPulse?: boolean;
18
+ }
19
+ export declare const ChatHeader: React.FC<ChatHeaderProps>;
20
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface ChatInputProps {
3
+ onSendMessage: (message: string) => void;
4
+ disabled?: boolean;
5
+ placeholder?: string;
6
+ poweredByText?: string;
7
+ }
8
+ export declare const ChatInput: React.FC<ChatInputProps>;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { type EnvStage } from "./EnvBadge";
3
+ export type WidgetViewPreset = "bot" | "agent" | "ended" | "live";
4
+ interface ChatWidgetProps {
5
+ mode?: "floating" | "embedded";
6
+ onClose?: () => void;
7
+ preset?: WidgetViewPreset;
8
+ /** Environment badge stage shown in the header. Omit for production. */
9
+ envStage?: EnvStage;
10
+ /** Whether the dot inside the badge pulses. Default: true */
11
+ envPulse?: boolean;
12
+ }
13
+ export declare const ChatWidget: React.FC<ChatWidgetProps>;
14
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface ConnectingStatusProps {
3
+ label?: string;
4
+ }
5
+ export declare const ConnectingStatus: React.FC<ConnectingStatusProps>;
6
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * EnvBadge.tsx
3
+ *
4
+ * Renders a compact, animated environment stage badge.
5
+ *
6
+ * Supported stages
7
+ * ─────────────────
8
+ * "alpha" – earliest internal build (purple / FlaskConical)
9
+ * "beta" – public pre-release (blue / TestTubeDiagonal)
10
+ * "gamma" – release candidate (teal / Microscope)
11
+ * "qa" – quality assurance (amber / ClipboardCheck)
12
+ *
13
+ * Usage
14
+ * ──────
15
+ * <EnvBadge stage="beta" />
16
+ * <EnvBadge stage="alpha" pulse={false} />
17
+ *
18
+ * Returns null when `stage` is undefined → zero footprint in production.
19
+ */
20
+ import React from "react";
21
+ export type EnvStage = "alpha" | "beta" | "gamma" | "qa";
22
+ interface EnvBadgeProps {
23
+ /** Build stage to display. Omit entirely for production (renders nothing). */
24
+ stage?: EnvStage;
25
+ /** Whether the status dot pulses. Default: true */
26
+ pulse?: boolean;
27
+ /** Extra CSS class forwarded to the root element */
28
+ className?: string;
29
+ }
30
+ export declare const EnvBadge: React.FC<EnvBadgeProps>;
31
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface FeedbackRatingCardProps {
3
+ onSubmitFeedback?: (rating: string, reasons: string) => void;
4
+ onCancel?: () => void;
5
+ }
6
+ export declare const FeedbackRatingCard: React.FC<FeedbackRatingCardProps>;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { Message } from "../types/chat";
3
+ import { QuickOption } from "./QuickPrompts";
4
+ interface MessageItemProps {
5
+ message: Message;
6
+ agentInitials?: string;
7
+ isBot?: boolean;
8
+ onSelectPrompt?: (prompt: string) => void;
9
+ quickOptions?: QuickOption[];
10
+ }
11
+ export declare const MessageItem: React.FC<MessageItemProps>;
12
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { Message } from "../types/chat";
3
+ import { QuickOption } from "./QuickPrompts";
4
+ interface MessageListProps {
5
+ messages: Message[];
6
+ isLoading: boolean;
7
+ isConnectingAgent?: boolean;
8
+ connectingLabel?: string;
9
+ isChatClosed?: boolean;
10
+ showFeedbackCard?: boolean;
11
+ agentName?: string;
12
+ agentInitials?: string;
13
+ chatDuration?: string;
14
+ isBot?: boolean;
15
+ onSelectPrompt?: (prompt: string) => void;
16
+ welcomeQuickOptions?: QuickOption[];
17
+ onSubmitFeedback?: (rating: string, reasons: string) => void;
18
+ onCancelFeedback?: () => void;
19
+ }
20
+ export declare const MessageList: React.FC<MessageListProps>;
21
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export interface StepperStep {
3
+ label: string;
4
+ status: "completed" | "active" | "pending";
5
+ }
6
+ interface OrderTrackingCardProps {
7
+ orderId?: string;
8
+ statusBadge?: string;
9
+ totalAmount?: string;
10
+ steps?: StepperStep[];
11
+ }
12
+ export declare const OrderTrackingCard: React.FC<OrderTrackingCardProps>;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export interface QuickOption {
3
+ label: string;
4
+ query: string;
5
+ }
6
+ interface QuickPromptsProps {
7
+ onSelectPrompt: (prompt: string) => void;
8
+ options?: QuickOption[];
9
+ }
10
+ export declare const QuickPrompts: React.FC<QuickPromptsProps>;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ResponseIconMapper.tsx
3
+ *
4
+ * Analyses assistant message content and renders a context-aware status
5
+ * icon badge above/beside the bubble to give instant visual cues about
6
+ * the nature of the response.
7
+ *
8
+ * Mappings (first match wins):
9
+ * ─ Error / not-found keywords → AlertCircle (red)
10
+ * ─ Database / ticket keywords → Database (indigo)
11
+ * ─ LinkedIn URL present → Linkedin (blue)
12
+ * ─ YouTube URL present → Youtube (red)
13
+ * ─ Link / URL present → Link2 (orange)
14
+ * ─ Success / resolved → CheckCircle2 (green)
15
+ * ─ Warning / urgent → AlertTriangle (amber)
16
+ * ─ Info / help / guide → Info (sky)
17
+ * ─ Chemical / sample / bunker → FlaskConical (teal)
18
+ * ─ Vessel / ship → Anchor (slate)
19
+ * ─ Default → MessageSquare (muted)
20
+ */
21
+ import React from "react";
22
+ interface ResponseIconMapperProps {
23
+ content: string;
24
+ }
25
+ export declare const ResponseIconMapper: React.FC<ResponseIconMapperProps>;
26
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { Source } from "../types/chat";
3
+ interface SourceCitationsProps {
4
+ sources?: Source[];
5
+ }
6
+ export declare const SourceCitations: React.FC<SourceCitationsProps>;
7
+ export {};