@aslaluroba/help-center-react 3.0.4 → 3.0.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.
Files changed (58) hide show
  1. package/README.md +28 -33
  2. package/dist/components/shared/Button/button.d.ts +1 -2
  3. package/dist/components/ui/agent-response/agent-response.d.ts +1 -2
  4. package/dist/components/ui/header.d.ts +1 -2
  5. package/dist/i18n.d.ts +2 -1
  6. package/dist/index.css +1 -0
  7. package/dist/index.d.ts +1 -2
  8. package/dist/index.esm.js +36042 -11149
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/index.js +36049 -11158
  11. package/dist/index.js.map +1 -1
  12. package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +0 -1
  13. package/dist/ui/chatbot-popup/chat-window-screen/header.d.ts +1 -1
  14. package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +1 -1
  15. package/dist/ui/chatbot-popup/error-screen/index.d.ts +0 -1
  16. package/dist/ui/chatbot-popup/home-screen/card.d.ts +0 -1
  17. package/dist/ui/chatbot-popup/home-screen/chat-now-card.d.ts +0 -1
  18. package/dist/ui/chatbot-popup/home-screen/index.d.ts +0 -1
  19. package/dist/ui/chatbot-popup/loading-screen/index.d.ts +0 -1
  20. package/dist/ui/chatbot-popup/options-list-screen/expanded-option.d.ts +0 -1
  21. package/dist/ui/chatbot-popup/options-list-screen/header.d.ts +0 -1
  22. package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +0 -1
  23. package/dist/ui/chatbot-popup/options-list-screen/option-card.d.ts +0 -1
  24. package/dist/ui/confirmation-modal/index.d.ts +1 -2
  25. package/dist/ui/floating-message.d.ts +1 -2
  26. package/dist/ui/help-button.d.ts +1 -2
  27. package/dist/ui/help-center.d.ts +1 -2
  28. package/dist/ui/help-popup.d.ts +1 -2
  29. package/dist/ui/review-dialog/index.d.ts +0 -1
  30. package/package.json +25 -25
  31. package/src/components/shared/Button/button.tsx +0 -1
  32. package/src/components/ui/agent-response/agent-response.tsx +0 -1
  33. package/src/components/ui/header.tsx +0 -1
  34. package/src/globals.css +1 -1
  35. package/src/i18n.ts +9 -5
  36. package/src/index.ts +1 -3
  37. package/src/types/svg.d.ts +4 -4
  38. package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +0 -1
  39. package/src/ui/chatbot-popup/chat-window-screen/header.tsx +42 -26
  40. package/src/ui/chatbot-popup/error-screen/index.tsx +0 -1
  41. package/src/ui/chatbot-popup/home-screen/card.tsx +25 -25
  42. package/src/ui/chatbot-popup/home-screen/chat-now-card.tsx +0 -2
  43. package/src/ui/chatbot-popup/home-screen/index.tsx +0 -1
  44. package/src/ui/chatbot-popup/loading-screen/index.tsx +0 -2
  45. package/src/ui/chatbot-popup/options-list-screen/expanded-option.tsx +0 -1
  46. package/src/ui/chatbot-popup/options-list-screen/header.tsx +14 -12
  47. package/src/ui/chatbot-popup/options-list-screen/index.tsx +0 -1
  48. package/src/ui/chatbot-popup/options-list-screen/option-card.tsx +26 -19
  49. package/src/ui/confirmation-modal/index.tsx +0 -1
  50. package/src/ui/floating-message.tsx +0 -1
  51. package/src/ui/help-button.tsx +0 -1
  52. package/src/ui/help-center.tsx +3 -2
  53. package/src/ui/help-popup.tsx +1 -1
  54. package/src/ui/review-dialog/index.tsx +4 -4
  55. package/src/useLocalTranslation.ts +5 -5
  56. package/tsconfig.json +19 -8
  57. package/src/.DS_Store +0 -0
  58. package/src/styles/tailwind.css +0 -4
@@ -1,25 +1,32 @@
1
- import { Button } from '@/components';
2
- import React from 'react';
3
- import ArrowRight from '../../../assets/icons/arrowRight.svg';
4
- import { useTranslation } from 'react-i18next'
1
+ import { Button } from "@/components";
2
+ import ArrowRight from "../../../assets/icons/arrowRight.svg";
3
+ import { useLocalTranslation } from "@/useLocalTranslation";
5
4
 
