@incodetech/web 2.0.0-alpha.1 → 2.0.0-alpha.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.
Files changed (116) hide show
  1. package/.turbo/turbo-build.log +58 -0
  2. package/.turbo/turbo-coverage.log +23 -0
  3. package/.turbo/turbo-format.log +6 -0
  4. package/.turbo/turbo-lint$colon$fix.log +6 -0
  5. package/.turbo/turbo-lint.log +6 -0
  6. package/.turbo/turbo-test.log +1033 -0
  7. package/.turbo/turbo-typecheck.log +5 -0
  8. package/coverage/base.css +224 -0
  9. package/coverage/block-navigation.js +87 -0
  10. package/coverage/email/email.tsx.html +850 -0
  11. package/coverage/email/emailInput.tsx.html +340 -0
  12. package/coverage/email/index.html +131 -0
  13. package/coverage/favicon.png +0 -0
  14. package/coverage/flow/flow.tsx.html +961 -0
  15. package/coverage/flow/flowCompleted.tsx.html +448 -0
  16. package/coverage/flow/flowInit.ts.html +367 -0
  17. package/coverage/flow/flowStart.tsx.html +208 -0
  18. package/coverage/flow/index.html +221 -0
  19. package/coverage/flow/preloadFlow.ts.html +598 -0
  20. package/coverage/flow/unsupportedModule.tsx.html +202 -0
  21. package/coverage/flow/useFlowInitialization.ts.html +469 -0
  22. package/coverage/flow/useModuleLoader.ts.html +361 -0
  23. package/coverage/hooks/index.html +116 -0
  24. package/coverage/hooks/useManager.ts.html +205 -0
  25. package/coverage/index.html +401 -0
  26. package/coverage/permissions/boldWithArrow.tsx.html +208 -0
  27. package/coverage/permissions/denied.tsx.html +172 -0
  28. package/coverage/permissions/deniedAndroid.tsx.html +253 -0
  29. package/coverage/permissions/deniedDesktop.tsx.html +277 -0
  30. package/coverage/permissions/deniedIOS.tsx.html +304 -0
  31. package/coverage/permissions/deniedInstructions.tsx.html +142 -0
  32. package/coverage/permissions/iconWrapper.tsx.html +130 -0
  33. package/coverage/permissions/index.html +251 -0
  34. package/coverage/permissions/learnMore.tsx.html +340 -0
  35. package/coverage/permissions/numberedStep.tsx.html +127 -0
  36. package/coverage/permissions/permissions.tsx.html +289 -0
  37. package/coverage/phone/index.html +116 -0
  38. package/coverage/phone/phoneInput.tsx.html +832 -0
  39. package/coverage/prettify.css +1 -0
  40. package/coverage/prettify.js +2 -0
  41. package/coverage/selfie/index.html +131 -0
  42. package/coverage/selfie/selfie.tsx.html +334 -0
  43. package/coverage/selfie/tutorial.tsx.html +214 -0
  44. package/coverage/shared/baseTutorial/baseTutorial.tsx.html +250 -0
  45. package/coverage/shared/baseTutorial/index.html +131 -0
  46. package/coverage/shared/baseTutorial/replaceBaseTutorial.ts.html +289 -0
  47. package/coverage/shared/button/button.tsx.html +226 -0
  48. package/coverage/shared/button/index.html +116 -0
  49. package/coverage/shared/componentRoot/incodeComponent.tsx.html +121 -0
  50. package/coverage/shared/componentRoot/index.html +116 -0
  51. package/coverage/shared/countries/countries.ts.html +502 -0
  52. package/coverage/shared/countries/index.html +116 -0
  53. package/coverage/shared/icons/chevronDown.tsx.html +151 -0
  54. package/coverage/shared/icons/index.html +131 -0
  55. package/coverage/shared/icons/successIcon.tsx.html +163 -0
  56. package/coverage/shared/loader/index.html +116 -0
  57. package/coverage/shared/loader/loadingIcon.tsx.html +286 -0
  58. package/coverage/shared/otpInput/index.html +116 -0
  59. package/coverage/shared/otpInput/otpInput.tsx.html +808 -0
  60. package/coverage/shared/page/index.html +146 -0
  61. package/coverage/shared/page/page.tsx.html +358 -0
  62. package/coverage/shared/page/pageUiConfig.ts.html +277 -0
  63. package/coverage/shared/page/verifiedByIncode.tsx.html +310 -0
  64. package/coverage/shared/spacer/index.html +116 -0
  65. package/coverage/shared/spacer/spacer.tsx.html +349 -0
  66. package/coverage/shared/spinner/index.html +116 -0
  67. package/coverage/shared/spinner/spinner.tsx.html +280 -0
  68. package/coverage/shared/title/index.html +116 -0
  69. package/coverage/shared/title/title.tsx.html +121 -0
  70. package/coverage/shared/uiConfig/index.html +116 -0
  71. package/coverage/shared/uiConfig/uiConfig.ts.html +193 -0
  72. package/coverage/shared/webComponent/incodeModule.ts.html +172 -0
  73. package/coverage/shared/webComponent/index.html +131 -0
  74. package/coverage/shared/webComponent/registerIncodeElement.ts.html +130 -0
  75. package/coverage/sort-arrow-sprite.png +0 -0
  76. package/coverage/sorter.js +210 -0
  77. package/coverage/styles/cn.tsx.html +148 -0
  78. package/coverage/styles/fetchTheme.ts.html +349 -0
  79. package/coverage/styles/index.html +131 -0
  80. package/dist/asset-manifest.json +18 -0
  81. package/dist/browser-ponyfill-B6W6hHVY.js +344 -0
  82. package/dist/button-DeMZ_34N.js +266 -0
  83. package/dist/button.css +335 -0
  84. package/dist/email/email.es.js +145 -0
  85. package/dist/email/styles.css +123 -0
  86. package/dist/flow/flow.es.js +9 -0
  87. package/dist/flow/styles.css +204 -0
  88. package/dist/flow-ZK6OBsa3.js +568 -0
  89. package/dist/incodeModule-BF5MX9GT.js +243 -0
  90. package/dist/incodeModule.css +119 -0
  91. package/dist/index.es.js +101 -0
  92. package/dist/otpInput-BUrV4IAF.js +151 -0
  93. package/dist/otpInput.css +167 -0
  94. package/dist/phone/phone.es.js +3442 -0
  95. package/dist/phone/styles.css +305 -0
  96. package/dist/selfie/selfie.es.js +893 -0
  97. package/dist/selfie/styles.css +1163 -0
  98. package/dist/selfieTutorial-C-u5GufD.js +29 -0
  99. package/dist/styles/core.css +1013 -0
  100. package/dist/styles/tokens.css +543 -0
  101. package/dist/successIcon.css +4 -0
  102. package/dist/title-ng7q7YDh.js +2161 -0
  103. package/dist/title.css +38 -0
  104. package/dist/types/core.d.ts +1 -0
  105. package/dist/types/email/email.d.ts +2 -0
  106. package/dist/types/email.d.ts +50 -0
  107. package/dist/types/flow/flow.d.ts +2 -0
  108. package/dist/types/flow.d.ts +46 -0
  109. package/dist/types/index.d.ts +223 -0
  110. package/dist/types/phone/phone.d.ts +2 -0
  111. package/dist/types/phone.d.ts +51 -0
  112. package/dist/types/selfie/selfie.d.ts +2 -0
  113. package/dist/types/selfie.d.ts +24 -0
  114. package/dist/types/styles/core.d.ts +1 -0
  115. package/dist/vendor-preact-CK0WeTOR.js +584 -0
  116. package/package.json +17 -17
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 {}