@vanira/sdk-react-native 0.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 +239 -0
- package/package.json +53 -0
- package/src/__tests__/WebRTCClient.integration.test.ts +396 -0
- package/src/__tests__/adapters.test.ts +475 -0
- package/src/__tests__/httpResponse.test.ts +25 -0
- package/src/__tests__/mocks/react-native-incall-manager.ts +8 -0
- package/src/__tests__/mocks/react-native-permissions.ts +15 -0
- package/src/__tests__/mocks/react-native-webrtc.ts +6 -0
- package/src/__tests__/mocks/react-native.ts +28 -0
- package/src/__tests__/preset.test.ts +239 -0
- package/src/__tests__/resolveRuntimeConfig.test.ts +90 -0
- package/src/__tests__/storage.test.ts +211 -0
- package/src/__tests__/webrtcSignaling.test.ts +42 -0
- package/src/adapters/PeerConnectionAdapter.ts +101 -0
- package/src/adapters/browser/BrowserAudioAdapter.ts +43 -0
- package/src/adapters/browser/BrowserDataChannelAdapter.ts +69 -0
- package/src/adapters/browser/BrowserMediaAdapter.ts +15 -0
- package/src/adapters/browser/BrowserPeerAdapter.ts +14 -0
- package/src/adapters/browser/index.ts +4 -0
- package/src/adapters/interfaces.ts +84 -0
- package/src/adapters/react-native/RNAudioAdapter.ts +42 -0
- package/src/adapters/react-native/RNDataChannelAdapter.ts +79 -0
- package/src/adapters/react-native/RNMediaAdapter.ts +46 -0
- package/src/adapters/react-native/RNPeerAdapter.ts +28 -0
- package/src/adapters/react-native/callAudioRouting.ts +115 -0
- package/src/adapters/react-native/decodeUtf8.ts +72 -0
- package/src/adapters/react-native/index.ts +4 -0
- package/src/adapters/react-native/rnUploadFile.ts +76 -0
- package/src/adapters/storage/BrowserDualStorageAdapter.ts +71 -0
- package/src/adapters/storage/MemoryStorageAdapter.ts +50 -0
- package/src/adapters/storage/StorageAdapter.ts +21 -0
- package/src/adapters/storage/createSyncStorageAdapter.ts +40 -0
- package/src/adapters/storage/index.ts +7 -0
- package/src/api/services/ChatService.ts +304 -0
- package/src/api/services/ConfigService.ts +33 -0
- package/src/assets/icons.js +35 -0
- package/src/cdn.ts +68 -0
- package/src/core/CallSessionStore.ts +137 -0
- package/src/core/DraggableController.ts +83 -0
- package/src/core/SessionManager.ts +322 -0
- package/src/core/VaniraAI.ts +464 -0
- package/src/core/WebRTCClient.ts +1012 -0
- package/src/core/httpResponse.ts +22 -0
- package/src/core/iceServers.ts +18 -0
- package/src/core/toolCallNormalize.ts +80 -0
- package/src/core/voice-client.js +236 -0
- package/src/core/webrtcSignaling.ts +72 -0
- package/src/index.js +34 -0
- package/src/index.ts +6 -0
- package/src/platforms/browser.ts +67 -0
- package/src/platforms/react-native.ts +105 -0
- package/src/presets/BookingCalendarModal.tsx +457 -0
- package/src/presets/CameraModal.tsx +576 -0
- package/src/presets/DynamicFormModal.tsx +378 -0
- package/src/presets/NativePresetRenderer.tsx +350 -0
- package/src/presets/NavigateHandler.tsx +75 -0
- package/src/presets/PresetHost.tsx +155 -0
- package/src/presets/PresetShellModal.tsx +97 -0
- package/src/presets/UploadModal.tsx +321 -0
- package/src/presets/calendar/calendarUtils.ts +386 -0
- package/src/presets/call/CallSpeakerToggle.tsx +59 -0
- package/src/presets/call/callAudioRouting.ts +2 -0
- package/src/presets/call/useCallSpeaker.ts +31 -0
- package/src/presets/camera/cameraPermissions.ts +18 -0
- package/src/presets/camera/cameraStream.ts +19 -0
- package/src/presets/camera/cameraUtils.ts +21 -0
- package/src/presets/camera/useLivenessFlow.ts +95 -0
- package/src/presets/chalkboard/ChalkboardOverlay.tsx +156 -0
- package/src/presets/chalkboard/EraseTextHandler.tsx +95 -0
- package/src/presets/chalkboard/TypeTextHandler.tsx +107 -0
- package/src/presets/chalkboard/boardAbort.ts +36 -0
- package/src/presets/chalkboard/boardQueue.ts +620 -0
- package/src/presets/chalkboard/chalkboardSession.ts +75 -0
- package/src/presets/chalkboard/drawUtils.ts +123 -0
- package/src/presets/chalkboard/textUtils.ts +109 -0
- package/src/presets/clipRegion/ClipRegionModal.tsx +261 -0
- package/src/presets/clipRegion/clipRegionBridge.ts +19 -0
- package/src/presets/form/formValidation.ts +104 -0
- package/src/presets/form/parseFormFields.ts +171 -0
- package/src/presets/host/HostElementPresetHandler.tsx +155 -0
- package/src/presets/host/hostPresetBridge.ts +71 -0
- package/src/presets/index.ts +63 -0
- package/src/presets/liveScreen/CloseLiveScreenHandler.tsx +36 -0
- package/src/presets/liveScreen/LiveScreenCaptureHost.tsx +312 -0
- package/src/presets/liveScreen/LiveScreenHandler.tsx +25 -0
- package/src/presets/liveScreen/LiveScreenPipOverlay.tsx +6 -0
- package/src/presets/liveScreen/liveScreenSession.ts +73 -0
- package/src/presets/liveVision/CloseLiveVisionHandler.tsx +29 -0
- package/src/presets/liveVision/LiveVisionCameraHost.tsx +317 -0
- package/src/presets/liveVision/LiveVisionHandler.tsx +26 -0
- package/src/presets/liveVision/LiveVisionPipOverlay.tsx +7 -0
- package/src/presets/liveVision/liveVisionFrameLoop.ts +38 -0
- package/src/presets/liveVision/liveVisionSession.ts +75 -0
- package/src/presets/liveVision/liveVisionUpload.ts +62 -0
- package/src/presets/navigation/internalRouteRegistry.ts +25 -0
- package/src/presets/navigation/navigationBridge.ts +76 -0
- package/src/presets/navigation/navigationTypes.ts +12 -0
- package/src/presets/parseToolCall.ts +60 -0
- package/src/presets/presetClientAdapter.ts +29 -0
- package/src/presets/presetCompletion.ts +91 -0
- package/src/presets/presetEventHelpers.ts +45 -0
- package/src/presets/registry.ts +128 -0
- package/src/presets/streaming/mediaFrameUpload.ts +93 -0
- package/src/presets/types.ts +74 -0
- package/src/presets/upload/pickUploadFile.ts +256 -0
- package/src/presets/upload/uploadFormats.ts +163 -0
- package/src/presets/upload/uploadUtils.ts +68 -0
- package/src/react/PresetRenderer.tsx +144 -0
- package/src/react/index.ts +1 -0
- package/src/runtime/browserRuntime.ts +54 -0
- package/src/runtime/platform.ts +17 -0
- package/src/runtime/reactNativeRuntime.ts +68 -0
- package/src/runtime/resolveRuntimeConfig.ts +75 -0
- package/src/runtime/runtimeBundles.ts +74 -0
- package/src/runtime/types.ts +135 -0
- package/src/types/react-native-incall-manager.d.ts +17 -0
- package/src/types/react-native-webrtc.d.ts +47 -0
- package/src/types.ts +133 -0
- package/src/ui/VaniraWidget.ts +87 -0
- package/src/ui/abstraction/AbstractWidgetProvider.ts +18 -0
- package/src/ui/abstraction/interfaces.ts +12 -0
- package/src/ui/adapters/VaniraChatAdapter.ts +42 -0
- package/src/ui/components/AvatarView.ts +81 -0
- package/src/ui/components/ChatWindow.ts +263 -0
- package/src/ui/components/FloatingButton.ts +163 -0
- package/src/ui/components/FloatingWelcomeChips.ts +137 -0
- package/src/ui/components/Panel.ts +120 -0
- package/src/ui/components/VoiceOrb.ts +79 -0
- package/src/ui/components/VoiceOverlay.ts +497 -0
- package/src/ui/components/index.ts +7 -0
- package/src/ui/factory/WidgetFactory.ts +16 -0
- package/src/ui/icons_data.ts +2 -0
- package/src/ui/presets/WidgetPresetRenderer.ts +1802 -0
- package/src/ui/presets/types.ts +16 -0
- package/src/ui/providers/VaniraInternalProvider.ts +1066 -0
- package/src/ui/styles/index.ts +323 -0
- package/src/ui/styles/keyframes.ts +76 -0
- package/src/ui/styles/theme.ts +57 -0
- package/src/ui/styles/widget.css.ts +838 -0
- package/src/ui/utils.ts +37 -0
- package/src/ui/views/AbstractChatView.ts +93 -0
- package/src/ui/views/AbstractVoiceView.ts +57 -0
- package/src/ui/views/AvatarOnlyView.ts +78 -0
- package/src/ui/views/ChatAvatarView.ts +66 -0
- package/src/ui/views/ChatOnlyView.ts +28 -0
- package/src/ui/views/ChatVoiceView.ts +15 -0
- package/src/ui/views/VoiceOnlyView.ts +25 -0
- package/src/ui/views/index.ts +5 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { MALE_ICON_BASE64, FEMALE_ICON_BASE64 } from '../icons_data';
|
|
2
|
+
|
|
3
|
+
export const icons = {
|
|
4
|
+
phone: `
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
6
|
+
<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>
|
|
7
|
+
</svg>
|
|
8
|
+
`,
|
|
9
|
+
close: `
|
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
11
|
+
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
12
|
+
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
13
|
+
</svg>
|
|
14
|
+
`,
|
|
15
|
+
refresh: `
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
17
|
+
<path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>
|
|
18
|
+
<path d="M3 3v5h5"/>
|
|
19
|
+
<path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/>
|
|
20
|
+
<path d="M16 16h5v5"/>
|
|
21
|
+
</svg>
|
|
22
|
+
`,
|
|
23
|
+
mic: `
|
|
24
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
25
|
+
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"/>
|
|
26
|
+
<path d="M19 10v2a7 7 0 0 1-14 0v-2"/>
|
|
27
|
+
<line x1="12" y1="19" x2="12" y2="22"/>
|
|
28
|
+
</svg>
|
|
29
|
+
`,
|
|
30
|
+
micOff: `
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
32
|
+
<line x1="1" y1="1" x2="23" y2="23"/>
|
|
33
|
+
<path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"/>
|
|
34
|
+
<path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"/>
|
|
35
|
+
<line x1="12" y1="19" x2="12" y2="23"/>
|
|
36
|
+
</svg>
|
|
37
|
+
`,
|
|
38
|
+
waves: `
|
|
39
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
40
|
+
<path d="M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>
|
|
41
|
+
<path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>
|
|
42
|
+
<path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>
|
|
43
|
+
</svg>
|
|
44
|
+
`,
|
|
45
|
+
send: `
|
|
46
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
47
|
+
<line x1="22" y1="2" x2="11" y2="13"/>
|
|
48
|
+
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
|
|
49
|
+
</svg>
|
|
50
|
+
`,
|
|
51
|
+
chat: `
|
|
52
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
53
|
+
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
|
54
|
+
</svg>
|
|
55
|
+
`,
|
|
56
|
+
video: `
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
58
|
+
<polygon points="23 7 16 12 23 17 23 7"/>
|
|
59
|
+
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"/>
|
|
60
|
+
</svg>
|
|
61
|
+
`,
|
|
62
|
+
talkToAgent: `
|
|
63
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
64
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" opacity="0.3"/>
|
|
65
|
+
<path d="M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"/>
|
|
66
|
+
<circle cx="12" cy="12" r="2"/>
|
|
67
|
+
</svg>
|
|
68
|
+
`,
|
|
69
|
+
sparkles: `
|
|
70
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
71
|
+
<path d="M12 2l2.5 6.5L21 11l-6.5 2.5L12 20l-2.5-6.5L3 11l6.5-2.5L12 2z"/>
|
|
72
|
+
<path d="M18 2l1.5 3.5L23 7l-3.5 1.5L18 12l-1.5-3.5L13 7l3.5-1.5L18 2z" opacity="0.6"/>
|
|
73
|
+
<path d="M6 12l1.5 3.5L11 17l-3.5 1.5L6 22l-1.5-3.5L1 17l3.5-1.5L6 12z" opacity="0.6"/>
|
|
74
|
+
</svg>
|
|
75
|
+
`,
|
|
76
|
+
audioLines: `
|
|
77
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
78
|
+
<path d="M2 10v3"/>
|
|
79
|
+
<path d="M6 6v11"/>
|
|
80
|
+
<path d="M10 3v18"/>
|
|
81
|
+
<path d="M14 8v7"/>
|
|
82
|
+
<path d="M18 5v13"/>
|
|
83
|
+
<path d="M22 10v3"/>
|
|
84
|
+
</svg>
|
|
85
|
+
`,
|
|
86
|
+
maximize2: `
|
|
87
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
88
|
+
<polyline points="15 3 21 3 21 9"/>
|
|
89
|
+
<polyline points="9 21 3 21 3 15"/>
|
|
90
|
+
<line x1="21" y1="3" x2="14" y2="10"/>
|
|
91
|
+
<line x1="3" y1="21" x2="10" y2="14"/>
|
|
92
|
+
</svg>
|
|
93
|
+
`,
|
|
94
|
+
minimize2: `
|
|
95
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
96
|
+
<polyline points="4 14 10 14 10 20"/>
|
|
97
|
+
<polyline points="20 10 14 10 14 4"/>
|
|
98
|
+
<line x1="14" y1="10" x2="21" y2="3"/>
|
|
99
|
+
<line x1="3" y1="21" x2="10" y2="14"/>
|
|
100
|
+
</svg>
|
|
101
|
+
`,
|
|
102
|
+
user: `
|
|
103
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
104
|
+
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
|
105
|
+
<circle cx="12" cy="7" r="4"/>
|
|
106
|
+
</svg>
|
|
107
|
+
`,
|
|
108
|
+
keyboard: `
|
|
109
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
110
|
+
<rect x="2" y="4" width="20" height="16" rx="2" ry="2"/>
|
|
111
|
+
<line x1="6" y1="8" x2="6" y2="8"/>
|
|
112
|
+
<line x1="10" y1="8" x2="10" y2="8"/>
|
|
113
|
+
<line x1="14" y1="8" x2="14" y2="8"/>
|
|
114
|
+
<line x1="18" y1="8" x2="18" y2="8"/>
|
|
115
|
+
<line x1="6" y1="12" x2="6" y2="12"/>
|
|
116
|
+
<line x1="10" y1="12" x2="10" y2="12"/>
|
|
117
|
+
<line x1="14" y1="12" x2="14" y2="12"/>
|
|
118
|
+
<line x1="18" y1="12" x2="18" y2="12"/>
|
|
119
|
+
<line x1="7" y1="16" x2="17" y2="16"/>
|
|
120
|
+
</svg>
|
|
121
|
+
`,
|
|
122
|
+
voice_orb: `
|
|
123
|
+
<div style="display: flex; align-items: center; justify-content: center; gap: 3px; height: 100%; width: 100%;">
|
|
124
|
+
<div style="width: 3px; height: 10px; background: white; border-radius: 10px; animation: voice-bars-orb 1.2s infinite ease-in-out; animation-delay: 0s;"></div>
|
|
125
|
+
<div style="width: 3px; height: 18px; background: white; border-radius: 10px; animation: voice-bars-orb 1.2s infinite ease-in-out; animation-delay: 0.2s;"></div>
|
|
126
|
+
<div style="width: 3px; height: 14px; background: white; border-radius: 10px; animation: voice-bars-orb 1.2s infinite ease-in-out; animation-delay: 0.4s;"></div>
|
|
127
|
+
<div style="width: 3px; height: 22px; background: white; border-radius: 10px; animation: voice-bars-orb 1.2s infinite ease-in-out; animation-delay: 0.1s;"></div>
|
|
128
|
+
<div style="width: 3px; height: 12px; background: white; border-radius: 10px; animation: voice-bars-orb 1.2s infinite ease-in-out; animation-delay: 0.3s;"></div>
|
|
129
|
+
</div>
|
|
130
|
+
`
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const industryIcons: Record<string, string> = {
|
|
134
|
+
automotive: `
|
|
135
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
136
|
+
<path d="M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2"/>
|
|
137
|
+
<circle cx="7" cy="17" r="2"/>
|
|
138
|
+
<path d="M9 17h6"/>
|
|
139
|
+
<circle cx="17" cy="17" r="2"/>
|
|
140
|
+
</svg>
|
|
141
|
+
`,
|
|
142
|
+
education: `
|
|
143
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
144
|
+
<path d="M22 10v6M2 10l10-5 10 5-10 5z"/>
|
|
145
|
+
<path d="M6 12v5c3 3 9 3 12 0v-5"/>
|
|
146
|
+
</svg>
|
|
147
|
+
`,
|
|
148
|
+
finance: `
|
|
149
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
150
|
+
<line x1="3" y1="21" x2="21" y2="21"/>
|
|
151
|
+
<line x1="6" y1="21" x2="6" y2="12"/>
|
|
152
|
+
<line x1="18" y1="21" x2="18" y2="12"/>
|
|
153
|
+
<line x1="6" y1="12" x2="18" y2="12"/>
|
|
154
|
+
<path d="M5 6 L12 2 L19 6"/>
|
|
155
|
+
<line x1="6" y1="6" x2="6" y2="12"/>
|
|
156
|
+
<line x1="18" y1="6" x2="18" y2="12"/>
|
|
157
|
+
<line x1="10" y1="21" x2="10" y2="12"/>
|
|
158
|
+
<line x1="14" y1="21" x2="14" y2="12"/>
|
|
159
|
+
</svg>
|
|
160
|
+
`,
|
|
161
|
+
fitness: `
|
|
162
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
163
|
+
<path d="m6.5 6.5 11 11"/>
|
|
164
|
+
<path d="m21 21-1-1"/>
|
|
165
|
+
<path d="m3 3 1 1"/>
|
|
166
|
+
<path d="m18 22 4-4"/>
|
|
167
|
+
<path d="m2 6 4-4"/>
|
|
168
|
+
<path d="m3 10 7-7"/>
|
|
169
|
+
<path d="m14 21 7-7"/>
|
|
170
|
+
</svg>
|
|
171
|
+
`,
|
|
172
|
+
food: `
|
|
173
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
174
|
+
<path d="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2"/>
|
|
175
|
+
<path d="M7 2v20"/>
|
|
176
|
+
<path d="M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7"/>
|
|
177
|
+
</svg>
|
|
178
|
+
`,
|
|
179
|
+
government: `
|
|
180
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
181
|
+
<rect x="4" y="2" width="16" height="20" rx="2" ry="2"/>
|
|
182
|
+
<path d="M9 22v-4h6v4"/>
|
|
183
|
+
<path d="M8 6h.01"/>
|
|
184
|
+
<path d="M16 6h.01"/>
|
|
185
|
+
<path d="M12 6h.01"/>
|
|
186
|
+
<path d="M12 10h.01"/>
|
|
187
|
+
<path d="M12 14h.01"/>
|
|
188
|
+
<path d="M16 10h.01"/>
|
|
189
|
+
<path d="M16 14h.01"/>
|
|
190
|
+
<path d="M8 10h.01"/>
|
|
191
|
+
<path d="M8 14h.01"/>
|
|
192
|
+
</svg>
|
|
193
|
+
`,
|
|
194
|
+
healthcare: `
|
|
195
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
196
|
+
<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>
|
|
197
|
+
</svg>
|
|
198
|
+
`,
|
|
199
|
+
travel: `
|
|
200
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
201
|
+
<path d="M12 2a5 5 0 0 1 5 5c0 4.5-9 13-9 13S3 11.5 3 7a5 5 0 0 1 10 0Z"/>
|
|
202
|
+
<circle cx="12" cy="7" r="2"/>
|
|
203
|
+
</svg>
|
|
204
|
+
`,
|
|
205
|
+
legal: `
|
|
206
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
207
|
+
<path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1z"/>
|
|
208
|
+
<path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1z"/>
|
|
209
|
+
<path d="M7 21h10"/>
|
|
210
|
+
<path d="M12 3v18"/>
|
|
211
|
+
<path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"/>
|
|
212
|
+
</svg>
|
|
213
|
+
`,
|
|
214
|
+
manufacturing: `
|
|
215
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
216
|
+
<path d="M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"/>
|
|
217
|
+
<path d="M17 18h1"/>
|
|
218
|
+
<path d="M12 18h1"/>
|
|
219
|
+
<path d="M7 18h1"/>
|
|
220
|
+
</svg>
|
|
221
|
+
`,
|
|
222
|
+
media: `
|
|
223
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
224
|
+
<rect width="20" height="20" x="2" y="2" rx="2.18" ry="2.18"/>
|
|
225
|
+
<line x1="7" x2="7" y1="2" y2="22"/>
|
|
226
|
+
<line x1="17" x2="17" y1="2" y2="22"/>
|
|
227
|
+
<line x1="2" x2="22" y1="12" y2="12"/>
|
|
228
|
+
<line x1="2" x2="7" y1="7" y2="7"/>
|
|
229
|
+
<line x1="2" x2="7" y1="17" y2="17"/>
|
|
230
|
+
<line x1="17" x2="22" y1="17" y2="17"/>
|
|
231
|
+
<line x1="17" x2="22" y1="7" y2="7"/>
|
|
232
|
+
</svg>
|
|
233
|
+
`,
|
|
234
|
+
nonprofit: `
|
|
235
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
236
|
+
<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>
|
|
237
|
+
</svg>
|
|
238
|
+
`,
|
|
239
|
+
professional: `
|
|
240
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
241
|
+
<rect width="20" height="14" x="2" y="7" rx="2" ry="2"/>
|
|
242
|
+
<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>
|
|
243
|
+
</svg>
|
|
244
|
+
`,
|
|
245
|
+
realestate: `
|
|
246
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
247
|
+
<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
|
|
248
|
+
<polyline points="9 22 9 12 15 12 15 22"/>
|
|
249
|
+
</svg>
|
|
250
|
+
`,
|
|
251
|
+
retail: `
|
|
252
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
253
|
+
<path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"/>
|
|
254
|
+
<path d="M3 6h18"/>
|
|
255
|
+
<path d="M16 10a4 4 0 0 1-8 0"/>
|
|
256
|
+
</svg>
|
|
257
|
+
`,
|
|
258
|
+
technology: `
|
|
259
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
260
|
+
<rect width="18" height="12" x="3" y="4" rx="2" ry="2"/>
|
|
261
|
+
<line x1="2" x2="22" y1="20" y2="20"/>
|
|
262
|
+
</svg>
|
|
263
|
+
`
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export const widgetIcons: Record<string, string> = {
|
|
267
|
+
...industryIcons,
|
|
268
|
+
default_chat: icons.chat,
|
|
269
|
+
default_voice: icons.mic,
|
|
270
|
+
voice_orb: icons.voice_orb,
|
|
271
|
+
male: `<img src="${MALE_ICON_BASE64}" style="width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;" />`,
|
|
272
|
+
female: `<img src="${FEMALE_ICON_BASE64}" style="width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;" />`,
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
Object.entries(industryIcons).forEach(([name, svg]) => {
|
|
276
|
+
widgetIcons[`male_${name} `] = `
|
|
277
|
+
< div style = "position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: white; border-radius: 50%;" >
|
|
278
|
+
<div style="width: 60%; height: 60%; color: #000000;" >
|
|
279
|
+
${svg}
|
|
280
|
+
</div>
|
|
281
|
+
< div style = "
|
|
282
|
+
position: absolute;
|
|
283
|
+
bottom: -2px;
|
|
284
|
+
right: -2px;
|
|
285
|
+
width: 28px;
|
|
286
|
+
height: 28px;
|
|
287
|
+
background: white;
|
|
288
|
+
border - radius: 50 %;
|
|
289
|
+
border: 2px solid white;
|
|
290
|
+
box - shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
">
|
|
293
|
+
< img src = "${MALE_ICON_BASE64}" style = "width: 100%; height: 100%; object-fit: cover;" />
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
`;
|
|
297
|
+
|
|
298
|
+
widgetIcons[`female_${name} `] = `
|
|
299
|
+
< div style = "position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: white; border-radius: 50%;" >
|
|
300
|
+
<div style="width: 60%; height: 60%; color: #000000;" >
|
|
301
|
+
${svg}
|
|
302
|
+
</div>
|
|
303
|
+
< div style = "
|
|
304
|
+
position: absolute;
|
|
305
|
+
bottom: -2px;
|
|
306
|
+
right: -2px;
|
|
307
|
+
width: 28px;
|
|
308
|
+
height: 28px;
|
|
309
|
+
background: white;
|
|
310
|
+
border - radius: 50 %;
|
|
311
|
+
border: 2px solid white;
|
|
312
|
+
box - shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
313
|
+
overflow: hidden;
|
|
314
|
+
">
|
|
315
|
+
< img src = "${FEMALE_ICON_BASE64}" style = "width: 100%; height: 100%; object-fit: cover;" />
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
`;
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
export * from './theme';
|
|
322
|
+
export * from './widget.css';
|
|
323
|
+
export * from './keyframes';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
export const keyframes = `
|
|
3
|
+
@keyframes fadeInScale {
|
|
4
|
+
from { opacity: 0; transform: scale(0.8); }
|
|
5
|
+
to { opacity: 1; transform: scale(1); }
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@keyframes pulse {
|
|
9
|
+
0%, 100% { opacity: 1; }
|
|
10
|
+
50% { opacity: 0.5; }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes wave {
|
|
14
|
+
0%, 100% { transform: translateY(0); }
|
|
15
|
+
50% { transform: translateY(-4px); }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes wave-rotate-1 {
|
|
19
|
+
0% { transform: rotate(0deg) scale(1); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
|
|
20
|
+
25% { transform: rotate(90deg) scale(1.02); border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
|
|
21
|
+
50% { transform: rotate(180deg) scale(1); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
|
|
22
|
+
75% { transform: rotate(270deg) scale(0.98); border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%; }
|
|
23
|
+
100% { transform: rotate(360deg) scale(1); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes wave-rotate-2 {
|
|
27
|
+
0% { transform: rotate(60deg) scale(1.02); border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%; }
|
|
28
|
+
33% { transform: rotate(180deg) scale(0.98); border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%; }
|
|
29
|
+
66% { transform: rotate(300deg) scale(1.02); border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
|
|
30
|
+
100% { transform: rotate(420deg) scale(1.02); border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes wave-rotate-3 {
|
|
34
|
+
0% { transform: rotate(120deg) scale(1); border-radius: 50% 50% 50% 50%; }
|
|
35
|
+
50% { transform: rotate(300deg) scale(1.05); border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%; }
|
|
36
|
+
100% { transform: rotate(480deg) scale(1); border-radius: 50% 50% 50% 50%; }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@keyframes clickBounce {
|
|
40
|
+
0% { transform: scale(1); }
|
|
41
|
+
25% { transform: scale(0.9) rotate(-5deg); }
|
|
42
|
+
50% { transform: scale(1.15) rotate(5deg); }
|
|
43
|
+
75% { transform: scale(0.95) rotate(-2deg); }
|
|
44
|
+
100% { transform: scale(1) rotate(0deg); }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes pulseGlow {
|
|
48
|
+
0%, 100% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4); }
|
|
49
|
+
50% { box-shadow: 0 4px 24px rgba(239, 68, 68, 0.6), 0 0 32px rgba(239, 68, 68, 0.3); }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes typingBounce {
|
|
53
|
+
0%, 80%, 100% { transform: translateY(0); }
|
|
54
|
+
40% { transform: translateY(-6px); }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes floatOrb {
|
|
58
|
+
0%, 100% { transform: translateY(0); }
|
|
59
|
+
50% { transform: translateY(-10px); }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes pulseGlowIdle {
|
|
63
|
+
0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
|
|
64
|
+
50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.2; }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes spin {
|
|
68
|
+
from { transform: rotate(0deg); }
|
|
69
|
+
to { transform: rotate(360deg); }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@keyframes voice-bars-orb {
|
|
73
|
+
0%, 100% { transform: scaleY(1); opacity: 0.7; }
|
|
74
|
+
50% { transform: scaleY(1.8); opacity: 1; }
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const theme = {
|
|
2
|
+
colors: {
|
|
3
|
+
primary: 'var(--primary, #000000)',
|
|
4
|
+
primaryHover: 'var(--primary-hover, #111111)',
|
|
5
|
+
secondary: 'var(--secondary, #111111)',
|
|
6
|
+
bg: 'var(--bg, #ffffff)',
|
|
7
|
+
text: 'var(--text, #1f2937)',
|
|
8
|
+
textMuted: 'var(--text-muted, #6b7280)',
|
|
9
|
+
border: 'var(--border, #e5e7eb)',
|
|
10
|
+
danger: '#ef4444',
|
|
11
|
+
success: '#10b981',
|
|
12
|
+
white: '#ffffff',
|
|
13
|
+
},
|
|
14
|
+
shadows: {
|
|
15
|
+
base: 'var(--shadow, 0 10px 40px rgba(0, 0, 0, 0.1))',
|
|
16
|
+
lg: 'var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.15))',
|
|
17
|
+
},
|
|
18
|
+
transitions: {
|
|
19
|
+
base: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
20
|
+
smooth: 'all 0.5s ease',
|
|
21
|
+
},
|
|
22
|
+
fonts: {
|
|
23
|
+
base: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const hexToRgb = (hex: string) => {
|
|
28
|
+
// Remove the hash if it's there
|
|
29
|
+
hex = hex.replace(/^#/, '');
|
|
30
|
+
|
|
31
|
+
// Parse the hex values
|
|
32
|
+
let r, g, b;
|
|
33
|
+
if (hex.length === 3) {
|
|
34
|
+
r = parseInt(hex.charAt(0) + hex.charAt(0), 16);
|
|
35
|
+
g = parseInt(hex.charAt(1) + hex.charAt(1), 16);
|
|
36
|
+
b = parseInt(hex.charAt(2) + hex.charAt(2), 16);
|
|
37
|
+
} else {
|
|
38
|
+
r = parseInt(hex.substring(0, 2), 16);
|
|
39
|
+
g = parseInt(hex.substring(2, 4), 16);
|
|
40
|
+
b = parseInt(hex.substring(4, 6), 16);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return isNaN(r) || isNaN(g) || isNaN(b) ? '0, 0, 0' : `${r}, ${g}, ${b}`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const generateThemeVars = (primary: string, secondary: string | null) => {
|
|
47
|
+
const primaryRgb = hexToRgb(primary);
|
|
48
|
+
const secondaryRgb = hexToRgb(secondary || primary);
|
|
49
|
+
|
|
50
|
+
return `
|
|
51
|
+
--primary: ${primary};
|
|
52
|
+
--primary-rgb: ${primaryRgb};
|
|
53
|
+
--primary-hover: ${secondary || primary};
|
|
54
|
+
--secondary: ${secondary || primary};
|
|
55
|
+
--secondary-rgb: ${secondaryRgb};
|
|
56
|
+
`;
|
|
57
|
+
};
|