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

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 (209) hide show
  1. package/dist/base.css +1071 -0
  2. package/dist/browser-ponyfill-B6W6hHVY.js +344 -0
  3. package/dist/email/email.es.js +145 -0
  4. package/dist/email/styles.css +123 -0
  5. package/dist/flow/flow.es.js +555 -0
  6. package/dist/flow/styles.css +1119 -0
  7. package/dist/incodeModule-Dv8Qllrv.js +254 -0
  8. package/dist/index.es.js +6 -0
  9. package/dist/instance-B-q0ZREN.js +2140 -0
  10. package/dist/otpInput-BtoZe0Wz.js +151 -0
  11. package/dist/page-Dh_Zw2ik.js +234 -0
  12. package/dist/phone/phone.es.js +3441 -0
  13. package/dist/phone/styles.css +305 -0
  14. package/dist/selfie/selfie.es.js +893 -0
  15. package/dist/selfie/styles.css +590 -0
  16. package/dist/selfieTutorial-C-u5GufD.js +29 -0
  17. package/dist/setup-wNL83jmW.js +20 -0
  18. package/dist/themes/dark.css +652 -0
  19. package/dist/themes/light.css +543 -0
  20. package/dist/title-BfO5Dlzk.js +25 -0
  21. package/dist/types/base.d.ts +1 -0
  22. package/dist/types/dark.d.ts +1 -0
  23. package/dist/types/email.d.ts +57 -0
  24. package/dist/types/flow.d.ts +69 -0
  25. package/dist/types/index.d.ts +38 -0
  26. package/dist/types/light.d.ts +1 -0
  27. package/dist/types/phone.d.ts +58 -0
  28. package/dist/types/selfie.d.ts +31 -0
  29. package/dist/types/styles.d.ts +1 -0
  30. package/dist/types/themes/dark.d.ts +1 -0
  31. package/dist/types/themes/light.d.ts +1 -0
  32. package/dist/uiConfig-CQ1W9cUD.js +23 -0
  33. package/dist/vendor-preact-CK0WeTOR.js +584 -0
  34. package/package.json +32 -26
  35. package/dev/README.md +0 -163
  36. package/dev/getToken.ts +0 -36
  37. package/dev/headless.html +0 -875
  38. package/dev/index.html +0 -366
  39. package/dev/main-headless.tsx +0 -1332
  40. package/dev/main-orchestrated-flow.tsx +0 -1158
  41. package/dev/main-preact.tsx +0 -323
  42. package/dev/main-simplified.tsx +0 -123
  43. package/dev/main-web-component.tsx +0 -256
  44. package/dev/main.tsx +0 -332
  45. package/dev/manual.html +0 -27
  46. package/dev/orchestrated-flow.html +0 -64
  47. package/dev/simplified.html +0 -64
  48. package/dev/tiktok-logo.svg +0 -7
  49. package/src/defineCustomElement.tsx +0 -30
  50. package/src/email/email.test.tsx +0 -368
  51. package/src/email/email.tsx +0 -255
  52. package/src/email/emailInput.test.tsx +0 -264
  53. package/src/email/emailInput.tsx +0 -85
  54. package/src/email/styles.css +0 -59
  55. package/src/flow/flow.test.tsx +0 -796
  56. package/src/flow/flow.tsx +0 -292
  57. package/src/flow/flowCompleted.css +0 -30
  58. package/src/flow/flowCompleted.test.tsx +0 -331
  59. package/src/flow/flowCompleted.tsx +0 -121
  60. package/src/flow/flowInit.test.ts +0 -264
  61. package/src/flow/flowInit.ts +0 -94
  62. package/src/flow/flowStart.css +0 -58
  63. package/src/flow/flowStart.test.tsx +0 -49
  64. package/src/flow/flowStart.tsx +0 -41
  65. package/src/flow/incode-logo.svg +0 -8
  66. package/src/flow/index.ts +0 -7
  67. package/src/flow/preloadFlow.test.ts +0 -421
  68. package/src/flow/preloadFlow.ts +0 -171
  69. package/src/flow/styles.css +0 -9
  70. package/src/flow/unsupportedModule.css +0 -21
  71. package/src/flow/unsupportedModule.tsx +0 -39
  72. package/src/flow/useFlowInitialization.test.tsx +0 -292
  73. package/src/flow/useFlowInitialization.ts +0 -128
  74. package/src/flow/useModuleLoader.test.tsx +0 -212
  75. package/src/flow/useModuleLoader.ts +0 -92
  76. package/src/hooks/index.ts +0 -1
  77. package/src/hooks/useManager.test.ts +0 -91
  78. package/src/hooks/useManager.ts +0 -40
  79. package/src/i18n/index.ts +0 -3
  80. package/src/i18n/instance.ts +0 -16
  81. package/src/i18n/setup.ts +0 -184
  82. package/src/i18n/useTranslation.ts +0 -42
  83. package/src/index.ts +0 -27
  84. package/src/permissions/assets/android-dots-icon.svg +0 -7
  85. package/src/permissions/assets/android-settings-icon.svg +0 -16
  86. package/src/permissions/assets/android-toggle-icon.svg +0 -20
  87. package/src/permissions/assets/bank-card-icon.svg +0 -14
  88. package/src/permissions/assets/camera-icon.svg +0 -12
  89. package/src/permissions/assets/camera-ios.svg +0 -53
  90. package/src/permissions/assets/check-icon.svg +0 -8
  91. package/src/permissions/assets/chrome-icon.svg +0 -43
  92. package/src/permissions/assets/password-icon.svg +0 -11
  93. package/src/permissions/assets/permissions-img.svg +0 -51
  94. package/src/permissions/assets/safari-icon.svg +0 -37
  95. package/src/permissions/assets/settings-icon.svg +0 -33
  96. package/src/permissions/assets/toggle-icon.svg +0 -19
  97. package/src/permissions/assets/warning-icon.svg +0 -6
  98. package/src/permissions/boldWithArrow.css +0 -9
  99. package/src/permissions/boldWithArrow.tsx +0 -41
  100. package/src/permissions/denied.css +0 -37
  101. package/src/permissions/denied.tsx +0 -29
  102. package/src/permissions/deniedAndroid.tsx +0 -56
  103. package/src/permissions/deniedDesktop.css +0 -9
  104. package/src/permissions/deniedDesktop.tsx +0 -64
  105. package/src/permissions/deniedIOS.tsx +0 -73
  106. package/src/permissions/deniedInstructions.tsx +0 -19
  107. package/src/permissions/iconWrapper.css +0 -9
  108. package/src/permissions/iconWrapper.tsx +0 -15
  109. package/src/permissions/learnMore.css +0 -37
  110. package/src/permissions/learnMore.tsx +0 -85
  111. package/src/permissions/numberedStep.css +0 -13
  112. package/src/permissions/numberedStep.tsx +0 -14
  113. package/src/permissions/permissions.css +0 -13
  114. package/src/permissions/permissions.tsx +0 -68
  115. package/src/phone/phone.tsx +0 -246
  116. package/src/phone/phoneInput.test.tsx +0 -275
  117. package/src/phone/phoneInput.tsx +0 -249
  118. package/src/phone/styles.css +0 -158
  119. package/src/selfie/cameraButton.css +0 -13
  120. package/src/selfie/cameraButton.tsx +0 -35
  121. package/src/selfie/capture.css +0 -57
  122. package/src/selfie/capture.tsx +0 -232
  123. package/src/selfie/errorModal.tsx +0 -218
  124. package/src/selfie/errorModalContent.css +0 -33
  125. package/src/selfie/errorModalContent.tsx +0 -44
  126. package/src/selfie/faceOutline.css +0 -5
  127. package/src/selfie/faceOutline.tsx +0 -22
  128. package/src/selfie/loadingBorder.css +0 -12
  129. package/src/selfie/loadingBorder.tsx +0 -77
  130. package/src/selfie/manualCaptureButton.css +0 -13
  131. package/src/selfie/manualCaptureButton.tsx +0 -35
  132. package/src/selfie/noMoreAttemptsModal.tsx +0 -44
  133. package/src/selfie/notification.css +0 -9
  134. package/src/selfie/notification.tsx +0 -36
  135. package/src/selfie/retryErrorModal.tsx +0 -56
  136. package/src/selfie/selfie.test.tsx +0 -458
  137. package/src/selfie/selfie.tsx +0 -83
  138. package/src/selfie/selfieTutorial.json +0 -2626
  139. package/src/selfie/styles.css +0 -1
  140. package/src/selfie/tutorial.test.tsx +0 -200
  141. package/src/selfie/tutorial.tsx +0 -43
  142. package/src/setup.ts +0 -33
  143. package/src/shared/baseTutorial/baseTutorial.css +0 -21
  144. package/src/shared/baseTutorial/baseTutorial.test.tsx +0 -184
  145. package/src/shared/baseTutorial/baseTutorial.tsx +0 -55
  146. package/src/shared/baseTutorial/replaceBaseTutorial.test.ts +0 -267
  147. package/src/shared/baseTutorial/replaceBaseTutorial.ts +0 -68
  148. package/src/shared/button/button.css +0 -55
  149. package/src/shared/button/button.test.tsx +0 -101
  150. package/src/shared/button/button.tsx +0 -47
  151. package/src/shared/componentRoot/incodeComponent.tsx +0 -12
  152. package/src/shared/countries/countries.test.ts +0 -75
  153. package/src/shared/countries/countries.ts +0 -139
  154. package/src/shared/countries/index.ts +0 -6
  155. package/src/shared/icons/chevronDown.tsx +0 -22
  156. package/src/shared/icons/index.ts +0 -2
  157. package/src/shared/icons/successIcon.css +0 -5
  158. package/src/shared/icons/successIcon.test.tsx +0 -40
  159. package/src/shared/icons/successIcon.tsx +0 -26
  160. package/src/shared/loader/loadingIcon.css +0 -28
  161. package/src/shared/loader/loadingIcon.tsx +0 -67
  162. package/src/shared/lottie/lottie.tsx +0 -108
  163. package/src/shared/otpInput/otpInput.css +0 -85
  164. package/src/shared/otpInput/otpInput.test.tsx +0 -356
  165. package/src/shared/otpInput/otpInput.tsx +0 -241
  166. package/src/shared/page/incode-logo.svg +0 -3
  167. package/src/shared/page/page.css +0 -47
  168. package/src/shared/page/page.test.tsx +0 -97
  169. package/src/shared/page/page.tsx +0 -91
  170. package/src/shared/page/pageUiConfig.test.ts +0 -112
  171. package/src/shared/page/pageUiConfig.ts +0 -64
  172. package/src/shared/page/verifiedByIncode.css +0 -5
  173. package/src/shared/page/verifiedByIncode.tsx +0 -75
  174. package/src/shared/spacer/spacer.css +0 -149
  175. package/src/shared/spacer/spacer.test.tsx +0 -143
  176. package/src/shared/spacer/spacer.tsx +0 -88
  177. package/src/shared/spinner/index.ts +0 -2
  178. package/src/shared/spinner/spinner.css +0 -28
  179. package/src/shared/spinner/spinner.test.tsx +0 -82
  180. package/src/shared/spinner/spinner.tsx +0 -65
  181. package/src/shared/title/title.css +0 -7
  182. package/src/shared/title/title.tsx +0 -12
  183. package/src/shared/uiConfig/uiConfig.ts +0 -36
  184. package/src/shared/webComponent/incodeModule.ts +0 -29
  185. package/src/shared/webComponent/registerIncodeElement.ts +0 -15
  186. package/src/styles/__mocks__/fetchTheme.ts +0 -19
  187. package/src/styles/applyTheme.ts +0 -37
  188. package/src/styles/cn.test.tsx +0 -57
  189. package/src/styles/cn.tsx +0 -21
  190. package/src/styles/core.css +0 -12
  191. package/src/styles/fetchTheme.test.ts +0 -390
  192. package/src/styles/fetchTheme.ts +0 -88
  193. package/src/styles/generatePalette.ts +0 -111
  194. package/src/styles/reset.css +0 -65
  195. package/src/styles/resolveCssVariableToHex.ts +0 -28
  196. package/src/styles/tailwind.css +0 -291
  197. package/src/styles/themeTypes.ts +0 -18
  198. package/src/styles/tokens/colors.css +0 -190
  199. package/src/styles/tokens/components.css +0 -174
  200. package/src/styles/tokens/index.css +0 -4
  201. package/src/styles/tokens/primitives.css +0 -129
  202. package/src/styles/tokens/semantic.css +0 -51
  203. package/src/svg.d.ts +0 -4
  204. package/src/types/assets.d.ts +0 -1
  205. package/src/types/custom-elements.d.ts +0 -104
  206. package/tsconfig.json +0 -22
  207. package/vite.config.ts +0 -260
  208. package/vitest.config.ts +0 -40
  209. package/vitest.setup.ts +0 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -9,65 +9,58 @@
