@incodetech/web 0.0.0-dev-20260409-09dfd52 → 0.0.0-dev-20260409-089e5c6

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.
@@ -0,0 +1,197 @@
1
+ import { n as e } from "../i18n-DGG1zc7t.js";
2
+ import { _ as t, v as n } from "../vendor-preact-D6SntenC.js";
3
+ import { c as r, r as i } from "../loadingIcon-B3xEpDvA.js";
4
+ import { t as a } from "../page-kB-LDkaO.js";
5
+ import { t as o } from "../spinner-4epdvlck.js";
6
+ import { t as s } from "../button-Dt72Wn3U.js";
7
+ import { t as c } from "../incodeModule-C3p8eAh_.js";
8
+ import { createIdentityReuseManager as l } from "@incodetech/core/identity-reuse";
9
+ //#region src/modules/identity-reuse/identity-reuse.tsx
10
+ var u = ({ name: e }) => /* @__PURE__ */ n("div", {
11
+ class: "IncodeIdentityReuseCircle",
12
+ children: /* @__PURE__ */ n("span", {
13
+ class: "IncodeIdentityReuseCircleText",
14
+ children: e
15
+ })
16
+ }), d = () => /* @__PURE__ */ n("svg", {
17
+ class: "IncodeIdentityReuseArrow",
18
+ viewBox: "0 0 24 24",
19
+ fill: "none",
20
+ "aria-hidden": "true",
21
+ children: /* @__PURE__ */ n("path", {
22
+ d: "M5 12h14M13 6l6 6-6 6",
23
+ stroke: "currentColor",
24
+ "stroke-width": "2",
25
+ "stroke-linecap": "round",
26
+ "stroke-linejoin": "round"
27
+ })
28
+ }), f = ({ providingOrganization: e, receivingOrganization: t }) => /* @__PURE__ */ n("div", {
29
+ class: "IncodeIdentityReuseVisualization",
30
+ children: [
31
+ /* @__PURE__ */ n("div", {
32
+ class: "IncodeIdentityReuseCircleWrapper",
33
+ children: /* @__PURE__ */ n(u, { name: e })
34
+ }),
35
+ /* @__PURE__ */ n("div", {
36
+ class: "IncodeIdentityReuseArrowWrapper",
37
+ children: /* @__PURE__ */ n(d, {})
38
+ }),
39
+ /* @__PURE__ */ n("div", {
40
+ class: "IncodeIdentityReuseCircleWrapper",
41
+ children: /* @__PURE__ */ n(u, { name: t })
42
+ })
43
+ ]
44
+ }), p = ({ config: i, manager: c, onFinish: u, onError: d }) => {
45
+ let { t: p } = e(), [m, h] = r(() => {
46
+ if (c) return c;
47
+ if (!i) throw Error("IdentityReuse config is required when no manager is provided");
48
+ return l({ config: i });
49
+ }, { manageLifecycle: !c });
50
+ t(() => {
51
+ m.status === "finished" && u?.();
52
+ }, [m.status, u]);
53
+ let g = m.status === "error" ? m.error : void 0;
54
+ return t(() => {
55
+ g && d?.(g);
56
+ }, [g, d]), m.status === "idle" || m.status === "loading" || m.status === "submitContinue" || m.status === "submitSkip" ? /* @__PURE__ */ n(o, { title: p("identityReuse.loading") }) : m.status === "oneCandidateFound" ? /* @__PURE__ */ n(a, {
57
+ className: "IncodeIdentityReusePage",
58
+ title: p("identityReuse.title"),
59
+ subtitle: p("identityReuse.subtitle"),
60
+ children: [/* @__PURE__ */ n("div", {
61
+ class: "IncodeIdentityReuseContent",
62
+ children: [/* @__PURE__ */ n(f, {
63
+ providingOrganization: m.selectedOrganizationName,
64
+ receivingOrganization: m.currentOrganizationName
65
+ }), /* @__PURE__ */ n("p", {
66
+ class: "IncodeIdentityReuseDescription",
67
+ children: p("identityReuse.description", { companyName: m.currentOrganizationName })
68
+ })]
69
+ }), /* @__PURE__ */ n("div", {
70
+ class: "IncodeIdentityReuseActions",
71
+ children: [/* @__PURE__ */ n(s, {
72
+ onClick: () => h.submitCandidate(),
73
+ "data-testid": "identity-reuse-continue-button",
74
+ children: p("identityReuse.cta.continue")
75
+ }), /* @__PURE__ */ n(s, {
76
+ onClick: () => h.skip(),
77
+ variant: "link",
78
+ "data-testid": "identity-reuse-verify-button",
79
+ children: p("identityReuse.cta.verify")
80
+ })]
81
+ })]
82
+ }) : m.status === "multiCandidatesFound" ? m.selectionPhase === "candidateSelected" ? /* @__PURE__ */ n(a, {
83
+ className: "IncodeIdentityReusePage",
84
+ title: p("identityReuse.title"),
85
+ subtitle: p("identityReuse.subtitle"),
86
+ children: [/* @__PURE__ */ n("div", {
87
+ class: "IncodeIdentityReuseContent",
88
+ children: [/* @__PURE__ */ n(f, {
89
+ providingOrganization: m.selectedOrganizationName,
90
+ receivingOrganization: m.currentOrganizationName
91
+ }), /* @__PURE__ */ n("p", {
92
+ class: "IncodeIdentityReuseDescription",
93
+ children: p("identityReuse.description", { companyName: m.currentOrganizationName })
94
+ })]
95
+ }), /* @__PURE__ */ n("div", {
96
+ class: "IncodeIdentityReuseActions",
97
+ children: [
98
+ /* @__PURE__ */ n(s, {
99
+ onClick: () => h.submitCandidate(),
100
+ "data-testid": "identity-reuse-continue-button",
101
+ children: p("identityReuse.cta.continue")
102
+ }),
103
+ /* @__PURE__ */ n(s, {
104
+ onClick: () => h.changeCandidate(),
105
+ variant: "link",
106
+ "data-testid": "identity-reuse-change-button",
107
+ children: p("identityReuse.cta.change")
108
+ }),
109
+ /* @__PURE__ */ n(s, {
110
+ onClick: () => h.skip(),
111
+ variant: "link",
112
+ "data-testid": "identity-reuse-verify-button",
113
+ children: p("identityReuse.cta.verify")
114
+ })
115
+ ]
116
+ })]
117
+ }) : /* @__PURE__ */ n(a, {
118
+ className: "IncodeIdentityReusePage",
119
+ title: p("identityReuse.selectTitle"),
120
+ subtitle: p("identityReuse.selectSubtitle"),
121
+ children: [/* @__PURE__ */ n("div", {
122
+ class: "IncodeIdentityReuseContent",
123
+ children: /* @__PURE__ */ n("div", {
124
+ class: "IncodeIdentityReuseCandidateList",
125
+ children: m.candidateOrganizationNames.map((e) => /* @__PURE__ */ n("button", {
126
+ type: "button",
127
+ class: "IncodeIdentityReuseCandidateItem",
128
+ onClick: () => {
129
+ h.startSelection(), h.chooseCandidate(e);
130
+ },
131
+ "data-testid": `identity-reuse-candidate-${e}`,
132
+ children: [/* @__PURE__ */ n("span", {
133
+ class: "IncodeIdentityReuseCandidateItemName",
134
+ children: e
135
+ }), /* @__PURE__ */ n("svg", {
136
+ class: "IncodeIdentityReuseCandidateItemChevron",
137
+ viewBox: "0 0 24 24",
138
+ fill: "none",
139
+ "aria-hidden": "true",
140
+ children: /* @__PURE__ */ n("path", {
141
+ d: "M9 6l6 6-6 6",
142
+ stroke: "currentColor",
143
+ "stroke-width": "2",
144
+ "stroke-linecap": "round",
145
+ "stroke-linejoin": "round"
146
+ })
147
+ })]
148
+ }, e))
149
+ })
150
+ }), /* @__PURE__ */ n("div", {
151
+ class: "IncodeIdentityReuseActions",
152
+ children: /* @__PURE__ */ n(s, {
153
+ onClick: () => h.skip(),
154
+ variant: "link",
155
+ "data-testid": "identity-reuse-verify-button",
156
+ children: p("identityReuse.cta.verify")
157
+ })
158
+ })]
159
+ }) : m.status === "noCandidatesFound" ? /* @__PURE__ */ n(a, {
160
+ className: "IncodeIdentityReusePage",
161
+ title: p("identityReuse.noCandidatesTitle"),
162
+ subtitle: p("identityReuse.noCandidatesSubtitle"),
163
+ children: [/* @__PURE__ */ n("div", { class: "IncodeIdentityReuseContent" }), /* @__PURE__ */ n("div", {
164
+ class: "IncodeIdentityReuseActions",
165
+ children: /* @__PURE__ */ n(s, {
166
+ onClick: () => h.skip(),
167
+ "data-testid": "identity-reuse-continue-button",
168
+ children: p("identityReuse.cta.continueVerification")
169
+ })
170
+ })]
171
+ }) : m.status === "error" ? /* @__PURE__ */ n(a, {
172
+ className: "IncodeIdentityReusePage",
173
+ title: p("identityReuse.errorTitle"),
174
+ subtitle: m.error,
175
+ children: [/* @__PURE__ */ n("div", { class: "IncodeIdentityReuseContent" }), /* @__PURE__ */ n("div", {
176
+ class: "IncodeIdentityReuseActions",
177
+ children: [/* @__PURE__ */ n(s, {
178
+ onClick: () => h.retry(),
179
+ "data-testid": "identity-reuse-retry-button",
180
+ children: p("identityReuse.cta.retry")
181
+ }), /* @__PURE__ */ n(s, {
182
+ onClick: () => h.skip(),
183
+ variant: "link",
184
+ "data-testid": "identity-reuse-verify-button",
185
+ children: p("identityReuse.cta.verify")
186
+ })]
187
+ })]
188
+ }) : (m.status, null);
189
+ }, m = ({ config: e, manager: t, onFinish: r, onError: a }) => /* @__PURE__ */ n(i, { children: e || t ? /* @__PURE__ */ n(p, {
190
+ config: e,
191
+ manager: t,
192
+ onFinish: r,
193
+ onError: a
194
+ }) : null });
195
+ c(m, "incode-identity-reuse");
196
+ //#endregion
197
+ export { m as IdentityReuse };
@@ -0,0 +1,163 @@
1
+ /*! tailwindcss v4.2.2 | 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-font-weight: initial;
6
+ --tw-border-style: solid;
7
+ --tw-duration: initial;
8
+ }
9
+ }
10
+ }
11
+
12
+ @keyframes fadeIn {
13
+ from {
14
+ opacity: 0;
15
+ transform: translateY(8px);
16
+ }
17
+
18
+ to {
19
+ opacity: 1;
20
+ transform: translateY(0);
21
+ }
22
+ }
23
+
24
+ .IncodeIdentityReusePage {
25
+ animation: .4s ease-out fadeIn;
26
+ }
27
+
28
+ .IncodeIdentityReuseContent {
29
+ flex-direction: column;
30
+ flex: 1;
31
+ justify-content: center;
32
+ align-items: center;
33
+ display: flex;
34
+ }
35
+
36
+ .IncodeIdentityReuseVisualization {
37
+ justify-content: center;
38
+ align-items: center;
39
+ gap: var(--spacing-8, var(--spacing-8, 8px));
40
+ width: 100%;
41
+ display: flex;
42
+ }
43
+
44
+ .IncodeIdentityReuseCircleWrapper {
45
+ flex: 1;
46
+ justify-content: center;
47
+ align-items: center;
48
+ display: flex;
49
+ }
50
+
51
+ .IncodeIdentityReuseCircle {
52
+ aspect-ratio: 1;
53
+ border-radius: var(--radius-full, var(--border-radius-full));
54
+ background-color: var(--surface-brand-50);
55
+ justify-content: center;
56
+ align-items: center;
57
+ width: 100%;
58
+ max-width: 180px;
59
+ display: flex;
60
+ }
61
+
62
+ .IncodeIdentityReuseCircleText {
63
+ padding-inline: var(--spacing-16, var(--spacing-16, 16px));
64
+ text-align: center;
65
+ font-size: var(--text-18, var(--primitive-typography-size-18));
66
+ --tw-font-weight: var(--font-weight-bold, var(--primitive-typography-weight-bold));
67
+ font-weight: var(--font-weight-bold, var(--primitive-typography-weight-bold));
68
+ color: var(--surface-brand-500);
69
+ }
70
+
71
+ .IncodeIdentityReuseArrowWrapper {
72
+ justify-content: center;
73
+ align-items: center;
74
+ width: 10%;
75
+ display: flex;
76
+ }
77
+
78
+ .IncodeIdentityReuseArrow {
79
+ width: 100%;
80
+ color: var(--text-body-800-secondary);
81
+ }
82
+
83
+ .IncodeIdentityReuseDescription {
84
+ margin: var(--spacing-0, var(--spacing-none, 0px));
85
+ margin-top: var(--spacing-24, var(--spacing-24, 24px));
86
+ text-align: center;
87
+ font-size: var(--text-16, var(--primitive-typography-size-16));
88
+ color: var(--text-body-800-secondary);
89
+ }
90
+
91
+ .IncodeIdentityReuseActions {
92
+ gap: var(--spacing-8, var(--spacing-8, 8px));
93
+ flex-direction: column;
94
+ display: flex;
95
+ }
96
+
97
+ .IncodeIdentityReuseCandidateList {
98
+ gap: var(--spacing-8, var(--spacing-8, 8px));
99
+ flex-direction: column;
100
+ width: 100%;
101
+ display: flex;
102
+ }
103
+
104
+ .IncodeIdentityReuseCandidateItem {
105
+ cursor: pointer;
106
+ border-radius: var(--radius-medium, var(--border-radius-medium));
107
+ border-style: var(--tw-border-style);
108
+ width: 100%;
109
+ padding-inline: var(--spacing-16, var(--spacing-16, 16px));
110
+ padding-block: var(--spacing-16, var(--spacing-16, 16px));
111
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
112
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));
113
+ transition-duration: var(--tw-duration, var(--default-transition-duration, .15s));
114
+ --tw-duration: .2s;
115
+ background-color: var(--surface-brand-50);
116
+ border-width: 1px;
117
+ border-color: var(--surface-brand-50);
118
+ justify-content: space-between;
119
+ align-items: center;
120
+ transition-duration: .2s;
121
+ display: flex;
122
+ }
123
+
124
+ .IncodeIdentityReuseCandidateItem:hover {
125
+ border-color: var(--surface-brand-500);
126
+ }
127
+
128
+ .IncodeIdentityReuseCandidateItem:focus-visible {
129
+ --tw-outline-style: none;
130
+ border-color: var(--border-status-focus);
131
+ box-shadow: 0 0 0 2px var(--border-status-focus);
132
+ outline-style: none;
133
+ }
134
+
135
+ .IncodeIdentityReuseCandidateItemName {
136
+ font-size: var(--text-16, var(--primitive-typography-size-16));
137
+ --tw-font-weight: var(--font-weight-medium, var(--primitive-typography-weight-medium));
138
+ font-weight: var(--font-weight-medium, var(--primitive-typography-weight-medium));
139
+ color: var(--text-body-800-primary);
140
+ }
141
+
142
+ .IncodeIdentityReuseCandidateItemChevron {
143
+ width: var(--spacing-24, var(--spacing-24, 24px));
144
+ height: var(--spacing-24, var(--spacing-24, 24px));
145
+ color: var(--text-body-800-secondary);
146
+ flex-shrink: 0;
147
+ }
148
+
149
+ @property --tw-font-weight {
150
+ syntax: "*";
151
+ inherits: false
152
+ }
153
+
154
+ @property --tw-border-style {
155
+ syntax: "*";
156
+ inherits: false;
157
+ initial-value: solid;
158
+ }
159
+
160
+ @property --tw-duration {
161
+ syntax: "*";
162
+ inherits: false
163
+ }
@@ -0,0 +1,38 @@
1
+ import { FC } from 'preact/compat';
2
+ import { IdentityReuseConfig } from '@incodetech/core/identity-reuse';
3
+ import { IdentityReuseManager } from '@incodetech/core/identity-reuse';
4
+
5
+ export declare const IdentityReuse: FC<IdentityReuseProps>;
6
+
7
+ declare type IdentityReuseProps = IncodeModuleProps<IdentityReuseConfig, void, IdentityReuseManager>;
8
+
9
+ declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown> = {
10
+ /**
11
+ * Module configuration required to render the flow.
12
+ * For Web Components, this is typically assigned via `element.config = ...`.
13
+ */
14
+ config?: TConfig;
15
+ /**
16
+ * Optional pre-built manager. When provided, the module does not create or manage the manager lifecycle.
17
+ */
18
+ manager?: TManager;
19
+ /**
20
+ * Callback invoked when the module completes successfully.
21
+ * @param result - Optional result data from the module completion
22
+ */
23
+ onFinish?: (result?: TResult) => void;
24
+ /**
25
+ * Callback invoked when a fatal module error occurs.
26
+ */
27
+ onError?: (error: string | undefined) => void;
28
+ };
29
+
30
+ export { }
31
+
32
+ declare global {
33
+ interface HTMLElementTagNameMap {
34
+ 'incode-identity-reuse': HTMLElement & IncodeModuleProps<IdentityReuseConfig,
35
+ void,
36
+ IdentityReuseManagerType>;
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260409-09dfd52",
3
+ "version": "0.0.0-dev-20260409-089e5c6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -81,6 +81,13 @@
81
81
  "./geolocation/styles.css": {
82
82
  "default": "./dist/geolocation/styles.css"
83
83
  },
84
+ "./identity-reuse": {
85
+ "types": "./dist/types/identity-reuse.d.ts",
86
+ "import": "./dist/identity-reuse/identity-reuse.es.js"
87
+ },
88
+ "./identity-reuse/styles.css": {
89
+ "default": "./dist/identity-reuse/styles.css"
90
+ },
84
91
  "./ekyc": {
85
92
  "types": "./dist/types/ekyc.d.ts",
86
93
  "import": "./dist/ekyc/ekyc.es.js"
@@ -155,7 +162,7 @@
155
162
  "qrcode": "^1.5.4",
156
163
  "signature_pad": "^5.1.3",
157
164
  "tailwindcss": "^4.1.17",
158
- "@incodetech/core": "0.0.0-dev-20260409-09dfd52"
165
+ "@incodetech/core": "0.0.0-dev-20260409-089e5c6"
159
166
  },
160
167
  "devDependencies": {
161
168
  "@microsoft/api-extractor": "^7.53.3",