@thisispamela/react 1.0.0 → 1.0.2

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 CHANGED
@@ -1,11 +1,11 @@
1
- # @pamela/react
1
+ # @thisispamela/react
2
2
 
3
3
  React component library for easy integration of Pamela Voice API into your React applications.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @pamela/react @pamela/sdk
8
+ npm install @thisispamela/react @thisispamela/sdk
9
9
  ```
10
10
 
11
11
  ## Quick Start
@@ -13,7 +13,7 @@ npm install @pamela/react @pamela/sdk
13
13
  ### 1. Wrap your app with PamelaProvider
14
14
 
15
15
  ```tsx
16
- import { PamelaProvider } from '@pamela/react';
16
+ import { PamelaProvider } from '@thisispamela/react';
17
17
 
18
18
  function App() {
19
19
  return (
@@ -32,7 +32,7 @@ function App() {
32
32
  ### 2. Use the components
33
33
 
34
34
  ```tsx
35
- import { CallButton, CallStatus } from '@pamela/react';
35
+ import { CallButton, CallStatus } from '@thisispamela/react';
36
36
 
37
37
  function MyComponent() {
38
38
  const [callId, setCallId] = useState<string | null>(null);
@@ -73,6 +73,10 @@ A button component that initiates a call when clicked.
73
73
  locale="en-US"
74
74
  instructions="Be professional and concise"
75
75
  metadata={{ customer_id: "12345" }}
76
+ variant="primary"
77
+ size="md"
78
+ pollInterval={2000}
79
+ pollTimeout={300000}
76
80
  onCallStart={(callId) => console.log('Call started:', callId)}
77
81
  onCallComplete={(call) => console.log('Call completed:', call)}
78
82
  onError={(error) => console.error('Error:', error)}
@@ -90,16 +94,20 @@ A button component that initiates a call when clicked.
90
94
  - `locale`: Locale string (optional, e.g., "en-US")
91
95
  - `instructions`: Additional instructions (optional)
92
96
  - `metadata`: Custom metadata object (optional)
97
+ - `variant`: Button style - `"primary"` | `"secondary"` | `"danger"` (default: `"primary"`)
98
+ - `size`: Button size - `"sm"` | `"md"` | `"lg"` (default: `"md"`)
99
+ - `pollInterval`: Status polling interval in ms (default: 2000)
100
+ - `pollTimeout`: Maximum polling duration in ms (default: 300000 = 5 min)
93
101
  - `onCallStart`: Callback when call starts (optional)
94
102
  - `onCallComplete`: Callback when call completes (optional)
95
103
  - `onError`: Error callback (optional)
96
104
  - `disabled`: Disable button (optional)
97
105
  - `className`: Custom CSS class (optional)
98
- - `children`: Button content (optional, defaults to "Make Call")
106
+ - `children`: Button content (optional, defaults to "Call Now")
99
107
 
100
108
  ### CallStatus
101
109
 
102
- Displays the current status of a call with optional transcript.
110
+ Displays the current status of a call with optional transcript and summary.
103
111
 
104
112
  ```tsx
105
113
  <CallStatus
@@ -107,6 +115,8 @@ Displays the current status of a call with optional transcript.
107
115
  pollInterval={5000}
108
116
  onStatusChange={(status) => console.log('Status:', status)}
109
117
  showTranscript={true}
118
+ showSummary={true}
119
+ compact={false}
110
120
  className="my-custom-class"
111
121
  />
112
122
  ```
@@ -116,11 +126,13 @@ Displays the current status of a call with optional transcript.
116
126
  - `pollInterval`: Polling interval in milliseconds (default: 5000)
117
127
  - `onStatusChange`: Callback when status changes (optional)
118
128
  - `showTranscript`: Show transcript (default: true)
129
+ - `showSummary`: Show call summary when available (default: true)
130
+ - `compact`: Use compact layout (default: false)
119
131
  - `className`: Custom CSS class (optional)
120
132
 
121
133
  ### TranscriptViewer
122
134
 
123
- Displays a call transcript in a readable format.
135
+ Displays a call transcript in a readable format with auto-scroll support.
124
136
 
125
137
  ```tsx
126
138
  <TranscriptViewer
@@ -136,14 +148,54 @@ Displays a call transcript in a readable format.
136
148
  timestamp: "2024-01-01T00:00:05Z"
137
149
  }
138
150
  ]}
151
+ maxHeight={400}
152
+ autoScroll={true}
139
153
  className="my-custom-class"
140
154
  />