6
5
  interface OptionCardProps {
7
- title: string;
6
+ title: string;
8
7
  }
9
8
 
10
9
  const OptionCard: React.FC<OptionCardProps> = (props) => {
11
- const { i18n} = useTranslation();
12
- const isLTR = i18n.dir() === 'ltr';
13
- return (
14
- <div className="babylai-flex babylai-items-center babylai-justify-between babylai-p-2">
15
- <p className="babylai-text-sm babylai-font-medium babylai-text-black-white-800 dark:babylai-text-white">{props.title}</p>
16
- <Button variant="rounded-icon" size="icon" className="babylai-text-primary-500 hover:babylai-bg-primary-100">
17
- <ArrowRight className={`babylai-w-[12px] babylai-h-[12px] ${
18
- isLTR ? '' : 'babylai-rotate-180'
19
- } babylai-text-primary-500`}/>
20
- </Button>
21
- </div>
22
- )
23
- }
10
+ const i18n = useLocalTranslation();
11
+ const isLTR = i18n.dir == "ltr";
12
+ return (
13
+ <div className="babylai-flex babylai-items-center babylai-justify-between babylai-p-2">
14
+ <p className="babylai-text-sm babylai-font-medium babylai-text-black-white-800 dark:babylai-text-white">
15
+ {props.title}
16
+ </p>
17
+ <Button
18
+ variant="rounded-icon"
19
+ size="icon"
20
+ className="babylai-text-primary-500 hover:babylai-bg-primary-100"
21
+ >
22
+ <ArrowRight
23
+ className={`babylai-w-[12px] babylai-h-[12px] ${
24
+ isLTR ? "" : "babylai-rotate-180"
25
+ } babylai-text-primary-500`}
26
+ />
27
+ </Button>
28
+ </div>
29
+ );
30
+ };
24
31
 
25
- export default OptionCard
32
+ export default OptionCard;
@@ -1,6 +1,5 @@
1
1
  import { Button } from "@/components";
2
2
  import { useLocalTranslation } from "@/useLocalTranslation";
3
- import React from "react";
4
3
 
