@incodetech/web 2.0.0-alpha.1 → 2.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/asset-manifest.json +18 -0
  2. package/dist/browser-ponyfill-B6W6hHVY.js +344 -0
  3. package/dist/button-DeMZ_34N.js +266 -0
  4. package/dist/button.css +335 -0
  5. package/dist/email/email.es.js +145 -0
  6. package/dist/email/styles.css +123 -0
  7. package/dist/flow/flow.es.js +9 -0
  8. package/dist/flow/styles.css +204 -0
  9. package/dist/flow-ZK6OBsa3.js +568 -0
  10. package/dist/incodeModule-BF5MX9GT.js +243 -0
  11. package/dist/incodeModule.css +119 -0
  12. package/dist/index.es.js +101 -0
  13. package/dist/otpInput-BUrV4IAF.js +151 -0
  14. package/dist/otpInput.css +167 -0
  15. package/dist/phone/phone.es.js +3442 -0
  16. package/dist/phone/styles.css +305 -0
  17. package/dist/selfie/selfie.es.js +893 -0
  18. package/dist/selfie/styles.css +1163 -0
  19. package/dist/selfieTutorial-C-u5GufD.js +29 -0
  20. package/dist/styles/core.css +1013 -0
  21. package/dist/styles/tokens.css +543 -0
  22. package/dist/successIcon.css +4 -0
  23. package/dist/title-ng7q7YDh.js +2161 -0
  24. package/dist/title.css +38 -0
  25. package/dist/types/core.d.ts +1 -0
  26. package/dist/types/email/email.d.ts +2 -0
  27. package/dist/types/email.d.ts +50 -0
  28. package/dist/types/flow/flow.d.ts +2 -0
  29. package/dist/types/flow.d.ts +46 -0
  30. package/dist/types/index.d.ts +223 -0
  31. package/dist/types/phone/phone.d.ts +2 -0
  32. package/dist/types/phone.d.ts +51 -0
  33. package/dist/types/selfie/selfie.d.ts +2 -0
  34. package/dist/types/selfie.d.ts +24 -0
  35. package/dist/types/styles/core.d.ts +1 -0
  36. package/dist/vendor-preact-CK0WeTOR.js +584 -0
  37. package/package.json +20 -17
  38. package/dev/README.md +0 -163
  39. package/dev/getToken.ts +0 -36
  40. package/dev/headless.html +0 -875
  41. package/dev/index.html +0 -366
  42. package/dev/main-headless.tsx +0 -1332
  43. package/dev/main-orchestrated-flow.tsx +0 -1158
  44. package/dev/main-preact.tsx +0 -323
  45. package/dev/main-simplified.tsx +0 -123
  46. package/dev/main-web-component.tsx +0 -256
  47. package/dev/main.tsx +0 -332
  48. package/dev/manual.html +0 -27
  49. package/dev/orchestrated-flow.html +0 -64
  50. package/dev/simplified.html +0 -64
  51. package/dev/tiktok-logo.svg +0 -7
  52. package/src/defineCustomElement.tsx +0 -30
  53. package/src/email/email.test.tsx +0 -368
  54. package/src/email/email.tsx +0 -255
  55. package/src/email/emailInput.test.tsx +0 -264
  56. package/src/email/emailInput.tsx +0 -85
  57. package/src/email/styles.css +0 -59
  58. package/src/flow/flow.test.tsx +0 -796
  59. package/src/flow/flow.tsx +0 -292
  60. package/src/flow/flowCompleted.css +0 -30
  61. package/src/flow/flowCompleted.test.tsx +0 -331
  62. package/src/flow/flowCompleted.tsx +0 -121
  63. package/src/flow/flowInit.test.ts +0 -264
  64. package/src/flow/flowInit.ts +0 -94
  65. package/src/flow/flowStart.css +0 -58
  66. package/src/flow/flowStart.test.tsx +0 -49
  67. package/src/flow/flowStart.tsx +0 -41
  68. package/src/flow/incode-logo.svg +0 -8
  69. package/src/flow/index.ts +0 -7
  70. package/src/flow/preloadFlow.test.ts +0 -421
  71. package/src/flow/preloadFlow.ts +0 -171
  72. package/src/flow/styles.css +0 -9
  73. package/src/flow/unsupportedModule.css +0 -21
  74. package/src/flow/unsupportedModule.tsx +0 -39
  75. package/src/flow/useFlowInitialization.test.tsx +0 -292
  76. package/src/flow/useFlowInitialization.ts +0 -128
  77. package/src/flow/useModuleLoader.test.tsx +0 -212
  78. package/src/flow/useModuleLoader.ts +0 -92
  79. package/src/hooks/index.ts +0 -1
  80. package/src/hooks/useManager.test.ts +0 -91
  81. package/src/hooks/useManager.ts +0 -40
  82. package/src/i18n/index.ts +0 -3
  83. package/src/i18n/instance.ts +0 -16
  84. package/src/i18n/setup.ts +0 -184
  85. package/src/i18n/useTranslation.ts +0 -42
  86. package/src/index.ts +0 -27
  87. package/src/permissions/assets/android-dots-icon.svg +0 -7
  88. package/src/permissions/assets/android-settings-icon.svg +0 -16
  89. package/src/permissions/assets/android-toggle-icon.svg +0 -20
  90. package/src/permissions/assets/bank-card-icon.svg +0 -14
  91. package/src/permissions/assets/camera-icon.svg +0 -12
  92. package/src/permissions/assets/camera-ios.svg +0 -53
  93. package/src/permissions/assets/check-icon.svg +0 -8
  94. package/src/permissions/assets/chrome-icon.svg +0 -43
  95. package/src/permissions/assets/password-icon.svg +0 -11
  96. package/src/permissions/assets/permissions-img.svg +0 -51
  97. package/src/permissions/assets/safari-icon.svg +0 -37
  98. package/src/permissions/assets/settings-icon.svg +0 -33
  99. package/src/permissions/assets/toggle-icon.svg +0 -19
  100. package/src/permissions/assets/warning-icon.svg +0 -6
  101. package/src/permissions/boldWithArrow.css +0 -9
  102. package/src/permissions/boldWithArrow.tsx +0 -41
  103. package/src/permissions/denied.css +0 -37
  104. package/src/permissions/denied.tsx +0 -29
  105. package/src/permissions/deniedAndroid.tsx +0 -56
  106. package/src/permissions/deniedDesktop.css +0 -9
  107. package/src/permissions/deniedDesktop.tsx +0 -64
  108. package/src/permissions/deniedIOS.tsx +0 -73
  109. package/src/permissions/deniedInstructions.tsx +0 -19
  110. package/src/permissions/iconWrapper.css +0 -9
  111. package/src/permissions/iconWrapper.tsx +0 -15
  112. package/src/permissions/learnMore.css +0 -37
  113. package/src/permissions/learnMore.tsx +0 -85
  114. package/src/permissions/numberedStep.css +0 -13
  115. package/src/permissions/numberedStep.tsx +0 -14
  116. package/src/permissions/permissions.css +0 -13
  117. package/src/permissions/permissions.tsx +0 -68
  118. package/src/phone/phone.tsx +0 -246
  119. package/src/phone/phoneInput.test.tsx +0 -275
  120. package/src/phone/phoneInput.tsx +0 -249
  121. package/src/phone/styles.css +0 -158
  122. package/src/selfie/cameraButton.css +0 -13
  123. package/src/selfie/cameraButton.tsx +0 -35
  124. package/src/selfie/capture.css +0 -57
  125. package/src/selfie/capture.tsx +0 -232
  126. package/src/selfie/errorModal.tsx +0 -218
  127. package/src/selfie/errorModalContent.css +0 -33
  128. package/src/selfie/errorModalContent.tsx +0 -44
  129. package/src/selfie/faceOutline.css +0 -5
  130. package/src/selfie/faceOutline.tsx +0 -22
  131. package/src/selfie/loadingBorder.css +0 -12
  132. package/src/selfie/loadingBorder.tsx +0 -77
  133. package/src/selfie/manualCaptureButton.css +0 -13
  134. package/src/selfie/manualCaptureButton.tsx +0 -35
  135. package/src/selfie/noMoreAttemptsModal.tsx +0 -44
  136. package/src/selfie/notification.css +0 -9
  137. package/src/selfie/notification.tsx +0 -36
  138. package/src/selfie/retryErrorModal.tsx +0 -56
  139. package/src/selfie/selfie.test.tsx +0 -458
  140. package/src/selfie/selfie.tsx +0 -83
  141. package/src/selfie/selfieTutorial.json +0 -2626
  142. package/src/selfie/styles.css +0 -1
  143. package/src/selfie/tutorial.test.tsx +0 -200
  144. package/src/selfie/tutorial.tsx +0 -43
  145. package/src/setup.ts +0 -33
  146. package/src/shared/baseTutorial/baseTutorial.css +0 -21
  147. package/src/shared/baseTutorial/baseTutorial.test.tsx +0 -184
  148. package/src/shared/baseTutorial/baseTutorial.tsx +0 -55
  149. package/src/shared/baseTutorial/replaceBaseTutorial.test.ts +0 -267
  150. package/src/shared/baseTutorial/replaceBaseTutorial.ts +0 -68
  151. package/src/shared/button/button.css +0 -55
  152. package/src/shared/button/button.test.tsx +0 -101
  153. package/src/shared/button/button.tsx +0 -47
  154. package/src/shared/componentRoot/incodeComponent.tsx +0 -12
  155. package/src/shared/countries/countries.test.ts +0 -75
  156. package/src/shared/countries/countries.ts +0 -139
  157. package/src/shared/countries/index.ts +0 -6
  158. package/src/shared/icons/chevronDown.tsx +0 -22
  159. package/src/shared/icons/index.ts +0 -2
  160. package/src/shared/icons/successIcon.css +0 -5
  161. package/src/shared/icons/successIcon.test.tsx +0 -40
  162. package/src/shared/icons/successIcon.tsx +0 -26
  163. package/src/shared/loader/loadingIcon.css +0 -28
  164. package/src/shared/loader/loadingIcon.tsx +0 -67
  165. package/src/shared/lottie/lottie.tsx +0 -108
  166. package/src/shared/otpInput/otpInput.css +0 -85
  167. package/src/shared/otpInput/otpInput.test.tsx +0 -356
  168. package/src/shared/otpInput/otpInput.tsx +0 -241
  169. package/src/shared/page/incode-logo.svg +0 -3
  170. package/src/shared/page/page.css +0 -47
  171. package/src/shared/page/page.test.tsx +0 -97
  172. package/src/shared/page/page.tsx +0 -91
  173. package/src/shared/page/pageUiConfig.test.ts +0 -112
  174. package/src/shared/page/pageUiConfig.ts +0 -64
  175. package/src/shared/page/verifiedByIncode.css +0 -5
  176. package/src/shared/page/verifiedByIncode.tsx +0 -75
  177. package/src/shared/spacer/spacer.css +0 -149
  178. package/src/shared/spacer/spacer.test.tsx +0 -143
  179. package/src/shared/spacer/spacer.tsx +0 -88
  180. package/src/shared/spinner/index.ts +0 -2
  181. package/src/shared/spinner/spinner.css +0 -28
  182. package/src/shared/spinner/spinner.test.tsx +0 -82
  183. package/src/shared/spinner/spinner.tsx +0 -65
  184. package/src/shared/title/title.css +0 -7
  185. package/src/shared/title/title.tsx +0 -12
  186. package/src/shared/uiConfig/uiConfig.ts +0 -36
  187. package/src/shared/webComponent/incodeModule.ts +0 -29
  188. package/src/shared/webComponent/registerIncodeElement.ts +0 -15
  189. package/src/styles/__mocks__/fetchTheme.ts +0 -19
  190. package/src/styles/applyTheme.ts +0 -37
  191. package/src/styles/cn.test.tsx +0 -57
  192. package/src/styles/cn.tsx +0 -21
  193. package/src/styles/core.css +0 -12
  194. package/src/styles/fetchTheme.test.ts +0 -390
  195. package/src/styles/fetchTheme.ts +0 -88
  196. package/src/styles/generatePalette.ts +0 -111
  197. package/src/styles/reset.css +0 -65
  198. package/src/styles/resolveCssVariableToHex.ts +0 -28
  199. package/src/styles/tailwind.css +0 -291
  200. package/src/styles/themeTypes.ts +0 -18
  201. package/src/styles/tokens/colors.css +0 -190
  202. package/src/styles/tokens/components.css +0 -174
  203. package/src/styles/tokens/index.css +0 -4
  204. package/src/styles/tokens/primitives.css +0 -129
  205. package/src/styles/tokens/semantic.css +0 -51
  206. package/src/svg.d.ts +0 -4
  207. package/src/types/assets.d.ts +0 -1
  208. package/src/types/custom-elements.d.ts +0 -104
  209. package/tsconfig.json +0 -22
  210. package/vite.config.ts +0 -260
  211. package/vitest.config.ts +0 -40
  212. package/vitest.setup.ts +0 -16
