shopify-chatbot-widget 0.9.7 → 1.0.0

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.
@@ -1,31 +1,134 @@
1
- .typing-boxes {
2
- display: flex;
1
+ /* ===== BASE TYPING INDICATOR ===== */
2
+ .typing-indicator {
3
+ display: inline-flex;
3
4
  gap: 6px;
4
5
  align-items: center;
5
6
  justify-content: flex-start;
7
+ padding: 8px 12px;
8
+ background: #eff0f1;
9
+ border-color: black;
10
+ border-radius: 18px;
11
+ width: fit-content;
6
12
  }
7
13
 
8
- .typing-boxes span {
9
- border-radius: 3px; /* keep boxy feel */
14
+ .typing-dot {
15
+ border-radius: 50%;
10
16
  display: inline-block;
11
- animation: pulseBox 0.8s infinite alternate;
12
17
  }
13
18
 
14
- .typing-boxes span:nth-child(2) {
19
+ /* ===== DOTS VARIANT (Default - Smooth bounce) ===== */
20
+ .typing-dots .typing-dot {
21
+ animation: bounceDot 1.4s infinite ease-in-out both;
22
+ }
23
+
24
+ .typing-dots .typing-dot:nth-child(1) {
25
+ animation-delay: -0.32s;
26
+ }
27
+
28
+ .typing-dots .typing-dot:nth-child(2) {
29
+ animation-delay: -0.16s;
30
+ }
31
+
32
+ @keyframes bounceDot {
33
+ 0%, 80%, 100% {
34
+ transform: translateY(0) scale(1);
35
+ opacity: 0.7;
36
+ }
37
+ 40% {
38
+ transform: translateY(-10px) scale(1.1);
39
+ opacity: 1;
40
+ }
41
+ }
42
+
43
+ /* ===== BOXES VARIANT (Pulsing squares) ===== */
44
+ .typing-boxes .typing-dot {
45
+ border-radius: 3px;
46
+ animation: pulseBox 1s infinite ease-in-out both;
47
+ }
48
+
49
+ .typing-boxes .typing-dot:nth-child(1) {
50
+ animation-delay: 0s;
51
+ }
52
+
53
+ .typing-boxes .typing-dot:nth-child(2) {
15
54
  animation-delay: 0.2s;
16
55
  }
17
56
 
18
- .typing-boxes span:nth-child(3) {
57
+ .typing-boxes .typing-dot:nth-child(3) {
19
58
  animation-delay: 0.4s;
20
59
  }
21
60
 
22
61
  @keyframes pulseBox {
23
- from {
24
- transform: scale(1);
62
+ 0%, 100% {
63
+ transform: scale(0.8);
25
64
  opacity: 0.5;
26
65
  }
27
- to {
28
- transform: scale(1.3);
66
+ 50% {
67
+ transform: scale(1.2);
68
+ opacity: 1;
69
+ }
70
+ }
71
+
72
+ /* ===== WAVE VARIANT (Wave motion) ===== */
73
+ .typing-wave .typing-dot {
74
+ animation: wave 1.2s infinite ease-in-out;
75
+ }
76
+
77
+ .typing-wave .typing-dot:nth-child(1) {
78
+ animation-delay: 0s;
79
+ }
80
+
81
+ .typing-wave .typing-dot:nth-child(2) {
82
+ animation-delay: 0.15s;
83
+ }
84
+
85
+ .typing-wave .typing-dot:nth-child(3) {
86
+ animation-delay: 0.3s;
87
+ }
88
+
89
+ @keyframes wave {
90
+ 0%, 60%, 100% {
91
+ transform: translateY(0);
92
+ opacity: 0.6;
93
+ }
94
+ 30% {
95
+ transform: translateY(-12px);
29
96
  opacity: 1;
30
97
  }
31
98
  }
99
+
100
+ /* ===== MINIMAL VARIANT (No background bubble) ===== */
101
+ .typing-indicator.minimal {
102
+ background: transparent;
103
+ padding: 0;
104
+ }
105
+
106
+ /* ===== DARK MODE SUPPORT ===== */
107
+ .typing-indicator.dark {
108
+ background: #374151;
109
+ }
110
+
111
+ /* ===== SIZE VARIANTS ===== */
112
+ .typing-indicator.small {
113
+ padding: 6px 10px;
114
+ gap: 4px;
115
+ }
116
+
117
+ .typing-indicator.large {
118
+ padding: 10px 16px;
119
+ gap: 8px;
120
+ }
121
+
122
+ /* ===== RESPONSIVE ===== */
123
+ @media (max-width: 600px) {
124
+ .typing-indicator {
125
+ padding: 6px 10px;
126
+ gap: 5px;
127
+ }
128
+ }
129
+
130
+ /* ===== SMOOTH PERFORMANCE ===== */
131
+ .typing-dot {
132
+ will-change: transform, opacity;
133
+ backface-visibility: hidden;
134
+ }
@@ -2,18 +2,32 @@ import React from 'react';
2
2
  import './Typing.css';
3
3
 
4
4
  interface TypingProps {
5
- color?: string; // optional, defaults to black
6
- size?: number; // optional, lets you control box size
5
+ color?: string;
6
+ size?: number;
7
+ variant?: 'dots' | 'boxes' | 'wave'; // Different animation styles
7
8
  }
8
9
 
9
- const Typing: React.FC<TypingProps> = ({ color, size = 5 }) => {
10
+ const Typing: React.FC<TypingProps> = ({
11
+ color = '#6b7280',
12
+ size = 8,
13
+ variant = 'dots'
14
+ }) => {
10
15
  return (
11
- <div className="typing-boxes">
12
- <span style={{ backgroundColor: color, width: size, height: size }}></span>
13
- <span style={{ backgroundColor: color, width: size, height: size }}></span>
14
- <span style={{ backgroundColor: color, width: size, height: size }}></span>
16
+ <div className={`typing-indicator typing-${variant}`}>
17
+ <span
18
+ className="typing-dot"
19
+ style={{ backgroundColor: color, width: size, height: size }}
20
+ />
21
+ <span
22
+ className="typing-dot"
23
+ style={{ backgroundColor: color, width: size, height: size }}
24
+ />
25
+ <span
26
+ className="typing-dot"
27
+ style={{ backgroundColor: color, width: size, height: size }}
28
+ />
15
29
  </div>
16
30
  );
17
31
  };
18
32
 
19
- export default Typing;
33
+ export default Typing;
@@ -5,7 +5,6 @@ import '../../Chatbot.css';
5
5
  import { useChatbotMessage } from '../../../hooks/useSessionMessages';
6
6
  import axios from 'axios';
7
7
  import ChatInput from '../../components/ChatInput';
8
- import Suggestions from '../../components/Suggestions';
9
8
  import Powered from '../../components/Powered';
10
9
  import ChatMessages from '../../components/Messages/ChatMessages';
11
10
  import config from '../../../hooks/config';
@@ -537,25 +536,26 @@ const socket = useChatSocket(sessionId, handleSocketData);
537
536
 
538
537
 
539
538
 
540
- <ChatMessages
541
- messages={messages}
542
- colorCode={colorCode}
543
- isLoading={false}
544
- handleAddToCart={handleToCart}
545
- agentStatus={agentStatus}
546
- sessionId={sessionId}
547
- handleRemoveFromCart={handleRemoveFromCart}
548
- userType={userType}
549
- calendly={calendly}
550
- disableCheckout={disbleCheckout}
551
- isfetchingMessage={isFetchingMessages}
552
- />
553
-
539
+ <ChatMessages
540
+ messages={messages}
541
+ colorCode={colorCode}
542
+ isLoading={false}
543
+ handleAddToCart={handleToCart}
544
+ agentStatus={agentStatus}
545
+ sessionId={sessionId}
546
+ handleRemoveFromCart={handleRemoveFromCart}
547
+ userType={userType}
548
+ calendly={calendly}
549
+ disableCheckout={disbleCheckout}
550
+ isfetchingMessage={isFetchingMessages}
551
+ messagesSuggestions={messagesSuggestions}
552
+ sendMessageSuggestion={sendMessageSuggestion}
553
+ />
554
554
 
555
555
 
556
556
 
557
557
  <div className="chatbot-input-area">
558
- <Suggestions sendMessageSuggestion={sendMessageSuggestion} colorCode={colorCode} suggestions={messagesSuggestions} />
558
+ {/* <Suggestions sendMessageSuggestion={sendMessageSuggestion} colorCode={colorCode} suggestions={messagesSuggestions} /> */}
559
559
 
560
560
  <ChatInput
561
561
  userMessage={input}
@@ -568,6 +568,7 @@ const socket = useChatSocket(sessionId, handleSocketData);
568
568
  audioBlob={audioBlob}
569
569
  setAudioBlob={setAudioBlob}
570
570
  isSending={isSending}
571
+ colorCode={colorCode}
571
572
 
572
573
  />
573
574