vpschatbotwidget 1.0.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpschatbotwidget",
3
- "version": "1.0.1",
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": "^29.1.1",
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 { Bot, BotMessageSquare } from "lucide-react";
2
+ import { BotMessageSquare } from "lucide-react";
3
3
 
4
4
  export const ChatEmptyState: React.FC = () => {
5
5
  return (
6
- <div className="flex items-start gap-2.5">
6
+ <div className="chat-empty-row">
7
7
  <div
8
- className="mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground"
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="max-w-[82%] rounded-2xl rounded-tl-sm border border-border bg-[var(--bubble-assistant-bg)] px-3.5 py-2.5 text-[13.5px] leading-[1.55] text-foreground">
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="mx-4 mb-2 rounded-lg border border-[var(--error-border)] bg-[var(--error-bg)] px-3 py-2 text-[12.5px] text-[var(--error-text)]"
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="mt-1.5 text-[12px] font-semibold underline underline-offset-2"
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, Bot, Minus, RefreshCw } from "lucide-react";
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="flex items-center justify-between border-b border-border bg-card px-5 py-4">
45
- <div className="flex items-center gap-3">
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="flex h-8 w-8 items-center justify-center rounded-full border border-border bg-muted text-muted-foreground hover:bg-[var(--grey-100)]"
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="flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground"
57
+ className="avatar-circle"
58
58
  aria-hidden="true"
59
59
  >
60
- <SVGComponent width="16px" height="16px" Color="white" />
60
+ <SVGComponent width="16px" height="16px" color="white" />
61
61
  </div>
62
62
  <div>
63
- <div className="flex items-center gap-1.5">
64
- <h2 className="text-[16px] font-bold tracking-tight text-foreground">
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="text-[12px] text-muted-foreground font-medium text-[var(--text-subtle)]">{subtitle || "Customer portal support"}</p>
70
+ <p className="chat-header-subtitle">{subtitle || "Customer portal support"}</p>
71
71
  </div>
72
72
  </div>
73
- <div className="flex items-center gap-1">
73
+ <div className="chat-header-actions">
74
74
  {onReset && (
75
75
  <button
76
76
  type="button"
77
77
  onClick={onReset}
78
- className="flex h-7 w-7 items-center justify-center rounded-md text-[var(--text-subtle)] hover:bg-muted hover:text-foreground"
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="flex h-7 w-7 items-center justify-center rounded-md text-[var(--text-subtle)] hover:bg-muted hover:text-foreground"
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="bg-card px-4 pb-3 pt-2">
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="flex items-end gap-2 rounded-xl bg-[var(--input-bg)] px-2.5 py-1.5">
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="max-h-24 flex-1 resize-none bg-transparent py-1.5 text-[13.5px] text-foreground outline-none placeholder:text-[var(--text-subtle)] disabled:opacity-60"
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="mb-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-action text-action-foreground hover:bg-[var(--action-hover)] disabled:cursor-not-allowed disabled:opacity-40"
93
+ className="chat-send-btn"
94
94
  >
95
95
  <ArrowUp size={16} />
96
96
  </button>
97
97
  </div>
98
- <p className="mt-2 text-center text-[11px] font-medium text-[var(--text-subtle)]">
99
- Powered by <span className="text-primary font-bold hover:underline cursor-pointer">VPS Veritas AI</span>
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="rounded bg-[var(--input-bg)] px-1 py-0.5 font-mono text-[12px] text-foreground"
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="underline underline-offset-2"
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="my-1.5 ml-4 list-disc space-y-0.5">
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="my-1.5 ml-4 list-decimal space-y-0.5">
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="my-2 overflow-x-auto rounded-lg bg-[var(--code-bg)] p-3 font-mono text-[12px] text-primary-foreground"
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="mb-2 last:mb-0 whitespace-pre-wrap">
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="mt-2 border-t border-border pt-1.5">
18
+ <div className="sources-panel">
20
19
  <button
21
20
  type="button"
22
- className="inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-muted-foreground hover:text-foreground"
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="mt-1.5 space-y-1">
30
+ <ul className="sources-list">
32
31
  {sources.map((source) => (
33
32
  <li
34
33
  key={source.chunkId}
35
- className="flex items-center justify-between rounded-md border border-border bg-muted px-2 py-1 text-[11px] text-muted-foreground"
34
+ className="source-item"
36
35
  >
37
- <span className="truncate" title={source.source}>
36
+ <span className="source-name" title={source.source}>
38
37
  {source.source.split(/[/\\]/).pop() || source.source}
39
38
  </span>
40
- <span className="ml-2 font-semibold text-success">
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="mt-2 flex flex-wrap gap-1.5">
53
+ <div className="tool-badges">
55
54
  {toolCalls.map((call, index) => (
56
55
  <span
57
56
  key={`${call.toolName}-${index}`}
58
- className="inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] text-muted-foreground"
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="mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground"
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={cn("flex max-w-[82%] flex-col", isUser && "items-end")}>
84
+ <div className={`msg-col${isUser ? " msg-col--user" : ""}`}>
88
85
  <div
89
- className={cn(
90
- "rounded-2xl px-3.5 py-2.5 text-[13.5px] leading-[1.55]",
91
- isUser && "rounded-tr-sm bg-[var(--bubble-user-bg)] text-[var(--bubble-user-text)] font-medium",
92
- !isUser &&
93
- !isError &&
94
- "rounded-tl-sm border border-border bg-[var(--bubble-bot-message-bg)] text-foreground",
95
- isError &&
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="whitespace-pre-wrap">{message.content}</p>
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="mt-1 text-success" aria-hidden="true" />
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={cn(
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="relative min-h-0 flex-1">
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="mb-2 flex flex-wrap gap-1.5"
31
+ className="suggestions-badge-list"
33
32
  aria-label="Suggested questions"
34
33
  >
35
34
  {suggestions.map((item) => (
36
- <li key={item.query} className="max-w-full">
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={cn(
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="mt-3 flex flex-col gap-2">
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="rounded-lg border border-border bg-card px-3.5 py-2.5 text-left text-[13px] font-semibold text-foreground shadow-[0_1px_3px_rgba(0,0,0,0.02)] transition hover:-translate-y-px hover:border-vps-light-grey hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none motion-reduce:hover:translate-y-0"
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="mx-4 mb-3 rounded-xl border border-border bg-card p-4 shadow-sm"
14
+ className="ticket-card"
15
15
  role="region"
16
16
  aria-label="Create support ticket"
17
17
  >
18
- <h3 className="text-[13.5px] font-bold text-foreground">
18
+ <h3 className="ticket-card-title">
19
19
  Create support ticket?
20
20
  </h3>
21
- <p className="mt-1.5 text-[12.5px] leading-5 text-muted-foreground">
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="mt-2 rounded-md bg-muted px-2.5 py-2 text-[12.5px] text-foreground">
24
+ <p className="ticket-card-body">
25
25
  {pendingTicket.description}
26
26
  </p>
27
27
  {needsIdentity && (
28
- <label className="mt-3 block text-[12px] font-semibold text-foreground">
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="mt-1 w-full rounded-md border border-border px-2.5 py-2 text-[13px] font-normal outline-none focus-visible:ring-2 focus-visible:ring-primary"
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="mt-3 flex justify-end gap-2">
39
+ <div className="ticket-actions">
40
40
  <button
41
41
  type="button"
42
42
  onClick={cancelTicket}
43
43
  disabled={ticketBusy}
44
- className="rounded-lg border border-border bg-card px-3.5 py-1.5 text-[12.5px] font-semibold text-muted-foreground hover:bg-muted"
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="rounded-lg bg-action px-3.5 py-1.5 text-[12.5px] font-semibold text-action-foreground hover:bg-[var(--action-hover)] disabled:opacity-40"
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("flex items-center gap-1 py-0.5", className)}
7
+ className={cn("typing-indicator", className)}
8
8
  role="status"
9
9
  aria-label="Assistant is preparing a reply"
10
10
  >
11
- <span className="h-1.5 w-1.5 rounded-full bg-[var(--text-subtle)] motion-safe:animate-pulse" />
12
- <span className="h-1.5 w-1.5 rounded-full bg-[var(--text-subtle)] motion-safe:animate-pulse [animation-delay:150ms]" />
13
- <span className="h-1.5 w-1.5 rounded-full bg-[var(--text-subtle)] motion-safe:animate-pulse [animation-delay:300ms]" />
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={cn(
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={cn(
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={`fixed right-0 z-[80] flex touch-none items-center gap-2 rounded-l-lg bg-action px-3 py-2.5 text-[12.5px] font-semibold text-action-foreground shadow-lg hover:bg-[var(--action-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${
156
- dragging ? "cursor-grabbing" : "cursor-grab"
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={cn(
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={cn(
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} text-[var(--vps-orange)] font-medium text-[10px] leading-[12px] px-1.5 py-0.5 rounded-full border border-[var(--border)] bg-[var(--orange-50)] hover:bg-[var(--grey-200)] cursor-pointer hover:text-foreground flex items-center gap-1 `}
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="text-[var(--text-primary)] font-medium text-[10px] leading-[12px]">{label}</span>
100
+ <span className="env-badge-inline-label">{label}</span>
101
101
  </span>
102
102
  );
103
103
  };