@aslaluroba/help-center-react 3.2.13 → 3.2.14

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.
@@ -6,6 +6,7 @@ interface HelpscreenListProps {
6
6
  onToggleOption: (option: Option) => void;
7
7
  onStartChat: () => void;
8
8
  showChatNowButton?: boolean;
9
+ chatWithUs?: boolean;
9
10
  }
10
11
  declare const HelpscreenList: React.FC<HelpscreenListProps>;
11
12
  export default HelpscreenList;
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.13",
6
+ "version": "3.2.14",
7
7
  "description": "BabylAI Help Center Widget for React and Next.js",
8
8
  "private": false,
9
9
  "exports": {
@@ -11,6 +11,7 @@ interface HelpscreenListProps {
11
11
  onToggleOption: (option: Option) => void;
12
12
  onStartChat: () => void;
13
13
  showChatNowButton?: boolean;
14
+ chatWithUs?: boolean;
14
15
  }
15
16
 
16
17
  const HelpscreenList: React.FC<HelpscreenListProps> = ({
@@ -19,6 +20,7 @@ const HelpscreenList: React.FC<HelpscreenListProps> = ({
19
20
  onToggleOption,
20
21
  onStartChat,
21
22
  showChatNowButton = true,
23
+ chatWithUs = true,
22
24
  }) => {
23
25
  const { t } = useLocalTranslation();
24
26
 
@@ -39,7 +41,7 @@ const HelpscreenList: React.FC<HelpscreenListProps> = ({
39
41
  <Button
40
42
  variant='default'
41
43
  onClick={onStartChat}
42
- disabled={!selectedOption}
44
+ disabled={!selectedOption || !chatWithUs}
43
45
  >
44
46
  {t('homeSdk.chatNow')}
45
47
  <SolarPlain2BoldDuotone className="babylai:w-6 babylai:h-6" />
@@ -13,23 +13,31 @@ const HelpscreenOption: React.FC<HelpscreenOptionProps> = ({
13
13
  isSelected,
14
14
  onClick,
15
15
  }) => {
16
+ const chatWithUs = option.chatWithUs ?? true;
17
+
16
18
  return (
17
19
  <div
18
- role="button"
19
- tabIndex={0}
20
+ role={chatWithUs ? 'button' : undefined}
21
+ tabIndex={chatWithUs ? 0 : undefined}
20
22
  className={cn(
21
- 'babylai:flex babylai:flex-col babylai:gap-2 babylai:p-6 babylai:rounded-3xl babylai:text-start babylai:border babylai:border-black-white-200 babylai:bg-card babylai:cursor-pointer',
23
+ 'babylai:flex babylai:flex-col babylai:gap-2 babylai:p-6 babylai:rounded-3xl babylai:text-start babylai:border babylai:border-black-white-200 babylai:bg-card',
22
24
  'babylai:transition-all babylai:duration-200 babylai:ease-out',
23
- 'babylai:active:scale-[0.98] babylai:active:opacity-95',
25
+ chatWithUs
26
+ ? 'babylai:cursor-pointer babylai:active:scale-[0.98] babylai:active:opacity-95'
27
+ : 'babylai:cursor-default',
24
28
  isSelected && 'babylai:ring babylai:ring-primary-500 babylai:shadow-md'
25
29
  )}
26
- onClick={onClick}
27
- onKeyDown={(e) => {
28
- if (e.key === 'Enter' || e.key === ' ') {
29
- e.preventDefault();
30
- onClick();
31
- }
32
- }}
30
+ onClick={chatWithUs ? onClick : undefined}
31
+ onKeyDown={
32
+ chatWithUs
33
+ ? (e) => {
34
+ if (e.key === 'Enter' || e.key === ' ') {
35
+ e.preventDefault();
36
+ onClick();
37
+ }
38
+ }
39
+ : undefined
40
+ }
33
41
  >
34
42
  <h2 className="babylai:text-base! babylai:font-semibold! babylai:text-card-foreground" dir="auto">
35
43
  {option.title}
@@ -59,6 +59,7 @@ const OptionsListScreen: React.FC<OptionsListScreenProps> = ({
59
59
  onToggleOption={handleToggleExpandOption}
60
60
  onStartChat={handleStartChatWithSelected}
61
61
  showChatNowButton={!hasActiveSession}
62
+ chatWithUs={helpScreen?.chatWithUs ?? true}
62
63
  />
63
64
  </div >
64
65
  <PoweredBy />