141
155
  ```
142
156
 
143
157
  **Props:**
144
158
  - `transcript` (required): Array of transcript entries
159
+ - `maxHeight`: Maximum container height (default: 400, accepts number or CSS string)
160
+ - `autoScroll`: Auto-scroll to latest message (default: true)
145
161
  - `className`: Custom CSS class (optional)
146
162
 
163
+ ### VoiceOrb
164
+
165
+ Animated voice indicator orb with idle and active states. Matches the Pamela app signature visual.
166
+
167
+ ```tsx
168
+ import { VoiceOrb } from '@thisispamela/react';
169
+
170
+ // Idle state (breathing animation)
171
+ <VoiceOrb isActive={false} size="large" />
172
+
173
+ // Active state (pulsing animation)
174
+ <VoiceOrb isActive={true} size="medium" />
175
+ ```
176
+
177
+ **Props:**
178
+ - `isActive`: Whether the orb is in active state (default: false)
179
+ - `size`: Orb size - `"small"` | `"medium"` | `"large"` (default: `"large"`)
180
+ - `className`: Custom CSS class (optional)
181
+
182
+ **Size CSS Variables:**
183
+ You can customize sizes via CSS variables:
184
+ ```css
185
+ :root {
186
+ --pamela-orb-size-small: 96px;
187
+ --pamela-orb-size-medium: 128px;
188
+ --pamela-orb-size-large: 192px;
189
+ }
190
+ ```
191
+
192
+ **Features:**
193
+ - Multi-layer breathing effect (idle mode)
194
+ - Pulsing animation with ripples (active mode)
195
+ - Floating/levitation effect
196
+ - Gradient rotation
197
+ - Shimmer highlights
198
+
147
199
  ### CallHistory
148
200
 
149
201
  Displays a list of previous calls (requires API endpoint).
@@ -168,7 +220,7 @@ Displays a list of previous calls (requires API endpoint).
168
220
  Access the Pamela client directly for custom integrations.
169
221
 
170
222
  ```tsx
171
- import { usePamela } from '@pamela/react';
223
+ import { usePamela } from '@thisispamela/react';
172
224
 
