@aslaluroba/help-center-react 3.0.7 → 3.0.9
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/index.css +1 -1
- package/dist/index.esm.js +2269 -60
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2269 -61
- package/dist/index.js.map +1 -1
- package/package.json +2 -4
- package/src/components/shared/Button/button.tsx +3 -3
- package/src/components/shared/Card/card.tsx +8 -8
- package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +1 -1
- package/src/ui/chatbot-popup/chat-window-screen/header.tsx +8 -9
- package/src/ui/chatbot-popup/chat-window-screen/index.tsx +1 -1
- package/src/ui/chatbot-popup/error-screen/index.tsx +1 -1
- package/src/ui/chatbot-popup/home-screen/card.tsx +1 -1
- package/src/ui/chatbot-popup/home-screen/index.tsx +2 -2
- package/src/ui/chatbot-popup/loading-screen/index.tsx +1 -1
- package/src/ui/chatbot-popup/options-list-screen/header.tsx +5 -7
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +3 -3
- package/src/ui/chatbot-popup/options-list-screen/option-card.tsx +4 -5
- package/src/ui/floating-message.tsx +1 -1
- package/src/ui/help-popup.tsx +3 -3
- package/src/ui/review-dialog/index.tsx +6 -6
- package/src/ui/review-dialog/rating.tsx +7 -7
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.0.
|
|
6
|
+
"version": "3.0.9",
|
|
7
7
|
"description": "BabylAI Help Center Widget for React and Next.js",
|
|
8
8
|
"private": false,
|
|
9
9
|
"exports": {
|
|
@@ -52,10 +52,8 @@
|
|
|
52
52
|
"dist/index.css"
|
|
53
53
|
],
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"i18next": "^23.0.0 || ^25.0.0",
|
|
56
55
|
"react": "^18 || ^19",
|
|
57
|
-
"react-dom": "^18 || ^19"
|
|
58
|
-
"react-i18next": "^13.0.0 || ^15.0.0"
|
|
56
|
+
"react-dom": "^18 || ^19"
|
|
59
57
|
},
|
|
60
58
|
"dependencies": {
|
|
61
59
|
"@ably/chat": "^0.8.0",
|
|
@@ -8,14 +8,14 @@ const buttonVariants = cva(
|
|
|
8
8
|
variant: {
|
|
9
9
|
default: 'babylai-bg-primary-500 babylai-p-2 babylai-text-white babylai-text-xs babylai-font-semibold hover:babylai-bg-primary-600',
|
|
10
10
|
destructive:
|
|
11
|
-
'babylai-bg-destructive babylai-p-2 babylai-text-destructive-foreground babylai-shadow-sm
|
|
11
|
+
'babylai-bg-destructive babylai-p-2 babylai-text-destructive-foreground babylai-shadow-sm hover:babylai-bg-destructive/90',
|
|
12
12
|
outline:
|
|
13
13
|
'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',
|
|
14
14
|
secondary:
|
|
15
15
|
'babylai-bg-secondary babylai-p-2 babylai-text-secondary-foreground babylai-shadow-sm babylai-hover:babylai-bg-secondary/80',
|
|
16
16
|
ghost:
|
|
17
|
-
'babylai-bg-transparent babylai-p-2 babylai-text-secondary-foreground babylai-shadow-sm
|
|
18
|
-
link: 'babylai-text-primary babylai-underline-offset-4
|
|
17
|
+
'babylai-bg-transparent babylai-p-2 babylai-text-secondary-foreground babylai-shadow-sm hover:babylai-bg-secondary/80',
|
|
18
|
+
link: 'babylai-text-primary babylai-underline-offset-4 hover:babylai-underline',
|
|
19
19
|
'rounded-icon': '!babylai-p-2'
|
|
20
20
|
},
|
|
21
21
|
size: {
|
|
@@ -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: 'rounded-xl border bg-card text-card-foreground shadow',
|
|
11
|
-
rounded: 'rounded-3xl bg-black-white-50 py-4 px-3',
|
|
12
|
-
shadowed: 'rounded-xl border bg-card text-card-foreground shadow-lg'
|
|
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('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
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('font-semibold leading-none tracking-tight', className)} {...props} />
|
|
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('text-sm text-muted-foreground', className)} {...props} />
|
|
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('p-6 pt-0', className)} {...props} />
|
|
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('flex items-center p-6 pt-0', className)} {...props} />
|
|
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
|
|
|
@@ -27,7 +27,7 @@ const ChatWindowFooter: React.FC<ChatWindowFooterProps> = (props) => {
|
|
|
27
27
|
size='icon'
|
|
28
28
|
onClick={props.handleSendMessage}
|
|
29
29
|
disabled={props?.isLoading}
|
|
30
|
-
className='babylai-rounded-full babylai-bg-purple-500 babylai-hover:babylai-bg-purple-600 babylai-w-8 babylai-h-8
|
|
30
|
+
className='babylai-rounded-full babylai-bg-purple-500 babylai-hover:babylai-bg-purple-600 babylai-w-8 babylai-h-8 disabled:babylai-opacity-50'
|
|
31
31
|
>
|
|
32
32
|
<EnvelopeIcon className={`babylai-w-4 babylai-h-4 ${dir === 'rtl' ? 'babylai-rotate-270' : ''}`} />
|
|
33
33
|
</Button>
|
|
@@ -17,7 +17,7 @@ interface ChatWindowHeaderProps {
|
|
|
17
17
|
const ChatWindowHeader: React.FC<ChatWindowHeaderProps> = (props) => {
|
|
18
18
|
const [showMenu, setShowMenu] = useState(false);
|
|
19
19
|
const { t, dir } = useLocalTranslation();
|
|
20
|
-
const isRTL = dir === "rtl";
|
|
20
|
+
const isRTL = String(dir) === "rtl";
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<header className="babylai-flex babylai-w-full babylai-items-center babylai-py-[18px] babylai-px-[18px] babylai-justify-between babylai-relative babylai-bg-black-white-50 dark:!babylai-bg-storm-dust-900 babylai-rounded-t-3xl">
|
|
@@ -29,17 +29,17 @@ const ChatWindowHeader: React.FC<ChatWindowHeaderProps> = (props) => {
|
|
|
29
29
|
onClick={props.handleBack}
|
|
30
30
|
>
|
|
31
31
|
<ArrowRight
|
|
32
|
-
className={
|
|
33
|
-
/>
|
|
32
|
+
className={`babylai-w-3 babylai-h-3 ${isRTL ? "" : "babylai-rotate-180"} babylai-text-primary-500 dark:babylai-text-white`}
|
|
33
|
+
/>
|
|
34
34
|
</Button>
|
|
35
|
-
<div className="babylai-relative
|
|
35
|
+
<div className="babylai-relative">
|
|
36
36
|
<Button
|
|
37
37
|
variant="rounded-icon"
|
|
38
38
|
size="icon"
|
|
39
39
|
className="babylai-bg-primary-500/10 dark:babylai-bg-storm-dust-950"
|
|
40
40
|
onClick={() => setShowMenu(!showMenu)}
|
|
41
41
|
>
|
|
42
|
-
<ThreeDots className="babylai-w-
|
|
42
|
+
<ThreeDots className="babylai-w-3.5 babylai-h-1 babylai-text-primary-500 dark:babylai-text-white" />
|
|
43
43
|
</Button>
|
|
44
44
|
|
|
45
45
|
{showMenu && (
|
|
@@ -50,7 +50,7 @@ const ChatWindowHeader: React.FC<ChatWindowHeaderProps> = (props) => {
|
|
|
50
50
|
aria-orientation="vertical"
|
|
51
51
|
>
|
|
52
52
|
<button
|
|
53
|
-
className="babylai-block babylai-px-4 babylai-py-2 babylai-text-sm babylai-text-gray-700 dark:babylai-text-white
|
|
53
|
+
className="babylai-block babylai-px-4 babylai-py-2 babylai-text-sm babylai-text-gray-700 dark:babylai-text-white hover:babylai-bg-gray-100 babylai-w-full babylai-text-start"
|
|
54
54
|
role="menuitem"
|
|
55
55
|
onClick={(e) => {
|
|
56
56
|
e.stopPropagation();
|
|
@@ -65,9 +65,8 @@ const ChatWindowHeader: React.FC<ChatWindowHeaderProps> = (props) => {
|
|
|
65
65
|
)}
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</div>
|
|
68
|
+
|
|
69
|
+
<Logo className="babylai-w-[124px] babylai-h-auto dark:babylai-text-white" />
|
|
71
70
|
</header>
|
|
72
71
|
);
|
|
73
72
|
};
|
|
@@ -32,7 +32,7 @@ const MessageComponent = React.memo(
|
|
|
32
32
|
}) => {
|
|
33
33
|
const isFirstInSequence = index === 0 || messages[index - 1].senderType !== message.senderType;
|
|
34
34
|
const isFirstHumanAgentMessage = index === firstHumanAgentIndex && message.senderType === 2;
|
|
35
|
-
const textDirection = message.senderType === 1 ? 'justify-end' : 'justify-start';
|
|
35
|
+
const textDirection = message.senderType === 1 ? 'babylai-justify-end' : 'babylai-justify-start';
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<div key={message.id}>
|
|
@@ -8,7 +8,7 @@ interface ChatBotErrorScreenProps {
|
|
|
8
8
|
const ChatBotErrorScreen: React.FC<ChatBotErrorScreenProps> = (props) => {
|
|
9
9
|
return (
|
|
10
10
|
<div className="babylai-w-full babylai-h-full babylai-bg-black-white-50 babylai-rounded-3xl babylai-shadow-lg babylai-z-50 babylai-flex babylai-flex-col">
|
|
11
|
-
<div className="h-full
|
|
11
|
+
<div className="babylai-h-full babylai-rounded-3xl babylai-flex babylai-flex-col babylai-bg-gradient-to-b babylai-from-primary-500 babylai-to-primary-500/60 babylai-py-6 md:babylai-py-8 babylai-px-6 babylai-gap-4 md:babylai-gap-8">
|
|
12
12
|
<Header onClose={props.onClose} />
|
|
13
13
|
<div className="babylai-flex babylai-flex-col babylai-items-center babylai-justify-center babylai-w-full babylai-h-full babylai-px-6 babylai-py-16 md:babylai-py-28">
|
|
14
14
|
<div className="babylai-text-white babylai-text-lg">Error: {props.error}</div>
|
|
@@ -11,7 +11,7 @@ const Card: React.FC<CardProps> = (props) => {
|
|
|
11
11
|
const { dir } = useLocalTranslation();
|
|
12
12
|
const isLTR = dir === "ltr";
|
|
13
13
|
return (
|
|
14
|
-
<div className="babylai-flex
|
|
14
|
+
<div className="babylai-flex babylai-items-center babylai-justify-between babylai-gap-4 babylai-bg-black-white-50 babylai-rounded-3xl babylai-p-6">
|
|
15
15
|
<p className="babylai-text-base md:babylai-text-lg babylai-font-medium babylai-text-black-white-800">
|
|
16
16
|
{props.text}
|
|
17
17
|
</p>
|
|
@@ -20,7 +20,7 @@ const HomeScreen: React.FC<HomeScreenProps> = (props) => {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<div className="babylai-h-full babylai-flex babylai-flex-col babylai-overflow-y-auto babylai-py-6 md:babylai-py-8 babylai-px-6 gap-4 md:gap-8">
|
|
23
|
+
<div className="babylai-h-full babylai-flex babylai-flex-col babylai-overflow-y-auto babylai-py-6 md:babylai-py-8 babylai-px-6 babylai-gap-4 md:babylai-gap-8">
|
|
24
24
|
<Header onClose={props.onClose} />
|
|
25
25
|
|
|
26
26
|
<h1 className="babylai-text-2xl md:babylai-text-4xl babylai-font-bold babylai-text-white">
|
|
@@ -29,7 +29,7 @@ const HomeScreen: React.FC<HomeScreenProps> = (props) => {
|
|
|
29
29
|
BabylAI 🚀
|
|
30
30
|
</h1>
|
|
31
31
|
|
|
32
|
-
<div className="babylai-flex babylai-flex-col gap-3">
|
|
32
|
+
<div className="babylai-flex babylai-flex-col babylai-gap-3">
|
|
33
33
|
<ChatNowCard setIsShowList={props.setIsShowList} />
|
|
34
34
|
|
|
35
35
|
<Card handleClick={handleNavigateTo} text={t('homeSdk.tryBabylAi')} />
|
|
@@ -12,7 +12,7 @@ const ChatBotLoadingScreen: React.FC<ChatBotLoadingScreenProps> = (props) => {
|
|
|
12
12
|
<div className="babylai-w-full babylai-h-full babylai-bg-black-white-50 dark:babylai-bg-storm-dust-950 babylai-rounded-3xl babylai-shadow-lg babylai-flex babylai-flex-col">
|
|
13
13
|
<div
|
|
14
14
|
className={cn(
|
|
15
|
-
'babylai-rounded-3xl babylai-h-full babylai-flex babylai-flex-col babylai-py-6 md:babylai-py-8 babylai-px-6 gap-4 md:gap-8',
|
|
15
|
+
'babylai-rounded-3xl babylai-h-full babylai-flex babylai-flex-col babylai-py-6 md:babylai-py-8 babylai-px-6 babylai-gap-4 md:babylai-gap-8',
|
|
16
16
|
{
|
|
17
17
|
'babylai-bg-gradient-to-b babylai-from-primary-500 babylai-to-primary-500/60': !props.isShowList,
|
|
18
18
|
'babylai-bg-black-white-100 dark:babylai-bg-storm-dust-950': props.isShowList
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from '@/components';
|
|
2
2
|
import ArrowRight from './../../../assets/icons/arrowRight.svg';
|
|
3
|
-
import ThinkingLogo from '
|
|
3
|
+
import ThinkingLogo from '@/assets/thinking-logo.svg';
|
|
4
4
|
import { useLocalTranslation } from '../../../useLocalTranslation';
|
|
5
5
|
import CloseCircle from '../../../assets/icons/closeCirclePrimary.svg';
|
|
6
6
|
|
|
@@ -14,14 +14,12 @@ const OptionsListHeader: React.FC<OptionsListHeaderProps> = ({
|
|
|
14
14
|
showHelpScreen,
|
|
15
15
|
}) => {
|
|
16
16
|
const { dir } = useLocalTranslation();
|
|
17
|
-
const isRTL = dir === "rtl";
|
|
17
|
+
const isRTL = String(dir) === "rtl";
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<header
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
!showHelpScreen ? "babylai-justify-end" : "babylai-justify-between"
|
|
24
|
-
}`}
|
|
21
|
+
className={`babylai-flex babylai-w-full babylai-items-center babylai-mb-2 ${!showHelpScreen ? "babylai-justify-end" : "babylai-justify-between"
|
|
22
|
+
}`}
|
|
25
23
|
>
|
|
26
24
|
<Button
|
|
27
25
|
variant="rounded-icon"
|
|
@@ -31,7 +29,7 @@ const OptionsListHeader: React.FC<OptionsListHeaderProps> = ({
|
|
|
31
29
|
>
|
|
32
30
|
{showHelpScreen ? (
|
|
33
31
|
<ArrowRight
|
|
34
|
-
className={`${isRTL ? "" : "babylai-rotate-180"} babylai-text-primary-500 babylai-w-full babylai-h-full`}
|
|
32
|
+
className={`${!isRTL ? "" : "babylai-rotate-180"} babylai-text-primary-500 babylai-w-full babylai-h-full`}
|
|
35
33
|
/>
|
|
36
34
|
) : (
|
|
37
35
|
<CloseCircle className="!babylai-w-full !babylai-h-full babylai-cursor-pointer" />
|
|
@@ -30,10 +30,10 @@ const OptionsListScreen: React.FC<OptionsListScreenProps> = ({
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<div className='babylai-px-8 babylai-pb-12 babylai-pt-8 babylai-overflow-y-auto
|
|
33
|
+
<div className='babylai-px-8 babylai-pb-12 babylai-pt-8 babylai-overflow-y-auto babylai-h-full'>
|
|
34
34
|
<OptionsListHeader handleBack={handleBack} showHelpScreen={showHelpScreen} />
|
|
35
35
|
|
|
36
|
-
<h1 className='babylai-text-4xl babylai-font-bold mb-4 babylai-text-black-white-800 dark:babylai-text-white'>
|
|
36
|
+
<h1 className='babylai-text-4xl babylai-font-bold babylai-mb-4 babylai-text-black-white-800 dark:babylai-text-white'>
|
|
37
37
|
{helpScreen?.title}
|
|
38
38
|
</h1>
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ const OptionsListScreen: React.FC<OptionsListScreenProps> = ({
|
|
|
43
43
|
<Card
|
|
44
44
|
key={option.id}
|
|
45
45
|
variant='rounded'
|
|
46
|
-
className='babylai-cursor-pointer babylai-transition-all
|
|
46
|
+
className='babylai-cursor-pointer babylai-transition-all hover:babylai-shadow-md !babylai-px-2 !babylai-py-1 dark:!babylai-bg-storm-dust-900'
|
|
47
47
|
onClick={() => handleToggleExpandOption(option)}
|
|
48
48
|
>
|
|
49
49
|
<OptionCard title={option.title} />
|
|
@@ -7,8 +7,9 @@ interface OptionCardProps {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const OptionCard: React.FC<OptionCardProps> = (props) => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const { dir } = useLocalTranslation();
|
|
11
|
+
const isRTL = String(dir) === "rtl";
|
|
12
|
+
|
|
12
13
|
return (
|
|
13
14
|
<div className="babylai-flex babylai-items-center babylai-justify-between babylai-p-2">
|
|
14
15
|
<p className="babylai-text-sm babylai-font-medium babylai-text-black-white-800 dark:babylai-text-white">
|
|
@@ -20,9 +21,7 @@ const OptionCard: React.FC<OptionCardProps> = (props) => {
|
|
|
20
21
|
className="babylai-text-primary-500 hover:babylai-bg-primary-100"
|
|
21
22
|
>
|
|
22
23
|
<ArrowRight
|
|
23
|
-
className={`babylai-w-
|
|
24
|
-
isLTR ? "" : "babylai-rotate-180"
|
|
25
|
-
} babylai-text-primary-500`}
|
|
24
|
+
className={`babylai-w-3 babylai-h-3 ${!isRTL ? "" : "babylai-rotate-180"} babylai-text-primary-500 dark:babylai-text-white`}
|
|
26
25
|
/>
|
|
27
26
|
</Button>
|
|
28
27
|
</div>
|
|
@@ -13,7 +13,7 @@ export function FloatingMessage({ message, onClose }: FloatingMessageProps) {
|
|
|
13
13
|
<div className="babylai-bg-primary-500 babylai-text-white babylai-py-3 babylai-px-4 babylai-rounded-3xl babylai-shadow-lg babylai-mb-4 babylai-max-w-[200px] babylai-relative after:babylai-content-[''] after:babylai-absolute after:babylai--bottom-[10px] after:babylai-right-5 after:babylai-w-0 after:babylai-h-0 after:babylai-border-l-[10px] after:babylai-border-r-[10px] after:babylai-border-t-[10px] after:babylai-border-l-transparent after:babylai-border-r-transparent after:babylai-border-t-primary-500">
|
|
14
14
|
<p className="babylai-text-xs babylai-font-bold babylai-m-0">{message}</p>
|
|
15
15
|
<button
|
|
16
|
-
className="babylai-absolute babylai--top-2 babylai--right-2 babylai-w-5 babylai-h-5 babylai-rounded-full babylai-bg-white babylai-border-none babylai-cursor-pointer babylai-flex babylai-items-center babylai-justify-center babylai-text-black-white-700 babylai-p-[3px] babylai-
|
|
16
|
+
className="babylai-absolute babylai--top-2 babylai--right-2 babylai-w-5 babylai-h-5 babylai-rounded-full babylai-bg-white babylai-border-none babylai-cursor-pointer babylai-flex babylai-items-center babylai-justify-center babylai-text-black-white-700 babylai-p-[3px] hover:babylai-bg-primary-400 babylai-hover:text-white babylai-shadow-md"
|
|
17
17
|
onClick={onClose}
|
|
18
18
|
>
|
|
19
19
|
<CloseIcon className="babylai-w-8 babylai-h-8" />
|
package/src/ui/help-popup.tsx
CHANGED
|
@@ -247,7 +247,7 @@ export function HelpPopup({
|
|
|
247
247
|
if (status === 'loading' && !helpScreen) {
|
|
248
248
|
return (
|
|
249
249
|
<div
|
|
250
|
-
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-
|
|
250
|
+
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-h-[calc(100vh-240px)] babylai-max-h-[800px]
|
|
251
251
|
babylai-overflow-auto babylai-w-full babylai-bg-black-white-50 md:babylai-mb-4
|
|
252
252
|
md:babylai-bottom-[6rem] md:babylai-right-4 babylai-rounded-none md:babylai-rounded-3xl babylai-shadow-lg babylai-z-50 babylai-flex babylai-flex-col'
|
|
253
253
|
>
|
|
@@ -259,7 +259,7 @@ md:babylai-bottom-[6rem] md:babylai-right-4 babylai-rounded-none md:babylai-roun
|
|
|
259
259
|
if (error) {
|
|
260
260
|
return (
|
|
261
261
|
<div
|
|
262
|
-
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-
|
|
262
|
+
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-h-[calc(100vh-240px)] babylai-max-h-[800px]
|
|
263
263
|
babylai-overflow-auto babylai-w-full babylai-bg-black-white-50 md:babylai-mb-4
|
|
264
264
|
md:babylai-bottom-[6rem] md:babylai-right-4 babylai-rounded-none md:babylai-rounded-3xl babylai-shadow-lg babylai-z-50 babylai-flex babylai-flex-col'
|
|
265
265
|
>
|
|
@@ -270,7 +270,7 @@ md:babylai-bottom-[6rem] md:babylai-right-4 babylai-rounded-none md:babylai-roun
|
|
|
270
270
|
|
|
271
271
|
return (
|
|
272
272
|
<div
|
|
273
|
-
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-
|
|
273
|
+
className='babylai-fixed babylai-inset-0 md:babylai-inset-auto md:babylai-max-w-sm md:babylai-h-[calc(100vh-240px)] babylai-max-h-[800px]
|
|
274
274
|
babylai-overflow-auto babylai-w-full babylai-bg-black-white-50 md:babylai-mb-4
|
|
275
275
|
md:babylai-bottom-[6rem] md:babylai-right-4 babylai-rounded-none md:babylai-rounded-3xl babylai-shadow-lg babylai-z-50 babylai-flex babylai-flex-col'
|
|
276
276
|
>
|
|
@@ -52,19 +52,19 @@ const ReviewDialog: React.FC<ReviewDialogProps> = (props) => {
|
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
54
|
<section className="babylai-p-6 babylai-gap-6 babylai-max-w-sm babylai-max-h-[calc(100vh-90px)] babylai-overflow-auto babylai-w-full babylai-bg-black-white-50 dark:babylai-bg-storm-dust-950 babylai-fixed babylai-bottom-20 babylai-right-0 md:babylai-right-4 babylai-rounded-3xl babylai-shadow-lg babylai-z-50 babylai-flex babylai-flex-col">
|
|
55
|
-
<header className='border-b pb-4 babylai-flex babylai-items-center babylai-justify-between babylai-gap-4'>
|
|
55
|
+
<header className='babylai-border-b babylai-pb-4 babylai-flex babylai-items-center babylai-justify-between babylai-gap-4'>
|
|
56
56
|
<h2 className="babylai-text-lg babylai-font-semibold dark:babylai-text-white">{t('homeSdk.ReviewDialog.title')}</h2>
|
|
57
57
|
<CloseCircle className="babylai-w-6 babylai-h-6 babylai-cursor-pointer dark:babylai-text-white" onClick={props.onClose} />
|
|
58
58
|
</header>
|
|
59
59
|
<div className="babylai-flex babylai-flex-col babylai-gap-2">
|
|
60
|
-
<p className="babylai-text-sm babylai-text-gray-600 mb-3 dark:babylai-text-white">
|
|
60
|
+
<p className="babylai-text-sm babylai-text-gray-600 babylai-mb-3 dark:babylai-text-white">
|
|
61
61
|
{t('homeSdk.ReviewDialog.description')}
|
|
62
62
|
</p>
|
|
63
63
|
|
|
64
64
|
<div className="babylai-flex babylai-items-center babylai-gap-2">
|
|
65
65
|
<span className="babylai-text-base babylai-font-medium dark:babylai-text-white">{t('homeSdk.ReviewDialog.rating_label')}</span>
|
|
66
66
|
<Rating value={rating} onChange={handleRatingChange} />
|
|
67
|
-
<span className={`babylai-text-sm babylai-text-red-500 transition-opacity duration-300 ${error.rating ? 'opacity-100' : 'opacity-0'}`}>
|
|
67
|
+
<span className={`babylai-text-sm babylai-text-red-500 babylai-transition-opacity babylai-duration-300 ${error.rating ? 'babylai-opacity-100' : 'babylai-opacity-0'}`}>
|
|
68
68
|
{error.rating}
|
|
69
69
|
</span>
|
|
70
70
|
</div>
|
|
@@ -79,7 +79,7 @@ const ReviewDialog: React.FC<ReviewDialogProps> = (props) => {
|
|
|
79
79
|
value={comment}
|
|
80
80
|
onChange={(e) => handleCommentChange(e.target.value)}
|
|
81
81
|
/>
|
|
82
|
-
<span className={`babylai-text-sm babylai-text-red-500 transition-opacity duration-300 ${error.comment ? 'opacity-100' : 'opacity-0'}`}>
|
|
82
|
+
<span className={`babylai-text-sm babylai-text-red-500 babylai-transition-opacity babylai-duration-300 ${error.comment ? 'babylai-opacity-100' : 'babylai-opacity-0'}`}>
|
|
83
83
|
{error.comment}
|
|
84
84
|
</span>
|
|
85
85
|
</div>
|
|
@@ -87,13 +87,13 @@ const ReviewDialog: React.FC<ReviewDialogProps> = (props) => {
|
|
|
87
87
|
|
|
88
88
|
<footer className="babylai-flex babylai-justify-between babylai-gap-4 babylai-border-t babylai-pt-4">
|
|
89
89
|
<button
|
|
90
|
-
className="babylai-px-4 babylai-py-2 babylai-rounded-lg babylai-bg-gray-200 babylai-text-gray-700 hover:babylai-bg-gray-300 transition-all"
|
|
90
|
+
className="babylai-px-4 babylai-py-2 babylai-rounded-lg babylai-bg-gray-200 babylai-text-gray-700 hover:babylai-bg-gray-300 babylai-transition-all"
|
|
91
91
|
onClick={props.onClose}
|
|
92
92
|
>
|
|
93
93
|
{t('homeSdk.ReviewDialog.skip_button')}
|
|
94
94
|
</button>
|
|
95
95
|
<button
|
|
96
|
-
className='babylai-px-4 babylai-py-2 babylai-rounded-lg babylai-shadow transition-all babylai-bg-primary-500 babylai-text-white hover:babylai-bg-primary-600'
|
|
96
|
+
className='babylai-px-4 babylai-py-2 babylai-rounded-lg babylai-shadow babylai-transition-all babylai-bg-primary-500 babylai-text-white hover:babylai-bg-primary-600'
|
|
97
97
|
onClick={validateAndSubmit}
|
|
98
98
|
>
|
|
99
99
|
{t('homeSdk.ReviewDialog.submit_button')}
|
|
@@ -20,9 +20,9 @@ const iconMap = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const sizeMap = {
|
|
23
|
-
sm: 'w-4 h-4',
|
|
24
|
-
md: 'w-6 h-6',
|
|
25
|
-
lg: 'w-8 h-8'
|
|
23
|
+
sm: 'babylai-w-4 babylai-h-4',
|
|
24
|
+
md: 'babylai-w-6 babylai-h-6',
|
|
25
|
+
lg: 'babylai-w-8 babylai-h-8'
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
|
|
@@ -47,7 +47,7 @@ export const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
|
-
<div ref={ref} className={cn('flex items-center', className)} {...props}>
|
|
50
|
+
<div ref={ref} className={cn('babylai-flex babylai-items-center', className)} {...props}>
|
|
51
51
|
{[...Array(max)].map((_, index) => {
|
|
52
52
|
const filled = (hoverValue !== null ? hoverValue : value) > index
|
|
53
53
|
|
|
@@ -56,9 +56,9 @@ export const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
|
|
|
56
56
|
key={index}
|
|
57
57
|
className={cn(
|
|
58
58
|
sizeMap[size],
|
|
59
|
-
'cursor-pointer transition-colors',
|
|
60
|
-
filled ? 'text-yellow-400 fill-yellow-400' : 'text-gray-300',
|
|
61
|
-
readOnly && 'cursor-default'
|
|
59
|
+
'babylai-cursor-pointer babylai-transition-colors',
|
|
60
|
+
filled ? 'babylai-text-yellow-400 babylai-fill-yellow-400' : 'babylai-text-gray-300',
|
|
61
|
+
readOnly && 'babylai-cursor-default'
|
|
62
62
|
)}
|
|
63
63
|
onMouseEnter={() => handleMouseEnter(index + 1)}
|
|
64
64
|
onMouseLeave={handleMouseLeave}
|