@thisispamela/react 1.0.1 → 1.0.3
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 +64 -3
- package/dist/CallButton.d.ts +1 -1
- package/dist/CallButton.d.ts.map +1 -1
- package/dist/CallStatus.d.ts +1 -1
- package/dist/CallStatus.d.ts.map +1 -1
- package/dist/TranscriptViewer.d.ts +1 -1
- package/dist/TranscriptViewer.d.ts.map +1 -1
- package/dist/VoiceOrb.d.ts +4 -0
- package/dist/VoiceOrb.d.ts.map +1 -0
- package/dist/index.d.ts +22 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +293 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +292 -26
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -42,6 +42,9 @@ function MyComponent() {
|
|
|
42
42
|
<CallButton
|
|
43
43
|
to="+1234567890"
|
|
44
44
|
task="Schedule a meeting for next week"
|
|
45
|
+
voice="female"
|
|
46
|
+
agent_name="Pamela"
|
|
47
|
+
caller_name="John from Acme"
|
|
45
48
|
onCallStart={(id) => setCallId(id)}
|
|
46
49
|
onCallComplete={(call) => console.log('Call completed:', call)}
|
|
47
50
|
>
|
|
@@ -72,7 +75,14 @@ A button component that initiates a call when clicked.
|
|
|
72
75
|
country="US"
|
|
73
76
|
locale="en-US"
|
|
74
77
|
instructions="Be professional and concise"
|
|
78
|
+
voice="female"
|
|
79
|
+
agent_name="Pamela"
|
|
80
|
+
caller_name="John from Acme"
|
|
75
81
|
metadata={{ customer_id: "12345" }}
|
|
82
|
+
variant="primary"
|
|
83
|
+
size="md"
|
|
84
|
+
pollInterval={2000}
|
|
85
|
+
pollTimeout={300000}
|
|
76
86
|
onCallStart={(callId) => console.log('Call started:', callId)}
|
|
77
87
|
onCallComplete={(call) => console.log('Call completed:', call)}
|
|
78
88
|
onError={(error) => console.error('Error:', error)}
|
|
@@ -89,17 +99,24 @@ A button component that initiates a call when clicked.
|
|
|
89
99
|
- `country`: ISO country code (optional)
|
|
90
100
|
- `locale`: Locale string (optional, e.g., "en-US")
|
|
91
101
|
- `instructions`: Additional instructions (optional)
|
|
102
|
+
- `voice`: Voice preference `"male" | "female" | "auto"` (optional)
|
|
103
|
+
- `agent_name`: Agent name override (optional)
|
|
104
|
+
- `caller_name`: Name of who the agent is calling on behalf of (optional)
|
|
92
105
|
- `metadata`: Custom metadata object (optional)
|
|
106
|
+
- `variant`: Button style - `"primary"` | `"secondary"` | `"danger"` (default: `"primary"`)
|
|
107
|
+
- `size`: Button size - `"sm"` | `"md"` | `"lg"` (default: `"md"`)
|
|
108
|
+
- `pollInterval`: Status polling interval in ms (default: 2000)
|
|
109
|
+
- `pollTimeout`: Maximum polling duration in ms (default: 300000 = 5 min)
|
|
93
110
|
- `onCallStart`: Callback when call starts (optional)
|
|
94
111
|
- `onCallComplete`: Callback when call completes (optional)
|
|
95
112
|
- `onError`: Error callback (optional)
|
|
96
113
|
- `disabled`: Disable button (optional)
|
|
97
114
|
- `className`: Custom CSS class (optional)
|
|
98
|
-
- `children`: Button content (optional, defaults to "
|
|
115
|
+
- `children`: Button content (optional, defaults to "Call Now")
|
|
99
116
|
|
|
100
117
|
### CallStatus
|
|
101
118
|
|
|
102
|
-
Displays the current status of a call with optional transcript.
|
|
119
|
+
Displays the current status of a call with optional transcript and summary.
|
|
103
120
|
|
|
104
121
|
```tsx
|
|
105
122
|
<CallStatus
|
|
@@ -107,6 +124,8 @@ Displays the current status of a call with optional transcript.
|
|
|
107
124
|
pollInterval={5000}
|
|
108
125
|
onStatusChange={(status) => console.log('Status:', status)}
|
|
109
126
|
showTranscript={true}
|
|
127
|
+
showSummary={true}
|
|
128
|
+
compact={false}
|
|
110
129
|
className="my-custom-class"
|
|
111
130
|
/>
|
|
112
131
|
```
|
|
@@ -116,11 +135,13 @@ Displays the current status of a call with optional transcript.
|
|
|
116
135
|
- `pollInterval`: Polling interval in milliseconds (default: 5000)
|
|
117
136
|
- `onStatusChange`: Callback when status changes (optional)
|
|
118
137
|
- `showTranscript`: Show transcript (default: true)
|
|
138
|
+
- `showSummary`: Show call summary when available (default: true)
|
|
139
|
+
- `compact`: Use compact layout (default: false)
|
|
119
140
|
- `className`: Custom CSS class (optional)
|
|
120
141
|
|
|
121
142
|
### TranscriptViewer
|
|
122
143
|
|
|
123
|
-
Displays a call transcript in a readable format.
|
|
144
|
+
Displays a call transcript in a readable format with auto-scroll support.
|
|
124
145
|
|
|
125
146
|
```tsx
|
|
126
147
|
<TranscriptViewer
|
|
@@ -136,14 +157,54 @@ Displays a call transcript in a readable format.
|
|
|
136
157
|
timestamp: "2024-01-01T00:00:05Z"
|
|
137
158
|
}
|
|
138
159
|
]}
|
|
160
|
+
maxHeight={400}
|
|
161
|
+
autoScroll={true}
|
|
139
162
|
className="my-custom-class"
|
|
140
163
|
/>
|
|
141
164
|
```
|
|
142
165
|
|
|
143
166
|
**Props:**
|
|
144
167
|
- `transcript` (required): Array of transcript entries
|
|
168
|
+
- `maxHeight`: Maximum container height (default: 400, accepts number or CSS string)
|
|
169
|
+
- `autoScroll`: Auto-scroll to latest message (default: true)
|
|
145
170
|
- `className`: Custom CSS class (optional)
|
|
146
171
|
|
|
172
|
+
### VoiceOrb
|
|
173
|
+
|
|
174
|
+
Animated voice indicator orb with idle and active states. Matches the Pamela app signature visual.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import { VoiceOrb } from '@thisispamela/react';
|
|
178
|
+
|
|
179
|
+
// Idle state (breathing animation)
|
|
180
|
+
<VoiceOrb isActive={false} size="large" />
|
|
181
|
+
|
|
182
|
+
// Active state (pulsing animation)
|
|
183
|
+
<VoiceOrb isActive={true} size="medium" />
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Props:**
|
|
187
|
+
- `isActive`: Whether the orb is in active state (default: false)
|
|
188
|
+
- `size`: Orb size - `"small"` | `"medium"` | `"large"` (default: `"large"`)
|
|
189
|
+
- `className`: Custom CSS class (optional)
|
|
190
|
+
|
|
191
|
+
**Size CSS Variables:**
|
|
192
|
+
You can customize sizes via CSS variables:
|
|
193
|
+
```css
|
|
194
|
+
:root {
|
|
195
|
+
--pamela-orb-size-small: 96px;
|
|
196
|
+
--pamela-orb-size-medium: 128px;
|
|
197
|
+
--pamela-orb-size-large: 192px;
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Features:**
|
|
202
|
+
- Multi-layer breathing effect (idle mode)
|
|
203
|
+
- Pulsing animation with ripples (active mode)
|
|
204
|
+
- Floating/levitation effect
|
|
205
|
+
- Gradient rotation
|
|
206
|
+
- Shimmer highlights
|
|
207
|
+
|
|
147
208
|
### CallHistory
|
|
148
209
|
|
|
149
210
|
Displays a list of previous calls (requires API endpoint).
|
package/dist/CallButton.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CallButtonProps } from './types';
|
|
3
|
-
export declare function CallButton({ to, task, country, locale, instructions, end_user_id, metadata, tools, webhooks, onCallStart, onCallComplete, onError, disabled, className, children, }: CallButtonProps): React.JSX.Element;
|
|
3
|
+
export declare function CallButton({ to, task, country, locale, instructions, voice, agent_name, caller_name, end_user_id, metadata, tools, webhooks, onCallStart, onCallComplete, onError, variant, size, pollInterval, pollTimeout, disabled, className, children, }: CallButtonProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=CallButton.d.ts.map
|
package/dist/CallButton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallButton.d.ts","sourceRoot":"","sources":["../src/CallButton.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CallButton.d.ts","sourceRoot":"","sources":["../src/CallButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,IAAI,EACJ,OAAO,EACP,MAAM,EACN,YAAY,EACZ,KAAK,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EACP,OAAmB,EACnB,IAAW,EACX,YAAmB,EACnB,WAA2B,EAC3B,QAAgB,EAChB,SAAc,EACd,QAAQ,GACT,EAAE,eAAe,qBAwHjB"}
|
package/dist/CallStatus.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CallStatusProps } from './types';
|
|
3
|
-
export declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, className, }: CallStatusProps): React.JSX.Element;
|
|
3
|
+
export declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, showSummary, compact, className, }: CallStatusProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=CallStatus.d.ts.map
|
package/dist/CallStatus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallStatus.d.ts","sourceRoot":"","sources":["../src/CallStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CallStatus.d.ts","sourceRoot":"","sources":["../src/CallStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA6H1C,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,YAAmB,EACnB,cAAc,EACd,cAAqB,EACrB,WAAkB,EAClB,OAAe,EACf,SAAc,GACf,EAAE,eAAe,qBA2IjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TranscriptViewerProps } from './types';
|
|
3
|
-
export declare function TranscriptViewer({ transcript, className }: TranscriptViewerProps): React.JSX.Element;
|
|
3
|
+
export declare function TranscriptViewer({ transcript, maxHeight, autoScroll, className, }: TranscriptViewerProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=TranscriptViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptViewer.d.ts","sourceRoot":"","sources":["../src/TranscriptViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TranscriptViewer.d.ts","sourceRoot":"","sources":["../src/TranscriptViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,SAAe,EACf,UAAiB,EACjB,SAAc,GACf,EAAE,qBAAqB,qBA2HvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceOrb.d.ts","sourceRoot":"","sources":["../src/VoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQxC,wBAAgB,QAAQ,CAAC,EAAE,QAAgB,EAAE,IAAc,EAAE,SAAc,EAAE,EAAE,aAAa,qBA6Q3F"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ interface CallButtonProps {
|
|
|
11
11
|
country?: string;
|
|
12
12
|
locale?: string;
|
|
13
13
|
instructions?: string;
|
|
14
|
+
voice?: CreateCallRequest['voice'];
|
|
15
|
+
agent_name?: string;
|
|
16
|
+
caller_name?: string;
|
|
14
17
|
end_user_id?: string;
|
|
15
18
|
metadata?: Record<string, any>;
|
|
16
19
|
tools?: CreateCallRequest["tools"];
|
|
@@ -18,6 +21,10 @@ interface CallButtonProps {
|
|
|
18
21
|
onCallStart?: (callId: string) => void;
|
|
19
22
|
onCallComplete?: (call: CallStatus$1) => void;
|
|
20
23
|
onError?: (error: Error) => void;
|
|
24
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
25
|
+
size?: 'sm' | 'md' | 'lg';
|
|
26
|
+
pollInterval?: number;
|
|
27
|
+
pollTimeout?: number;
|
|
21
28
|
disabled?: boolean;
|
|
22
29
|
className?: string;
|
|
23
30
|
children?: ReactNode;
|
|
@@ -27,6 +34,8 @@ interface CallStatusProps {
|
|
|
27
34
|
pollInterval?: number;
|
|
28
35
|
onStatusChange?: (status: CallStatus$1) => void;
|
|
29
36
|
showTranscript?: boolean;
|
|
37
|
+
showSummary?: boolean;
|
|
38
|
+
compact?: boolean;
|
|
30
39
|
className?: string;
|
|
31
40
|
}
|
|
32
41
|
interface TranscriptViewerProps {
|
|
@@ -35,6 +44,8 @@ interface TranscriptViewerProps {
|
|
|
35
44
|
text: string;
|
|
36
45
|
timestamp: string;
|
|
37
46
|
}>;
|
|
47
|
+
maxHeight?: number | string;
|
|
48
|
+
autoScroll?: boolean;
|
|
38
49
|
className?: string;
|
|
39
50
|
}
|
|
40
51
|
interface CallHistoryProps {
|
|
@@ -42,6 +53,11 @@ interface CallHistoryProps {
|
|
|
42
53
|
onCallSelect?: (callId: string) => void;
|
|
43
54
|
className?: string;
|
|
44
55
|
}
|
|
56
|
+
interface VoiceOrbProps {
|
|
57
|
+
isActive?: boolean;
|
|
58
|
+
size?: 'small' | 'medium' | 'large';
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
45
61
|
|
|
46
62
|
interface PamelaContextValue {
|
|
47
63
|
client: PamelaClient;
|
|
@@ -53,12 +69,14 @@ interface PamelaProviderProps {
|
|
|
53
69
|
declare function PamelaProvider({ config, children }: PamelaProviderProps): React.JSX.Element;
|
|
54
70
|
declare function usePamela(): PamelaContextValue;
|
|
55
71
|
|
|
56
|
-
declare function CallButton({ to, task, country, locale, instructions, end_user_id, metadata, tools, webhooks, onCallStart, onCallComplete, onError, disabled, className, children, }: CallButtonProps): React.JSX.Element;
|
|
72
|
+
declare function CallButton({ to, task, country, locale, instructions, voice, agent_name, caller_name, end_user_id, metadata, tools, webhooks, onCallStart, onCallComplete, onError, variant, size, pollInterval, pollTimeout, disabled, className, children, }: CallButtonProps): React.JSX.Element;
|
|
57
73
|
|
|
58
|
-
declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, className, }: CallStatusProps): React.JSX.Element;
|
|
74
|
+
declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, showSummary, compact, className, }: CallStatusProps): React.JSX.Element;
|
|
59
75
|
|
|
60
|
-
declare function TranscriptViewer({ transcript, className }: TranscriptViewerProps): React.JSX.Element;
|
|
76
|
+
declare function TranscriptViewer({ transcript, maxHeight, autoScroll, className, }: TranscriptViewerProps): React.JSX.Element;
|
|
61
77
|
|
|
62
78
|
declare function CallHistory({ limit, onCallSelect, className, }: CallHistoryProps): React.JSX.Element;
|
|
63
79
|
|
|
64
|
-
|
|
80
|
+
declare function VoiceOrb({ isActive, size, className }: VoiceOrbProps): React.JSX.Element;
|
|
81
|
+
|
|
82
|
+
export { CallButton, CallButtonProps, CallHistory, CallHistoryProps, CallStatus, CallStatusProps, PamelaConfig, PamelaProvider, TranscriptViewer, TranscriptViewerProps, VoiceOrb, VoiceOrbProps, usePamela };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,YAAY,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,GACd,MAAM,SAAS,CAAC"}
|