173
225
  function MyComponent() {
174
226
  const { client } = usePamela();
@@ -220,7 +272,7 @@ Or use the `className` prop on any component to add your own classes.
220
272
 
221
273
  ```tsx
222
274
  import React, { useState } from 'react';
223
- import { PamelaProvider, CallButton, CallStatus, TranscriptViewer } from '@pamela/react';
275
+ import { PamelaProvider, CallButton, CallStatus, TranscriptViewer } from '@thisispamela/react';
224
276
 
225
277
  function App() {
226
278
  return (
@@ -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, onCallStart, onCallComplete, onError, disabled, className, children, }: CallButtonProps): React.JSX.Element;
3
+ export declare function CallButton({ to, task, country, locale, instructions, 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
@@ -1 +1 @@
1
- {"version":3,"file":"CallButton.d.ts","sourceRoot":"","sources":["../src/CallButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,IAAI,EACJ,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,cAAc,EACd,OAAO,EACP,QAAgB,EAChB,SAAc,EACd,QAAQ,GACT,EAAE,eAAe,qBA2EjB"}
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,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,qBAqHjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"CallHistory.d.ts","sourceRoot":"","sources":["../src/CallHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,wBAAgB,WAAW,CAAC,EAC1B,KAAU,EACV,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,qBA6FlB"}
1
+ {"version":3,"file":"CallHistory.d.ts","sourceRoot":"","sources":["../src/CallHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,wBAAgB,WAAW,CAAC,EAC1B,KAAU,EACV,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,qBAgHlB"}
@@ -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
@@ -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;AA0G1C,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,YAAmB,EACnB,cAAc,EACd,cAAqB,EACrB,SAAc,GACf,EAAE,eAAe,qBAqJjB"}
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 +1 @@
1
- {"version":3,"file":"PamelaProvider.d.ts","sourceRoot":"","sources":["../src/PamelaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,UAAU,kBAAkB;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB;AAID,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,qBAWvE;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
1
+ {"version":3,"file":"PamelaProvider.d.ts","sourceRoot":"","sources":["../src/PamelaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAW,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,UAAU,kBAAkB;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB;AAID,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,qBAevE;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
@@ -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,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,EAAE,UAAU,EAAE,SAAc,EAAE,EAAE,qBAAqB,qBA8GrF"}
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,4 @@
1
+ import React from 'react';
2
+ import { VoiceOrbProps } from './types';
3
+ export declare function VoiceOrb({ isActive, size, className }: VoiceOrbProps): React.JSX.Element;
4
+ //# sourceMappingURL=VoiceOrb.d.ts.map
@@ -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
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { CallStatus as CallStatus$1, PamelaClient } from '@thisispamela/sdk';
2
+ import { CreateCallRequest, CallStatus as CallStatus$1, PamelaClient } from '@thisispamela/sdk';
3
3
 
4
4
  interface PamelaConfig {
5
5
  apiKey: string;
@@ -13,9 +13,15 @@ interface CallButtonProps {
13
13
  instructions?: string;
14
14
  end_user_id?: string;
15
15
  metadata?: Record<string, any>;
16
+ tools?: CreateCallRequest["tools"];
17
+ webhooks?: CreateCallRequest["webhooks"];
16
18
  onCallStart?: (callId: string) => void;
17
19
  onCallComplete?: (call: CallStatus$1) => void;
18
20
  onError?: (error: Error) => void;
21
+ variant?: 'primary' | 'secondary' | 'danger';
22
+ size?: 'sm' | 'md' | 'lg';
23
+ pollInterval?: number;
24
+ pollTimeout?: number;
19
25
  disabled?: boolean;
20
26
  className?: string;
21
27
  children?: ReactNode;
@@ -25,6 +31,8 @@ interface CallStatusProps {
25
31
  pollInterval?: number;
26
32
  onStatusChange?: (status: CallStatus$1) => void;
27
33
  showTranscript?: boolean;
34
+ showSummary?: boolean;
35
+ compact?: boolean;
28
36
  className?: string;
29
37
  }
30
38
  interface TranscriptViewerProps {
@@ -33,6 +41,8 @@ interface TranscriptViewerProps {
33
41
  text: string;
34
42
  timestamp: string;
35
43
  }>;
44
+ maxHeight?: number | string;
45
+ autoScroll?: boolean;
36
46
  className?: string;
37
47
  }
38
48
  interface CallHistoryProps {
@@ -40,6 +50,11 @@ interface CallHistoryProps {
40
50
  onCallSelect?: (callId: string) => void;
41
51
  className?: string;
42
52
  }
53
+ interface VoiceOrbProps {
54
+ isActive?: boolean;
55
+ size?: 'small' | 'medium' | 'large';
56
+ className?: string;
57
+ }
43
58
 
44
59
  interface PamelaContextValue {
45
60
  client: PamelaClient;
@@ -51,12 +66,14 @@ interface PamelaProviderProps {
51
66
  declare function PamelaProvider({ config, children }: PamelaProviderProps): React.JSX.Element;
52
67
  declare function usePamela(): PamelaContextValue;
53
68
 
54
- declare function CallButton({ to, task, country, locale, instructions, end_user_id, metadata, onCallStart, onCallComplete, onError, disabled, className, children, }: CallButtonProps): React.JSX.Element;
69
+ declare function CallButton({ to, task, country, locale, instructions, end_user_id, metadata, tools, webhooks, onCallStart, onCallComplete, onError, variant, size, pollInterval, pollTimeout, disabled, className, children, }: CallButtonProps): React.JSX.Element;
55
70
 
56
- declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, className, }: CallStatusProps): React.JSX.Element;
71
+ declare function CallStatus({ callId, pollInterval, onStatusChange, showTranscript, showSummary, compact, className, }: CallStatusProps): React.JSX.Element;
57
72
 
58
- declare function TranscriptViewer({ transcript, className }: TranscriptViewerProps): React.JSX.Element;
73
+ declare function TranscriptViewer({ transcript, maxHeight, autoScroll, className, }: TranscriptViewerProps): React.JSX.Element;
59
74
 
60
75
  declare function CallHistory({ limit, onCallSelect, className, }: CallHistoryProps): React.JSX.Element;
61
76
 
62
- export { CallButton, CallButtonProps, CallHistory, CallHistoryProps, CallStatus, CallStatusProps, PamelaConfig, PamelaProvider, TranscriptViewer, TranscriptViewerProps, usePamela };
77
+ declare function VoiceOrb({ isActive, size, className }: VoiceOrbProps): React.JSX.Element;
78
+
79
+ export { CallButton, CallButtonProps, CallHistory, CallHistoryProps, CallStatus, CallStatusProps, PamelaConfig, PamelaProvider, TranscriptViewer, TranscriptViewerProps, VoiceOrb, VoiceOrbProps, usePamela };
@@ -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;AAE5C,YAAY,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,SAAS,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"}