5
4
  interface ConfirmationModalProps {
6
5
  title: string;
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import CloseIcon from '../assets/icons/close.svg'
3
2
  interface FloatingMessageProps {
4
3
  message: string
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import Logo from '../assets/logo.svg'
3
2
 
4
3
  interface HelpButtonProps {
@@ -1,5 +1,5 @@
1
1
  import ReviewDialog from '@/ui/review-dialog';
2
- import React, { useEffect, useState } from 'react';
2
+ import { useEffect, useState } from 'react';
3
3
  import { apiRequest } from '../core/api';
4
4
  import { ClientAblyService } from '../core/AblyService';
5
5
  import { useLocalTranslation } from '../useLocalTranslation';
@@ -8,6 +8,7 @@ import { HelpScreenData, Message, Option, ReviewProps } from '../lib/types';
8
8
  import { FloatingMessage } from './floating-message';
9
9
  import { HelpButton } from './help-button';
10
10
  import { HelpPopup } from './help-popup';
11
+ import { defaultLanguage } from '@/i18n';
11
12
 
12
13
  interface HelpCenterProps {
13
14
  helpScreenId: string;
@@ -27,7 +28,7 @@ export function HelpCenter({
27
28
  helpScreenId,
28
29
  user,
29
30
  showArrow = true,
30
- language = 'en',
31
+ language = defaultLanguage,
31
32
  messageLabel = null,
32
33
  showHelpScreen = false,
33
34
  }: HelpCenterProps) {
@@ -5,7 +5,7 @@ import ChatBotErrorScreen from '@/ui/chatbot-popup/error-screen';
5
5
  import HomeScreen from '@/ui/chatbot-popup/home-screen';
6
6
  import ChatBotLoadingScreen from '@/ui/chatbot-popup/loading-screen';
7
7
  import OptionsListScreen from '@/ui/chatbot-popup/options-list-screen';
8
- import React, { useEffect, useRef, useState, useCallback, useMemo } from 'react';
8
+ import { useEffect, useRef, useState, useCallback, useMemo } from 'react';
9
9
  import ChatIcon from '../assets/icons/chat.svg';
10
10
  import { Button } from '@/components';
11
11
  import { HelpScreenData, Message, Option } from '@/lib/types';
@@ -1,8 +1,8 @@
1
1
  import { ReviewProps } from '@/lib/types'
2
2
  import { Rating } from '@/ui/review-dialog/rating'
3
- import React from 'react'
4
3
  import { useLocalTranslation } from '../../useLocalTranslation'
5
4
  import CloseCircle from '../../assets/icons/closeCircle.svg'
5
+ import { useState } from 'react';
6
6
 
7
7
  interface ReviewDialogProps {
8
8
  handleSubmit: ({ comment, rating }: ReviewProps) => void;
@@ -11,9 +11,9 @@ interface ReviewDialogProps {
11
11
 
12
12
  const ReviewDialog: React.FC<ReviewDialogProps> = (props) => {
13
13
  const { t } = useLocalTranslation()
14
- const [comment, setComment] = React.useState<string>('')
15
- const [rating, setRating] = React.useState<number>(0)
16
- const [error, setError] = React.useState<{ comment?: string; rating?: string }>({})
14
+ const [comment, setComment] = useState<string>('')
15
+ const [rating, setRating] = useState<number>(0)
16
+ const [error, setError] = useState<{ comment?: string; rating?: string }>({})
17
17
 
18
18
  const isCommentValid = comment.length >= 10 && comment.length <= 500
19
19
  const isRatingValid = rating >= 1 && rating <= 5
@@ -1,14 +1,14 @@
1
-
2
- import { useMemo } from 'react';
3
- import { createHelpCenterI18n } from './i18n';
1
+ import { useMemo } from "react";
2
+ import { createHelpCenterI18n, defaultLanguage } from "./i18n";
4
3
 
5
4
  export const useLocalTranslation = (languageFromProps?: string) => {
6
- const language = languageFromProps || localStorage.getItem('app-language') || 'en';
5
+ const language =
6
+ languageFromProps || localStorage.getItem("app-language") || defaultLanguage;
7
7
 
8
8
  const i18n = useMemo(() => createHelpCenterI18n(language), [language]);
9
9
 
10
10
  const t = (key: string) => i18n.t(key);
11
11
  const dir = i18n.dir();
12
12
 
13
- return { t, dir , i18n };
13
+ return { t, dir, i18n };
14
14
  };
package/tsconfig.json CHANGED
@@ -22,23 +22,34 @@
22
22
  "noUnusedParameters": true,
23
23
  "noImplicitReturns": true,
24
24
  "noFallthroughCasesInSwitch": true,
25
- "moduleResolution": "node",
26
- "jsx": "react",
25
+ "moduleResolution": "bundler",
26
+ "jsx": "react-jsx",
27
27
  "resolveJsonModule": true,
28
28
  "esModuleInterop": true,
29
29
  "skipLibCheck": true,
30
30
  "forceConsistentCasingInFileNames": true,
31
31
  "baseUrl": ".",
32
- "paths": {
33
- "@/*": ["src/*"],
34
- "@/components/*": ["src/components/*"],
35
- "@/ui/*": ["src/ui/*"],
36
- "@/lib/*": ["src/lib/*"],
37
- "@/assets/*": ["src/assets/*"]
32
+ "paths": {
33
+ "@/*": [
34
+ "src/*"
35
+ ],
36
+ "@/components/*": [
37
+ "src/components/*"
38
+ ],
39
+ "@/ui/*": [
40
+ "src/ui/*"
41
+ ],
42
+ "@/lib/*": [
43
+ "src/lib/*"
44
+ ],
45
+ "@/assets/*": [
46
+ "src/assets/*"
47
+ ]
38
48
  },
39
49
  },
40
50
  "include": [
41
51
  "src",
52
+ "src/types",
42
53
  "assets"
43
54
  ],
44
55
  "exclude": [
package/src/.DS_Store DELETED
Binary file
@@ -1,4 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&display=swap');
2
- @tailwind base;
3
- @tailwind components;
4
- @tailwind utilities;