9
9
  "types": "./dist/types/index.d.ts",
10
10
  "import": "./dist/index.es.js"
11
11
  },
12
- "./styles/tokens.css": {
13
- "default": "./dist/styles/tokens.css"
12
+ "./themes/light.css": {
13
+ "default": "./dist/themes/light.css"
14
14
  },
15
- "./styles/core.css": {
16
- "default": "./dist/styles/core.css"
15
+ "./themes/dark.css": {
16
+ "default": "./dist/themes/dark.css"
17
+ },
18
+ "./base.css": {
19
+ "default": "./dist/base.css"
17
20
  },
18
21
  "./selfie": {
19
- "types": "./dist/types/selfie/selfie.d.ts",
22
+ "types": "./dist/types/selfie.d.ts",
20
23
  "import": "./dist/selfie/selfie.es.js"
21
24
  },
22
25
  "./selfie/styles.css": {
23
26
  "default": "./dist/selfie/styles.css"
24
27
  },
25
28
  "./phone": {
26
- "types": "./dist/types/phone/phone.d.ts",
29
+ "types": "./dist/types/phone.d.ts",
27
30
  "import": "./dist/phone/phone.es.js"
28
31
  },
29
32
  "./phone/styles.css": {
30
33
  "default": "./dist/phone/styles.css"
31
34
  },
32
35
  "./email": {
33
- "types": "./dist/types/email/email.d.ts",
36
+ "types": "./dist/types/email.d.ts",
34
37
  "import": "./dist/email/email.es.js"
35
38
  },
36
39
  "./email/styles.css": {
37
40
  "default": "./dist/email/styles.css"
38
41
  },
39
42
  "./flow": {
40
- "types": "./dist/types/flow/flow.d.ts",
43
+ "types": "./dist/types/flow.d.ts",
41
44
  "import": "./dist/flow/flow.es.js"
42
45
  },
43
46
  "./flow/styles.css": {
44
47
  "default": "./dist/flow/styles.css"
45
48
  }
46
49
  },
47
- "scripts": {
48
- "dev": "vite",
49
- "build:dev": "vite build --watch",
50
- "prebuild": "bun run ../../scripts/generate-asset-manifest.ts",
51
- "build": "vite build",
52
- "test": "vitest run",
53
- "coverage": "vitest run --coverage",
54
- "lint": "biome lint .",
55
- "format": "biome format . --write",
56
- "typecheck": "tsc -p tsconfig.json --noEmit"
57
- },
50
+ "files": [
51
+ "dist"
52
+ ],
58
53
  "dependencies": {
59
- "@incodetech/core": "workspace:*",
60
54
  "@tailwindcss/vite": "^4.1.17",
61
55
  "i18next": "^25.7.1",
62
56
  "i18next-browser-languagedetector": "^8.2.0",
63
57
  "i18next-http-backend": "^3.0.2",
64
58
  "libphonenumber-js": "^1.11.0",
65
59
  "preact-custom-element": "^4.6.0",
66
- "tailwindcss": "^4.1.17"
60
+ "tailwindcss": "^4.1.17",
61
+ "@incodetech/core": "2.0.0-alpha.10"
67
62
  },
68
63
  "devDependencies": {
69
- "@biomejs/biome": "^2.3.7",
70
- "@incodetech/config": "workspace:*",
71
64
  "@preact/preset-vite": "^2.10.2",
72
65
  "@tailwindcss/postcss": "^4.1.17",
73
66
  "@testing-library/preact": "^3.2.4",
@@ -80,6 +73,19 @@
80
73
  "typescript": "^5.9.3",
81
74
  "vite": "^7.2.4",
82
75
  "vite-plugin-dts": "^4.5.4",
83
- "vitest": "^4.0.13"
76
+ "vitest": "^4.0.13",
77
+ "@incodetech/config": "1.0.0"
78
+ },
79
+ "scripts": {
80
+ "dev": "vite",
81
+ "build:dev": "vite build --watch",
82
+ "build": "vite build",
83
+ "test": "vitest run",
84
+ "coverage": "vitest run --coverage",
85
+ "lint": "eslint .",
86
+ "lint:fix": "eslint . --fix",
87
+ "format": "prettier --write .",
88
+ "format:check": "prettier --check .",
89
+ "typecheck": "tsc -p tsconfig.json --noEmit"
84
90
  }
85
- }
91
+ }
package/dev/README.md DELETED
@@ -1,163 +0,0 @@
1
- # UI Dev Demos
2
-
3
- This folder contains various demo files to test and demonstrate different integration patterns for the Incode Web SDK.
4
-
5
- ## Running the Demos
6
-
7
- ```bash
8
- cd packages/ui
9
- pnpm dev
10
- ```
11
-
12
- Then open the landing page at `/dev/index.html` to see all available demos.
13
-
14
- ### Landing Page
15
-
16
- The landing page (`/dev/index.html`) provides:
17
- - Overview of all integration patterns
18
- - Config ID input field (persisted to localStorage)
19
- - Quick links to each demo with configId passed as query parameter
20
-
21
- ---
22
-
23
- ## Demo Scenarios
24
-
25
- ### 1. Simplified Flow (`/dev/simplified.html`)
26
-
27
- **Files:** `simplified.html`, `main-simplified.tsx`
28
-
29
- **Pattern:** Drop-in `<incode-flow>` web component
30
-
31
- **Best for:** Customers who want the simplest integration with minimal code.
32
-
33
- ```html
34
- <incode-flow id="flow"></incode-flow>
35
-
36
- <script type="module">
37
- import '@incodetech/ui/flow';
38
-
39
- const flow = document.getElementById('flow');
40
- flow.token = 'your-session-token';
41
- flow.onComplete = (result) => {
42
- console.log('Done!', result);
43
- };
44
- </script>
45
- ```
46
-
47
- **What it demonstrates:**
48
- - Single web component handles everything
49
- - No manual flow management needed
50
- - Automatic module orchestration
51
-
52
- ---
53
-
54
- ### 2. Orchestrated Flow with Custom UI (`/dev/orchestrated-flow.html`)
55
-
56
- **Files:** `orchestrated-flow.html`, `main-orchestrated-flow.tsx`
57
-
58
- **Pattern:** `createOrchestratedFlowManager` with custom UI components
59
-
60
- **Best for:** Customers who want orchestration benefits but need custom UI.
61
-
62
- ```tsx
63
- const [state, flowManager] = useManager(() =>
64
- createOrchestratedFlowManager({
65
- modules: { PHONE: phoneMachine },
66
- })
67
- );
68
-
69
- // Render your own UI, signal completion when done
70
- <Phone
71
- config={config}
72
- onFinish={() => flowManager.completeModule()}
73
- />
74
- ```
75
-
76
- **What it demonstrates:**
77
- - Using the orchestrator directly
78
- - Custom UI rendering based on flow state
79
- - Signaling module completion with `completeModule()`
80
- - Access to `finishStatus` when flow completes
81
-
82
- ---
83
-
84
- ### 3. Manual Flow Control (`/dev/manual.html`)
85
-
86
- **Files:** `manual.html`, `main-web-component.tsx`
87
-
88
- **Pattern:** `createFlowManager` with manual `nextStep()` calls
89
-
90
- **Best for:** Legacy pattern or customers needing full manual control.
91
-
92
- ```tsx
93
- const [state, flowManager] = useManager(() => createFlowManager());
94
-
95
- // Manually advance the flow
96
- <Phone
97
- config={config}
98
- onFinish={() => flowManager.nextStep()}
99
- />
100
- ```
101
-
102
- **What it demonstrates:**
103
- - Original flow manager (non-orchestrated)
104
- - Manual step advancement
105
- - Full control over flow progression
106
-
107
- ---
108
-
109
- ### 4. Headless Demo (`/dev/headless.html`)
110
-
111
- **Files:** `headless.html`, `main-headless.tsx`
112
-
113
- **Pattern:** Core SDK only, custom vanilla UI
114
-
115
- **Best for:** Customers building completely custom UIs (React, Vue, vanilla JS, etc.)
116
-
117
- ```ts
118
- import { createPhoneManager } from '@incodetech/core/phone';
119
-
120
- const manager = createPhoneManager({ config });
121
-
122
- // Subscribe to state changes
123
- manager.subscribe((state) => {
124
- // Render your own UI based on state
125
- renderCustomUI(state);
126
- });
127
-
128
- // Call manager methods
129
- manager.setPhoneNumber('+1234567890', true);
130
- manager.submit();
131
- ```
132
-
133
- **What it demonstrates:**
134
- - Using Core SDK without any Incode UI components
135
- - Building custom UI with vanilla JavaScript (or any framework)
136
- - Full state machine visibility and control
137
- - Manager pattern API
138
-
139
- ---
140
-
141
- ## Comparison Chart
142
-
143
- | Demo | Flow Manager | UI Components | Complexity | Use Case |
144
- |------|--------------|---------------|------------|----------|
145
- | Simplified | Orchestrated (internal) | `<incode-flow>` | ⭐ Lowest | Drop-in integration |
146
- | Orchestrated | `createOrchestratedFlowManager` | Incode UI | ⭐⭐ Medium | Custom flow, Incode UI |
147
- | Manual | `createFlowManager` | Incode UI | ⭐⭐⭐ Higher | Full manual control |
148
- | Headless | None | Custom | ⭐⭐⭐⭐ Highest | Fully custom UI |
149
-
150
- ---
151
-
152
- ## Architecture Layers
153
-
154
- All demos follow the three-layer architecture:
155
-
156
- ```
157
- Layer 2 (UI) → Preact components, CSS, web components
158
- Layer 1 (Core) → State machines, managers, business logic
159
- Layer 0 (Infra) → Browser APIs, WASM, utilities
160
- ```
161
-
162
- See `/docs/ARCHITECTURE_GOALS.md` for full details.
163
-
package/dev/getToken.ts DELETED
@@ -1,36 +0,0 @@
1
- // this never will be export or use in production, this is for development purposes only
2
-
3
- const DEFAULT_CONFIG_ID = '67ddc65d36b9814a930c4dff';
4
-
5
- export function getConfigIdFromUrl(): string {
6
- const params = new URLSearchParams(window.location.search);
7
- return params.get('configId') ?? DEFAULT_CONFIG_ID;
8
- }
9
-
10
- type GetTokenOptions = {
11
- configId?: string;
12
- };
13
-
14
- export const getToken = async (options: GetTokenOptions = {}) => {
15
- const configId = options.configId ?? getConfigIdFromUrl();
16
-
17
- const response = await fetch(
18
- 'https://user-service-k8s.stage.incodetest.com/omni/start',
19
- {
20
- headers: {
21
- 'x-api-key': '5fbc0ab5a652b7808fbec42fffd8b4c9ec248413',
22
- 'api-version': '1.0',
23
- 'Content-Type': 'application/json',
24
- Accept: 'application/json',
25
- },
26
- body: JSON.stringify({
27
- configurationId: configId,
28
- uuid: null,
29
- interviewId: null,
30
- language: 'en-US',
31
- }),
32
- method: 'POST',
33
- },
34
- );
35
- return response.json();
36
- };