@teamvortexsoftware/vortex-react-native 0.0.13 → 1.0.1

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.
Files changed (228) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1227 -11
  3. package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
  4. package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
  5. package/dist/VortexClient.js +192 -0
  6. package/dist/VortexClient.js.map +1 -0
  7. package/dist/VortexDeferredLinks.js +127 -0
  8. package/dist/VortexDeferredLinks.js.map +1 -0
  9. package/dist/clientInfo.js +45 -0
  10. package/dist/clientInfo.js.map +1 -0
  11. package/dist/components/ContactsPickerModal.js +182 -0
  12. package/dist/components/ContactsPickerModal.js.map +1 -0
  13. package/dist/components/InviteFormCore.js +2141 -0
  14. package/dist/components/InviteFormCore.js.map +1 -0
  15. package/dist/components/InviteFormMobile.js +463 -0
  16. package/dist/components/InviteFormMobile.js.map +1 -0
  17. package/dist/components/InviteFormWeb.js +295 -0
  18. package/dist/components/InviteFormWeb.js.map +1 -0
  19. package/dist/components/PlacedItemToolbar.js +147 -0
  20. package/dist/components/PlacedItemToolbar.js.map +1 -0
  21. package/dist/components/ShareButtons.js +1 -0
  22. package/dist/components/ShareButtons.js.map +1 -0
  23. package/dist/components/VrtxContactsImport.js +234 -0
  24. package/dist/components/VrtxContactsImport.js.map +1 -0
  25. package/dist/components/VrtxEmailInvitations.js +341 -0
  26. package/dist/components/VrtxEmailInvitations.js.map +1 -0
  27. package/dist/components/VrtxFindFriends.js +400 -0
  28. package/dist/components/VrtxFindFriends.js.map +1 -0
  29. package/dist/components/VrtxHeading.js +58 -0
  30. package/dist/components/VrtxHeading.js.map +1 -0
  31. package/dist/components/VrtxIncomingInvitations.js +657 -0
  32. package/dist/components/VrtxIncomingInvitations.js.map +1 -0
  33. package/dist/components/VrtxInvitationSuggestions.js +506 -0
  34. package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
  35. package/dist/components/VrtxInviteContacts.js +512 -0
  36. package/dist/components/VrtxInviteContacts.js.map +1 -0
  37. package/dist/components/VrtxOutgoingInvitations.js +572 -0
  38. package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
  39. package/dist/components/VrtxSearchBox.js +487 -0
  40. package/dist/components/VrtxSearchBox.js.map +1 -0
  41. package/dist/components/VrtxSelect.js +27 -0
  42. package/dist/components/VrtxSelect.js.map +1 -0
  43. package/dist/components/VrtxShareOptions.js +435 -0
  44. package/dist/components/VrtxShareOptions.js.map +1 -0
  45. package/dist/components/VrtxSubmit.js +132 -0
  46. package/dist/components/VrtxSubmit.js.map +1 -0
  47. package/dist/components/VrtxText.js +146 -0
  48. package/dist/components/VrtxText.js.map +1 -0
  49. package/dist/constants/mockData.d.mts +7 -0
  50. package/dist/constants/mockData.d.ts +7 -0
  51. package/dist/constants/mockData.js +48 -0
  52. package/dist/constants/mockData.js.map +1 -0
  53. package/dist/constants/mockData.mjs +22 -0
  54. package/dist/constants/mockData.mjs.map +1 -0
  55. package/dist/context/VortexModulesContext.js +135 -0
  56. package/dist/context/VortexModulesContext.js.map +1 -0
  57. package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
  58. package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
  59. package/dist/hooks/useInvitationFormLogic.js +300 -0
  60. package/dist/hooks/useInvitationFormLogic.js.map +1 -0
  61. package/dist/hooks/useInvitationFormLogic.mjs +276 -0
  62. package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
  63. package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
  64. package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
  65. package/dist/hooks/useThemeStyles.js +2 -0
  66. package/dist/hooks/useThemeStyles.js.map +1 -0
  67. package/dist/hooks/useVortexInvite.js +467 -56
  68. package/dist/hooks/useVortexInvite.js.map +1 -0
  69. package/dist/index-web.d.mts +93 -0
  70. package/dist/index-web.d.ts +93 -0
  71. package/dist/index-web.js +7397 -0
  72. package/dist/index-web.js.map +1 -0
  73. package/dist/index-web.mjs +7445 -0
  74. package/dist/index-web.mjs.map +1 -0
  75. package/dist/index.d.mts +656 -0
  76. package/dist/index.d.ts +656 -0
  77. package/dist/index.js +10205 -4
  78. package/dist/index.js.map +1 -0
  79. package/dist/index.mjs +10244 -0
  80. package/dist/index.mjs.map +1 -0
  81. package/dist/types/VortexClient.d.ts +106 -0
  82. package/dist/types/VortexClient.d.ts.map +1 -0
  83. package/dist/types/VortexDeferredLinks.d.ts +73 -0
  84. package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
  85. package/dist/types/clientInfo.d.ts +5 -0
  86. package/dist/types/clientInfo.d.ts.map +1 -0
  87. package/dist/types/components/ContactsPickerModal.d.ts +18 -0
  88. package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
  89. package/dist/types/components/InviteFormCore.d.ts +166 -0
  90. package/dist/types/components/InviteFormCore.d.ts.map +1 -0
  91. package/dist/types/components/InviteFormMobile.d.ts +42 -0
  92. package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
  93. package/dist/types/components/InviteFormWeb.d.ts +87 -0
  94. package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
  95. package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
  96. package/dist/types/components/PlacedItemToolbar.d.ts.map +1 -0
  97. package/dist/types/components/VrtxContactsImport.d.ts +14 -0
  98. package/dist/types/components/VrtxContactsImport.d.ts.map +1 -0
  99. package/dist/types/components/VrtxEmailInvitations.d.ts +31 -0
  100. package/dist/types/components/VrtxEmailInvitations.d.ts.map +1 -0
  101. package/dist/types/components/VrtxFindFriends.d.ts +25 -0
  102. package/dist/types/components/VrtxFindFriends.d.ts.map +1 -0
  103. package/dist/types/components/VrtxHeading.d.ts +6 -0
  104. package/dist/types/components/VrtxHeading.d.ts.map +1 -0
  105. package/dist/types/components/VrtxIncomingInvitations.d.ts +27 -0
  106. package/dist/types/components/VrtxIncomingInvitations.d.ts.map +1 -0
  107. package/dist/types/components/VrtxInvitationSuggestions.d.ts +25 -0
  108. package/dist/types/components/VrtxInvitationSuggestions.d.ts.map +1 -0
  109. package/dist/types/components/VrtxInviteContacts.d.ts +24 -0
  110. package/dist/types/components/VrtxInviteContacts.d.ts.map +1 -0
  111. package/dist/types/components/VrtxOutgoingInvitations.d.ts +27 -0
  112. package/dist/types/components/VrtxOutgoingInvitations.d.ts.map +1 -0
  113. package/dist/types/components/VrtxSearchBox.d.ts +28 -0
  114. package/dist/types/components/VrtxSearchBox.d.ts.map +1 -0
  115. package/dist/types/components/VrtxSelect.d.ts +6 -0
  116. package/dist/types/components/VrtxSelect.d.ts.map +1 -0
  117. package/dist/types/components/VrtxShareOptions.d.ts +41 -0
  118. package/dist/types/components/VrtxShareOptions.d.ts.map +1 -0
  119. package/dist/types/components/VrtxSubmit.d.ts +18 -0
  120. package/dist/types/components/VrtxSubmit.d.ts.map +1 -0
  121. package/dist/types/components/VrtxText.d.ts +8 -0
  122. package/dist/types/components/VrtxText.d.ts.map +1 -0
  123. package/dist/types/constants/mockData.d.ts +4 -0
  124. package/dist/types/constants/mockData.d.ts.map +1 -0
  125. package/dist/types/context/VortexModulesContext.d.ts +238 -0
  126. package/dist/types/context/VortexModulesContext.d.ts.map +1 -0
  127. package/dist/types/findFriends.js +10 -0
  128. package/dist/types/findFriends.js.map +1 -0
  129. package/dist/types/hooks/useInvitationFormLogic.d.ts +55 -0
  130. package/dist/types/hooks/useInvitationFormLogic.d.ts.map +1 -0
  131. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts +39 -0
  132. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts.map +1 -0
  133. package/dist/types/hooks/useThemeStyles.d.ts +1 -0
  134. package/dist/types/hooks/useThemeStyles.d.ts.map +1 -1
  135. package/dist/types/hooks/useVortexInvite.d.ts +48 -6
  136. package/dist/types/hooks/useVortexInvite.d.ts.map +1 -1
  137. package/dist/types/index-web.d.ts +23 -0
  138. package/dist/types/index-web.d.ts.map +1 -0
  139. package/dist/types/index.d.ts +21 -0
  140. package/dist/types/index.d.ts.map +1 -1
  141. package/dist/types/invitations.js +13 -0
  142. package/dist/types/invitations.js.map +1 -0
  143. package/dist/types/inviteContacts.js +14 -0
  144. package/dist/types/inviteContacts.js.map +1 -0
  145. package/dist/{shared/InvitationResult.js → types/platformOperations.js} +1 -0
  146. package/dist/types/platformOperations.js.map +1 -0
  147. package/dist/types/searchBox.js +11 -0
  148. package/dist/types/searchBox.js.map +1 -0
  149. package/dist/types/types/findFriends.d.ts +101 -0
  150. package/dist/types/types/findFriends.d.ts.map +1 -0
  151. package/dist/types/types/invitations.d.ts +301 -0
  152. package/dist/types/types/invitations.d.ts.map +1 -0
  153. package/dist/types/types/inviteContacts.d.ts +86 -0
  154. package/dist/types/types/inviteContacts.d.ts.map +1 -0
  155. package/dist/types/types/platformOperations.d.ts +185 -0
  156. package/dist/types/types/platformOperations.d.ts.map +1 -0
  157. package/dist/types/types/searchBox.d.ts +69 -0
  158. package/dist/types/types/searchBox.d.ts.map +1 -0
  159. package/dist/types/types/unfurlConfig.d.ts +34 -0
  160. package/dist/types/types/unfurlConfig.d.ts.map +1 -0
  161. package/dist/types/unfurlConfig.js +21 -0
  162. package/dist/types/unfurlConfig.js.map +1 -0
  163. package/dist/types/utils/analytics.d.ts +54 -0
  164. package/dist/types/utils/analytics.d.ts.map +1 -0
  165. package/dist/types/utils/configCache.d.ts +34 -0
  166. package/dist/types/utils/configCache.d.ts.map +1 -0
  167. package/dist/types/utils/contactUtils.d.ts +9 -0
  168. package/dist/types/utils/contactUtils.d.ts.map +1 -0
  169. package/dist/types/utils/featureWarnings.d.ts +56 -0
  170. package/dist/types/utils/featureWarnings.d.ts.map +1 -0
  171. package/dist/types/utils/formUtils.d.ts +11 -3
  172. package/dist/types/utils/formUtils.d.ts.map +1 -1
  173. package/dist/types/utils/gradientUtils.d.ts +67 -0
  174. package/dist/types/utils/gradientUtils.d.ts.map +1 -0
  175. package/dist/types/utils/invitationEvents.d.ts +21 -0
  176. package/dist/types/utils/invitationEvents.d.ts.map +1 -0
  177. package/dist/types/utils/moduleLoaders.d.ts +115 -0
  178. package/dist/types/utils/moduleLoaders.d.ts.map +1 -0
  179. package/dist/types/utils/moduleLoaders.web.d.ts +73 -0
  180. package/dist/types/utils/moduleLoaders.web.d.ts.map +1 -0
  181. package/dist/types/utils/nameUtils.d.ts +15 -0
  182. package/dist/types/utils/nameUtils.d.ts.map +1 -0
  183. package/dist/types/utils/themeUtils.d.ts +3 -1
  184. package/dist/types/utils/themeUtils.d.ts.map +1 -1
  185. package/dist/types/vortexInvite.d.ts +145 -5
  186. package/dist/types/vortexInvite.d.ts.map +1 -1
  187. package/dist/useInvitationFormLogic-Ct73M19B.d.mts +242 -0
  188. package/dist/useInvitationFormLogic-Ct73M19B.d.ts +242 -0
  189. package/dist/utils/analytics.js +92 -0
  190. package/dist/utils/analytics.js.map +1 -0
  191. package/dist/utils/configCache.js +68 -0
  192. package/dist/utils/configCache.js.map +1 -0
  193. package/dist/utils/contactUtils.d.mts +12 -0
  194. package/dist/utils/contactUtils.d.ts +12 -0
  195. package/dist/utils/contactUtils.js +37 -0
  196. package/dist/utils/contactUtils.js.map +1 -0
  197. package/dist/utils/contactUtils.mjs +12 -0
  198. package/dist/utils/contactUtils.mjs.map +1 -0
  199. package/dist/utils/featureWarnings.js +214 -0
  200. package/dist/utils/featureWarnings.js.map +1 -0
  201. package/dist/utils/formUtils.js +161 -51
  202. package/dist/utils/formUtils.js.map +1 -0
  203. package/dist/utils/gradientUtils.js +120 -0
  204. package/dist/utils/gradientUtils.js.map +1 -0
  205. package/dist/utils/invitationEvents.js +45 -0
  206. package/dist/utils/invitationEvents.js.map +1 -0
  207. package/dist/utils/moduleLoaders.js +275 -0
  208. package/dist/utils/moduleLoaders.js.map +1 -0
  209. package/dist/utils/moduleLoaders.web.js +72 -0
  210. package/dist/utils/moduleLoaders.web.js.map +1 -0
  211. package/dist/utils/nameUtils.js +51 -0
  212. package/dist/utils/nameUtils.js.map +1 -0
  213. package/dist/utils/themeUtils.js +117 -32
  214. package/dist/utils/themeUtils.js.map +1 -0
  215. package/dist/vortexInvite.js +78 -167
  216. package/dist/vortexInvite.js.map +1 -0
  217. package/package.json +69 -31
  218. package/dist/components/Clipboard.js +0 -64
  219. package/dist/shared/api.js +0 -90
  220. package/dist/tests/TestVortexInvite.js +0 -134
  221. package/dist/types/components/Clipboard.d.ts +0 -16
  222. package/dist/types/components/Clipboard.d.ts.map +0 -1
  223. package/dist/types/shared/InvitationResult.d.ts +0 -24
  224. package/dist/types/shared/InvitationResult.d.ts.map +0 -1
  225. package/dist/types/shared/api.d.ts +0 -14
  226. package/dist/types/shared/api.d.ts.map +0 -1
  227. package/dist/types/tests/TestVortexInvite.d.ts +0 -4
  228. package/dist/types/tests/TestVortexInvite.d.ts.map +0 -1