package/dist/title.css ADDED
@@ -0,0 +1,38 @@
1
+ /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
2
+ @layer properties {
3
+ @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
4
+ *, :before, :after, ::backdrop {
5
+ --tw-leading: initial;
6
+ --tw-font-weight: initial;
7
+ --tw-tracking: initial;
8
+ }
9
+ }
10
+ }
11
+
12
+ .IncodeComponent .IncodeTitle {
13
+ text-align: center;
14
+ font-size: var(--text-2xl, 1.5rem);
15
+ line-height: var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)));
16
+ --tw-leading: 125%;
17
+ --tw-font-weight: var(--font-weight-bold, var(--primitive-typography-weight-bold));
18
+ line-height: 125%;
19
+ font-weight: var(--font-weight-bold, var(--primitive-typography-weight-bold));
20
+ --tw-tracking: -1px;
21
+ letter-spacing: -1px;
22
+ color: var(--color-text-body-primary, var(--text-body-primary));
23
+ }
24
+
25
+ @property --tw-leading {
26
+ syntax: "*";
27
+ inherits: false
28
+ }
29
+
30
+ @property --tw-font-weight {
31
+ syntax: "*";
32
+ inherits: false
33
+ }
34
+
35
+ @property --tw-tracking {
36
+ syntax: "*";
37
+ inherits: false
38
+ }
@@ -0,0 +1 @@
1
+ export { }
@@ -0,0 +1,2 @@
1
+ export * from '../ui/src/email/email'
2
+ export {}
@@ -0,0 +1,50 @@
1
+ import { EmailConfig } from '../../../core/src/email';
2
+ import { FC } from 'preact/compat';
3
+
4
+ /**
5
+ * Email verification UI component.
6
+ *
7
+ * Provides a complete email verification experience including:
8
+ * - Email address input with validation
9
+ * - OTP code entry with resend functionality
10
+ * - Loading states and error handling
11
+ *
12
+ * @example Basic usage
13
+ * ```tsx
14
+ * <Email
15
+ * config={{
16
+ * otpVerification: true,
17
+ * otpExpirationInMinutes: 5,
18
+ * prefill: false,
19
+ * }}
20
+ * onFinish={() => router.push('/next-step')}
21
+ * onError={(err) => toast.error(err)}
22
+ * />
23
+ * ```
24
+ *
25
+ * @see {@link createEmailManager} for headless usage
26
+ */
27
+ export declare const Email: FC<EmailProps>;
28
+
29
+ /**
30
+ * Props for the Email component
31
+ */
32
+ declare type EmailProps = IncodeModuleProps<EmailConfig>;
33
+
34
+ declare type IncodeModuleProps<TConfig> = {
35
+ /**
36
+ * Module configuration required to render the flow.
37
+ * For Web Components, this is typically assigned via `element.config = ...`.
38
+ */
39
+ config?: TConfig;
40
+ /**
41
+ * Callback invoked when the module completes successfully.
42
+ */
43
+ onFinish?: () => void;
44
+ /**
45
+ * Callback invoked when a fatal module error occurs.
46
+ */
47
+ onError?: (error: string | undefined) => void;
48
+ };
49
+
50
+ export { }
@@ -0,0 +1,2 @@
1
+ export * from '../ui/src/flow/flow'
2
+ export {}
@@ -0,0 +1,46 @@
1
+ import { FC } from 'preact/compat';
2
+ import { FinishStatus } from '../../../core/src/flow';
3
+ import { WasmConfig } from '../../../core/src';
4
+
5
+ export declare const IncodeFlow: FC<IncodeFlowProps>;
6
+
7
+ export declare type IncodeFlowProps = {
8
+ apiURL: string;
9
+ token: string;
10
+ wasmConfig?: WasmConfig;
11
+ lang?: string;
12
+ disableDashboardTheme?: boolean;
13
+ onComplete: (result: FinishStatus) => void;
14
+ onError?: (error: string) => void;
15
+ onModuleLoading?: (moduleKey: string) => void;
16
+ onModuleLoaded?: (moduleKey: string) => void;
17
+ onWasmWarmup?: (pipelines: string[]) => void;
18
+ spinnerConfig?: SpinnerConfig;
19
+ };
20
+
21
+ declare type PreloadConfig = {
22
+ apiURL: string;
23
+ token: string;
24
+ lang?: string;
25
+ disableDashboardTheme?: boolean;
26
+ wasmConfig?: WasmConfig;
27
+ };
28
+
29
+ export declare type PreloadHandle = {
30
+ get isReady(): boolean;
31
+ get error(): string | null;
32
+ waitUntilReady(): Promise<void>;
33
+ cancel(): void;
34
+ };
35
+
36
+ export declare function preloadIncodeFlow(config: PreloadConfig): PreloadHandle;
37
+
38
+ export declare type SpinnerConfig = {
39
+ title?: string;
40
+ subtitle?: string;
41
+ size?: SpinnerSize;
42
+ };
43
+
44
+ declare type SpinnerSize = 'small' | 'medium' | 'large';
45
+
46
+ export { }
@@ -0,0 +1,223 @@
1
+ import { EmailConfig } from '../../../core/src/email';
2
+ import { FC } from 'preact/compat';
3
+ import { FinishStatus } from '../../../core/src/flow';
4
+ import { i18n } from 'i18next';
5
+ import { PhoneConfig } from '../../../core/src/phone';
6
+ import { SelfieConfig } from '../../../core/src/selfie';
7
+ import { TFunction } from 'i18next';
8
+ import { WasmConfig } from '../../../core/src';
9
+ import { WasmConfig as WasmConfig_2 } from '../../core/src';
10
+
11
+ export declare const FlowCompleted: FC<FlowCompletedProps>;
12
+
13
+ /**
14
+ * Element type for the `<incode-flow-completed>` web component.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const completed = document.createElement('incode-flow-completed');
19
+ * completed.action = 'approved';
20
+ * completed.scoreStatus = 'OK';
21
+ * document.body.appendChild(completed);
22
+ * ```
23
+ */
24
+ export declare type FlowCompletedElement = HTMLElement & FlowCompletedProps;
25
+
26
+ export declare type FlowCompletedProps = {
27
+ title?: string;
28
+ message?: string;
29
+ redirectionUrl?: string;
30
+ action?: 'approved' | 'rejected' | 'none';
31
+ scoreStatus?: 'OK' | 'WARN' | 'MANUAL_OK' | 'FAIL' | 'UNKNOWN' | 'MANUAL_FAIL';
32
+ redirectDelay?: number;
33
+ disableRedirect?: boolean;
34
+ redirectOriginOnly?: boolean;
35
+ flowId?: string;
36
+ interviewId?: string;
37
+ };
38
+
39
+ export declare const FlowStart: FC<FlowStartProps>;
40
+
41
+ declare type FlowStartProps = {
42
+ logoUrl?: string;
43
+ subtitle?: string;
44
+ onStart: () => void;
45
+ };
46
+
47
+ declare type I18nOptions = {
48
+ lang?: string;
49
+ translations?: Translations;
50
+ };
51
+
52
+ /**
53
+ * Element type for the `<incode-email>` web component.
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const email = document.createElement('incode-email');
58
+ * email.config = { otpVerification: true, otpExpirationInMinutes: 5 };
59
+ * email.onFinish = () => console.log('Email verified!');
60
+ * email.onError = (error) => console.error(error);
61
+ * document.body.appendChild(email);
62
+ * ```
63
+ */
64
+ export declare type IncodeEmailElement = HTMLElement & IncodeModuleProps<EmailConfig>;
65
+
66
+ export declare const IncodeFlow: FC<IncodeFlowProps>;
67
+
68
+ /**
69
+ * Element type for the `<incode-flow>` web component.
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const flow = document.createElement('incode-flow');
74
+ * flow.apiURL = 'https://api.example.com';
75
+ * flow.token = 'session-token';
76
+ * flow.onComplete = (result) => console.log(result);
77
+ * document.body.appendChild(flow);
78
+ * ```
79
+ */
80
+ export declare type IncodeFlowElement = HTMLElement & IncodeFlowProps;
81
+
82
+ export declare type IncodeFlowProps = {
83
+ apiURL: string;
84
+ token: string;
85
+ wasmConfig?: WasmConfig;
86
+ lang?: string;
87
+ disableDashboardTheme?: boolean;
88
+ onComplete: (result: FinishStatus) => void;
89
+ onError?: (error: string) => void;
90
+ onModuleLoading?: (moduleKey: string) => void;
91
+ onModuleLoaded?: (moduleKey: string) => void;
92
+ onWasmWarmup?: (pipelines: string[]) => void;
93
+ spinnerConfig?: SpinnerConfig;
94
+ };
95
+
96
+ export declare type IncodeModuleProps<TConfig> = {
97
+ /**
98
+ * Module configuration required to render the flow.
99
+ * For Web Components, this is typically assigned via `element.config = ...`.
100
+ */
101
+ config?: TConfig;
102
+ /**
103
+ * Callback invoked when the module completes successfully.
104
+ */
105
+ onFinish?: () => void;
106
+ /**
107
+ * Callback invoked when a fatal module error occurs.
108
+ */
109
+ onError?: (error: string | undefined) => void;
110
+ };
111
+
112
+ /**
113
+ * Element type for the `<incode-phone>` web component.
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * const phone = document.createElement('incode-phone');
118
+ * phone.config = { otpVerification: true, otpExpirationInMinutes: 5 };
119
+ * phone.onFinish = () => console.log('Phone verified!');
120
+ * phone.onError = (error) => console.error(error);
121
+ * document.body.appendChild(phone);
122
+ * ```
123
+ */
124
+ export declare type IncodePhoneElement = HTMLElement & IncodeModuleProps<PhoneConfig>;
125
+
126
+ /**
127
+ * Element type for the `<incode-selfie>` web component.
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * const selfie = document.createElement('incode-selfie');
132
+ * selfie.config = { showTutorial: true };
133
+ * selfie.onFinish = () => console.log('Selfie captured!');
134
+ * selfie.onError = (error) => console.error(error);
135
+ * document.body.appendChild(selfie);
136
+ * ```
137
+ */
138
+ export declare type IncodeSelfieElement = HTMLElement & IncodeModuleProps<SelfieConfig>;
139
+
140
+ declare type InferState<T> = T extends {
141
+ getState: () => infer S;
142
+ } ? S : never;
143
+
144
+ declare type LanguageTranslations = Record<string, TranslationValue>;
145
+
146
+ declare type PreloadConfig = {
147
+ apiURL: string;
148
+ token: string;
149
+ lang?: string;
150
+ disableDashboardTheme?: boolean;
151
+ wasmConfig?: WasmConfig;
152
+ };
153
+
154
+ export declare type PreloadHandle = {
155
+ get isReady(): boolean;
156
+ get error(): string | null;
157
+ waitUntilReady(): Promise<void>;
158
+ cancel(): void;
159
+ };
160
+
161
+ export declare function preloadIncodeFlow(config: PreloadConfig): PreloadHandle;
162
+
163
+ /**
164
+ * Sets global UI configuration defaults for `@incodetech/ui`.
165
+ */
166
+ export declare function setUiConfig(next: UiConfig): void;
167
+
168
+ export declare function setup({ apiURL, token, customHeaders, timeout, wasm, i18n, uiConfig, }: SetupOptions): Promise<void>;
169
+
170
+ declare type SetupOptions = {
171
+ apiURL: string;
172
+ token: string;
173
+ customHeaders?: Record<string, string>;
174
+ timeout?: number;
175
+ wasm?: WasmConfig_2;
176
+ i18n?: I18nOptions;
177
+ uiConfig?: UiConfig;
178
+ };
179
+
180
+ export declare type SpinnerConfig = {
181
+ title?: string;
182
+ subtitle?: string;
183
+ size?: SpinnerSize;
184
+ };
185
+
186
+ declare type SpinnerSize = 'small' | 'medium' | 'large';
187
+
188
+ declare type Translations = Partial<Record<string, LanguageTranslations>>;
189
+
190
+ declare type TranslationValue = string | Record<string, unknown>;
191
+
192
+ export declare type UiConfig = {
193
+ logoSrc?: string;
194
+ logoHeight?: string;
195
+ hideHeader?: boolean;
196
+ hideFooterBranding?: boolean;
197
+ };
198
+
199
+ /**
200
+ * Hook for subscribing to manager state updates
201
+ * @param factory - Factory function that creates the manager instance
202
+ * @param options - Configuration options
203
+ * @returns Tuple of [state, manager]
204
+ */
205
+ export declare function useManager<TManager extends {
206
+ getState: () => TState;
207
+ subscribe: (listener: (state: TState) => void) => () => void;
208
+ load?: () => void;
209
+ }, TState = InferState<TManager>>(factory: () => TManager, options?: UseManagerOptions): [TState, TManager];
210
+
211
+ declare type UseManagerOptions = {
212
+ autoLoad?: boolean;
213
+ };
214
+
215
+ export declare function useTranslation(): UseTranslationReturn;
216
+
217
+ declare type UseTranslationReturn = {
218
+ t: TFunction;
219
+ ready: boolean;
220
+ i18n: i18n;
221
+ };
222
+
223
+ export { }
@@ -0,0 +1,2 @@
1
+ export * from '../ui/src/phone/phone'
2
+ export {}
@@ -0,0 +1,51 @@
1
+ import { FC } from 'preact/compat';
2
+ import { PhoneConfig } from '../../../core/src/phone';
3
+
4
+ declare type IncodeModuleProps<TConfig> = {
5
+ /**
6
+ * Module configuration required to render the flow.
7
+ * For Web Components, this is typically assigned via `element.config = ...`.
8
+ */
9
+ config?: TConfig;
10
+ /**
11
+ * Callback invoked when the module completes successfully.
12
+ */
13
+ onFinish?: () => void;
14
+ /**
15
+ * Callback invoked when a fatal module error occurs.
16
+ */
17
+ onError?: (error: string | undefined) => void;
18
+ };
19
+
20
+ /**
21
+ * Phone verification UI component.
22
+ *
23
+ * Provides a complete phone verification experience including:
24
+ * - Country code selector with flag emojis
25
+ * - Phone number input with validation
26
+ * - OTP code entry with resend functionality
27
+ * - Loading states and error handling
28
+ *
29
+ * @example Basic usage
30
+ * ```tsx
31
+ * <Phone
32
+ * config={{
33
+ * otpVerification: true,
34
+ * otpExpirationInMinutes: 5,
35
+ * prefill: false,
36
+ * }}
37
+ * onFinish={() => router.push('/next-step')}
38
+ * onError={(err) => toast.error(err)}
39
+ * />
40
+ * ```
41
+ *
42
+ * @see {@link createPhoneManager} for headless usage
43
+ */
44
+ export declare const Phone: FC<PhoneProps>;
45
+
46
+ /**
47
+ * Props for the Phone component
48
+ */
49
+ declare type PhoneProps = IncodeModuleProps<PhoneConfig>;
50
+
51
+ export { }
@@ -0,0 +1,2 @@
1
+ export * from '../ui/src/selfie/selfie'
2
+ export {}
@@ -0,0 +1,24 @@
1
+ import { FC } from 'preact/compat';
2
+ import { SelfieConfig } from '../../../core/src/selfie';
3
+
4
+ declare type IncodeModuleProps<TConfig> = {
5
+ /**
6
+ * Module configuration required to render the flow.
7
+ * For Web Components, this is typically assigned via `element.config = ...`.
8
+ */
9
+ config?: TConfig;
10
+ /**
11
+ * Callback invoked when the module completes successfully.
12
+ */
13
+ onFinish?: () => void;
14
+ /**
15
+ * Callback invoked when a fatal module error occurs.
16
+ */
17
+ onError?: (error: string | undefined) => void;
18
+ };
19
+
20
+ export declare const Selfie: FC<SelfieProps>;
21
+
22
+ declare type SelfieProps = IncodeModuleProps<SelfieConfig>;
23
+
24
+ export { }
@@ -0,0 +1 @@
1
+ export {}