@aslaluroba/help-center-react 3.2.5 → 3.2.6
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/README.md +0 -3
- package/dist/components/shared/Button/button.d.ts +3 -3
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/core/api.d.ts +4 -4
- package/dist/index.css +1 -1
- package/dist/index.esm.js +15543 -15136
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15546 -15145
- package/dist/index.js.map +1 -1
- package/dist/lib/theme-utils.d.ts +0 -9
- package/dist/lib/types.d.ts +6 -3
- package/dist/services.esm.js +9474 -9222
- package/dist/services.esm.js.map +1 -1
- package/dist/services.js +9472 -9222
- package/dist/services.js.map +1 -1
- package/dist/ui/chatbot-popup/active-chat-actions.d.ts +7 -0
- package/dist/ui/chatbot-popup/chat-window-screen/action-button.d.ts +10 -0
- package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +1 -0
- package/dist/ui/chatbot-popup/chat-window-screen/header.d.ts +2 -5
- package/dist/ui/chatbot-popup/chat-window-screen/in-chat-review.d.ts +9 -0
- package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +7 -3
- package/dist/ui/chatbot-popup/chat-window-screen/typing-indicator.d.ts +6 -0
- package/dist/ui/chatbot-popup/error-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/loading-screen/index.d.ts +0 -2
- package/dist/ui/chatbot-popup/options-list-screen/company-card.d.ts +9 -0
- package/dist/ui/chatbot-popup/options-list-screen/header.d.ts +1 -2
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-intro.d.ts +6 -0
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-list.d.ts +10 -0
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-option.d.ts +9 -0
- package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +1 -4
- package/dist/ui/help-center.d.ts +2 -5
- package/dist/ui/help-popup.d.ts +16 -7
- package/dist/ui/review-dialog/index.d.ts +2 -1
- package/package.json +35 -29
- package/src/components/shared/Button/button.tsx +11 -18
- package/src/components/shared/Card/card.tsx +8 -8
- package/src/components/ui/agent-response/agent-response.tsx +4 -4
- package/src/components/ui/image-attachment.tsx +8 -8
- package/src/components/ui/image-preview-dialog.tsx +41 -41
- package/src/components/ui/index.ts +0 -1
- package/src/core/AblyService.ts +22 -17
- package/src/core/api.ts +9 -7
- package/src/globals.css +216 -50
- package/src/lib/theme-utils.ts +1 -33
- package/src/lib/types.ts +7 -4
- package/src/locales/ar.json +16 -6
- package/src/locales/en.json +16 -6
- package/src/types/icons.d.ts +6 -0
- package/src/ui/chatbot-popup/active-chat-actions.tsx +39 -0
- package/src/ui/chatbot-popup/chat-window-screen/action-button.tsx +37 -0
- package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +42 -43
- package/src/ui/chatbot-popup/chat-window-screen/header.tsx +34 -67
- package/src/ui/chatbot-popup/chat-window-screen/in-chat-review.tsx +83 -0
- package/src/ui/chatbot-popup/chat-window-screen/index.tsx +49 -42
- package/src/ui/chatbot-popup/chat-window-screen/typing-indicator.tsx +27 -0
- package/src/ui/chatbot-popup/error-screen/index.tsx +7 -7
- package/src/ui/chatbot-popup/loading-screen/index.tsx +6 -17
- package/src/ui/chatbot-popup/options-list-screen/company-card.tsx +37 -0
- package/src/ui/chatbot-popup/options-list-screen/header.tsx +12 -31
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-intro.tsx +32 -0
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-list.tsx +48 -0
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-option.tsx +38 -0
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +44 -38
- package/src/ui/confirmation-modal/index.tsx +27 -12
- package/src/ui/floating-message.tsx +8 -7
- package/src/ui/help-button.tsx +5 -5
- package/src/ui/help-center.tsx +71 -59
- package/src/ui/help-popup.tsx +114 -91
- package/src/ui/powered-by.tsx +49 -7
- package/src/ui/review-dialog/index.tsx +48 -65
- package/src/ui/review-dialog/rating.tsx +7 -7
- package/dist/components/ui/header.d.ts +0 -6
- package/dist/ui/chatbot-popup/home-screen/card.d.ts +0 -6
- package/dist/ui/chatbot-popup/home-screen/chat-now-card.d.ts +0 -5
- package/dist/ui/chatbot-popup/home-screen/index.d.ts +0 -7
- package/dist/ui/chatbot-popup/options-list-screen/expanded-option.d.ts +0 -7
- package/dist/ui/chatbot-popup/options-list-screen/option-card.d.ts +0 -5
- package/src/assets/icons/arrowRight.svg +0 -3
- package/src/assets/icons/chat.svg +0 -4
- package/src/assets/icons/close.svg +0 -1
- package/src/assets/icons/closeCircle.svg +0 -3
- package/src/assets/icons/closeCirclePrimary.svg +0 -4
- package/src/assets/icons/envelope.svg +0 -3
- package/src/assets/icons/paperclip.svg +0 -3
- package/src/assets/icons/threeDots.svg +0 -3
- package/src/assets/icons/user.svg +0 -3
- package/src/assets/icons/x.svg +0 -4
- package/src/assets/logoColors.svg +0 -5
- package/src/assets/logo_ai.svg +0 -14
- package/src/assets/thinking-logo.svg +0 -3
- package/src/components/ui/header.tsx +0 -22
- package/src/ui/chatbot-popup/home-screen/card.tsx +0 -33
- package/src/ui/chatbot-popup/home-screen/chat-now-card.tsx +0 -36
- package/src/ui/chatbot-popup/home-screen/index.tsx +0 -44
- package/src/ui/chatbot-popup/options-list-screen/expanded-option.tsx +0 -37
- package/src/ui/chatbot-popup/options-list-screen/option-card.tsx +0 -31
- /package/src/assets/{icons/seperator.svg → seperator.svg} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ActionButtonProps {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ActionButton: React.FC<ActionButtonProps>;
|
|
10
|
+
export default ActionButton;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface ChatWindowHeaderProps {
|
|
3
|
-
isShowList: boolean;
|
|
4
|
-
setIsShowList?: (isShowList: boolean) => void;
|
|
5
|
-
showChat: boolean;
|
|
6
|
-
onClose: () => void;
|
|
7
3
|
handleBack: () => void;
|
|
8
4
|
handleEndChat: () => void;
|
|
9
|
-
|
|
5
|
+
handleMinimize: () => void;
|
|
6
|
+
optionTitle: string;
|
|
10
7
|
}
|
|
11
8
|
declare const ChatWindowHeader: React.FC<ChatWindowHeaderProps>;
|
|
12
9
|
export default ChatWindowHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReviewProps } from '@/lib/types';
|
|
3
|
+
interface InChatReviewProps {
|
|
4
|
+
onSubmit: (payload: ReviewProps) => void | Promise<void>;
|
|
5
|
+
onDone?: () => void;
|
|
6
|
+
isSubmitting?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const InChatReview: React.FC<InChatReviewProps>;
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Message } from '@/lib/types';
|
|
1
|
+
import { Message, ReviewProps } from '@/lib/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface ChatWindowProps {
|
|
4
4
|
onSendMessage: (message: string, attachmentIds: string[]) => void;
|
|
@@ -6,8 +6,12 @@ interface ChatWindowProps {
|
|
|
6
6
|
messages: Message[];
|
|
7
7
|
assistantStatus: string;
|
|
8
8
|
needsAgent: boolean;
|
|
9
|
-
isAblyConnected: boolean;
|
|
10
9
|
sessionId?: string | null;
|
|
10
|
+
isChatClosed?: boolean;
|
|
11
|
+
inChatReviewSessionId?: string | null;
|
|
12
|
+
isSubmittingReview?: boolean;
|
|
13
|
+
onInChatReviewSubmit?: (payload: ReviewProps) => void | Promise<void>;
|
|
14
|
+
onInChatReviewDone?: () => void;
|
|
11
15
|
}
|
|
12
|
-
export declare const ChatWindow: React.MemoExoticComponent<({ onSendMessage, onEnsureSession, messages, assistantStatus, needsAgent, sessionId, }: ChatWindowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
+
export declare const ChatWindow: React.MemoExoticComponent<({ onSendMessage, onEnsureSession, messages, assistantStatus, needsAgent, sessionId, isChatClosed, inChatReviewSessionId, isSubmittingReview, onInChatReviewSubmit, onInChatReviewDone, }: ChatWindowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
17
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TypingIndicatorProps {
|
|
3
|
+
firstHumanAgentIndex: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const TypingIndicator: React.MemoExoticComponent<({ firstHumanAgentIndex }: TypingIndicatorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
6
|
+
export default TypingIndicator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Option } from '@/lib/types';
|
|
3
|
+
interface HelpscreenListProps {
|
|
4
|
+
options: Option[] | undefined;
|
|
5
|
+
selectedOption: Option | null;
|
|
6
|
+
onToggleOption: (option: Option) => void;
|
|
7
|
+
onStartChat: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const HelpscreenList: React.FC<HelpscreenListProps>;
|
|
10
|
+
export default HelpscreenList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Option } from '@/lib/types';
|
|
3
|
+
interface HelpscreenOptionProps {
|
|
4
|
+
option: Option;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const HelpscreenOption: React.FC<HelpscreenOptionProps>;
|
|
9
|
+
export default HelpscreenOption;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { HelpScreenData, Option } from '@/lib/types';
|
|
2
2
|
interface OptionsListScreenProps {
|
|
3
3
|
helpScreen: HelpScreenData | null;
|
|
4
|
-
expandedOption: Option | null;
|
|
5
|
-
setExpandedOption: (option: Option | null) => void;
|
|
6
4
|
handleStartChat: (option: Option) => void;
|
|
7
|
-
|
|
8
|
-
showHelpScreen: boolean;
|
|
5
|
+
handleMinimize: () => void;
|
|
9
6
|
}
|
|
10
7
|
declare const OptionsListScreen: React.FC<OptionsListScreenProps>;
|
|
11
8
|
export default OptionsListScreen;
|
package/dist/ui/help-center.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../globals.css';
|
|
2
2
|
interface HelpCenterProps {
|
|
3
3
|
helpScreenId: string;
|
|
4
|
-
language
|
|
4
|
+
language?: 'ar' | 'en';
|
|
5
5
|
user?: {
|
|
6
6
|
id?: string;
|
|
7
7
|
name?: string;
|
|
@@ -10,10 +10,7 @@ interface HelpCenterProps {
|
|
|
10
10
|
};
|
|
11
11
|
showArrow?: boolean;
|
|
12
12
|
messageLabel?: string | null;
|
|
13
|
-
showHelpScreen?: boolean;
|
|
14
13
|
primaryColor?: string;
|
|
15
|
-
secondaryColor?: string;
|
|
16
|
-
logoUrl?: string;
|
|
17
14
|
}
|
|
18
|
-
declare const HelpCenter: ({ helpScreenId, user, showArrow, language, messageLabel,
|
|
15
|
+
declare const HelpCenter: ({ helpScreenId, user, showArrow, language, messageLabel, primaryColor, }: HelpCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
16
|
export default HelpCenter;
|
package/dist/ui/help-popup.d.ts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import { HelpScreenData, Message, Option } from '@/lib/types';
|
|
1
|
+
import { HelpScreenData, Message, Option, ReviewProps } from '@/lib/types';
|
|
2
2
|
type HelpPopupProps = {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
helpScreen: HelpScreenData | null;
|
|
6
6
|
status: string;
|
|
7
7
|
error: string | null;
|
|
8
|
-
user:
|
|
8
|
+
user: unknown;
|
|
9
9
|
onStartChat: (option: Option) => void;
|
|
10
10
|
onSendMessage: (message: string, attachmentIds: string[]) => void;
|
|
11
11
|
onEnsureSession: () => Promise<string>;
|
|
12
|
-
onEndChat: (
|
|
12
|
+
onEndChat: (options?: {
|
|
13
|
+
fromChatScreen?: boolean;
|
|
14
|
+
}) => void | Promise<void>;
|
|
13
15
|
messages: Message[];
|
|
14
16
|
needsAgent: boolean;
|
|
15
17
|
assistantStatus: string;
|
|
16
18
|
sessionId: string | null;
|
|
17
19
|
isChatClosed: boolean;
|
|
18
|
-
isAblyConnected: boolean;
|
|
19
20
|
selectedOption: Option | null;
|
|
20
21
|
setSelectedOption: (option: Option | null) => void;
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
inChatReviewSessionId?: string | null;
|
|
23
|
+
onInChatReviewSubmit?: (payload: ReviewProps) => void | Promise<void>;
|
|
24
|
+
onInChatReviewDone?: () => void;
|
|
25
|
+
navigateToOptionsListAfterReview?: boolean;
|
|
26
|
+
onNavigatedToOptionsList?: () => void;
|
|
27
|
+
isReviewDialogOpen?: boolean;
|
|
28
|
+
reviewSessionId?: string | null;
|
|
29
|
+
isSubmittingReview?: boolean;
|
|
30
|
+
onReviewDialogSubmit?: (payload: ReviewProps) => void | Promise<void>;
|
|
31
|
+
onReviewDialogClose?: () => void;
|
|
23
32
|
};
|
|
24
|
-
declare const HelpPopup: ({ onClose, helpScreen, status, error, onStartChat, onSendMessage, onEnsureSession, onEndChat, messages, assistantStatus, needsAgent, sessionId, selectedOption, setSelectedOption,
|
|
33
|
+
declare const HelpPopup: ({ isOpen, onClose, helpScreen, status, error, onStartChat, onSendMessage, onEnsureSession, onEndChat, messages, assistantStatus, needsAgent, sessionId, isChatClosed, selectedOption, setSelectedOption, inChatReviewSessionId, onInChatReviewSubmit, onInChatReviewDone, navigateToOptionsListAfterReview, onNavigatedToOptionsList, isReviewDialogOpen, reviewSessionId, isSubmittingReview, onReviewDialogSubmit, onReviewDialogClose, }: HelpPopupProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
34
|
export default HelpPopup;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReviewProps } from '@/lib/types';
|
|
2
2
|
interface ReviewDialogProps {
|
|
3
|
-
handleSubmit: ({
|
|
3
|
+
handleSubmit: ({ rating }: ReviewProps) => void;
|
|
4
4
|
onClose: () => void;
|
|
5
|
+
isSubmitting?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const ReviewDialog: React.FC<ReviewDialogProps>;
|
|
7
8
|
export default ReviewDialog;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "dist/index.js",
|
|
4
4
|
"module": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
-
"version": "3.2.
|
|
6
|
+
"version": "3.2.6",
|
|
7
7
|
"description": "BabylAI Help Center Widget for React and Next.js",
|
|
8
8
|
"private": false,
|
|
9
9
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "rollup -c",
|
|
26
|
-
"dev": "rollup --watch --config rollup.dev.config.
|
|
26
|
+
"dev": "rollup --watch --config rollup.dev.config.mjs",
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"clean": "rimraf dist",
|
|
29
29
|
"version:patch": "npm version patch --no-git-tag-version",
|
|
@@ -42,9 +42,8 @@
|
|
|
42
42
|
"globals.css",
|
|
43
43
|
"package.json",
|
|
44
44
|
"tsconfig.json",
|
|
45
|
-
"./tailwind.config.js",
|
|
46
45
|
"./postcss.config.js",
|
|
47
|
-
"./rollup.config.
|
|
46
|
+
"./rollup.config.mjs"
|
|
48
47
|
],
|
|
49
48
|
"keywords": [
|
|
50
49
|
"help-center",
|
|
@@ -63,50 +62,57 @@
|
|
|
63
62
|
"react-dom": "^18 || ^19"
|
|
64
63
|
},
|
|
65
64
|
"dependencies": {
|
|
66
|
-
"@ably/chat": "^
|
|
67
|
-
"@tabler/icons-react": "^3.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
65
|
+
"@ably/chat": "^1.1.1",
|
|
66
|
+
"@tabler/icons-react": "^3.36.1",
|
|
67
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
68
|
+
"ably": "^2.17.1",
|
|
69
|
+
"axios": "^1.13.4",
|
|
70
70
|
"class-variance-authority": "^0.7.1",
|
|
71
71
|
"clsx": "^2.1.1",
|
|
72
72
|
"react-markdown": "^10.1.0",
|
|
73
|
-
"tailwind-merge": "^3.
|
|
73
|
+
"tailwind-merge": "^3.4.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@babel/core": "^7.
|
|
77
|
-
"@babel/preset-env": "^7.
|
|
78
|
-
"@babel/preset-react": "^7.
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
76
|
+
"@babel/core": "^7.29.0",
|
|
77
|
+
"@babel/preset-env": "^7.29.0",
|
|
78
|
+
"@babel/preset-react": "^7.28.5",
|
|
79
|
+
"@iconify-json/ic": "^1.2.4",
|
|
80
|
+
"@iconify-json/material-symbols": "^1.2.53",
|
|
81
|
+
"@iconify-json/solar": "^1.2.5",
|
|
82
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
83
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
84
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
82
85
|
"@rollup/plugin-image": "^3.0.3",
|
|
83
86
|
"@rollup/plugin-json": "^6.1.0",
|
|
84
|
-
"@rollup/plugin-node-resolve": "^
|
|
85
|
-
"@rollup/plugin-typescript": "^
|
|
87
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
88
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
86
89
|
"@rollup/plugin-url": "^8.0.2",
|
|
90
|
+
"@svgr/core": "^8.1.0",
|
|
91
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
87
92
|
"@svgr/rollup": "^8.1.0",
|
|
88
|
-
"@tabler/icons-react": "^3.
|
|
93
|
+
"@tabler/icons-react": "^3.36.1",
|
|
89
94
|
"@types/hast": "^3.0.4",
|
|
90
|
-
"@types/node": "^
|
|
91
|
-
"@types/react": "^
|
|
92
|
-
"@types/react-dom": "^
|
|
93
|
-
"autoprefixer": "^10.4.
|
|
95
|
+
"@types/node": "^25.2.0",
|
|
96
|
+
"@types/react": "^19.2.10",
|
|
97
|
+
"@types/react-dom": "^19.2.3",
|
|
98
|
+
"autoprefixer": "^10.4.24",
|
|
94
99
|
"babel-loader": "^10.0.0",
|
|
95
100
|
"clsx": "^2.1.1",
|
|
96
101
|
"concurrently": "^9.2.1",
|
|
97
|
-
"i18next": "^25.
|
|
102
|
+
"i18next": "^25.8.0",
|
|
98
103
|
"postcss": "^8.5.6",
|
|
99
|
-
"react-i18next": "^
|
|
104
|
+
"react-i18next": "^16.5.4",
|
|
100
105
|
"react-markdown": "^10.1.0",
|
|
101
|
-
"rimraf": "^6.
|
|
102
|
-
"rollup": "^
|
|
106
|
+
"rimraf": "^6.1.2",
|
|
107
|
+
"rollup": "^4.57.1",
|
|
103
108
|
"rollup-plugin-postcss": "^4.0.2",
|
|
104
|
-
"tailwindcss": "^
|
|
109
|
+
"tailwindcss": "^4.1.18",
|
|
105
110
|
"tailwindcss-animate": "^1.0.7",
|
|
106
111
|
"tailwindcss-rtl": "^0.9.0",
|
|
107
112
|
"tslib": "^2.8.1",
|
|
108
|
-
"typescript": "^5.9.
|
|
109
|
-
"
|
|
113
|
+
"typescript": "^5.9.3",
|
|
114
|
+
"unplugin-icons": "^23.0.1",
|
|
115
|
+
"webpack": "^5.104.1"
|
|
110
116
|
},
|
|
111
117
|
"publishConfig": {
|
|
112
118
|
"access": "public"
|
|
@@ -2,32 +2,25 @@ import { cn } from '../../../lib'
|
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
3
|
|
|
4
4
|
const buttonVariants = cva(
|
|
5
|
-
'babylai
|
|
5
|
+
'babylai:border babylai:disabled:bg-black-white-300 babylai:cursor-pointer babylai:text-xl babylai:transition-all babylai:w-full babylai:disabled:border-black-white-300 babylai:disabled:cursor-not-allowed babylai:disabled:text-white babylai:duration-200 babylai:ease-out babylai:flex babylai:gap-1 babylai:items-center babylai:justify-center babylai:p-3 babylai:relative babylai:rounded-2xl',
|
|
6
6
|
{
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
|
-
default: 'babylai
|
|
10
|
-
destructive:
|
|
11
|
-
'babylai-bg-destructive babylai-p-2 babylai-text-destructive-foreground babylai-shadow-sm hover:babylai-bg-destructive/90',
|
|
12
|
-
outline:
|
|
13
|
-
'babylai-bg-transparent babylai-border babylai-border-primary-500 babylai-bg-background-transparent hover:babylai-border-primary-600 hover:babylai-text-primary-600 babylai-text-primary-500 babylai-font-bold',
|
|
9
|
+
default: 'babylai:bg-primary babylai:border-primary babylai:text-white babylai:hover:bg-primary-600 babylai:hover:border-primary-600',
|
|
14
10
|
secondary:
|
|
15
|
-
'babylai
|
|
11
|
+
'babylai:text-primary babylai:hover:bg-primary-100 babylai:hover:border-primary-200',
|
|
16
12
|
ghost:
|
|
17
|
-
'babylai
|
|
18
|
-
link: 'babylai-bg-transparent babylai-text-primary babylai-underline-offset-4 hover:babylai-underline babylai-border-none',
|
|
19
|
-
'rounded-icon': '!babylai-p-2 babylai-border-none babylai-bg-transparent'
|
|
13
|
+
'babylai:bg-transparent babylai:p-2 babylai:text-secondary-foreground babylai:shadow-sm babylai:hover:bg-secondary/80',
|
|
20
14
|
},
|
|
21
15
|
size: {
|
|
22
|
-
default: '
|
|
23
|
-
sm: 'babylai
|
|
24
|
-
lg: '
|
|
25
|
-
icon: 'babylai
|
|
16
|
+
default: '',
|
|
17
|
+
sm: 'babylai:h-8 babylai:rounded-full babylai:px-3 babylai:text-xs',
|
|
18
|
+
lg: '',
|
|
19
|
+
icon: 'babylai:h-7 babylai:w-7'
|
|
26
20
|
}
|
|
27
21
|
},
|
|
28
22
|
defaultVariants: {
|
|
29
|
-
variant: 'default'
|
|
30
|
-
size: 'default'
|
|
23
|
+
variant: 'default'
|
|
31
24
|
}
|
|
32
25
|
}
|
|
33
26
|
)
|
|
@@ -36,9 +29,9 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Var
|
|
|
36
29
|
asChild?: boolean
|
|
37
30
|
}
|
|
38
31
|
|
|
39
|
-
export const Button = ({ children, className, variant,
|
|
32
|
+
export const Button = ({ children, className, variant, ...props }: ButtonProps) => {
|
|
40
33
|
return (
|
|
41
|
-
<button className={cn(buttonVariants({ variant,
|
|
34
|
+
<button className={cn(buttonVariants({ variant, className }), className)} {...props}>
|
|
42
35
|
{children}
|
|
43
36
|
</button>
|
|
44
37
|
)
|
|
@@ -7,9 +7,9 @@ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
|
|
8
8
|
const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, variant = 'default', ...props }, ref) => {
|
|
9
9
|
const variantStyles = {
|
|
10
|
-
default: 'babylai
|
|
11
|
-
rounded: 'babylai
|
|
12
|
-
shadowed: 'babylai
|
|
10
|
+
default: 'babylai:rounded-xl babylai:border babylai:bg-card babylai:text-card-foreground babylai:shadow',
|
|
11
|
+
rounded: 'babylai:rounded-3xl babylai:bg-black-white-50 babylai:py-4 babylai:px-3',
|
|
12
|
+
shadowed: 'babylai:rounded-xl babylai:border babylai:bg-card babylai:text-card-foreground babylai:shadow-lg'
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
return <div ref={ref} className={cn(variantStyles[variant], className)} {...props} />
|
|
@@ -17,27 +17,27 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(({ className, variant =
|
|
|
17
17
|
Card.displayName = 'Card'
|
|
18
18
|
|
|
19
19
|
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
20
|
-
<div ref={ref} className={cn('babylai
|
|
20
|
+
<div ref={ref} className={cn('babylai:flex babylai:flex-col babylai:space-y-1.5 babylai:p-6', className)} {...props} />
|
|
21
21
|
))
|
|
22
22
|
CardHeader.displayName = 'CardHeader'
|
|
23
23
|
|
|
24
24
|
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
25
|
-
<div ref={ref} className={cn('babylai
|
|
25
|
+
<div ref={ref} className={cn('babylai:font-semibold babylai:leading-none babylai:tracking-tight', className)} {...props} />
|
|
26
26
|
))
|
|
27
27
|
CardTitle.displayName = 'CardTitle'
|
|
28
28
|
|
|
29
29
|
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
30
|
-
<div ref={ref} className={cn('babylai
|
|
30
|
+
<div ref={ref} className={cn('babylai:text-sm babylai:text-muted-foreground', className)} {...props} />
|
|
31
31
|
))
|
|
32
32
|
CardDescription.displayName = 'CardDescription'
|
|
33
33
|
|
|
34
34
|
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
35
|
-
<div ref={ref} className={cn('babylai
|
|
35
|
+
<div ref={ref} className={cn('babylai:p-6 babylai:pt-0', className)} {...props} />
|
|
36
36
|
))
|
|
37
37
|
CardContent.displayName = 'CardContent'
|
|
38
38
|
|
|
39
39
|
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
40
|
-
<div ref={ref} className={cn('babylai
|
|
40
|
+
<div ref={ref} className={cn('babylai:flex babylai:items-center babylai:p-6 babylai:pt-0', className)} {...props} />
|
|
41
41
|
))
|
|
42
42
|
CardFooter.displayName = 'CardFooter'
|
|
43
43
|
|
|
@@ -25,17 +25,17 @@ const AgentResponse = ({ senderType, messageContent, messageId, onType }: AgentR
|
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<div
|
|
28
|
-
className={`babylai
|
|
28
|
+
className={`babylai:rounded-2xl babylai:p-4 ${
|
|
29
29
|
senderType === 1
|
|
30
|
-
? 'babylai
|
|
31
|
-
: 'babylai
|
|
30
|
+
? 'babylai:bg-primary-500 babylai:text-black-white-50 babylai:max-w-[220px]'
|
|
31
|
+
: 'babylai:bg-card'
|
|
32
32
|
}`}
|
|
33
33
|
>
|
|
34
34
|
<Markdown
|
|
35
35
|
components={{
|
|
36
36
|
p: ({ node, ...props }: { node?: Element; [key: string]: any }) => (
|
|
37
37
|
<p
|
|
38
|
-
className='babylai
|
|
38
|
+
className='babylai:m-0 babylai:leading-6 babylai:text-sm babylai:font-sans babylai:wrap-break-word babylai:dark:text-white babylai:text-start'
|
|
39
39
|
{...props}
|
|
40
40
|
/>
|
|
41
41
|
),
|
|
@@ -39,7 +39,7 @@ export const ImageAttachment: React.FC<ImageAttachmentProps> = ({
|
|
|
39
39
|
try {
|
|
40
40
|
setLoading(true);
|
|
41
41
|
setError(false);
|
|
42
|
-
const response = await presignDownload(fileId, i18n.language);
|
|
42
|
+
const response = await presignDownload(fileId, i18n.language as 'ar' | 'en');
|
|
43
43
|
setImageUrl(response.downloadUrl);
|
|
44
44
|
} catch (err) {
|
|
45
45
|
setError(true);
|
|
@@ -50,7 +50,7 @@ export const ImageAttachment: React.FC<ImageAttachmentProps> = ({
|
|
|
50
50
|
|
|
51
51
|
fetchImageUrl();
|
|
52
52
|
}
|
|
53
|
-
}, [fileId, propImageUrl, i18n.language]);
|
|
53
|
+
}, [fileId, propImageUrl, i18n.language as 'ar' | 'en']);
|
|
54
54
|
|
|
55
55
|
const handleImageClick = () => {
|
|
56
56
|
if (onClick) {
|
|
@@ -64,11 +64,11 @@ export const ImageAttachment: React.FC<ImageAttachmentProps> = ({
|
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
66
66
|
className={cn(
|
|
67
|
-
'babylai
|
|
67
|
+
'babylai:flex babylai:items-center babylai:justify-center babylai:bg-black-white-100 babylai:rounded-lg babylai:w-16 babylai:h-16',
|
|
68
68
|
className
|
|
69
69
|
)}
|
|
70
70
|
>
|
|
71
|
-
<div className='babylai
|
|
71
|
+
<div className='babylai:animate-pulse babylai:text-xs babylai:text-black-white-500'>...</div>
|
|
72
72
|
</div>
|
|
73
73
|
);
|
|
74
74
|
}
|
|
@@ -77,11 +77,11 @@ export const ImageAttachment: React.FC<ImageAttachmentProps> = ({
|
|
|
77
77
|
return (
|
|
78
78
|
<div
|
|
79
79
|
className={cn(
|
|
80
|
-
'babylai
|
|
80
|
+
'babylai:flex babylai:items-center babylai:justify-center babylai:bg-black-white-100 babylai:rounded-lg babylai:w-16 babylai:h-16 babylai:border babylai:border-black-white-200',
|
|
81
81
|
className
|
|
82
82
|
)}
|
|
83
83
|
>
|
|
84
|
-
<div className='babylai
|
|
84
|
+
<div className='babylai:text-xs babylai:text-black-white-500'>!</div>
|
|
85
85
|
</div>
|
|
86
86
|
);
|
|
87
87
|
}
|
|
@@ -92,8 +92,8 @@ export const ImageAttachment: React.FC<ImageAttachmentProps> = ({
|
|
|
92
92
|
src={imageUrl}
|
|
93
93
|
alt='Attachment'
|
|
94
94
|
className={cn(
|
|
95
|
-
'babylai
|
|
96
|
-
(enablePreview || onClick) && 'babylai
|
|
95
|
+
'babylai:w-16 babylai:h-16 babylai:object-cover babylai:rounded-lg babylai:border babylai:border-black-white-200 babylai:max-w-[50px]',
|
|
96
|
+
(enablePreview || onClick) && 'babylai:cursor-pointer babylai:hover:opacity-80 babylai:transition-opacity',
|
|
97
97
|
className
|
|
98
98
|
)}
|
|
99
99
|
onError={() => setError(true)}
|