@@ -0,0 +1,721 @@
1
+ import react__default, { ReactNode } from 'react';
2
+ import { P as PlatformOperations } from './useInvitationFormLogic-Ct73M19B.mjs';
3
+
4
+ /**
5
+ * Types for the Find Friends feature.
6
+ *
7
+ * The Find Friends component displays a list of contacts provided by the customer.
8
+ * Each contact has a user ID that identifies them in the customer's platform.
9
+ * When the user taps "Connect", an invitation is created via the Vortex backend.
10
+ */
11
+ /**
12
+ * A contact in the Find Friends list.
13
+ * Provided by the customer via findFriendsConfig.contacts.
14
+ */
15
+ interface FindFriendsContact {
16
+ /** The user ID that identifies this contact in the customer's platform */
17
+ userId: string;
18
+ /** Display name of the contact */
19
+ name: string;
20
+ /** Optional subtitle (e.g., username, email, or app-specific info) */
21
+ subtitle?: string;
22
+ /** Avatar/profile image URL (optional) */
23
+ avatarUrl?: string;
24
+ /** Optional metadata for app-specific data */
25
+ metadata?: Record<string, unknown>;
26
+ }
27
+ /**
28
+ * Configuration for the Find Friends feature.
29
+ * Passed to VortexInvite to enable and configure the Find Friends component.
30
+ */
31
+ interface FindFriendsConfig {
32
+ /**
33
+ * List of contacts to display.
34
+ * Each contact must have a userId that identifies them in the customer's platform.
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * <VortexInvite
39
+ * findFriendsConfig={{
40
+ * contacts: [
41
+ * { userId: 'user-123', name: 'John Doe', subtitle: '@johndoe' },
42
+ * { userId: 'user-456', name: 'Jane Smith', avatarUrl: 'https://...' },
43
+ * ],
44
+ * onConnect: async (contact) => {
45
+ * // Return true to create the invitation via Vortex backend
46
+ * return true;
47
+ * },
48
+ * }}
49
+ * />
50
+ * ```
51
+ */
52
+ contacts: FindFriendsContact[];
53
+ /**
54
+ * Called when user taps "Connect" on a contact.
55
+ * The customer implements this callback to perform any pre-connection logic.
56
+ *
57
+ * If the callback returns true, the SDK will create an invitation via the
58
+ * Vortex backend.
59
+ *
60
+ * If the callback returns false, no invitation is created.
61
+ *
62
+ * @param contact - The contact that was tapped
63
+ * @returns Promise resolving to true if the invitation should be created, false otherwise
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * onConnect: async (contact) => {
68
+ * // Perform any pre-connection validation
69
+ * const canConnect = await myApi.checkCanConnect(contact.userId);
70
+ * if (!canConnect) {
71
+ * showError('Cannot connect to this user');
72
+ * return false;
73
+ * }
74
+ * return true; // SDK will create the invitation
75
+ * }
76
+ * ```
77
+ */
78
+ onConnect: (contact: FindFriendsContact) => Promise<boolean> | boolean;
79
+ /**
80
+ * Optional: Called after an invitation is successfully created.
81
+ * Use this to update your UI or local state.
82
+ *
83
+ * @param contact - The contact for whom the invitation was created
84
+ */
85
+ onInvitationCreated?: (contact: FindFriendsContact) => void;
86
+ /**
87
+ * Optional: Called if creating the invitation fails.
88
+ *
89
+ * @param contact - The contact for whom the invitation failed
90
+ * @param error - The error that occurred
91
+ */
92
+ onInvitationError?: (contact: FindFriendsContact, error: Error) => void;
93
+ /**
94
+ * Optional: Custom text for the "Connect" button.
95
+ * @default "Connect"
96
+ */
97
+ connectButtonText?: string;
98
+ /**
99
+ * Optional: Custom empty state message when no contacts are provided.
100
+ * @default "No contacts found"
101
+ */
102
+ emptyStateMessage?: string;
103
+ }
104
+
105
+ /**
106
+ * Types for the Incoming, Outgoing, and Invitation Suggestions features.
107
+ *
108
+ * These components display lists of invitations:
109
+ * - VrtxIncomingInvitations: Invitations the user has received (with Accept/Delete actions)
110
+ * - VrtxOutgoingInvitations: Invitations the user has sent (with Cancel action)
111
+ * - VrtxInvitationSuggestions: "People you may know" suggestions (with Invite/Dismiss actions)
112
+ *
113
+ * The invitation data is provided directly via props by the host application.
114
+ */
115
+ /**
116
+ * Represents a generic invitation/suggestion item.
117
+ * Used by VrtxInvitationSuggestions component.
118
+ */
119
+ interface InvitationItem {
120
+ /** Unique identifier for the invitation */
121
+ id: string;
122
+ /** Display name of the person */
123
+ name: string;
124
+ /** The user ID in the customer's platform */
125
+ userId?: string;
126
+ /** Optional subtitle (e.g., username, mutual friends count) */
127
+ subtitle?: string;
128
+ /** Avatar/profile image URL (optional) */
129
+ avatarUrl?: string;
130
+ /** Whether this invitation came from the Vortex backend */
131
+ isVortexInvitation?: boolean;
132
+ /** Optional metadata for app-specific data */
133
+ metadata?: Record<string, unknown>;
134
+ }
135
+ /**
136
+ * Represents an incoming invitation item.
137
+ * Used by VrtxIncomingInvitations component.
138
+ */
139
+ interface IncomingInvitationItem {
140
+ /** Unique identifier for the invitation */
141
+ id: string;
142
+ /** Display name of the sender */
143
+ name: string;
144
+ /**
145
+ * The user ID, used for deduplication (maps to creatorId from the Vortex API).
146
+ * When both API and internal invitations share the same `userId`, the API one is kept.
147
+ */
148
+ userId?: string;
149
+ /** Avatar/profile image URL (optional) */
150
+ avatarUrl?: string;
151
+ /**
152
+ * Whether this invitation came from the Vortex backend.
153
+ * When true, the SDK will call the Vortex API for accept/delete operations.
154
+ * When false, the SDK relies entirely on the app's callbacks.
155
+ * @default false for invitations provided via config
156
+ */
157
+ isVortexInvitation?: boolean;
158
+ /** Optional metadata for app-specific data */
159
+ metadata?: Record<string, unknown>;
160
+ }
161
+ /**
162
+ * Represents an outgoing invitation item.
163
+ * Used by VrtxOutgoingInvitations component.
164
+ */
165
+ interface OutgoingInvitationItem {
166
+ /** Unique identifier for the invitation */
167
+ id: string;
168
+ /** Display name of the invitee */
169
+ name: string;
170
+ /**
171
+ * The user ID, used for deduplication (maps to targetValue from the Vortex API).
172
+ * When both API and internal invitations share the same `userId`, the API one is kept.
173
+ */
174
+ userId?: string;
175
+ /** Avatar/profile image URL (optional) */
176
+ avatarUrl?: string;
177
+ /**
178
+ * Whether this invitation came from the Vortex backend.
179
+ * When true, the SDK will call the Vortex API for cancel operations.
180
+ * When false, the SDK relies entirely on the app's callbacks.
181
+ * @default false for invitations provided via config
182
+ */
183
+ isVortexInvitation?: boolean;
184
+ /** Optional metadata for app-specific data */
185
+ metadata?: Record<string, unknown>;
186
+ }
187
+ /**
188
+ * Configuration for VrtxIncomingInvitations component.
189
+ * Displays invitations the user has received with Accept and Delete actions.
190
+ */
191
+ interface IncomingInvitationsConfig {
192
+ /**
193
+ * List of incoming invitations to display.
194
+ * Provided by the host application.
195
+ */
196
+ invitations: IncomingInvitationItem[];
197
+ /**
198
+ * Called when user confirms "Accept" on an invitation.
199
+ * A confirmation dialog is shown before this callback is invoked.
200
+ *
201
+ * For non-Vortex invitations (isVortexInvitation=false), return true to remove
202
+ * the invitation from the list, or false to keep it displayed.
203
+ *
204
+ * For Vortex invitations, the return value is also respected - return false
205
+ * to prevent the API call and keep the invitation in the list.
206
+ *
207
+ * @param invitation - The invitation that was accepted
208
+ * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>
209
+ *
210
+ * @example
211
+ * ```typescript
212
+ * onAccept: async (invitation) => {
213
+ * const success = await api.acceptInvitation(invitation.id);
214
+ * return success; // Return true to remove from list
215
+ * }
216
+ * ```
217
+ */
218
+ onAccept: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;
219
+ /**
220
+ * Called when user confirms "Delete" on an invitation.
221
+ * A confirmation dialog is shown before this callback is invoked.
222
+ *
223
+ * For non-Vortex invitations (isVortexInvitation=false), return true to remove
224
+ * the invitation from the list, or false to keep it displayed.
225
+ *
226
+ * For Vortex invitations, the return value is also respected - return false
227
+ * to prevent the API call and keep the invitation in the list.
228
+ *
229
+ * @param invitation - The invitation that was deleted/declined
230
+ * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * onDelete: async (invitation) => {
235
+ * const success = await api.declineInvitation(invitation.id);
236
+ * return success; // Return true to remove from list
237
+ * }
238
+ * ```
239
+ */
240
+ onDelete: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;
241
+ /**
242
+ * Optional callback to compute a custom subtitle for each invitation.
243
+ *
244
+ * When provided, the SDK calls this function for each invitation to determine the
245
+ * displayed subtitle. Useful when the subtitle should be derived from the invitation's
246
+ * metadata (e.g., `invitation.metadata?.inviter_handle`).
247
+ *
248
+ * If not provided, no subtitle is rendered.
249
+ */
250
+ getSubtitle?: (invitation: IncomingInvitationItem) => string | undefined;
251
+ /**
252
+ * Optional: Custom text for the Accept button.
253
+ * @default "Accept"
254
+ */
255
+ acceptButtonText?: string;
256
+ /**
257
+ * Optional: Custom text for the Delete button.
258
+ * @default "Delete"
259
+ */
260
+ deleteButtonText?: string;
261
+ /**
262
+ * Optional: Custom empty state message when no invitations are present.
263
+ * @default "No incoming invitations"
264
+ */
265
+ emptyStateMessage?: string;
266
+ /**
267
+ * Optional: Custom title for the Accept confirmation dialog.
268
+ * @default "Accept Invitation"
269
+ */
270
+ acceptConfirmTitle?: string;
271
+ /**
272
+ * Optional: Custom message for the Accept confirmation dialog.
273
+ * Use {name} as a placeholder for the person's name.
274
+ * @default "Accept invitation from {name}?"
275
+ */
276
+ acceptConfirmMessage?: string;
277
+ /**
278
+ * Optional: Custom title for the Delete confirmation dialog.
279
+ * @default "Delete Invitation"
280
+ */
281
+ deleteConfirmTitle?: string;
282
+ /**
283
+ * Optional: Custom message for the Delete confirmation dialog.
284
+ * Use {name} as a placeholder for the person's name.
285
+ * @default "Delete invitation from {name}?"
286
+ */
287
+ deleteConfirmMessage?: string;
288
+ /**
289
+ * Optional: Custom text for the confirmation dialog's confirm button.
290
+ * @default "Confirm"
291
+ */
292
+ confirmButtonText?: string;
293
+ /**
294
+ * Optional: Custom text for the confirmation dialog's cancel button.
295
+ * @default "Cancel"
296
+ */
297
+ cancelButtonText?: string;
298
+ }
299
+ /**
300
+ * Configuration for VrtxOutgoingInvitations component.
301
+ * Displays invitations the user has sent with a Cancel action.
302
+ *
303
+ * Note: The component fetches invitations from the API and handles revocation automatically.
304
+ * Text customizations (button text, empty state, etc.) come from the widget configuration.
305
+ */
306
+ interface OutgoingInvitationsConfig {
307
+ /**
308
+ * Optional: Internal invitations provided by the app (merged with API-fetched ones).
309
+ * These invitations will NOT have `isVortexInvitation` set, so your app must handle
310
+ * the cancel logic in the `onCancel` callback.
311
+ *
312
+ * If an internal invitation has the same `userId` as an API invitation,
313
+ * the API invitation is kept (deduplicated).
314
+ */
315
+ invitations?: OutgoingInvitationItem[];
316
+ /**
317
+ * Optional callback when user taps "Cancel" on an invitation.
318
+ * Called before the API revocation as a gate.
319
+ *
320
+ * Return `true` (or void/undefined) to proceed with the API revocation,
321
+ * or `false` to cancel the action.
322
+ *
323
+ * @param invitation - The invitation being cancelled
324
+ * @returns Whether to proceed with the cancellation
325
+ *
326
+ * @example
327
+ * ```typescript
328
+ * onCancel: async (invitation) => {
329
+ * // Return true to proceed, false to cancel
330
+ * return true;
331
+ * }
332
+ * ```
333
+ */
334
+ onCancel?: (invitation: OutgoingInvitationItem) => boolean | void | Promise<boolean | void>;
335
+ /**
336
+ * Optional callback to compute a custom subtitle for each invitation.
337
+ *
338
+ * When provided, the SDK calls this function for each invitation to determine the
339
+ * displayed subtitle. Useful when the subtitle should be derived from the invitation's
340
+ * metadata (e.g., `invitation.metadata?.invitee_handle`).
341
+ *
342
+ * If not provided, no subtitle is rendered.
343
+ */
344
+ getSubtitle?: (invitation: OutgoingInvitationItem) => string | undefined;
345
+ /**
346
+ * @internal Mock invitations for preview mode only.
347
+ * When provided, skips API calls and uses these invitations instead.
348
+ * This is NOT for customer use - only for internal preview/web mode.
349
+ */
350
+ _mockInvitations?: OutgoingInvitationItem[];
351
+ }
352
+ /**
353
+ * Configuration for VrtxInvitationSuggestions component.
354
+ * Displays "People you may know" suggestions with Invite and Dismiss (X) actions.
355
+ */
356
+ interface InvitationSuggestionsConfig {
357
+ /**
358
+ * List of suggested people to display.
359
+ * Provided by the host application.
360
+ */
361
+ suggestions: InvitationItem[];
362
+ /**
363
+ * Called when user taps "Invite" on a suggestion.
364
+ * No confirmation dialog - invites immediately.
365
+ *
366
+ * @param suggestion - The suggestion that was invited
367
+ * @returns Optional promise for async operations
368
+ *
369
+ * @example
370
+ * ```typescript
371
+ * onInvite: async (suggestion) => {
372
+ * await api.sendInvitation(suggestion.id);
373
+ * // Update your local state to remove the suggestion
374
+ * }
375
+ * ```
376
+ */
377
+ onInvite: (suggestion: InvitationItem) => void | Promise<void>;
378
+ /**
379
+ * Called when user taps the dismiss (X) button on a suggestion.
380
+ * No confirmation dialog - dismisses immediately.
381
+ *
382
+ * @param suggestion - The suggestion that was dismissed
383
+ * @returns Optional promise for async operations
384
+ *
385
+ * @example
386
+ * ```typescript
387
+ * onDismiss: async (suggestion) => {
388
+ * await api.dismissSuggestion(suggestion.id);
389
+ * // Update your local state to remove the suggestion
390
+ * }
391
+ * ```
392
+ */
393
+ onDismiss: (suggestion: InvitationItem) => void | Promise<void>;
394
+ /**
395
+ * Optional: Custom text for the Invite button.
396
+ * @default "Invite"
397
+ */
398
+ inviteButtonText?: string;
399
+ /**
400
+ * Optional: Custom empty state message when no suggestions are present.
401
+ * @default "No suggestions"
402
+ */
403
+ emptyStateMessage?: string;
404
+ }
405
+
406
+ /**
407
+ * Types for the Invite Contacts feature.
408
+ *
409
+ * The Invite Contacts component displays a list of contacts that can be invited via SMS.
410
+ * Unlike Find Friends, this component:
411
+ * - Receives pre-classified contacts directly (no fetching/classification)
412
+ * - Only shows contacts that can be invited (no member/non-member distinction)
413
+ * - Creates SMS invitations and opens the SMS app for the user to send
414
+ *
415
+ * The component renders nothing (no height) if the contacts list is empty.
416
+ */
417
+ /**
418
+ * Contact to be displayed in the Invite Contacts component.
419
+ * Each contact has a name and phone number for SMS invitation.
420
+ */
421
+ interface InviteContactsContact {
422
+ /** Unique identifier for the contact */
423
+ id: string;
424
+ /** Display name of the contact */
425
+ name: string;
426
+ /** Phone number for SMS invitation */
427
+ phoneNumber: string;
428
+ /** Avatar/profile image URL (optional) */
429
+ avatarUrl?: string;
430
+ /** Optional metadata for the contact */
431
+ metadata?: Record<string, unknown>;
432
+ }
433
+ /**
434
+ * Configuration for the Invite Contacts feature.
435
+ * Passed to VortexInvite via the inviteContactsConfig prop.
436
+ */
437
+ interface InviteContactsConfig {
438
+ /**
439
+ * List of contacts to display for SMS invitation.
440
+ * If empty or undefined, the component renders nothing (no height).
441
+ */
442
+ contacts: InviteContactsContact[];
443
+ /**
444
+ * Called when user taps "Invite" on a contact.
445
+ * The SDK will:
446
+ * 1. Create an SMS invitation via the API
447
+ * 2. Get the short link for the invitation
448
+ * 3. Open the SMS app with the configured message and link
449
+ *
450
+ * This callback is optional and can be used for analytics or custom handling.
451
+ *
452
+ * @param contact - The contact that was invited
453
+ * @param shortLink - The invitation short link that was created
454
+ */
455
+ onInvite?: (contact: InviteContactsContact, shortLink: string) => void | Promise<void>;
456
+ /**
457
+ * Optional: Custom text for the "Invite your contacts" link.
458
+ * @default "Invite your contacts"
459
+ */
460
+ inviteYourContactsText?: string;
461
+ /**
462
+ * Optional: Custom text for the "Invite" button.
463
+ * @default "Invite"
464
+ */
465
+ inviteButtonText?: string;
466
+ /**
467
+ * Optional: Custom empty state message (shown when contacts list becomes empty after inviting).
468
+ * @default "No contacts to invite"
469
+ */
470
+ emptyStateMessage?: string;
471
+ /**
472
+ * Optional: Called when user navigates to the contacts list.
473
+ * Can be used for analytics.
474
+ */
475
+ onNavigateToContacts?: () => void;
476
+ /**
477
+ * Optional: Called when user navigates back from the contacts list.
478
+ * Can be used for analytics.
479
+ */
480
+ onNavigateBack?: () => void;
481
+ /**
482
+ * Optional: Called when an invitation is successfully created.
483
+ * This can be used to notify other components (like Outgoing Invitations)
484
+ * that they should refresh their data.
485
+ *
486
+ * @param contact - The contact that was invited
487
+ * @param shortLink - The invitation short link that was created
488
+ */
489
+ onInvitationCreated?: (contact: InviteContactsContact, shortLink: string) => void;
490
+ }
491
+
492
+ /**
493
+ * Types for the Search Box feature.
494
+ *
495
+ * The Search Box component displays a search input with a search button.
496
+ * When the user taps the search button, a customer-provided callback is invoked
497
+ * with the search query. The callback returns a list of matching contacts
498
+ * (identical to FindFriendsContact) which are rendered below the search box.
499
+ */
500
+
501
+ /**
502
+ * Configuration for the Search Box feature.
503
+ * Passed to VortexInvite to enable and configure the Search Box component.
504
+ */
505
+ interface SearchBoxConfig {
506
+ /**
507
+ * Called when the user taps the search button.
508
+ * The customer implements this callback to perform the search and return matching contacts.
509
+ *
510
+ * @param query - The search query entered by the user
511
+ * @returns Promise resolving to an array of matching contacts
512
+ *
513
+ * @example
514
+ * ```typescript
515
+ * onSearch: async (query) => {
516
+ * const results = await myApi.searchUsers(query);
517
+ * return results.map(user => ({
518
+ * userId: user.id,
519
+ * name: user.displayName,
520
+ * subtitle: user.email,
521
+ * avatarUrl: user.avatar,
522
+ * }));
523
+ * }
524
+ * ```
525
+ */
526
+ onSearch: (query: string) => Promise<FindFriendsContact[]> | FindFriendsContact[];
527
+ /**
528
+ * Called when user taps "Connect" on a search result contact.
529
+ * If the callback returns true, the SDK will create an invitation via the
530
+ * Vortex backend.
531
+ *
532
+ * @param contact - The contact that was tapped
533
+ * @returns Promise resolving to true if the invitation should be created
534
+ */
535
+ onConnect: (contact: FindFriendsContact) => Promise<boolean> | boolean;
536
+ /**
537
+ * Optional: Called after an invitation is successfully created.
538
+ *
539
+ * @param contact - The contact for whom the invitation was created
540
+ */
541
+ onInvitationCreated?: (contact: FindFriendsContact) => void;
542
+ /**
543
+ * Optional: Called if creating the invitation fails.
544
+ *
545
+ * @param contact - The contact for whom the invitation failed
546
+ * @param error - The error that occurred
547
+ */
548
+ onInvitationError?: (contact: FindFriendsContact, error: Error) => void;
549
+ /**
550
+ * Optional: Custom text for the "Connect" button.
551
+ * @default "Connect"
552
+ */
553
+ connectButtonText?: string;
554
+ /**
555
+ * Optional: Custom message shown when search returns no results.
556
+ * @default "No results found"
557
+ */
558
+ noResultsMessage?: string;
559
+ }
560
+
561
+ type IconName = 'close' | 'arrow-back' | 'link' | 'share' | 'import-contacts' | 'email' | 'google' | 'x-twitter' | 'instagram' | 'sms' | 'whatsapp' | 'line' | 'qr-code' | 'telegram' | 'discord' | 'facebook-messenger' | 'search';
562
+ interface IconRendererProps {
563
+ name: IconName;
564
+ size: number;
565
+ color: string;
566
+ opacity?: number;
567
+ }
568
+ interface ComponentInfo {
569
+ id: string;
570
+ type: string;
571
+ element: HTMLElement | null;
572
+ styles: react__default.CSSProperties;
573
+ content?: string;
574
+ droppedItem?: any;
575
+ }
576
+ interface InvitationFormCoreProps {
577
+ /**
578
+ * Function to render icons - allows different icon libraries to be used
579
+ */
580
+ renderIcon: (props: IconRendererProps) => ReactNode;
581
+ /**
582
+ * Function to render QR code - allows platform-specific QR libraries to be used
583
+ * - Native: uses react-native-qrcode-svg
584
+ * - Web: uses react-qr-code
585
+ */
586
+ renderQRCode?: (props: {
587
+ value: string;
588
+ size: number;
589
+ }) => ReactNode;
590
+ /**
591
+ * Platform-specific operations (clipboard, share, close)
592
+ */
593
+ platformOperations: PlatformOperations;
594
+ /**
595
+ * Font family to use for text
596
+ */
597
+ fontFamily?: string;
598
+ /**
599
+ * Container style overrides
600
+ */
601
+ containerStyle?: Record<string, any>;
602
+ /**
603
+ * Widget configuration containing component settings
604
+ */
605
+ widgetConfiguration?: any;
606
+ /**
607
+ * Whether edit mode is enabled (for hover highlighting and drag-drop)
608
+ */
609
+ isEditMode?: boolean;
610
+ /**
611
+ * Callback when a component is selected in edit mode
612
+ */
613
+ onComponentSelect?: (componentInfo: ComponentInfo) => void;
614
+ /**
615
+ * Callback when a palette item is dropped onto a component
616
+ */
617
+ onDrop?: (componentInfo: ComponentInfo, droppedItem: any) => void;
618
+ /**
619
+ * Callbacks for setting/clearing drop targets (for Redux integration)
620
+ */
621
+ onSetDropTarget?: (target: {
622
+ elementId: string;
623
+ elementType: string;
624
+ position: string;
625
+ rowId?: string;
626
+ insertionIndex?: number;
627
+ }) => void;
628
+ onClearDropTarget?: () => void;
629
+ /**
630
+ * Function to fetch the shareable invitation link for QR code
631
+ */
632
+ getShareableInviteLink?: () => Promise<string | undefined>;
633
+ /**
634
+ * Whether a drag is currently active (to show drop zones)
635
+ */
636
+ isDragging?: boolean;
637
+ /**
638
+ * Callback when a component is deleted in edit mode
639
+ */
640
+ onComponentDelete?: (componentId: string, componentType: string) => void;
641
+ /**
642
+ * Track share link click events
643
+ */
644
+ onShareLinkClick?: (clickName: string) => void;
645
+ /**
646
+ * Track email field focus events
647
+ */
648
+ onEmailFieldFocus?: () => void;
649
+ /**
650
+ * Track email field blur events
651
+ */
652
+ onEmailFieldBlur?: () => void;
653
+ /**
654
+ * Track email validation events
655
+ */
656
+ onEmailValidation?: (email: string, isValid: boolean) => void;
657
+ /**
658
+ * Track email invitations submitted events
659
+ */
660
+ onEmailInvitationsSubmitted?: (formData: Record<string, any>) => void;
661
+ /**
662
+ * Track email validation error events
663
+ */
664
+ onEmailValidationError?: (formData: Record<string, any>) => void;
665
+ /**
666
+ * Track email submit error events
667
+ */
668
+ onEmailSubmitError?: (error: string) => void;
669
+ /**
670
+ * Configuration for the Find Friends feature.
671
+ * When provided, enables the Find Friends component to display
672
+ * contacts with Connect buttons.
673
+ */
674
+ findFriendsConfig?: FindFriendsConfig;
675
+ /**
676
+ * Function to create an invitation with internal ID target type.
677
+ * Called when user taps Connect and the onConnect callback returns true.
678
+ */
679
+ createUserIdInvitation?: (userId: string, name?: string, avatarUrl?: string, metadata?: Record<string, unknown>) => Promise<void>;
680
+ /**
681
+ * Configuration for the Incoming Invitations feature.
682
+ * When provided, enables the Incoming Invitations component to display
683
+ * invitations the user has received with Accept/Delete buttons.
684
+ */
685
+ incomingInvitationsConfig?: IncomingInvitationsConfig;
686
+ /**
687
+ * Configuration for the Outgoing Invitations feature.
688
+ * When provided, enables the Outgoing Invitations component to display
689
+ * invitations the user has sent with a Cancel button.
690
+ */
691
+ outgoingInvitationsConfig?: OutgoingInvitationsConfig;
692
+ /**
693
+ * Configuration for the Invitation Suggestions feature.
694
+ * When provided, enables the Invitation Suggestions component to display
695
+ * "People you may know" with Invite and Dismiss buttons.
696
+ */
697
+ invitationSuggestionsConfig?: InvitationSuggestionsConfig;
698
+ /**
699
+ * Configuration for the Invite Contacts feature.
700
+ * When provided, enables the Invite Contacts component to display
701
+ * a list of contacts that can be invited via SMS.
702
+ */
703
+ inviteContactsConfig?: InviteContactsConfig;
704
+ /**
705
+ * Configuration for the Search Box feature.
706
+ * When provided, enables the Search Box component with a search input,
707
+ * search button, and results list with Connect buttons.
708
+ */
709
+ searchBoxConfig?: SearchBoxConfig;
710
+ /**
711
+ * API URL for server operations (e.g., fetching outgoing invitations)
712
+ */
713
+ apiUrl: string;
714
+ /**
715
+ * JWT token for authentication
716
+ */
717
+ jwt: string;
718
+ }
719
+ declare function InviteFormCore({ renderIcon, renderQRCode, platformOperations, fontFamily, containerStyle, widgetConfiguration, isEditMode, isDragging, onComponentSelect, onDrop, onSetDropTarget, onClearDropTarget, onComponentDelete, getShareableInviteLink, onShareLinkClick, onEmailFieldFocus, onEmailFieldBlur, onEmailValidation, onEmailInvitationsSubmitted, onEmailValidationError, onEmailSubmitError, findFriendsConfig, createUserIdInvitation, incomingInvitationsConfig, outgoingInvitationsConfig, invitationSuggestionsConfig, inviteContactsConfig, searchBoxConfig, apiUrl, jwt, }: InvitationFormCoreProps): react__default.JSX.Element;
720
+
721
+ export { type FindFriendsConfig as F, type IncomingInvitationsConfig as I, type OutgoingInvitationsConfig as O, type SearchBoxConfig as S, type InviteContactsConfig as a, type InvitationSuggestionsConfig as b, type IconRendererProps as c, InviteFormCore as d, type InvitationFormCoreProps as e, type IconName as f, type FindFriendsContact as g, type InvitationItem as h, type IncomingInvitationItem as i, type OutgoingInvitationItem as j, type InviteContactsContact as k };