@thisispamela/react 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.
package/dist/index.js ADDED
@@ -0,0 +1,424 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var sdk = require('@thisispamela/sdk');
5
+
6
+ function styleInject(css, ref) {
7
+ if ( ref === void 0 ) ref = {};
8
+ var insertAt = ref.insertAt;
9
+
10
+ if (!css || typeof document === 'undefined') { return; }
11
+
12
+ var head = document.head || document.getElementsByTagName('head')[0];
13
+ var style = document.createElement('style');
14
+ style.type = 'text/css';
15
+
16
+ if (insertAt === 'top') {
17
+ if (head.firstChild) {
18
+ head.insertBefore(style, head.firstChild);
19
+ } else {
20
+ head.appendChild(style);
21
+ }
22
+ } else {
23
+ head.appendChild(style);
24
+ }
25
+
26
+ if (style.styleSheet) {
27
+ style.styleSheet.cssText = css;
28
+ } else {
29
+ style.appendChild(document.createTextNode(css));
30
+ }
31
+ }
32
+
33
+ var css_248z = "/**\n * Pamela B2B React Component Library - Default Styles\n * \n * These styles match the Pamela B2C design system:\n * - Colors: Orange (#FA931C), Beige (#e7ab84), Blue (#4b4bea)\n * - Fonts: Poppins, Inter\n * - Dark mode support\n */\n\n/* Pulse animation for status indicators */\n@keyframes pamela-pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n}\n\n/* Call Button - matches your gradient style */\n.pamela-call-button {\n font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n background: linear-gradient(to right, #FA931C, #fd8b74);\n color: white;\n border: none;\n border-radius: 0.5rem;\n font-weight: 600;\n transition: opacity 0.2s;\n box-shadow: 0 2px 4px rgba(250, 147, 28, 0.2);\n}\n\n.pamela-call-button:hover:not(:disabled) {\n opacity: 0.9;\n}\n\n.pamela-call-button:disabled {\n opacity: 0.7;\n cursor: not-allowed;\n background: linear-gradient(to right, #ccc, #aaa);\n}\n\n/* Call Status - matches your card style */\n.pamela-call-status {\n font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n}\n\n/* Transcript Viewer - matches your message bubble style */\n.pamela-transcript-viewer {\n font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n}\n\n/* Dark mode support */\n@media (prefers-color-scheme: dark) {\n .pamela-call-status {\n color: #ffffff;\n }\n \n .pamela-transcript-viewer {\n color: #ffffff;\n }\n}\n\n";
34
+ styleInject(css_248z);
35
+
36
+ const PamelaContext = React.createContext(null);
37
+ function PamelaProvider({ config, children }) {
38
+ const client = new sdk.PamelaClient({
39
+ apiKey: config.apiKey,
40
+ baseUrl: config.baseUrl,
41
+ });
42
+ return (React.createElement(PamelaContext.Provider, { value: { client } }, children));
43
+ }
44
+ function usePamela() {
45
+ const context = React.useContext(PamelaContext);
46
+ if (!context) {
47
+ throw new Error('usePamela must be used within a PamelaProvider');
48
+ }
49
+ return context;
50
+ }
51
+
52
+ function CallButton({ to, task, country, locale, instructions, end_user_id, metadata, onCallStart, onCallComplete, onError, disabled = false, className = '', children, }) {
53
+ const { client } = usePamela();
54
+ const [loading, setLoading] = React.useState(false);
55
+ const [callId, setCallId] = React.useState(null);
56
+ const handleClick = async () => {
57
+ if (loading || disabled)
58
+ return;
59
+ setLoading(true);
60
+ try {
61
+ const call = await client.createCall({
62
+ to,
63
+ task,
64
+ country,
65
+ locale,
66
+ instructions,
67
+ end_user_id,
68
+ metadata,
69
+ });
70
+ setCallId(call.id);
71
+ onCallStart?.(call.id);
72
+ // Poll for call completion
73
+ const pollInterval = setInterval(async () => {
74
+ try {
75
+ const status = await client.getCall(call.id);
76
+ if (status.status === 'completed' || status.status === 'failed' || status.status === 'cancelled') {
77
+ clearInterval(pollInterval);
78
+ setLoading(false);
79
+ onCallComplete?.(status);
80
+ }
81
+ }
82
+ catch (error) {
83
+ clearInterval(pollInterval);
84
+ setLoading(false);
85
+ onError?.(error);
86
+ }
87
+ }, 2000);
88
+ // Timeout after 5 minutes
89
+ setTimeout(() => {
90
+ clearInterval(pollInterval);
91
+ setLoading(false);
92
+ }, 5 * 60 * 1000);
93
+ }
94
+ catch (error) {
95
+ setLoading(false);
96
+ onError?.(error);
97
+ }
98
+ };
99
+ return (React.createElement("button", { onClick: handleClick, disabled: loading || disabled, className: `pamela-call-button ${className}`, style: {
100
+ padding: '10px 20px',
101
+ background: loading
102
+ ? 'linear-gradient(to right, #ccc, #aaa)'
103
+ : 'linear-gradient(to right, #FA931C, #fd8b74)',
104
+ color: 'white',
105
+ border: 'none',
106
+ borderRadius: '0.5rem',
107
+ cursor: loading || disabled ? 'not-allowed' : 'pointer',
108
+ fontSize: '16px',
109
+ fontWeight: '600',
110
+ fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',
111
+ transition: 'opacity 0.2s',
112
+ opacity: loading || disabled ? 0.7 : 1,
113
+ boxShadow: loading || disabled ? 'none' : '0 2px 4px rgba(250, 147, 28, 0.2)',
114
+ } }, loading ? 'Calling...' : children || 'Call Now'));
115
+ }
116
+
117
+ function TranscriptViewer({ transcript, className = '' }) {
118
+ const getMessageStyle = (speaker) => {
119
+ if (speaker === 'pamela' || speaker === 'agent') {
120
+ // Pamela messages: white background with beige border
121
+ return {
122
+ backgroundColor: '#ffffff',
123
+ border: '1px solid rgba(231, 171, 132, 0.3)',
124
+ color: '#1f2937',
125
+ };
126
+ }
127
+ else if (speaker === 'user' || speaker === 'caller') {
128
+ // User messages: orange background
129
+ return {
130
+ backgroundColor: '#FA931C',
131
+ border: 'none',
132
+ color: '#ffffff',
133
+ };
134
+ }
135
+ else {
136
+ // Call recipient: blue background
137
+ return {
138
+ backgroundColor: '#4b4bea',
139
+ border: 'none',
140
+ color: '#ffffff',
141
+ };
142
+ }
143
+ };
144
+ return (React.createElement("div", { className: `pamela-transcript-viewer ${className}`, style: {
145
+ fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',
146
+ } },
147
+ React.createElement("h3", { style: {
148
+ marginBottom: '16px',
149
+ fontSize: '18px',
150
+ fontWeight: '600',
151
+ color: '#1f2937',
152
+ } }, "Transcript"),
153
+ React.createElement("div", { style: {
154
+ maxHeight: '400px',
155
+ overflowY: 'auto',
156
+ borderRadius: '0.5rem',
157
+ padding: '16px',
158
+ backgroundColor: '#F7F4ED',
159
+ } }, transcript.map((entry, index) => {
160
+ const style = getMessageStyle(entry.speaker);
161
+ return (React.createElement("div", { key: index, style: {
162
+ marginBottom: '12px',
163
+ padding: '12px 16px',
164
+ ...style,
165
+ borderRadius: '0.75rem',
166
+ maxWidth: '75%',
167
+ marginLeft: entry.speaker === 'pamela' || entry.speaker === 'agent' ? '0' : 'auto',
168
+ marginRight: entry.speaker === 'pamela' || entry.speaker === 'agent' ? 'auto' : '0',
169
+ } },
170
+ React.createElement("div", { style: {
171
+ fontSize: '12px',
172
+ fontWeight: '600',
173
+ color: style.color === '#ffffff' ? 'rgba(255, 255, 255, 0.9)' : '#6b7280',
174
+ marginBottom: '6px',
175
+ textTransform: 'capitalize',
176
+ } }, entry.speaker === 'pamela' || entry.speaker === 'agent'
177
+ ? 'Pamela'
178
+ : entry.speaker === 'user' || entry.speaker === 'caller'
179
+ ? 'You'
180
+ : 'Call Recipient'),
181
+ React.createElement("div", { style: {
182
+ fontSize: '14px',
183
+ lineHeight: '1.6',
184
+ color: style.color,
185
+ whiteSpace: 'pre-wrap',
186
+ wordBreak: 'break-word',
187
+ } }, entry.text),
188
+ entry.timestamp && (React.createElement("div", { style: {
189
+ fontSize: '11px',
190
+ color: style.color === '#ffffff' ? 'rgba(255, 255, 255, 0.7)' : '#9ca3af',
191
+ marginTop: '6px',
192
+ } }, new Date(entry.timestamp).toLocaleTimeString()))));
193
+ }))));
194
+ }
195
+
196
+ // Status indicator component matching your 3-color system
197
+ function StatusIndicator({ status }) {
198
+ const getStatusConfig = () => {
199
+ switch (status) {
200
+ case 'ringing':
201
+ return {
202
+ dots: [
203
+ { color: '#10b981', pulse: true }, // green-500 (first dot)
204
+ { color: '#eab308', pulse: true }, // yellow-500 (second dot)
205
+ { color: '#d1d5db', pulse: false }, // gray-300 (third dot)
206
+ { color: '#d1d5db', pulse: false }, // gray-300 (fourth dot)
207
+ ],
208
+ text: 'Ringing...',
209
+ textColor: '#eab308', // yellow-600
210
+ };
211
+ case 'in_progress':
212
+ case 'in-progress':
213
+ return {
214
+ dots: [
215
+ { color: '#10b981', pulse: false }, // green-500
216
+ { color: '#10b981', pulse: false },
217
+ { color: '#10b981', pulse: true }, // third dot pulses
218
+ { color: '#d1d5db', pulse: false }, // gray-300
219
+ ],
220
+ text: 'In progress',
221
+ textColor: '#10b981', // green-600
222
+ };
223
+ case 'completed':
224
+ return {
225
+ dots: [
226
+ { color: '#10b981', pulse: false },
227
+ { color: '#10b981', pulse: false },
228
+ { color: '#10b981', pulse: false },
229
+ { color: '#10b981', pulse: false, icon: true },
230
+ ],
231
+ text: 'Completed',
232
+ textColor: '#10b981',
233
+ };
234
+ case 'failed':
235
+ return {
236
+ dots: [],
237
+ text: 'Failed',
238
+ textColor: '#ef4444', // red-500
239
+ };
240
+ default:
241
+ return {
242
+ dots: [],
243
+ text: status,
244
+ textColor: '#6b7280', // gray-500
245
+ };
246
+ }
247
+ };
248
+ const config = getStatusConfig();
249
+ return (React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '6px' } },
250
+ config.dots.length > 0 && (React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' } }, config.dots.map((dot, idx) => (React.createElement("div", { key: idx }, dot.icon ? (React.createElement("svg", { style: { width: '12px', height: '12px', color: dot.color }, fill: "currentColor", viewBox: "0 0 20 20" },
251
+ React.createElement("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }))) : (React.createElement("div", { style: {
252
+ width: '8px',
253
+ height: '8px',
254
+ borderRadius: '50%',
255
+ backgroundColor: dot.color,
256
+ animation: dot.pulse ? 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite' : 'none',
257
+ } }))))))),
258
+ React.createElement("span", { style: {
259
+ fontSize: '12px',
260
+ fontWeight: '500',
261
+ color: config.textColor,
262
+ fontFamily: 'Poppins, Inter, sans-serif',
263
+ } }, config.text)));
264
+ }
265
+ function CallStatus({ callId, pollInterval = 5000, onStatusChange, showTranscript = true, className = '', }) {
266
+ const { client } = usePamela();
267
+ const [status, setStatus] = React.useState(null);
268
+ const [loading, setLoading] = React.useState(true);
269
+ const [error, setError] = React.useState(null);
270
+ React.useEffect(() => {
271
+ if (!callId)
272
+ return;
273
+ const fetchStatus = async () => {
274
+ try {
275
+ const callStatus = await client.getCall(callId);
276
+ setStatus(callStatus);
277
+ setLoading(false);
278
+ onStatusChange?.(callStatus);
279
+ }
280
+ catch (err) {
281
+ setError(err);
282
+ setLoading(false);
283
+ }
284
+ };
285
+ fetchStatus();
286
+ const interval = setInterval(fetchStatus, pollInterval);
287
+ return () => clearInterval(interval);
288
+ }, [callId, pollInterval, client, onStatusChange]);
289
+ if (loading) {
290
+ return (React.createElement("div", { className: `pamela-call-status ${className}` },
291
+ React.createElement("div", { style: { color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' } }, "Loading call status...")));
292
+ }
293
+ if (error) {
294
+ return (React.createElement("div", { className: `pamela-call-status ${className}` },
295
+ React.createElement("div", { style: { color: '#ef4444', fontFamily: 'Poppins, Inter, sans-serif' } },
296
+ "Error: ",
297
+ error.message)));
298
+ }
299
+ if (!status) {
300
+ return (React.createElement("div", { className: `pamela-call-status ${className}` },
301
+ React.createElement("div", { style: { color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' } }, "Call not found")));
302
+ }
303
+ return (React.createElement("div", { className: `pamela-call-status ${className}`, style: {
304
+ fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',
305
+ } },
306
+ React.createElement("div", { style: {
307
+ marginBottom: '16px',
308
+ padding: '16px',
309
+ backgroundColor: '#ffffff',
310
+ borderRadius: '0.75rem',
311
+ border: '1px solid rgba(231, 171, 132, 0.3)',
312
+ boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1)',
313
+ } },
314
+ React.createElement("div", { style: { marginBottom: '12px' } },
315
+ React.createElement(StatusIndicator, { status: status.status })),
316
+ React.createElement("div", { style: { fontSize: '14px', color: '#1f2937', lineHeight: '1.6' } },
317
+ React.createElement("div", { style: { marginBottom: '8px' } },
318
+ React.createElement("span", { style: { fontWeight: '600', color: '#6b7280' } }, "To:"),
319
+ ' ',
320
+ React.createElement("span", { style: { color: '#1f2937' } }, status.to)),
321
+ React.createElement("div", { style: { marginBottom: '8px' } },
322
+ React.createElement("span", { style: { fontWeight: '600', color: '#6b7280' } }, "From:"),
323
+ ' ',
324
+ React.createElement("span", { style: { color: '#1f2937' } }, status.from_)),
325
+ status.duration_seconds && (React.createElement("div", { style: { marginBottom: '8px' } },
326
+ React.createElement("span", { style: { fontWeight: '600', color: '#6b7280' } }, "Duration:"),
327
+ ' ',
328
+ React.createElement("span", { style: { color: '#1f2937' } },
329
+ status.duration_seconds,
330
+ "s")))),
331
+ status.summary && (React.createElement("div", { style: {
332
+ marginTop: '16px',
333
+ padding: '16px',
334
+ background: 'linear-gradient(to right, rgba(250, 147, 28, 0.1), rgba(253, 139, 116, 0.1))',
335
+ border: '1px solid rgba(250, 147, 28, 0.3)',
336
+ borderRadius: '0.75rem',
337
+ } },
338
+ React.createElement("div", { style: {
339
+ display: 'flex',
340
+ alignItems: 'center',
341
+ gap: '8px',
342
+ marginBottom: '8px',
343
+ } },
344
+ React.createElement("svg", { style: { width: '20px', height: '20px', color: '#FA931C' }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
345
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" })),
346
+ React.createElement("h4", { style: { fontWeight: '600', color: '#1f2937', fontSize: '14px' } }, "Call Summary")),
347
+ React.createElement("p", { style: { fontSize: '14px', color: '#1f2937', lineHeight: '1.6' } }, status.summary)))),
348
+ showTranscript && status.transcript && status.transcript.length > 0 && (React.createElement(TranscriptViewer, { transcript: status.transcript })),
349
+ React.createElement("style", null, `
350
+ @keyframes pulse {
351
+ 0%, 100% {
352
+ opacity: 1;
353
+ }
354
+ 50% {
355
+ opacity: 0.5;
356
+ }
357
+ }
358
+ `)));
359
+ }
360
+
361
+ function CallHistory({ limit = 10, onCallSelect, className = '', }) {
362
+ const { client } = usePamela();
363
+ const [calls, setCalls] = React.useState([]);
364
+ const [loading, setLoading] = React.useState(true);
365
+ const [error, setError] = React.useState(null);
366
+ // Note: This requires a list endpoint in the API
367
+ // For now, this is a placeholder that shows the structure
368
+ React.useEffect(() => {
369
+ // TODO: Implement when /api/b2b/v1/calls list endpoint is available
370
+ setLoading(false);
371
+ }, [client]);
372
+ if (loading) {
373
+ return (React.createElement("div", { className: `pamela-call-history ${className}` },
374
+ React.createElement("div", { style: { color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' } }, "Loading call history...")));
375
+ }
376
+ if (error) {
377
+ return (React.createElement("div", { className: `pamela-call-history ${className}` },
378
+ React.createElement("div", { style: { color: '#ef4444', fontFamily: 'Poppins, Inter, sans-serif' } },
379
+ "Error: ",
380
+ error.message)));
381
+ }
382
+ return (React.createElement("div", { className: `pamela-call-history ${className}`, style: {
383
+ fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',
384
+ } },
385
+ React.createElement("h3", { style: {
386
+ marginBottom: '16px',
387
+ fontSize: '18px',
388
+ fontWeight: '600',
389
+ color: '#1f2937',
390
+ } }, "Call History"),
391
+ calls.length === 0 ? (React.createElement("div", { style: { color: '#6b7280', fontSize: '14px' } }, "No calls yet")) : (React.createElement("div", null, calls.map((call) => (React.createElement("div", { key: call.id, onClick: () => onCallSelect?.(call.id), style: {
392
+ padding: '12px',
393
+ marginBottom: '8px',
394
+ border: '1px solid rgba(231, 171, 132, 0.3)',
395
+ borderRadius: '0.5rem',
396
+ cursor: onCallSelect ? 'pointer' : 'default',
397
+ backgroundColor: '#ffffff',
398
+ transition: 'background-color 0.2s',
399
+ ...(onCallSelect && {
400
+ ':hover': {
401
+ backgroundColor: '#F7F4ED',
402
+ },
403
+ }),
404
+ }, onMouseEnter: (e) => {
405
+ if (onCallSelect) {
406
+ e.currentTarget.style.backgroundColor = '#F7F4ED';
407
+ }
408
+ }, onMouseLeave: (e) => {
409
+ e.currentTarget.style.backgroundColor = '#ffffff';
410
+ } },
411
+ React.createElement("div", { style: { fontWeight: '600', color: '#1f2937', marginBottom: '4px' } }, call.to),
412
+ React.createElement("div", { style: { fontSize: '14px', color: '#6b7280' } },
413
+ call.status,
414
+ " \u2022 ",
415
+ new Date(call.created_at).toLocaleString()))))))));
416
+ }
417
+
418
+ exports.CallButton = CallButton;
419
+ exports.CallHistory = CallHistory;
420
+ exports.CallStatus = CallStatus;
421
+ exports.PamelaProvider = PamelaProvider;
422
+ exports.TranscriptViewer = TranscriptViewer;
423
+ exports.usePamela = usePamela;
424
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/PamelaProvider.tsx","../src/CallButton.tsx","../src/TranscriptViewer.tsx","../src/CallStatus.tsx","../src/CallHistory.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { createContext, useContext, ReactNode } from 'react';\nimport { PamelaClient, PamelaClientConfig } from '@thisispamela/sdk';\nimport { PamelaConfig } from './types';\n\ninterface PamelaContextValue {\n client: PamelaClient;\n}\n\nconst PamelaContext = createContext<PamelaContextValue | null>(null);\n\nexport interface PamelaProviderProps {\n config: PamelaConfig;\n children: ReactNode;\n}\n\nexport function PamelaProvider({ config, children }: PamelaProviderProps) {\n const client = new PamelaClient({\n apiKey: config.apiKey,\n baseUrl: config.baseUrl,\n });\n\n return (\n <PamelaContext.Provider value={{ client }}>\n {children}\n </PamelaContext.Provider>\n );\n}\n\nexport function usePamela(): PamelaContextValue {\n const context = useContext(PamelaContext);\n if (!context) {\n throw new Error('usePamela must be used within a PamelaProvider');\n }\n return context;\n}\n\n","import React, { useState } from 'react';\nimport { usePamela } from './PamelaProvider';\nimport { CallButtonProps } from './types';\n\nexport function CallButton({\n to,\n task,\n country,\n locale,\n instructions,\n end_user_id,\n metadata,\n onCallStart,\n onCallComplete,\n onError,\n disabled = false,\n className = '',\n children,\n}: CallButtonProps) {\n const { client } = usePamela();\n const [loading, setLoading] = useState(false);\n const [callId, setCallId] = useState<string | null>(null);\n\n const handleClick = async () => {\n if (loading || disabled) return;\n\n setLoading(true);\n try {\n const call = await client.createCall({\n to,\n task,\n country,\n locale,\n instructions,\n end_user_id,\n metadata,\n });\n\n setCallId(call.id);\n onCallStart?.(call.id);\n\n // Poll for call completion\n const pollInterval = setInterval(async () => {\n try {\n const status = await client.getCall(call.id);\n if (status.status === 'completed' || status.status === 'failed' || status.status === 'cancelled') {\n clearInterval(pollInterval);\n setLoading(false);\n onCallComplete?.(status);\n }\n } catch (error) {\n clearInterval(pollInterval);\n setLoading(false);\n onError?.(error as Error);\n }\n }, 2000);\n\n // Timeout after 5 minutes\n setTimeout(() => {\n clearInterval(pollInterval);\n setLoading(false);\n }, 5 * 60 * 1000);\n } catch (error) {\n setLoading(false);\n onError?.(error as Error);\n }\n };\n\n return (\n <button\n onClick={handleClick}\n disabled={loading || disabled}\n className={`pamela-call-button ${className}`}\n style={{\n padding: '10px 20px',\n background: loading \n ? 'linear-gradient(to right, #ccc, #aaa)' \n : 'linear-gradient(to right, #FA931C, #fd8b74)',\n color: 'white',\n border: 'none',\n borderRadius: '0.5rem',\n cursor: loading || disabled ? 'not-allowed' : 'pointer',\n fontSize: '16px',\n fontWeight: '600',\n fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',\n transition: 'opacity 0.2s',\n opacity: loading || disabled ? 0.7 : 1,\n boxShadow: loading || disabled ? 'none' : '0 2px 4px rgba(250, 147, 28, 0.2)',\n }}\n >\n {loading ? 'Calling...' : children || 'Call Now'}\n </button>\n );\n}\n\n","import React from 'react';\nimport { TranscriptViewerProps } from './types';\n\nexport function TranscriptViewer({ transcript, className = '' }: TranscriptViewerProps) {\n const getMessageStyle = (speaker: string) => {\n if (speaker === 'pamela' || speaker === 'agent') {\n // Pamela messages: white background with beige border\n return {\n backgroundColor: '#ffffff',\n border: '1px solid rgba(231, 171, 132, 0.3)',\n color: '#1f2937',\n };\n } else if (speaker === 'user' || speaker === 'caller') {\n // User messages: orange background\n return {\n backgroundColor: '#FA931C',\n border: 'none',\n color: '#ffffff',\n };\n } else {\n // Call recipient: blue background\n return {\n backgroundColor: '#4b4bea',\n border: 'none',\n color: '#ffffff',\n };\n }\n };\n\n return (\n <div\n className={`pamela-transcript-viewer ${className}`}\n style={{\n fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',\n }}\n >\n <h3\n style={{\n marginBottom: '16px',\n fontSize: '18px',\n fontWeight: '600',\n color: '#1f2937',\n }}\n >\n Transcript\n </h3>\n <div\n style={{\n maxHeight: '400px',\n overflowY: 'auto',\n borderRadius: '0.5rem',\n padding: '16px',\n backgroundColor: '#F7F4ED',\n }}\n >\n {transcript.map((entry, index) => {\n const style = getMessageStyle(entry.speaker);\n return (\n <div\n key={index}\n style={{\n marginBottom: '12px',\n padding: '12px 16px',\n ...style,\n borderRadius: '0.75rem',\n maxWidth: '75%',\n marginLeft: entry.speaker === 'pamela' || entry.speaker === 'agent' ? '0' : 'auto',\n marginRight: entry.speaker === 'pamela' || entry.speaker === 'agent' ? 'auto' : '0',\n }}\n >\n <div\n style={{\n fontSize: '12px',\n fontWeight: '600',\n color: style.color === '#ffffff' ? 'rgba(255, 255, 255, 0.9)' : '#6b7280',\n marginBottom: '6px',\n textTransform: 'capitalize',\n }}\n >\n {entry.speaker === 'pamela' || entry.speaker === 'agent'\n ? 'Pamela'\n : entry.speaker === 'user' || entry.speaker === 'caller'\n ? 'You'\n : 'Call Recipient'}\n </div>\n <div\n style={{\n fontSize: '14px',\n lineHeight: '1.6',\n color: style.color,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n }}\n >\n {entry.text}\n </div>\n {entry.timestamp && (\n <div\n style={{\n fontSize: '11px',\n color: style.color === '#ffffff' ? 'rgba(255, 255, 255, 0.7)' : '#9ca3af',\n marginTop: '6px',\n }}\n >\n {new Date(entry.timestamp).toLocaleTimeString()}\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n","import React, { useState, useEffect } from 'react';\nimport { usePamela } from './PamelaProvider';\nimport { CallStatusProps } from './types';\nimport { CallStatus as CallStatusType } from '@thisispamela/sdk';\nimport { TranscriptViewer } from './TranscriptViewer';\n\n// Status indicator component matching your 3-color system\nfunction StatusIndicator({ status }: { status: string }) {\n const getStatusConfig = () => {\n switch (status) {\n case 'ringing':\n return {\n dots: [\n { color: '#10b981', pulse: true }, // green-500 (first dot)\n { color: '#eab308', pulse: true }, // yellow-500 (second dot)\n { color: '#d1d5db', pulse: false }, // gray-300 (third dot)\n { color: '#d1d5db', pulse: false }, // gray-300 (fourth dot)\n ],\n text: 'Ringing...',\n textColor: '#eab308', // yellow-600\n };\n case 'in_progress':\n case 'in-progress':\n return {\n dots: [\n { color: '#10b981', pulse: false }, // green-500\n { color: '#10b981', pulse: false },\n { color: '#10b981', pulse: true }, // third dot pulses\n { color: '#d1d5db', pulse: false }, // gray-300\n ],\n text: 'In progress',\n textColor: '#10b981', // green-600\n };\n case 'completed':\n return {\n dots: [\n { color: '#10b981', pulse: false },\n { color: '#10b981', pulse: false },\n { color: '#10b981', pulse: false },\n { color: '#10b981', pulse: false, icon: true },\n ],\n text: 'Completed',\n textColor: '#10b981',\n };\n case 'failed':\n return {\n dots: [],\n text: 'Failed',\n textColor: '#ef4444', // red-500\n };\n default:\n return {\n dots: [],\n text: status,\n textColor: '#6b7280', // gray-500\n };\n }\n };\n\n const config = getStatusConfig();\n\n return (\n <div style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>\n {config.dots.length > 0 && (\n <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>\n {config.dots.map((dot, idx) => (\n <div key={idx}>\n {dot.icon ? (\n <svg\n style={{ width: '12px', height: '12px', color: dot.color }}\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n ) : (\n <div\n style={{\n width: '8px',\n height: '8px',\n borderRadius: '50%',\n backgroundColor: dot.color,\n animation: dot.pulse ? 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite' : 'none',\n }}\n />\n )}\n </div>\n ))}\n </div>\n )}\n <span\n style={{\n fontSize: '12px',\n fontWeight: '500',\n color: config.textColor,\n fontFamily: 'Poppins, Inter, sans-serif',\n }}\n >\n {config.text}\n </span>\n </div>\n );\n}\n\nexport function CallStatus({\n callId,\n pollInterval = 5000,\n onStatusChange,\n showTranscript = true,\n className = '',\n}: CallStatusProps) {\n const { client } = usePamela();\n const [status, setStatus] = useState<CallStatusType | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n if (!callId) return;\n\n const fetchStatus = async () => {\n try {\n const callStatus = await client.getCall(callId);\n setStatus(callStatus);\n setLoading(false);\n onStatusChange?.(callStatus);\n } catch (err) {\n setError(err as Error);\n setLoading(false);\n }\n };\n\n fetchStatus();\n\n const interval = setInterval(fetchStatus, pollInterval);\n return () => clearInterval(interval);\n }, [callId, pollInterval, client, onStatusChange]);\n\n if (loading) {\n return (\n <div className={`pamela-call-status ${className}`}>\n <div style={{ color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' }}>\n Loading call status...\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={`pamela-call-status ${className}`}>\n <div style={{ color: '#ef4444', fontFamily: 'Poppins, Inter, sans-serif' }}>\n Error: {error.message}\n </div>\n </div>\n );\n }\n\n if (!status) {\n return (\n <div className={`pamela-call-status ${className}`}>\n <div style={{ color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' }}>\n Call not found\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`pamela-call-status ${className}`}\n style={{\n fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',\n }}\n >\n <div\n style={{\n marginBottom: '16px',\n padding: '16px',\n backgroundColor: '#ffffff',\n borderRadius: '0.75rem',\n border: '1px solid rgba(231, 171, 132, 0.3)',\n boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1)',\n }}\n >\n <div style={{ marginBottom: '12px' }}>\n <StatusIndicator status={status.status} />\n </div>\n <div style={{ fontSize: '14px', color: '#1f2937', lineHeight: '1.6' }}>\n <div style={{ marginBottom: '8px' }}>\n <span style={{ fontWeight: '600', color: '#6b7280' }}>To:</span>{' '}\n <span style={{ color: '#1f2937' }}>{status.to}</span>\n </div>\n <div style={{ marginBottom: '8px' }}>\n <span style={{ fontWeight: '600', color: '#6b7280' }}>From:</span>{' '}\n <span style={{ color: '#1f2937' }}>{status.from_}</span>\n </div>\n {status.duration_seconds && (\n <div style={{ marginBottom: '8px' }}>\n <span style={{ fontWeight: '600', color: '#6b7280' }}>Duration:</span>{' '}\n <span style={{ color: '#1f2937' }}>{status.duration_seconds}s</span>\n </div>\n )}\n </div>\n {status.summary && (\n <div\n style={{\n marginTop: '16px',\n padding: '16px',\n background: 'linear-gradient(to right, rgba(250, 147, 28, 0.1), rgba(253, 139, 116, 0.1))',\n border: '1px solid rgba(250, 147, 28, 0.3)',\n borderRadius: '0.75rem',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n marginBottom: '8px',\n }}\n >\n <svg\n style={{ width: '20px', height: '20px', color: '#FA931C' }}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n />\n </svg>\n <h4 style={{ fontWeight: '600', color: '#1f2937', fontSize: '14px' }}>\n Call Summary\n </h4>\n </div>\n <p style={{ fontSize: '14px', color: '#1f2937', lineHeight: '1.6' }}>\n {status.summary}\n </p>\n </div>\n )}\n </div>\n {showTranscript && status.transcript && status.transcript.length > 0 && (\n <TranscriptViewer transcript={status.transcript as Array<{ speaker: string; text: string; timestamp: string }>} />\n )}\n <style>{`\n @keyframes pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n }\n `}</style>\n </div>\n );\n}\n\n","import React, { useState, useEffect } from 'react';\nimport { usePamela } from './PamelaProvider';\nimport { CallHistoryProps } from './types';\nimport { CallStatus } from '@thisispamela/sdk';\n\nexport function CallHistory({\n limit = 10,\n onCallSelect,\n className = '',\n}: CallHistoryProps) {\n const { client } = usePamela();\n const [calls, setCalls] = useState<CallStatus[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n // Note: This requires a list endpoint in the API\n // For now, this is a placeholder that shows the structure\n useEffect(() => {\n // TODO: Implement when /api/b2b/v1/calls list endpoint is available\n setLoading(false);\n }, [client]);\n\n if (loading) {\n return (\n <div className={`pamela-call-history ${className}`}>\n <div style={{ color: '#6b7280', fontFamily: 'Poppins, Inter, sans-serif' }}>\n Loading call history...\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={`pamela-call-history ${className}`}>\n <div style={{ color: '#ef4444', fontFamily: 'Poppins, Inter, sans-serif' }}>\n Error: {error.message}\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`pamela-call-history ${className}`}\n style={{\n fontFamily: 'Poppins, Inter, -apple-system, BlinkMacSystemFont, sans-serif',\n }}\n >\n <h3\n style={{\n marginBottom: '16px',\n fontSize: '18px',\n fontWeight: '600',\n color: '#1f2937',\n }}\n >\n Call History\n </h3>\n {calls.length === 0 ? (\n <div style={{ color: '#6b7280', fontSize: '14px' }}>No calls yet</div>\n ) : (\n <div>\n {calls.map((call) => (\n <div\n key={call.id}\n onClick={() => onCallSelect?.(call.id)}\n style={{\n padding: '12px',\n marginBottom: '8px',\n border: '1px solid rgba(231, 171, 132, 0.3)',\n borderRadius: '0.5rem',\n cursor: onCallSelect ? 'pointer' : 'default',\n backgroundColor: '#ffffff',\n transition: 'background-color 0.2s',\n ...(onCallSelect && {\n ':hover': {\n backgroundColor: '#F7F4ED',\n },\n }),\n }}\n onMouseEnter={(e) => {\n if (onCallSelect) {\n e.currentTarget.style.backgroundColor = '#F7F4ED';\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = '#ffffff';\n }}\n >\n <div style={{ fontWeight: '600', color: '#1f2937', marginBottom: '4px' }}>\n {call.to}\n </div>\n <div style={{ fontSize: '14px', color: '#6b7280' }}>\n {call.status} • {new Date(call.created_at).toLocaleString()}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"names":["createContext","PamelaClient","useContext","useState","useEffect"],"mappings":";;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;ACjBA,MAAM,aAAa,GAAGA,mBAAa,CAA4B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CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,IACrE,IAAI,CAAC,EAAE,CACJ;YACN,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAA;AAC/C,gBAAA,IAAI,CAAC,MAAM;;AAAK,gBAAA,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,cAAc,EAAE,CACvD,CACF,CACP,CAAC,CACE,CACP,CACG,EACN;AACJ;;;;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ import { CallStatus } from '@thisispamela/sdk';
3
+ export interface PamelaConfig {
4
+ apiKey: string;
5
+ baseUrl?: string;
6
+ }
7
+ export interface CallButtonProps {
8
+ to: string;
9
+ task: string;
10
+ country?: string;
11
+ locale?: string;
12
+ instructions?: string;
13
+ end_user_id?: string;
14
+ metadata?: Record<string, any>;
15
+ onCallStart?: (callId: string) => void;
16
+ onCallComplete?: (call: CallStatus) => void;
17
+ onError?: (error: Error) => void;
18
+ disabled?: boolean;
19
+ className?: string;
20
+ children?: ReactNode;
21
+ }
22
+ export interface CallStatusProps {
23
+ callId: string;
24
+ pollInterval?: number;
25
+ onStatusChange?: (status: CallStatus) => void;
26
+ showTranscript?: boolean;
27
+ className?: string;
28
+ }
29
+ export interface TranscriptViewerProps {
30
+ transcript: Array<{
31
+ speaker: string;
32
+ text: string;
33
+ timestamp: string;
34
+ }>;
35
+ className?: string;
36
+ }
37
+ export interface CallHistoryProps {
38
+ limit?: number;
39
+ onCallSelect?: (callId: string) => void;
40
+ className?: string;
41
+ }
42
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],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E,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@thisispamela/react",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "React components for Pamela B2B Voice API integration",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "rollup -c",
14
+ "dev": "rollup -c -w",
15
+ "prepublishOnly": "npm run build"
16
+ },
17
+ "keywords": [
18
+ "pamela",
19
+ "voice",
20
+ "api",
21
+ "b2b",
22
+ "phone",
23
+ "calling",
24
+ "react",
25
+ "components"
26
+ ],
27
+ "author": "Pamela",
28
+ "license": "MIT",
29
+ "peerDependencies": {
30
+ "react": ">=16.8.0",
31
+ "react-dom": ">=16.8.0"
32
+ },
33
+ "dependencies": {
34
+ "@thisispamela/sdk": "^1.0.0"
35
+ },
36
+ "devDependencies": {
37
+ "@rollup/plugin-commonjs": "^25.0.0",
38
+ "@rollup/plugin-node-resolve": "^15.0.0",
39
+ "@rollup/plugin-typescript": "^11.0.0",
40
+ "@types/react": "^18.0.0",
41
+ "@types/react-dom": "^18.0.0",
42
+ "rollup": "^3.0.0",
43
+ "rollup-plugin-dts": "^5.0.0",
44
+ "rollup-plugin-postcss": "^4.0.2",
45
+ "tslib": "^2.8.1",
46
+ "typescript": "^5.0.0"
47
+ }
48
+ }