vpschatbotwidget 1.0.2 → 1.0.3
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/dist-lib/vps-chatbot.cjs +10 -10
- package/dist-lib/vps-chatbot.js +742 -796
- package/package.json +2 -2
- package/src/chatbot/core/ChatEmptyState.tsx +4 -4
- package/src/chatbot/core/ChatError.tsx +2 -2
- package/src/chatbot/core/ChatHeader.tsx +13 -13
- package/src/chatbot/core/ChatInput.tsx +6 -6
- package/src/chatbot/core/ChatMarkdown.tsx +6 -6
- package/src/chatbot/core/ChatMessage.tsx +20 -25
- package/src/chatbot/core/ChatPanel.tsx +2 -6
- package/src/chatbot/core/ChatSuggestions.tsx +5 -10
- package/src/chatbot/core/ChatTicketConfirmation.tsx +9 -9
- package/src/chatbot/core/ChatTypingIndicator.tsx +4 -4
- package/src/chatbot/embedded/EmbeddedChatbotPanel.tsx +2 -11
- package/src/chatbot/embedded/EmbeddedChatbotTrigger.tsx +2 -2
- package/src/chatbot/widget/ChatbotWidgetPanel.tsx +1 -6
- package/src/chatbot/widget/ChatbotWidgetTrigger.tsx +1 -8
- package/src/components/EnvBadge.tsx +2 -2
- package/src/components/ui/message-scroller.tsx +5 -23
- package/src/index.css +984 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vpschatbotwidget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is an Package for the chatbot widget ui for our customer portel . ",
|
|
6
6
|
"homepage": "https://github.com/dhineshkumar-natobotics/VPS-Chatbot-Widget#readme",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/react": "^19.3.0",
|
|
66
66
|
"@types/react-dom": "^19.3.0",
|
|
67
67
|
"@vitejs/plugin-react": "^4.3.4",
|
|
68
|
-
"jsdom": "^
|
|
68
|
+
"jsdom": "^26.0.0",
|
|
69
69
|
"tailwindcss": "^4.3.3",
|
|
70
70
|
"typescript": "^5.6.3",
|
|
71
71
|
"vite": "^6.0.1",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { BotMessageSquare } from "lucide-react";
|
|
3
3
|
|
|
4
4
|
export const ChatEmptyState: React.FC = () => {
|
|
5
5
|
return (
|
|
6
|
-
<div className="
|
|
6
|
+
<div className="chat-empty-row">
|
|
7
7
|
<div
|
|
8
|
-
className="
|
|
8
|
+
className="avatar-circle avatar-circle--mt"
|
|
9
9
|
aria-hidden="true"
|
|
10
10
|
>
|
|
11
11
|
<BotMessageSquare size={15} />
|
|
12
12
|
</div>
|
|
13
|
-
<div className="
|
|
13
|
+
<div className="chat-empty-bubble">
|
|
14
14
|
<p>
|
|
15
15
|
Hello — I am the VPS Veritas assistant. Ask about reports, sample status,
|
|
16
16
|
registration, or support, or choose a question below the text box.
|
|
@@ -8,7 +8,7 @@ interface ChatErrorProps {
|
|
|
8
8
|
export const ChatError: React.FC<ChatErrorProps> = ({ message, onRetry }) => {
|
|
9
9
|
return (
|
|
10
10
|
<div
|
|
11
|
-
className="
|
|
11
|
+
className="chat-error-banner"
|
|
12
12
|
role="alert"
|
|
13
13
|
>
|
|
14
14
|
<p>{message}</p>
|
|
@@ -16,7 +16,7 @@ export const ChatError: React.FC<ChatErrorProps> = ({ message, onRetry }) => {
|
|
|
16
16
|
<button
|
|
17
17
|
type="button"
|
|
18
18
|
onClick={onRetry}
|
|
19
|
-
className="
|
|
19
|
+
className="chat-error-retry-btn"
|
|
20
20
|
>
|
|
21
21
|
Try again
|
|
22
22
|
</button>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { ArrowLeft,
|
|
3
|
-
import ChatbotIcon from "../../../Chatbot.svg";
|
|
2
|
+
import { ArrowLeft, Minus, RefreshCw } from "lucide-react";
|
|
4
3
|
import { EnvBadge, type EnvStage } from "../../components/EnvBadge";
|
|
5
4
|
|
|
6
5
|
interface ChatHeaderProps {
|
|
@@ -15,6 +14,7 @@ interface ChatHeaderProps {
|
|
|
15
14
|
/** Whether the status dot pulses. Default: true */
|
|
16
15
|
envPulse?: boolean;
|
|
17
16
|
}
|
|
17
|
+
|
|
18
18
|
const SVGComponent = (props: React.SVGProps<SVGSVGElement> & { width?: string; height?: string , Color?: string}) => (
|
|
19
19
|
<svg
|
|
20
20
|
width={props.width || "24px"}
|
|
@@ -41,41 +41,41 @@ export const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
41
41
|
envPulse = true,
|
|
42
42
|
}) => {
|
|
43
43
|
return (
|
|
44
|
-
<header className="
|
|
45
|
-
<div className="
|
|
44
|
+
<header className="chat-header">
|
|
45
|
+
<div className="chat-header-left">
|
|
46
46
|
{onBack && (
|
|
47
47
|
<button
|
|
48
48
|
type="button"
|
|
49
49
|
onClick={onBack}
|
|
50
|
-
className="
|
|
50
|
+
className="icon-btn-back"
|
|
51
51
|
aria-label="Back"
|
|
52
52
|
>
|
|
53
53
|
<ArrowLeft size={16} />
|
|
54
54
|
</button>
|
|
55
55
|
)}
|
|
56
56
|
<div
|
|
57
|
-
className="
|
|
57
|
+
className="avatar-circle"
|
|
58
58
|
aria-hidden="true"
|
|
59
59
|
>
|
|
60
|
-
<SVGComponent width="16px" height="16px"
|
|
60
|
+
<SVGComponent width="16px" height="16px" color="white" />
|
|
61
61
|
</div>
|
|
62
62
|
<div>
|
|
63
|
-
<div className="
|
|
64
|
-
<h2 className="
|
|
63
|
+
<div className="chat-header-title-row">
|
|
64
|
+
<h2 className="chat-header-title">
|
|
65
65
|
{title}
|
|
66
66
|
</h2>
|
|
67
67
|
{/* ── Env badge inline with title ── */}
|
|
68
68
|
<EnvBadge stage={envStage} pulse={envPulse} />
|
|
69
69
|
</div>
|
|
70
|
-
<p className="
|
|
70
|
+
<p className="chat-header-subtitle">{subtitle || "Customer portal support"}</p>
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
|
-
<div className="
|
|
73
|
+
<div className="chat-header-actions">
|
|
74
74
|
{onReset && (
|
|
75
75
|
<button
|
|
76
76
|
type="button"
|
|
77
77
|
onClick={onReset}
|
|
78
|
-
className="
|
|
78
|
+
className="icon-btn-action"
|
|
79
79
|
aria-label="Start a new conversation"
|
|
80
80
|
title="New conversation"
|
|
81
81
|
>
|
|
@@ -86,7 +86,7 @@ export const ChatHeader: React.FC<ChatHeaderProps> = ({
|
|
|
86
86
|
<button
|
|
87
87
|
type="button"
|
|
88
88
|
onClick={onClose}
|
|
89
|
-
className="
|
|
89
|
+
className="icon-btn-action"
|
|
90
90
|
aria-label={showMinimize ? "Minimize chat" : "Close chat"}
|
|
91
91
|
>
|
|
92
92
|
<Minus size={16} />
|
|
@@ -55,7 +55,7 @@ export const ChatInput: React.FC<ChatInputProps> = ({
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
|
-
<div className="
|
|
58
|
+
<div className="chat-input-wrapper">
|
|
59
59
|
<ChatSuggestions
|
|
60
60
|
variant="badge"
|
|
61
61
|
suggestions={visibleSuggestions}
|
|
@@ -65,7 +65,7 @@ export const ChatInput: React.FC<ChatInputProps> = ({
|
|
|
65
65
|
<label htmlFor="vps-chat-input" className="sr-only">
|
|
66
66
|
Chat message
|
|
67
67
|
</label>
|
|
68
|
-
<div className="
|
|
68
|
+
<div className="chat-input-row">
|
|
69
69
|
<textarea
|
|
70
70
|
id="vps-chat-input"
|
|
71
71
|
ref={textareaRef}
|
|
@@ -83,20 +83,20 @@ export const ChatInput: React.FC<ChatInputProps> = ({
|
|
|
83
83
|
send();
|
|
84
84
|
}
|
|
85
85
|
}}
|
|
86
|
-
className="
|
|
86
|
+
className="chat-textarea"
|
|
87
87
|
/>
|
|
88
88
|
<button
|
|
89
89
|
type="button"
|
|
90
90
|
onClick={send}
|
|
91
91
|
disabled={disabled || !text.trim()}
|
|
92
92
|
aria-label="Send message"
|
|
93
|
-
className="
|
|
93
|
+
className="chat-send-btn"
|
|
94
94
|
>
|
|
95
95
|
<ArrowUp size={16} />
|
|
96
96
|
</button>
|
|
97
97
|
</div>
|
|
98
|
-
<p className="
|
|
99
|
-
Powered by <span className="
|
|
98
|
+
<p className="chat-input-footer">
|
|
99
|
+
Powered by <span className="chat-input-footer-brand">VPS Veritas AI</span>
|
|
100
100
|
</p>
|
|
101
101
|
</div>
|
|
102
102
|
);
|
|
@@ -10,7 +10,7 @@ function renderInline(text: string): React.ReactNode[] {
|
|
|
10
10
|
return (
|
|
11
11
|
<code
|
|
12
12
|
key={index}
|
|
13
|
-
className="
|
|
13
|
+
className="md-code"
|
|
14
14
|
>
|
|
15
15
|
{part.slice(1, -1)}
|
|
16
16
|
</code>
|
|
@@ -23,7 +23,7 @@ function renderInline(text: string): React.ReactNode[] {
|
|
|
23
23
|
href={part}
|
|
24
24
|
target="_blank"
|
|
25
25
|
rel="noopener noreferrer"
|
|
26
|
-
className="
|
|
26
|
+
className="md-link"
|
|
27
27
|
>
|
|
28
28
|
{part}
|
|
29
29
|
</a>
|
|
@@ -45,7 +45,7 @@ export function ChatMarkdown({ text }: { text: string }) {
|
|
|
45
45
|
.split(/\n/)
|
|
46
46
|
.filter((line) => line.trim().startsWith("- ") || line.trim().startsWith("* "));
|
|
47
47
|
return (
|
|
48
|
-
<ul key={blockIndex} className="
|
|
48
|
+
<ul key={blockIndex} className="md-ul">
|
|
49
49
|
{items.map((item, itemIndex) => (
|
|
50
50
|
<li key={itemIndex}>{renderInline(item.replace(/^[-*]\s+/, ""))}</li>
|
|
51
51
|
))}
|
|
@@ -56,7 +56,7 @@ export function ChatMarkdown({ text }: { text: string }) {
|
|
|
56
56
|
if (/^\d+\.\s+/.test(block.trim())) {
|
|
57
57
|
const items = block.split(/\n/).filter((line) => /^\d+\.\s+/.test(line.trim()));
|
|
58
58
|
return (
|
|
59
|
-
<ol key={blockIndex} className="
|
|
59
|
+
<ol key={blockIndex} className="md-ol">
|
|
60
60
|
{items.map((item, itemIndex) => (
|
|
61
61
|
<li key={itemIndex}>{renderInline(item.replace(/^\d+\.\s+/, ""))}</li>
|
|
62
62
|
))}
|
|
@@ -69,7 +69,7 @@ export function ChatMarkdown({ text }: { text: string }) {
|
|
|
69
69
|
return (
|
|
70
70
|
<pre
|
|
71
71
|
key={blockIndex}
|
|
72
|
-
className="
|
|
72
|
+
className="md-pre"
|
|
73
73
|
>
|
|
74
74
|
<code>{content}</code>
|
|
75
75
|
</pre>
|
|
@@ -77,7 +77,7 @@ export function ChatMarkdown({ text }: { text: string }) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
<p key={blockIndex} className="
|
|
80
|
+
<p key={blockIndex} className="md-p">
|
|
81
81
|
{renderInline(block)}
|
|
82
82
|
</p>
|
|
83
83
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Bot, Check, ChevronDown, ChevronUp, FileText , BotMessageSquare} from "lucide-react";
|
|
3
3
|
import type { ChatMessage, Source, ToolCall } from "../api/chatbot-types";
|
|
4
|
-
import { cn } from "../../lib/cn";
|
|
5
4
|
import { ChatMarkdown } from "./ChatMarkdown";
|
|
6
5
|
import { ChatTypingIndicator } from "./ChatTypingIndicator";
|
|
7
6
|
|
|
@@ -16,10 +15,10 @@ function Sources({ sources }: { sources: Source[] }) {
|
|
|
16
15
|
const [open, setOpen] = useState(false);
|
|
17
16
|
if (!sources.length) return null;
|
|
18
17
|
return (
|
|
19
|
-
<div className="
|
|
18
|
+
<div className="sources-panel">
|
|
20
19
|
<button
|
|
21
20
|
type="button"
|
|
22
|
-
className="
|
|
21
|
+
className="sources-toggle-btn"
|
|
23
22
|
onClick={() => setOpen((value) => !value)}
|
|
24
23
|
aria-expanded={open}
|
|
25
24
|
>
|
|
@@ -28,16 +27,16 @@ function Sources({ sources }: { sources: Source[] }) {
|
|
|
28
27
|
{open ? <ChevronUp size={12} /> : <ChevronDown size={12} />}
|
|
29
28
|
</button>
|
|
30
29
|
{open && (
|
|
31
|
-
<ul className="
|
|
30
|
+
<ul className="sources-list">
|
|
32
31
|
{sources.map((source) => (
|
|
33
32
|
<li
|
|
34
33
|
key={source.chunkId}
|
|
35
|
-
className="
|
|
34
|
+
className="source-item"
|
|
36
35
|
>
|
|
37
|
-
<span className="
|
|
36
|
+
<span className="source-name" title={source.source}>
|
|
38
37
|
{source.source.split(/[/\\]/).pop() || source.source}
|
|
39
38
|
</span>
|
|
40
|
-
<span className="
|
|
39
|
+
<span className="source-score">
|
|
41
40
|
{Math.round(source.score * 100)}%
|
|
42
41
|
</span>
|
|
43
42
|
</li>
|
|
@@ -51,11 +50,11 @@ function Sources({ sources }: { sources: Source[] }) {
|
|
|
51
50
|
function Tools({ toolCalls }: { toolCalls: ToolCall[] }) {
|
|
52
51
|
if (!toolCalls.length) return null;
|
|
53
52
|
return (
|
|
54
|
-
<div className="
|
|
53
|
+
<div className="tool-badges">
|
|
55
54
|
{toolCalls.map((call, index) => (
|
|
56
55
|
<span
|
|
57
56
|
key={`${call.toolName}-${index}`}
|
|
58
|
-
className="
|
|
57
|
+
className="tool-badge"
|
|
59
58
|
>
|
|
60
59
|
{toolLabel(call.toolName)}
|
|
61
60
|
</span>
|
|
@@ -73,33 +72,29 @@ export const ChatMessageBubble: React.FC<ChatMessageProps> = ({ message }) => {
|
|
|
73
72
|
const isError = message.status === "error";
|
|
74
73
|
|
|
75
74
|
return (
|
|
76
|
-
<div
|
|
77
|
-
className={cn("flex items-start gap-2.5", isUser && "flex-row-reverse")}
|
|
78
|
-
>
|
|
75
|
+
<div className={`msg-row${isUser ? " msg-row--user" : ""}`}>
|
|
79
76
|
{!isUser && (
|
|
80
77
|
<div
|
|
81
|
-
className="
|
|
78
|
+
className="avatar-circle avatar-circle--mt"
|
|
82
79
|
aria-hidden="true"
|
|
83
80
|
>
|
|
84
81
|
<BotMessageSquare size={15} />
|
|
85
82
|
</div>
|
|
86
83
|
)}
|
|
87
|
-
<div className={
|
|
84
|
+
<div className={`msg-col${isUser ? " msg-col--user" : ""}`}>
|
|
88
85
|
<div
|
|
89
|
-
className={
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
"rounded-tl-sm border border-[var(--error-border)] bg-[var(--error-bg)] text-[var(--error-text)]"
|
|
97
|
-
)}
|
|
86
|
+
className={
|
|
87
|
+
isUser
|
|
88
|
+
? "msg-bubble msg-bubble--user"
|
|
89
|
+
: isError
|
|
90
|
+
? "msg-bubble msg-bubble--error"
|
|
91
|
+
: "msg-bubble msg-bubble--bot"
|
|
92
|
+
}
|
|
98
93
|
>
|
|
99
94
|
{message.status === "pending" ? (
|
|
100
95
|
<ChatTypingIndicator />
|
|
101
96
|
) : isUser ? (
|
|
102
|
-
<p className="
|
|
97
|
+
<p className="msg-user-pre">{message.content}</p>
|
|
103
98
|
) : (
|
|
104
99
|
<ChatMarkdown text={message.content} />
|
|
105
100
|
)}
|
|
@@ -107,7 +102,7 @@ export const ChatMessageBubble: React.FC<ChatMessageProps> = ({ message }) => {
|
|
|
107
102
|
{message.sources ? <Sources sources={message.sources} /> : null}
|
|
108
103
|
</div>
|
|
109
104
|
{isUser && message.status !== "error" && (
|
|
110
|
-
<Check size={13} className="
|
|
105
|
+
<Check size={13} className="msg-tick" aria-hidden="true" />
|
|
111
106
|
)}
|
|
112
107
|
</div>
|
|
113
108
|
</div>
|
|
@@ -5,7 +5,6 @@ import { ChatHeader } from "./ChatHeader";
|
|
|
5
5
|
import { ChatInput } from "./ChatInput";
|
|
6
6
|
import { ChatMessageList } from "./ChatMessageList";
|
|
7
7
|
import { ChatTicketConfirmation } from "./ChatTicketConfirmation";
|
|
8
|
-
import { cn } from "../../lib/cn";
|
|
9
8
|
import { type EnvStage } from "../../components/EnvBadge";
|
|
10
9
|
|
|
11
10
|
interface ChatPanelProps {
|
|
@@ -35,10 +34,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
36
|
<section
|
|
38
|
-
className={
|
|
39
|
-
"flex h-full min-h-0 flex-col overflow-hidden bg-card",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
37
|
+
className={`chat-panel${className ? ` ${className}` : ""}`}
|
|
42
38
|
aria-label="VPS AI Assistant"
|
|
43
39
|
>
|
|
44
40
|
<ChatHeader
|
|
@@ -50,7 +46,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
|
50
46
|
envStage={envStage}
|
|
51
47
|
envPulse={envPulse}
|
|
52
48
|
/>
|
|
53
|
-
<div className="
|
|
49
|
+
<div className="chat-panel-body">
|
|
54
50
|
<ChatMessageList />
|
|
55
51
|
</div>
|
|
56
52
|
{error && status === "error" && (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Suggestion } from "../api/chatbot-types";
|
|
3
|
-
import { cn } from "../../lib/cn";
|
|
4
3
|
|
|
5
4
|
export function filterSuggestions(suggestions: Suggestion[], text: string): Suggestion[] {
|
|
6
5
|
const query = text.trim().toLowerCase();
|
|
@@ -29,21 +28,17 @@ export const ChatSuggestions: React.FC<ChatSuggestionsProps> = ({
|
|
|
29
28
|
if (variant === "badge") {
|
|
30
29
|
return (
|
|
31
30
|
<ul
|
|
32
|
-
className="
|
|
31
|
+
className="suggestions-badge-list"
|
|
33
32
|
aria-label="Suggested questions"
|
|
34
33
|
>
|
|
35
34
|
{suggestions.map((item) => (
|
|
36
|
-
<li key={item.query} className="
|
|
35
|
+
<li key={item.query} className="suggestion-badge-item">
|
|
37
36
|
<button
|
|
38
37
|
type="button"
|
|
39
38
|
disabled={disabled}
|
|
40
39
|
onClick={() => onSelect(item)}
|
|
41
40
|
title={item.query}
|
|
42
|
-
className=
|
|
43
|
-
"max-w-full truncate rounded-full border border-border bg-card px-2.5 py-1 text-left text-[11.5px] font-semibold text-foreground",
|
|
44
|
-
"hover:border-primary hover:bg-[var(--tint-solus-10)] hover:text-primary",
|
|
45
|
-
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
46
|
-
)}
|
|
41
|
+
className="suggestion-badge-btn"
|
|
47
42
|
>
|
|
48
43
|
{item.label}
|
|
49
44
|
</button>
|
|
@@ -54,14 +49,14 @@ export const ChatSuggestions: React.FC<ChatSuggestionsProps> = ({
|
|
|
54
49
|
}
|
|
55
50
|
|
|
56
51
|
return (
|
|
57
|
-
<div className="
|
|
52
|
+
<div className="suggestions-list">
|
|
58
53
|
{suggestions.map((item) => (
|
|
59
54
|
<button
|
|
60
55
|
key={item.query}
|
|
61
56
|
type="button"
|
|
62
57
|
disabled={disabled}
|
|
63
58
|
onClick={() => onSelect(item)}
|
|
64
|
-
className="
|
|
59
|
+
className="suggestion-list-btn"
|
|
65
60
|
>
|
|
66
61
|
{item.label}
|
|
67
62
|
</button>
|
|
@@ -11,37 +11,37 @@ export const ChatTicketConfirmation: React.FC = () => {
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<div
|
|
14
|
-
className="
|
|
14
|
+
className="ticket-card"
|
|
15
15
|
role="region"
|
|
16
16
|
aria-label="Create support ticket"
|
|
17
17
|
>
|
|
18
|
-
<h3 className="
|
|
18
|
+
<h3 className="ticket-card-title">
|
|
19
19
|
Create support ticket?
|
|
20
20
|
</h3>
|
|
21
|
-
<p className="
|
|
21
|
+
<p className="ticket-card-desc">
|
|
22
22
|
I can open a support request for you. Nothing is created until you confirm.
|
|
23
23
|
</p>
|
|
24
|
-
<p className="
|
|
24
|
+
<p className="ticket-card-body">
|
|
25
25
|
{pendingTicket.description}
|
|
26
26
|
</p>
|
|
27
27
|
{needsIdentity && (
|
|
28
|
-
<label className="
|
|
28
|
+
<label className="ticket-id-label">
|
|
29
29
|
Customer ID or email
|
|
30
30
|
<input
|
|
31
31
|
value={identity}
|
|
32
32
|
onChange={(event) => setIdentity(event.target.value)}
|
|
33
|
-
className="
|
|
33
|
+
className="ticket-id-input"
|
|
34
34
|
placeholder="CUST-1001 or you@company.com"
|
|
35
35
|
autoComplete="email"
|
|
36
36
|
/>
|
|
37
37
|
</label>
|
|
38
38
|
)}
|
|
39
|
-
<div className="
|
|
39
|
+
<div className="ticket-actions">
|
|
40
40
|
<button
|
|
41
41
|
type="button"
|
|
42
42
|
onClick={cancelTicket}
|
|
43
43
|
disabled={ticketBusy}
|
|
44
|
-
className="
|
|
44
|
+
className="ticket-cancel-btn"
|
|
45
45
|
>
|
|
46
46
|
Cancel
|
|
47
47
|
</button>
|
|
@@ -49,7 +49,7 @@ export const ChatTicketConfirmation: React.FC = () => {
|
|
|
49
49
|
type="button"
|
|
50
50
|
onClick={() => void confirmTicket(identity)}
|
|
51
51
|
disabled={ticketBusy || (needsIdentity && !identity.trim())}
|
|
52
|
-
className="
|
|
52
|
+
className="ticket-confirm-btn"
|
|
53
53
|
>
|
|
54
54
|
{ticketBusy ? "Creating…" : "Create ticket"}
|
|
55
55
|
</button>
|
|
@@ -4,13 +4,13 @@ import { cn } from "../../lib/cn";
|
|
|
4
4
|
export const ChatTypingIndicator: React.FC<{ className?: string }> = ({ className }) => {
|
|
5
5
|
return (
|
|
6
6
|
<div
|
|
7
|
-
className={cn("
|
|
7
|
+
className={cn("typing-indicator", className)}
|
|
8
8
|
role="status"
|
|
9
9
|
aria-label="Assistant is preparing a reply"
|
|
10
10
|
>
|
|
11
|
-
<span className="
|
|
12
|
-
<span className="
|
|
13
|
-
<span className="
|
|
11
|
+
<span className="typing-dot" />
|
|
12
|
+
<span className="typing-dot" />
|
|
13
|
+
<span className="typing-dot" />
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
16
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ChatPanel } from "../core/ChatPanel";
|
|
3
|
-
import { cn } from "../../lib/cn";
|
|
4
3
|
import { type EnvStage } from "../../components/EnvBadge";
|
|
5
4
|
|
|
6
5
|
interface EmbeddedChatbotPanelProps {
|
|
@@ -23,22 +22,14 @@ export const EmbeddedChatbotPanel: React.FC<EmbeddedChatbotPanelProps> = ({
|
|
|
23
22
|
return (
|
|
24
23
|
<>
|
|
25
24
|
<div
|
|
26
|
-
className={
|
|
27
|
-
"fixed inset-0 z-[90] bg-[var(--overlay)] sm:hidden",
|
|
28
|
-
open ? "opacity-100" : "pointer-events-none opacity-0",
|
|
29
|
-
"transition-opacity duration-200 motion-reduce:transition-none"
|
|
30
|
-
)}
|
|
25
|
+
className={`embedded-overlay ${open ? "embedded-overlay--open" : "embedded-overlay--closed"}`}
|
|
31
26
|
hidden={!open}
|
|
32
27
|
onClick={onClose}
|
|
33
28
|
aria-hidden="true"
|
|
34
29
|
/>
|
|
35
30
|
<aside
|
|
36
31
|
id="vps-embedded-chat-panel"
|
|
37
|
-
className={
|
|
38
|
-
"fixed inset-y-0 right-0 z-[100] flex w-full max-w-[440px] flex-col border-l border-border bg-card shadow-xl",
|
|
39
|
-
"transition-transform duration-300 ease-out motion-reduce:transition-none",
|
|
40
|
-
open ? "translate-x-0" : "translate-x-full"
|
|
41
|
-
)}
|
|
32
|
+
className={`embedded-panel ${open ? "embedded-panel--open" : "embedded-panel--closed"}`}
|
|
42
33
|
aria-hidden={!open}
|
|
43
34
|
>
|
|
44
35
|
{open && (
|
|
@@ -152,8 +152,8 @@ export const EmbeddedChatbotTrigger: React.FC<EmbeddedChatbotTriggerProps> = ({
|
|
|
152
152
|
aria-expanded={false}
|
|
153
153
|
aria-controls="vps-embedded-chat-panel"
|
|
154
154
|
aria-label="Assistant"
|
|
155
|
-
className={`
|
|
156
|
-
dragging ? "
|
|
155
|
+
className={`embedded-trigger-btn ${
|
|
156
|
+
dragging ? "embedded-trigger-btn--grabbing" : "embedded-trigger-btn--grab"
|
|
157
157
|
}`}
|
|
158
158
|
style={{
|
|
159
159
|
top: top ?? "50%",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ChatPanel } from "../core/ChatPanel";
|
|
3
|
-
import { cn } from "../../lib/cn";
|
|
4
3
|
import { type EnvStage } from "../../components/EnvBadge";
|
|
5
4
|
|
|
6
5
|
interface ChatbotWidgetPanelProps {
|
|
@@ -21,11 +20,7 @@ export const ChatbotWidgetPanel: React.FC<ChatbotWidgetPanelProps> = ({
|
|
|
21
20
|
return (
|
|
22
21
|
<div
|
|
23
22
|
id="vps-chatbot-widget-panel"
|
|
24
|
-
className=
|
|
25
|
-
"fixed bottom-[98px] right-7 z-[999] flex h-[min(660px,calc(100vh-120px))] w-[min(420px,calc(100vw-32px))] flex-col overflow-hidden rounded-[20px] border border-border bg-card",
|
|
26
|
-
"shadow-[0_20px_40px_-15px_rgba(0,0,0,0.12)]",
|
|
27
|
-
"origin-bottom-right animate-[chat-pop_180ms_ease-out] motion-reduce:animate-none"
|
|
28
|
-
)}
|
|
23
|
+
className="widget-panel"
|
|
29
24
|
>
|
|
30
25
|
<ChatPanel
|
|
31
26
|
onClose={onClose}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MessageSquare, X } from "lucide-react";
|
|
3
|
-
import { cn } from "../../lib/cn";
|
|
4
3
|
|
|
5
4
|
interface ChatbotWidgetTriggerProps {
|
|
6
5
|
open: boolean;
|
|
@@ -18,13 +17,7 @@ export const ChatbotWidgetTrigger: React.FC<ChatbotWidgetTriggerProps> = ({
|
|
|
18
17
|
aria-expanded={open}
|
|
19
18
|
aria-controls="vps-chatbot-widget-panel"
|
|
20
19
|
aria-label={open ? "Close assistant" : "Open assistant"}
|
|
21
|
-
className=
|
|
22
|
-
"fixed bottom-7 right-7 z-[1000] flex h-[58px] w-[58px] items-center justify-center rounded-xl text-primary-foreground",
|
|
23
|
-
"bg-primary hover:bg-[var(--primary-hover)]",
|
|
24
|
-
"shadow-md",
|
|
25
|
-
"transition duration-200 motion-reduce:transition-none motion-reduce:hover:scale-100",
|
|
26
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary"
|
|
27
|
-
)}
|
|
20
|
+
className="widget-trigger-btn"
|
|
28
21
|
>
|
|
29
22
|
{open ? <X size={22} /> : <MessageSquare size={24} />}
|
|
30
23
|
</button>
|
|
@@ -87,7 +87,7 @@ export const EnvBadge: React.FC<EnvBadgeProps> = ({
|
|
|
87
87
|
|
|
88
88
|
return (
|
|
89
89
|
<span
|
|
90
|
-
className={`env-badge ${variant} ${className}
|
|
90
|
+
className={`env-badge-inline ${variant} ${className}`.trim()}
|
|
91
91
|
title={tooltip}
|
|
92
92
|
aria-label={`${label} build`}
|
|
93
93
|
role="status"
|
|
@@ -97,7 +97,7 @@ export const EnvBadge: React.FC<EnvBadgeProps> = ({
|
|
|
97
97
|
<Icon size={10} className="env-badge-icon" aria-hidden="true" />
|
|
98
98
|
|
|
99
99
|
{/* Label */}
|
|
100
|
-
<span className="
|
|
100
|
+
<span className="env-badge-inline-label">{label}</span>
|
|
101
101
|
</span>
|
|
102
102
|
);
|
|
103
103
|
};
|