antifraud-common-components-react 0.0.0-stage → 1.0.0

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 (38) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +167 -0
  3. package/README.md +9 -2
  4. package/dist/contracts.d.ts +62 -0
  5. package/dist/contracts.d.ts.map +1 -0
  6. package/dist/contracts.js +1 -0
  7. package/dist/credential-profile-selector.d.ts +15 -0
  8. package/dist/credential-profile-selector.d.ts.map +1 -0
  9. package/dist/credential-profile-selector.js +5 -0
  10. package/dist/identity-evidence-editor.d.ts +53 -0
  11. package/dist/identity-evidence-editor.d.ts.map +1 -0
  12. package/dist/identity-evidence-editor.js +27 -0
  13. package/dist/index.d.ts +11 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +10 -0
  16. package/dist/passkey-policy.d.ts +7 -0
  17. package/dist/passkey-policy.d.ts.map +1 -0
  18. package/dist/passkey-policy.js +15 -0
  19. package/dist/portal-brand-artwork.d.ts +8 -0
  20. package/dist/portal-brand-artwork.d.ts.map +1 -0
  21. package/dist/portal-brand-artwork.js +5 -0
  22. package/dist/portal-entry.d.ts +12 -0
  23. package/dist/portal-entry.d.ts.map +1 -0
  24. package/dist/portal-entry.js +8 -0
  25. package/dist/portal-sign-in-panel.d.ts +44 -0
  26. package/dist/portal-sign-in-panel.d.ts.map +1 -0
  27. package/dist/portal-sign-in-panel.js +7 -0
  28. package/dist/profile-protection-gate-v2.d.ts +15 -0
  29. package/dist/profile-protection-gate-v2.d.ts.map +1 -0
  30. package/dist/profile-protection-gate-v2.js +42 -0
  31. package/dist/profile-protection-gate.d.ts +11 -0
  32. package/dist/profile-protection-gate.d.ts.map +1 -0
  33. package/dist/profile-protection-gate.js +41 -0
  34. package/dist/styles.css +9 -0
  35. package/dist/verification-journey-panel.d.ts +26 -0
  36. package/dist/verification-journey-panel.d.ts.map +1 -0
  37. package/dist/verification-journey-panel.js +7 -0
  38. package/package.json +16 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 - 2026-10-21
4
+
5
+ - Extract domain-neutral portal entry, sign-in, biometric/PIN profile
6
+ protection and identity-evidence screens for health, veterinary,
7
+ qualification, controller and future marketplace consumers.
8
+ - Keep every provider, OTP, WebAuthn, session, wallet, tenant, BFF and
9
+ authorization adapter outside the presentation package.
package/LICENSE ADDED
@@ -0,0 +1,167 @@
1
+ Copyright 2026 Antifraud Services Inc.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and
12
+ distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by the
15
+ copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all other
18
+ entities that control, are controlled by, or are under common control with
19
+ that entity. For the purposes of this definition, "control" means (i) the
20
+ power, direct or indirect, to cause the direction or management of such
21
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
22
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
23
+ such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
26
+ permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation source,
30
+ and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical transformation
33
+ or translation of a Source form, including but not limited to compiled
34
+ object code, generated documentation, and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or Object form,
37
+ made available under the License, as indicated by a copyright notice that is
38
+ included in or attached to the work (an example is provided in the Appendix
39
+ below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object form,
42
+ that is based on (or derived from) the Work and for which the editorial
43
+ revisions, annotations, elaborations, or other modifications represent, as
44
+ a whole, an original work of authorship. For the purposes of this License,
45
+ Derivative Works shall not include works that remain separable from, or
46
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
47
+ Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including the original
50
+ version of the Work and any modifications or additions to that Work or
51
+ Derivative Works thereof, that is intentionally submitted to Licensor for
52
+ inclusion in the Work by the copyright owner or by an individual or Legal
53
+ Entity authorized to submit on behalf of the copyright owner. For the
54
+ purposes of this definition, "submitted" means any form of electronic,
55
+ verbal, or written communication sent to the Licensor or its representatives,
56
+ including but not limited to communication on electronic mailing lists,
57
+ source code control systems, and issue tracking systems that are managed by,
58
+ or on behalf of, the Licensor for the purpose of discussing and improving
59
+ the Work, but excluding communication that is conspicuously marked or
60
+ otherwise designated in writing by the copyright owner as "Not a
61
+ Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
64
+ behalf of whom a Contribution has been received by Licensor and subsequently
65
+ incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
68
+ License, each Contributor hereby grants to You a perpetual, worldwide,
69
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
70
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
71
+ sublicense, and distribute the Work and such Derivative Works in Source or
72
+ Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of this
75
+ License, each Contributor hereby grants to You a perpetual, worldwide,
76
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
77
+ this section) patent license to make, have made, use, offer to sell, sell,
78
+ import, and otherwise transfer the Work, where such license applies only to
79
+ those patent claims licensable by such Contributor that are necessarily
80
+ infringed by their Contribution(s) alone or by combination of their
81
+ Contribution(s) with the Work to which such Contribution(s) was submitted.
82
+ If You institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
84
+ Contribution incorporated within the Work constitutes direct or
85
+ contributory patent infringement, then any patent licenses granted to You
86
+ under this License for that Work shall terminate as of the date such
87
+ litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
90
+ Derivative Works thereof in any medium, with or without modifications, and
91
+ in Source or Object form, provided that You meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or Derivative Works a copy
94
+ of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices stating that
97
+ You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works that You
100
+ distribute, all copyright, patent, trademark, and attribution notices from
101
+ the Source form of the Work, excluding those notices that do not pertain to
102
+ any part of the Derivative Works; and
103
+
104
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
105
+ then any Derivative Works that You distribute must include a readable copy of
106
+ the attribution notices contained within such NOTICE file, excluding those
107
+ notices that do not pertain to any part of the Derivative Works, in at least
108
+ one of the following places: within a NOTICE text file distributed as part
109
+ of the Derivative Works; within the Source form or documentation, if provided
110
+ along with the Derivative Works; or, within a display generated by the
111
+ Derivative Works, if and wherever such third-party notices normally appear.
112
+ The contents of the NOTICE file are for informational purposes only and do
113
+ not modify the License. You may add Your own attribution notices within
114
+ Derivative Works that You distribute, alongside or as an addendum to the
115
+ NOTICE text from the Work, provided that such additional attribution notices
116
+ cannot be construed as modifying the License.
117
+
118
+ You may add Your own copyright statement to Your modifications and may
119
+ provide additional or different license terms and conditions for use,
120
+ reproduction, or distribution of Your modifications, or for any such
121
+ Derivative Works as a whole, provided Your use, reproduction, and
122
+ distribution of the Work otherwise complies with the conditions stated in
123
+ this License.
124
+
125
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
126
+ Contribution intentionally submitted for inclusion in the Work by You to the
127
+ Licensor shall be under the terms and conditions of this License, without
128
+ any additional terms or conditions. Notwithstanding the above, nothing
129
+ herein shall supersede or modify the terms of any separate license agreement
130
+ you may have executed with Licensor regarding such Contributions.
131
+
132
+ 6. Trademarks. This License does not grant permission to use the trade names,
133
+ trademarks, service marks, or product names of the Licensor, except as
134
+ required for reasonable and customary use in describing the origin of the
135
+ Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
138
+ writing, Licensor provides the Work (and each Contributor provides its
139
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
140
+ KIND, either express or implied, including, without limitation, any
141
+ warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
142
+ FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
143
+ the appropriateness of using or redistributing the Work and assume any risks
144
+ associated with Your exercise of permissions under this License.
145
+
146
+ 8. Limitation of Liability. In no event and under no legal theory, whether
147
+ in tort (including negligence), contract, or otherwise, unless required by
148
+ applicable law (such as deliberate and grossly negligent acts) or agreed to
149
+ in writing, shall any Contributor be liable to You for damages, including any
150
+ direct, indirect, special, incidental, or consequential damages of any
151
+ character arising as a result of this License or out of the use or inability
152
+ to use the Work (including but not limited to damages for loss of goodwill,
153
+ work stoppage, computer failure or malfunction, or any and all other
154
+ commercial damages or losses), even if such Contributor has been advised of
155
+ the possibility of such damages.
156
+
157
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
158
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
159
+ acceptance of support, warranty, indemnity, or other liability obligations
160
+ and/or rights consistent with this License. However, in accepting such
161
+ obligations, You may act only on Your own behalf and on Your sole
162
+ responsibility, not on behalf of any other Contributor, and only if You agree
163
+ to indemnify, defend, and hold each Contributor harmless for any liability
164
+ incurred by, or claims asserted against, such Contributor by reason of your
165
+ accepting any such warranty or additional liability.
166
+
167
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # Antifraud Common Components React
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Domain-neutral controlled React screens shared by health, veterinary,
4
+ qualification, controller and marketplace applications.
5
+
6
+ The package owns entry navigation, sign-in presentation, PIN/passkey profile
7
+ protection, browser passkey capability helpers and neutral identity evidence.
8
+ Identity providers, OTP delivery, WebAuthn ceremonies, sessions, wallet/key
9
+ custody, BFF calls, tenant selection, persistence and authorization remain in
10
+ the consuming application.
@@ -0,0 +1,62 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type PortalBrandAsset = Readonly<{
3
+ src: string;
4
+ alt: string;
5
+ width: number;
6
+ height: number;
7
+ }>;
8
+ export type PortalBrandArtworkSet = Readonly<{
9
+ darkSurface: PortalBrandAsset;
10
+ lightSurface: PortalBrandAsset;
11
+ }>;
12
+ export type PortalBrand = Readonly<{
13
+ family: 'personal' | 'professional' | 'controller' | 'marketplace';
14
+ productName: string;
15
+ organizationName: string;
16
+ homeHref: string;
17
+ mark: PortalBrandArtworkSet;
18
+ heroArtwork?: PortalBrandArtworkSet;
19
+ variables?: CSSProperties;
20
+ }>;
21
+ export type PortalAccessOption = Readonly<{
22
+ id: string;
23
+ href: string;
24
+ title: string;
25
+ description: string;
26
+ requirement: string;
27
+ }>;
28
+ export type ProfileProtectionState = 'not-required' | 'checking' | 'setup-required' | 'locked' | 'unavailable';
29
+ export type ProfileUnlockResult = 'unlocked' | 'invalid-pin' | 'temporarily-locked' | 'unavailable';
30
+ export type ProfileProtectionCopy = Readonly<{
31
+ checkingTitle: string;
32
+ checkingBody: string;
33
+ setupTitle: string;
34
+ setupBody: string;
35
+ unavailableTitle: string;
36
+ unavailableBody: string;
37
+ unlockTitle: string;
38
+ unlockBody: string;
39
+ pinLabel: string;
40
+ pinRequired: string;
41
+ invalidPin: string;
42
+ temporarilyLocked: string;
43
+ unlockUnavailable: string;
44
+ unlock: string;
45
+ retry: string;
46
+ }>;
47
+ export type ProfileProtectionTargetV2 = Readonly<{
48
+ eyebrow: string;
49
+ title: string;
50
+ subtitle?: string;
51
+ icon?: PortalBrandAsset;
52
+ badges?: readonly string[];
53
+ details?: readonly Readonly<{
54
+ label: string;
55
+ value: string;
56
+ }>[];
57
+ }>;
58
+ export type ProfileProtectionCopyV2 = ProfileProtectionCopy & Readonly<{
59
+ unlockWithPasskey: string;
60
+ usePinInstead: string;
61
+ }>;
62
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACpG,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAAE,WAAW,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAA;AAC/G,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAAE,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,aAAa,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,qBAAqB,CAAC;IAAC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAAC,SAAS,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,CAAA;AACxQ,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAChI,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,UAAU,GAAG,gBAAgB,GAAG,QAAQ,GAAG,aAAa,CAAA;AAC9G,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,aAAa,GAAG,oBAAoB,GAAG,aAAa,CAAA;AACnG,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAChX,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;CAAE,CAAC,CAAA;AAC7N,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAAG,QAAQ,CAAC;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface CredentialProfileOption {
2
+ id: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }
6
+ export interface CredentialProfileSelectorProps {
7
+ label: string;
8
+ value: string;
9
+ options: readonly CredentialProfileOption[];
10
+ onChange(value: string): void;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ }
14
+ export declare function CredentialProfileSelector({ label, value, options, onChange, disabled, className }: CredentialProfileSelectorProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=credential-profile-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-profile-selector.d.ts","sourceRoot":"","sources":["../src/credential-profile-selector.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;AAC1F,MAAM,WAAW,8BAA8B;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAEpM,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAgB,EAAE,SAAS,EAAE,EAAE,8BAA8B,+BAGzI"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function CredentialProfileSelector({ label, value, options, onChange, disabled = false, className }) {
3
+ const handleChange = (event) => onChange(event.currentTarget.value);
4
+ return _jsxs("label", { className: className, children: [_jsx("span", { children: label }), _jsx("select", { disabled: disabled, onChange: handleChange, value: value, children: options.map(option => _jsx("option", { disabled: option.disabled, value: option.id, children: option.label }, option.id)) })] });
5
+ }
@@ -0,0 +1,53 @@
1
+ export type IdentityEvidenceSubjectOption = Readonly<{
2
+ reference: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }>;
6
+ export type IdentityEvidenceEditorTarget = Readonly<{
7
+ kind: 'subject';
8
+ }> | Readonly<{
9
+ kind: 'relationship';
10
+ relationshipType: string;
11
+ relatedSubjectReference: string;
12
+ }> | Readonly<{
13
+ kind: 'predicate';
14
+ predicate: 'age-over';
15
+ sourceSubjectReference: string;
16
+ sourceClaimPath: 'org.schema.Person.birthDate';
17
+ threshold: number;
18
+ result: boolean;
19
+ }>;
20
+ export type IdentityEvidenceEditorSubmission = Readonly<{
21
+ subjectReference: string;
22
+ target: IdentityEvidenceEditorTarget;
23
+ checkReference: string;
24
+ }>;
25
+ export type IdentityEvidenceEditorCopy = Readonly<{
26
+ title: string;
27
+ description: string;
28
+ subject: string;
29
+ selectSubject: string;
30
+ target: string;
31
+ subjectIdentity: string;
32
+ relationship: string;
33
+ ageOver: string;
34
+ relationshipEvidence: string;
35
+ relatedSubject: string;
36
+ selectRelatedSubject: string;
37
+ relationshipType: string;
38
+ agePredicate: string;
39
+ ageThreshold: string;
40
+ meetsThreshold: string;
41
+ ageProfileHint: string;
42
+ checkReference: string;
43
+ submit: string;
44
+ }>;
45
+ export type IdentityEvidenceEditorProps = Readonly<{
46
+ subjects: readonly IdentityEvidenceSubjectOption[];
47
+ onSubmit?(submission: IdentityEvidenceEditorSubmission): void;
48
+ disabled?: boolean;
49
+ copy?: IdentityEvidenceEditorCopy;
50
+ submitAction?: string;
51
+ }>;
52
+ export declare function IdentityEvidenceEditor({ subjects, onSubmit, disabled, copy, submitAction }: IdentityEvidenceEditorProps): import("react").JSX.Element;
53
+ //# sourceMappingURL=identity-evidence-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-evidence-editor.d.ts","sourceRoot":"","sources":["../src/identity-evidence-editor.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAC9G,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,uBAAuB,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,UAAU,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,6BAA6B,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AACrV,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,4BAA4B,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACnJ,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACnc,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,gCAAgC,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,0BAA0B,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAcvP,wBAAgB,sBAAsB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAgB,EAAE,IAAmB,EAAE,YAAY,EAAE,EAAE,2BAA2B,+BAM9I"}
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ const DEFAULT_COPY = Object.freeze({
5
+ title: 'Identity evidence',
6
+ description: 'Record what was examined. The trusted service supplies the employee, organization and authorization and returns the authoritative result.',
7
+ subject: 'Subject', selectSubject: 'Select a subject', target: 'Evidence target',
8
+ subjectIdentity: 'Subject identity', relationship: 'Relationship between subjects', ageOver: 'Age-over predicate',
9
+ relationshipEvidence: 'Relationship evidence', relatedSubject: 'Related subject', selectRelatedSubject: 'Select the related subject', relationshipType: 'Relationship type',
10
+ agePredicate: 'Age predicate', ageThreshold: 'Age threshold', meetsThreshold: 'The subject meets this age threshold',
11
+ ageProfileHint: 'Only age over 18 maps to the standardized EUDI PID attribute. Other thresholds remain explicitly governed predicates.',
12
+ checkReference: 'Evidence check reference', submit: 'Record evidence',
13
+ });
14
+ export function IdentityEvidenceEditor({ subjects, onSubmit, disabled = false, copy = DEFAULT_COPY, submitAction }) {
15
+ const [subjectReference, setSubjectReference] = useState('');
16
+ const [targetChoice, setTargetChoice] = useState('subject');
17
+ const [relatedSubjectReference, setRelatedSubjectReference] = useState('');
18
+ const [relationshipType, setRelationshipType] = useState('');
19
+ const [ageThreshold, setAgeThreshold] = useState(18);
20
+ const [ageResult, setAgeResult] = useState(true);
21
+ const [checkReference, setCheckReference] = useState('');
22
+ const targetComplete = targetChoice === 'subject' || (targetChoice === 'relationship' && relatedSubjectReference.length > 0 && relationshipType.trim().length > 0) || (targetChoice === 'age-over' && Number.isInteger(ageThreshold) && ageThreshold >= 1 && ageThreshold <= 150);
23
+ const complete = !disabled && subjectReference.length > 0 && checkReference.trim().length > 0 && targetComplete;
24
+ function submit(event) { event.preventDefault(); if (!complete)
25
+ return; const target = targetChoice === 'relationship' ? { kind: 'relationship', relationshipType: relationshipType.trim(), relatedSubjectReference } : targetChoice === 'age-over' ? { kind: 'predicate', predicate: 'age-over', sourceSubjectReference: subjectReference, sourceClaimPath: 'org.schema.Person.birthDate', threshold: ageThreshold, result: ageResult } : { kind: 'subject' }; onSubmit?.({ subjectReference, target, checkReference: checkReference.trim() }); }
26
+ return _jsxs("section", { "aria-labelledby": "identity-evidence-editor-title", children: [_jsxs("header", { children: [_jsx("h2", { id: "identity-evidence-editor-title", children: copy.title }), _jsx("p", { children: copy.description })] }), _jsxs("form", { onSubmit: submit, children: [_jsxs("label", { children: [_jsx("span", { children: copy.subject }), _jsxs("select", { disabled: disabled, onChange: event => setSubjectReference(event.currentTarget.value), required: true, value: subjectReference, children: [_jsx("option", { value: "", children: copy.selectSubject }), subjects.map(subject => _jsx("option", { disabled: subject.disabled, value: subject.reference, children: subject.label }, subject.reference))] })] }), _jsxs("label", { children: [_jsx("span", { children: copy.target }), _jsxs("select", { disabled: disabled, onChange: event => setTargetChoice(event.currentTarget.value), value: targetChoice, children: [_jsx("option", { value: "subject", children: copy.subjectIdentity }), _jsx("option", { value: "relationship", children: copy.relationship }), _jsx("option", { value: "age-over", children: copy.ageOver })] })] }), targetChoice === 'relationship' ? _jsxs("fieldset", { children: [_jsx("legend", { children: copy.relationshipEvidence }), _jsxs("label", { children: [_jsx("span", { children: copy.relatedSubject }), _jsxs("select", { disabled: disabled, onChange: event => setRelatedSubjectReference(event.currentTarget.value), required: true, value: relatedSubjectReference, children: [_jsx("option", { value: "", children: copy.selectRelatedSubject }), subjects.filter(subject => subject.reference !== subjectReference).map(subject => _jsx("option", { disabled: subject.disabled, value: subject.reference, children: subject.label }, subject.reference))] })] }), _jsxs("label", { children: [_jsx("span", { children: copy.relationshipType }), _jsx("input", { disabled: disabled, onChange: event => setRelationshipType(event.currentTarget.value), required: true, value: relationshipType })] })] }) : null, targetChoice === 'age-over' ? _jsxs("fieldset", { children: [_jsx("legend", { children: copy.agePredicate }), _jsxs("label", { children: [_jsx("span", { children: copy.ageThreshold }), _jsx("input", { disabled: disabled, max: 150, min: 1, onChange: event => setAgeThreshold(event.currentTarget.valueAsNumber), required: true, type: "number", value: ageThreshold })] }), _jsxs("label", { children: [_jsx("input", { checked: ageResult, disabled: disabled, onChange: event => setAgeResult(event.currentTarget.checked), type: "checkbox" }), _jsx("span", { children: copy.meetsThreshold })] }), _jsx("p", { children: copy.ageProfileHint })] }) : null, _jsxs("label", { children: [_jsx("span", { children: copy.checkReference }), _jsx("input", { disabled: disabled, onChange: event => setCheckReference(event.currentTarget.value), required: true, value: checkReference })] }), _jsx("button", { "data-portal-action": submitAction, disabled: !complete, type: "submit", children: copy.submit })] })] });
27
+ }
@@ -0,0 +1,11 @@
1
+ export * from './contracts.js';
2
+ export * from './portal-brand-artwork.js';
3
+ export * from './portal-entry.js';
4
+ export * from './portal-sign-in-panel.js';
5
+ export * from './profile-protection-gate.js';
6
+ export * from './profile-protection-gate-v2.js';
7
+ export * from './passkey-policy.js';
8
+ export * from './identity-evidence-editor.js';
9
+ export * from './credential-profile-selector.js';
10
+ export * from './verification-journey-panel.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,2BAA2B,CAAA;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export * from './contracts.js';
2
+ export * from './portal-brand-artwork.js';
3
+ export * from './portal-entry.js';
4
+ export * from './portal-sign-in-panel.js';
5
+ export * from './profile-protection-gate.js';
6
+ export * from './profile-protection-gate-v2.js';
7
+ export * from './passkey-policy.js';
8
+ export * from './identity-evidence-editor.js';
9
+ export * from './credential-profile-selector.js';
10
+ export * from './verification-journey-panel.js';
@@ -0,0 +1,7 @@
1
+ export declare function isUserVerifyingPlatformPasskeyAvailable(): Promise<boolean>;
2
+ export declare function openWalletAfterRequiredPasskey<T>(input: Readonly<{
3
+ passkeyRequired: boolean;
4
+ enroll(): Promise<void>;
5
+ open(): Promise<T>;
6
+ }>): Promise<T>;
7
+ //# sourceMappingURL=passkey-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-policy.d.ts","sourceRoot":"","sources":["../src/passkey-policy.ts"],"names":[],"mappings":"AAAA,wBAAsB,uCAAuC,IAAI,OAAO,CAAC,OAAO,CAAC,CAGhF;AAED,wBAAsB,8BAA8B,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC;IAAE,eAAe,EAAE,OAAO,CAAC;IAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAG9J"}
@@ -0,0 +1,15 @@
1
+ export async function isUserVerifyingPlatformPasskeyAvailable() {
2
+ if (typeof PublicKeyCredential === 'undefined' || typeof PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable !== 'function')
3
+ return false;
4
+ try {
5
+ return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ }
11
+ export async function openWalletAfterRequiredPasskey(input) {
12
+ if (input.passkeyRequired)
13
+ await input.enroll();
14
+ return input.open();
15
+ }
@@ -0,0 +1,8 @@
1
+ import type { PortalBrandArtworkSet } from './contracts.js';
2
+ export type PortalBrandArtworkProps = Readonly<{
3
+ artwork: PortalBrandArtworkSet;
4
+ className?: string;
5
+ }>;
6
+ /** Render both official light and dark artwork variants without distortion. */
7
+ export declare function PortalBrandArtwork({ artwork, className }: PortalBrandArtworkProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=portal-brand-artwork.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-brand-artwork.d.ts","sourceRoot":"","sources":["../src/portal-brand-artwork.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAE3D,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,SAAc,EAAE,EAAE,uBAAuB,+BAmBtF"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /** Render both official light and dark artwork variants without distortion. */
3
+ export function PortalBrandArtwork({ artwork, className = '' }) {
4
+ return (_jsxs("span", { className: `uhcp-brand-artwork ${className}`.trim(), children: [_jsx("img", { className: "uhcp-brand-artwork-light", src: artwork.lightSurface.src, alt: artwork.lightSurface.alt, width: artwork.lightSurface.width, height: artwork.lightSurface.height }), _jsx("img", { className: "uhcp-brand-artwork-dark", src: artwork.darkSurface.src, alt: artwork.darkSurface.alt, width: artwork.darkSurface.width, height: artwork.darkSurface.height })] }));
5
+ }
@@ -0,0 +1,12 @@
1
+ import type { PortalAccessOption, PortalBrand } from './contracts.js';
2
+ export declare function PortalEntryHero({ brand, eyebrow, title, description }: Readonly<{
3
+ brand: PortalBrand;
4
+ eyebrow: string;
5
+ title: string;
6
+ description: string;
7
+ }>): import("react").JSX.Element;
8
+ export declare function PortalAccessChooser({ label, options }: Readonly<{
9
+ label: string;
10
+ options: readonly PortalAccessOption[];
11
+ }>): import("react").JSX.Element;
12
+ //# sourceMappingURL=portal-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-entry.d.ts","sourceRoot":"","sources":["../src/portal-entry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAyB,MAAM,gBAAgB,CAAA;AAG5F,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,+BAE5J;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,CAAC,+BAE1H"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PortalBrandArtwork } from './portal-brand-artwork.js';
3
+ export function PortalEntryHero({ brand, eyebrow, title, description }) {
4
+ return _jsxs("section", { className: "uhcp-entry-hero", style: brand.variables, children: [_jsx("div", { className: "uhcp-hero-orbit", "aria-hidden": "true", children: _jsx(PortalBrandArtwork, { artwork: brand.heroArtwork || brand.mark, className: "uhcp-hero-logo" }) }), _jsxs("div", { className: "uhcp-entry-copy", children: [_jsx("div", { className: "uhcp-badge", children: eyebrow }), _jsx("h1", { children: title }), _jsx("p", { children: description })] })] });
5
+ }
6
+ export function PortalAccessChooser({ label, options }) {
7
+ return _jsx("nav", { className: "uhcp-access-grid", "aria-label": label, children: options.map((option, index) => _jsxs("a", { className: "uhcp-access-card", href: option.href, children: [_jsx("span", { className: "uhcp-access-number", children: String(index + 1).padStart(2, '0') }), _jsx("strong", { children: option.title }), _jsx("span", { children: option.description }), _jsx("small", { children: option.requirement })] }, option.id)) });
8
+ }
@@ -0,0 +1,44 @@
1
+ import type { FormEvent } from 'react';
2
+ export type PortalSignInPanelCopy = Readonly<{
3
+ eyebrow: string;
4
+ title: string;
5
+ description: string;
6
+ provider: string;
7
+ separator: string;
8
+ email: string;
9
+ sendEmailCode: string;
10
+ emailCode: string;
11
+ verifyEmailCode: string;
12
+ changeEmail: string;
13
+ emailCodeSent: string;
14
+ passkeyHint: string;
15
+ passkey: string;
16
+ demoEmail: string;
17
+ demoCode: string;
18
+ demoSubmit: string;
19
+ demoHint: string;
20
+ busy: string;
21
+ }>;
22
+ export type PortalSignInPanelProps = Readonly<{
23
+ mode: 'trusted' | 'demo';
24
+ copy: PortalSignInPanelCopy;
25
+ email: string;
26
+ emailCode: string;
27
+ emailCodeRequested?: boolean;
28
+ busy?: boolean;
29
+ elapsedSeconds?: number;
30
+ error?: string;
31
+ providerEnabled?: boolean;
32
+ actionsEnabled?: boolean;
33
+ onEmailChange(value: string): void;
34
+ onEmailCodeChange(value: string): void;
35
+ onProvider?(): void | Promise<void>;
36
+ onRequestEmailCode?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
37
+ onVerifyEmailCode?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
38
+ onChangeEmail?(): void;
39
+ onPasskey?(): void | Promise<void>;
40
+ onDemo?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
41
+ }>;
42
+ /** Presentation only: identity providers, OTP, WebAuthn and sessions remain host adapters. */
43
+ export declare function PortalSignInPanel({ mode, copy, email, emailCode, emailCodeRequested, busy, elapsedSeconds, error, providerEnabled, actionsEnabled, onEmailChange, onEmailCodeChange, onProvider, onRequestEmailCode, onVerifyEmailCode, onChangeEmail, onPasskey, onDemo }: PortalSignInPanelProps): import("react").JSX.Element;
44
+ //# sourceMappingURL=portal-sign-in-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-sign-in-panel.d.ts","sourceRoot":"","sources":["../src/portal-sign-in-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACvY,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,kBAAkB,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,aAAa,CAAC,IAAI,IAAI,CAAC;IAAC,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,MAAM,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAA;AAEhqB,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,kBAA0B,EAAE,IAAY,EAAE,cAAkB,EAAE,KAAK,EAAE,eAAsB,EAAE,cAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,sBAAsB,+BAGpU"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /** Presentation only: identity providers, OTP, WebAuthn and sessions remain host adapters. */
4
+ export function PortalSignInPanel({ mode, copy, email, emailCode, emailCodeRequested = false, busy = false, elapsedSeconds = 0, error, providerEnabled = true, actionsEnabled = true, onEmailChange, onEmailCodeChange, onProvider, onRequestEmailCode, onVerifyEmailCode, onChangeEmail, onPasskey, onDemo }) {
5
+ const progress = busy ? _jsxs("p", { className: "uhcp-auth-progress", role: "status", children: [_jsx("span", { "aria-hidden": "true" }), " ", copy.busy, " ", elapsedSeconds, " s"] }) : null;
6
+ return _jsxs("section", { className: "uhcp-professional-access", "aria-busy": busy || undefined, children: [_jsx("p", { className: "uhcp-eyebrow", children: copy.eyebrow }), _jsx("h1", { children: copy.title }), _jsx("p", { children: copy.description }), mode === 'trusted' ? _jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: onProvider, disabled: !actionsEnabled || !providerEnabled || busy || !onProvider, children: copy.provider }), _jsx("div", { className: "uhcp-auth-separator", children: _jsx("span", { children: copy.separator }) }), !emailCodeRequested ? _jsxs("form", { onSubmit: onRequestEmailCode, children: [_jsxs("label", { children: [copy.email, _jsx("input", { type: "email", autoComplete: "username webauthn", value: email, onChange: event => onEmailChange(event.target.value), required: true, disabled: busy })] }), _jsx("button", { type: "submit", disabled: !actionsEnabled || busy || !onRequestEmailCode, children: copy.sendEmailCode }), onPasskey ? _jsxs(_Fragment, { children: [_jsx("p", { className: "uhcp-muted", children: copy.passkeyHint }), _jsx("button", { type: "button", className: "uhcp-secondary", disabled: !actionsEnabled || busy, onClick: onPasskey, children: copy.passkey })] }) : null] }) : _jsxs("form", { onSubmit: onVerifyEmailCode, children: [_jsx("p", { className: "uhcp-muted", children: copy.emailCodeSent.replace('{email}', email) }), _jsxs("label", { children: [copy.emailCode, _jsx("input", { type: "text", inputMode: "numeric", autoComplete: "one-time-code", pattern: "[0-9]{6}", minLength: 6, maxLength: 6, value: emailCode, onChange: event => onEmailCodeChange(event.target.value.replace(/\D/g, '').slice(0, 6)), required: true, disabled: busy })] }), _jsx("button", { type: "submit", disabled: !actionsEnabled || busy || emailCode.length !== 6 || !onVerifyEmailCode, children: copy.verifyEmailCode }), _jsx("button", { type: "button", className: "uhcp-secondary", disabled: busy || !onChangeEmail, onClick: onChangeEmail, children: copy.changeEmail })] })] }) : _jsxs("form", { onSubmit: onDemo, children: [_jsxs("label", { children: [copy.demoEmail, _jsx("input", { type: "email", autoComplete: "off", value: email, onChange: event => onEmailChange(event.target.value), required: true, disabled: busy })] }), _jsxs("label", { children: [copy.demoCode, _jsx("input", { type: "text", inputMode: "numeric", autoComplete: "one-time-code", pattern: "[0-9]{6}", minLength: 6, maxLength: 6, value: emailCode, onChange: event => onEmailCodeChange(event.target.value.replace(/\D/g, '').slice(0, 6)), required: true, disabled: busy })] }), _jsx("p", { className: "uhcp-muted", children: copy.demoHint }), _jsx("button", { type: "submit", disabled: !actionsEnabled || busy || emailCode.length !== 6 || !onDemo, children: copy.demoSubmit })] }), progress, error ? _jsx("p", { className: "uhcp-error", role: "alert", children: error }) : null] });
7
+ }
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ProfileProtectionCopyV2, ProfileProtectionState, ProfileProtectionTargetV2, ProfileUnlockResult } from './contracts.js';
3
+ export type ProfileProtectionGateV2Props = Readonly<{
4
+ state: ProfileProtectionState;
5
+ target: ProfileProtectionTargetV2;
6
+ copy: ProfileProtectionCopyV2;
7
+ onUnlock?: (pin: string) => ProfileUnlockResult | Promise<ProfileUnlockResult>;
8
+ onPasskeyUnlock?: () => void | Promise<void>;
9
+ onRetry?: () => void;
10
+ pinFailureActions?: ReactNode;
11
+ secondaryActions?: ReactNode;
12
+ children: ReactNode;
13
+ }>;
14
+ export declare function ProfileProtectionGateV2({ state, target, copy, onUnlock, onPasskeyUnlock, onRetry, pinFailureActions, secondaryActions, children }: ProfileProtectionGateV2Props): import("react").JSX.Element;
15
+ //# sourceMappingURL=profile-protection-gate-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-protection-gate-v2.d.ts","sourceRoot":"","sources":["../src/profile-protection-gate-v2.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAErI,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,sBAAsB,CAAC;IAAC,MAAM,EAAE,yBAAyB,CAAC;IAAC,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AAE9X,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,4BAA4B,+BAS/K"}
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from 'react';
4
+ export function ProfileProtectionGateV2({ state, target, copy, onUnlock, onPasskeyUnlock, onRetry, pinFailureActions, secondaryActions, children }) {
5
+ const [pin, setPin] = useState('');
6
+ const [error, setError] = useState('');
7
+ const [busy, setBusy] = useState(false);
8
+ const [pinRejected, setPinRejected] = useState(false);
9
+ const input = useRef(null);
10
+ useEffect(() => { setPin(''); setError(''); setPinRejected(false); }, [state, target.title, target.subtitle]);
11
+ async function unlock(event) { event.preventDefault(); if (pin.length < 6)
12
+ return setError(copy.pinRequired); if (!onUnlock)
13
+ return setError(copy.unlockUnavailable); setBusy(true); try {
14
+ const result = await onUnlock(pin);
15
+ if (result === 'unlocked') {
16
+ setPin('');
17
+ setError('');
18
+ setPinRejected(false);
19
+ return;
20
+ }
21
+ setPinRejected(result === 'invalid-pin');
22
+ setError(result === 'invalid-pin' ? copy.invalidPin : result === 'temporarily-locked' ? copy.temporarilyLocked : copy.unlockUnavailable);
23
+ }
24
+ finally {
25
+ setBusy(false);
26
+ } }
27
+ async function unlockWithPasskey() { if (!onPasskeyUnlock)
28
+ return; setBusy(true); setError(''); try {
29
+ await onPasskeyUnlock();
30
+ }
31
+ catch {
32
+ setError(copy.unlockUnavailable);
33
+ }
34
+ finally {
35
+ setBusy(false);
36
+ } }
37
+ if (state === 'not-required')
38
+ return _jsx(_Fragment, { children: children });
39
+ const title = state === 'checking' ? copy.checkingTitle : state === 'setup-required' ? copy.setupTitle : state === 'unavailable' ? copy.unavailableTitle : copy.unlockTitle;
40
+ const body = state === 'checking' ? copy.checkingBody : state === 'setup-required' ? copy.setupBody : state === 'unavailable' ? copy.unavailableBody : copy.unlockBody;
41
+ return _jsxs("section", { className: "uhcp-profile-gate uhcp-profile-gate-v2", "aria-live": "polite", children: [_jsxs("div", { className: "uhcp-profile-gate-copy", children: [_jsx("h1", { children: title }), _jsx("p", { children: body })] }), _jsxs("div", { className: "uhcp-profile-target", children: [target.icon ? _jsx("img", { src: target.icon.src, alt: target.icon.alt, width: target.icon.width, height: target.icon.height }) : null, _jsxs("div", { className: "uhcp-profile-target-content", children: [_jsxs("div", { className: "uhcp-profile-target-copy", children: [_jsx("strong", { children: target.title }), target.subtitle ? _jsx("span", { children: target.subtitle }) : null] }), target.badges?.length ? _jsx("ul", { className: "uhcp-profile-target-badges uhcp-profile-target-badges-centered", "aria-label": target.title, children: target.badges.map(badge => _jsx("li", { children: badge }, badge)) }) : null, target.details?.length ? _jsx("dl", { className: "uhcp-profile-target-details", children: target.details.map(detail => _jsxs("div", { children: [_jsx("dt", { children: detail.label }), _jsx("dd", { children: detail.value })] }, `${detail.label}:${detail.value}`)) }) : null] })] }), state === 'locked' && onPasskeyUnlock ? _jsx("button", { type: "button", className: "uhcp-action-unlock", "data-portal-action": "unlock-profile-with-passkey", disabled: busy, onClick: unlockWithPasskey, children: copy.unlockWithPasskey }) : null, state === 'locked' ? _jsxs("details", { className: "uhcp-profile-pin-fallback", open: !onPasskeyUnlock, children: [_jsx("summary", { children: onPasskeyUnlock ? copy.usePinInstead : copy.pinLabel }), _jsxs("form", { onSubmit: unlock, children: [_jsxs("label", { children: [copy.pinLabel, _jsx("input", { ref: input, type: "password", inputMode: "numeric", minLength: 6, autoComplete: "current-password", value: pin, onChange: event => setPin(event.target.value) })] }), error ? _jsx("p", { role: "alert", className: "uhcp-error", children: error }) : null, _jsx("button", { type: "submit", className: "uhcp-action-unlock", "data-portal-action": "unlock-profile", disabled: busy, children: copy.unlock })] }), pinRejected && pinFailureActions ? _jsx("div", { className: "uhcp-profile-pin-recovery", children: pinFailureActions }) : null] }) : null, state === 'unavailable' && onRetry ? _jsx("button", { type: "button", onClick: onRetry, children: copy.retry }) : null, secondaryActions ? _jsx("div", { className: "uhcp-profile-gate-secondary", children: secondaryActions }) : null] });
42
+ }
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ProfileProtectionCopy, ProfileProtectionState, ProfileUnlockResult } from './contracts.js';
3
+ export type ProfileProtectionGateProps = Readonly<{
4
+ state: ProfileProtectionState;
5
+ copy: ProfileProtectionCopy;
6
+ onUnlock?: (pin: string) => ProfileUnlockResult | Promise<ProfileUnlockResult>;
7
+ onRetry?: () => void;
8
+ children: ReactNode;
9
+ }>;
10
+ export declare function ProfileProtectionGate({ state, copy, onUnlock, onRetry, children }: ProfileProtectionGateProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=profile-protection-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-protection-gate.d.ts","sourceRoot":"","sources":["../src/profile-protection-gate.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAExG,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,KAAK,EAAE,sBAAsB,CAAA;IAC7B,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC9E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAC,CAAA;AAEF,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,0BAA0B,+BAmC7G"}
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from 'react';
4
+ export function ProfileProtectionGate({ state, copy, onUnlock, onRetry, children }) {
5
+ const [pin, setPin] = useState('');
6
+ const [error, setError] = useState('');
7
+ const [busy, setBusy] = useState(false);
8
+ const input = useRef(null);
9
+ useEffect(() => {
10
+ setPin('');
11
+ setError('');
12
+ if (state === 'locked')
13
+ input.current?.focus();
14
+ }, [state]);
15
+ async function unlock(event) {
16
+ event.preventDefault();
17
+ if (pin.length < 6)
18
+ return setError(copy.pinRequired);
19
+ if (!onUnlock)
20
+ return setError(copy.unlockUnavailable);
21
+ setBusy(true);
22
+ try {
23
+ const result = await onUnlock(pin);
24
+ if (result === 'unlocked') {
25
+ setPin('');
26
+ setError('');
27
+ }
28
+ else {
29
+ setError(result === 'invalid-pin' ? copy.invalidPin : result === 'temporarily-locked' ? copy.temporarilyLocked : copy.unlockUnavailable);
30
+ }
31
+ }
32
+ finally {
33
+ setBusy(false);
34
+ }
35
+ }
36
+ if (state === 'not-required')
37
+ return _jsx(_Fragment, { children: children });
38
+ const title = state === 'checking' ? copy.checkingTitle : state === 'setup-required' ? copy.setupTitle : state === 'unavailable' ? copy.unavailableTitle : copy.unlockTitle;
39
+ const body = state === 'checking' ? copy.checkingBody : state === 'setup-required' ? copy.setupBody : state === 'unavailable' ? copy.unavailableBody : copy.unlockBody;
40
+ return _jsxs("section", { className: "uhcp-profile-gate", "aria-live": "polite", children: [_jsx("span", { className: "uhcp-lock", "aria-hidden": "true", children: "\u233E" }), _jsx("h1", { children: title }), _jsx("p", { children: body }), state === 'locked' ? _jsxs("form", { onSubmit: unlock, children: [_jsxs("label", { children: [copy.pinLabel, _jsx("input", { ref: input, type: "password", minLength: 6, autoComplete: "current-password", value: pin, onChange: event => setPin(event.target.value) })] }), error ? _jsx("p", { role: "alert", className: "uhcp-error", children: error }) : null, _jsx("button", { type: "submit", disabled: busy, children: copy.unlock })] }) : null, state === 'unavailable' && onRetry ? _jsx("button", { type: "button", onClick: onRetry, children: copy.retry }) : null] });
41
+ }
@@ -0,0 +1,9 @@
1
+ :root { --uhcp-panel:#fff; --uhcp-panel-muted:#f1f5f9; --uhcp-text:#10213a; --uhcp-muted:#526174; --uhcp-border:#cbd5e1; --uhcp-line:#cbd5e1; --uhcp-turquoise:#0f9ca8; --uhcp-action-start:#0f9ca8; --uhcp-action-end:#2563a9; --uhcp-selected-start:#138c98; --uhcp-selected-end:#2563a9; --uhcp-surface-accent:#eef9fa; --uhcp-unlock-start:#17805f; --uhcp-unlock-end:#236a9b; --uhcp-unlock-text:#fff; }
2
+ .uhcp-brand-artwork{display:inline-flex}.uhcp-brand-artwork img{display:block;height:100%;max-height:100%;max-width:100%;object-fit:contain;width:100%}.uhcp-brand-artwork-dark{display:none!important}html[data-theme='dark'] .uhcp-brand-artwork-light{display:none!important}html[data-theme='dark'] .uhcp-brand-artwork-dark{display:block!important}
3
+ .uhcp-entry-hero { align-items:center; display:grid; gap:clamp(2rem,6vw,6rem); grid-template-columns:minmax(12rem,24rem) minmax(0,1fr); margin:0 auto; max-width:1160px; padding:clamp(2rem,7vw,6rem) clamp(1rem,4vw,3rem); }
4
+ .uhcp-hero-orbit { display:grid; place-items:center; min-height:16rem; border-radius:50%; background:color-mix(in srgb,var(--uhcp-turquoise) 9%,#fff); }.uhcp-hero-logo img { height:auto; max-width:100%; object-fit:contain; }
5
+ .uhcp-badge,.uhcp-eyebrow { color:var(--uhcp-turquoise); font-size:.8rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }.uhcp-entry-copy{max-width:48rem}.uhcp-entry-copy h1{font-size:clamp(2.25rem,5vw,4.75rem);letter-spacing:-.045em;line-height:.98;margin:1rem 0}.uhcp-entry-copy p{color:var(--uhcp-muted);font-size:clamp(1rem,2vw,1.25rem);line-height:1.7}
6
+ .uhcp-access-grid{display:grid;gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr));margin:0 auto;max-width:1160px;padding:clamp(1rem,4vw,3rem)}.uhcp-access-card{display:grid;gap:.65rem;min-height:12rem;padding:1.5rem;border:1px solid var(--uhcp-border);border-radius:1.25rem;color:var(--uhcp-text);background:var(--uhcp-panel);text-decoration:none}.uhcp-access-number{color:var(--uhcp-turquoise);font-weight:900}.uhcp-access-card strong{font-size:1.25rem}.uhcp-access-card small,.uhcp-access-card>span:not(.uhcp-access-number){color:var(--uhcp-muted)}
7
+ .uhcp-professional-access{display:grid;gap:1rem;margin-inline:auto;max-width:38rem}.uhcp-professional-access h1,.uhcp-professional-access p{margin-block:0}.uhcp-professional-access form{display:grid;gap:.9rem}.uhcp-professional-access label{display:grid;font-weight:700;gap:.4rem}.uhcp-professional-access input{background:var(--uhcp-panel);border:1px solid var(--uhcp-line);border-radius:.8rem;color:inherit;font:inherit;min-height:2.8rem;padding-inline:.85rem}.uhcp-professional-access button{background:linear-gradient(135deg,var(--uhcp-action-start),var(--uhcp-action-end));border:0;border-radius:999px;color:#fff;cursor:pointer;font:inherit;font-weight:800;min-height:2.8rem;padding:.7rem 1rem}.uhcp-professional-access button:disabled{cursor:wait;opacity:.55}.uhcp-professional-access .uhcp-secondary{background:transparent;border:1px solid var(--uhcp-line);color:inherit}.uhcp-muted{color:var(--uhcp-muted)}.uhcp-error{color:#c64747}.uhcp-auth-separator{align-items:center;color:var(--uhcp-muted);display:flex;gap:.75rem}.uhcp-auth-separator::before,.uhcp-auth-separator::after{background:var(--uhcp-line);content:'';flex:1;height:1px}.uhcp-auth-progress{align-items:center;display:flex;font-weight:750;gap:.6rem}.uhcp-auth-progress>span{animation:uhcp-auth-spin .8s linear infinite;border:3px solid var(--uhcp-line);border-radius:50%;border-top-color:var(--uhcp-action-end);height:1rem;width:1rem}@keyframes uhcp-auth-spin{to{transform:rotate(360deg)}}
8
+ .uhcp-profile-gate{display:grid;gap:1rem;margin:2rem auto;max-width:42rem;padding:clamp(1.5rem,4vw,3rem);text-align:center}.uhcp-profile-gate>p{color:var(--uhcp-muted);line-height:1.6}.uhcp-profile-gate form{display:grid;gap:1rem;margin-top:1.5rem;text-align:left}.uhcp-profile-gate label{color:var(--uhcp-muted);display:grid;gap:.45rem}.uhcp-profile-gate input{background:var(--uhcp-panel);border:1px solid var(--uhcp-border);border-radius:.75rem;color:var(--uhcp-text);padding:.8rem}.uhcp-profile-gate button{background:linear-gradient(135deg,var(--uhcp-action-start),var(--uhcp-action-end));border:0;border-radius:.75rem;color:#fff;cursor:pointer;font:inherit;font-weight:800;padding:.8rem 1rem}.uhcp-profile-gate-v2{background:linear-gradient(145deg,color-mix(in srgb,var(--uhcp-surface-accent) 76%,var(--uhcp-panel)),var(--uhcp-panel-muted));border:1px solid color-mix(in srgb,var(--uhcp-turquoise) 30%,var(--uhcp-border));border-radius:1.5rem;box-shadow:0 1.2rem 3rem color-mix(in srgb,var(--uhcp-text) 10%,transparent);gap:1rem}.uhcp-profile-gate-copy{text-align:center}.uhcp-profile-gate-copy h1,.uhcp-profile-gate-copy p{margin:0}.uhcp-profile-gate-copy p{margin-top:.45rem}.uhcp-profile-target{align-items:center;background:var(--uhcp-panel);border:1px solid color-mix(in srgb,var(--uhcp-turquoise) 32%,var(--uhcp-border));border-radius:1rem;display:grid;gap:1rem;grid-template-columns:auto minmax(0,1fr);padding:1rem}.uhcp-profile-target>img{background:var(--uhcp-panel);border-radius:.75rem;object-fit:contain}.uhcp-profile-target-content{display:grid;gap:.65rem;min-width:0}.uhcp-profile-target-copy{display:grid;gap:.2rem;text-align:left}.uhcp-profile-target-copy>strong{color:var(--uhcp-text);font-size:1.2rem}.uhcp-profile-target-copy>span:last-child{color:var(--uhcp-muted)}.uhcp-profile-target-badges{display:flex;flex-wrap:wrap;gap:.45rem;list-style:none;margin:0;padding:0}.uhcp-profile-target-badges li{background:linear-gradient(135deg,var(--uhcp-selected-start),var(--uhcp-selected-end));border-radius:999px;color:#fff;padding:.35rem .65rem}.uhcp-profile-gate .uhcp-action-unlock{background:linear-gradient(135deg,var(--uhcp-unlock-start),var(--uhcp-unlock-end));color:var(--uhcp-unlock-text)}.uhcp-profile-target-details{margin:0}.uhcp-profile-target-details>div{display:grid;gap:.2rem;grid-template-columns:minmax(8rem,auto) 1fr}.uhcp-profile-target-details dt{color:var(--uhcp-muted)}.uhcp-profile-target-details dd{color:var(--uhcp-text);font-weight:700;margin:0}.uhcp-profile-gate-secondary{border-top:1px solid var(--uhcp-border);display:grid;gap:.6rem;padding-top:.8rem}
9
+ @media(max-width:760px){.uhcp-entry-hero,.uhcp-access-grid{grid-template-columns:1fr}.uhcp-profile-target{grid-template-columns:1fr;justify-items:center}.uhcp-profile-target-content,.uhcp-profile-target-copy{text-align:center;width:100%}.uhcp-profile-target-badges-centered{justify-content:center}}
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from 'react';
2
+ export type VerificationJourneyPhase = 'idle' | 'waiting-for-wallet' | 'presentation-verified' | 'issuance-pending' | 'credential-issued' | 'denied' | 'failed';
3
+ export interface VerificationJourneyLabels {
4
+ startPresentation: string;
5
+ checkPresentation: string;
6
+ requestCredential: string;
7
+ checkIssuance: string;
8
+ retry: string;
9
+ }
10
+ export interface VerificationJourneyPanelProps {
11
+ phase: VerificationJourneyPhase;
12
+ requestedClaims: readonly string[];
13
+ authorizationUri?: string;
14
+ credentialReference?: string;
15
+ errorMessage?: string;
16
+ labels?: Partial<VerificationJourneyLabels>;
17
+ renderQr?(authorizationUri: string): ReactNode;
18
+ onStartPresentation?(): void;
19
+ onRefreshPresentation?(): void;
20
+ onRequestCredential?(): void;
21
+ onRefreshIssuance?(): void;
22
+ onRetry?(): void;
23
+ className?: string;
24
+ }
25
+ export declare function VerificationJourneyPanel(props: VerificationJourneyPanelProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=verification-journey-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-journey-panel.d.ts","sourceRoot":"","sources":["../src/verification-journey-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAC/J,MAAM,WAAW,yBAAyB;IAAG,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACpK,MAAM,WAAW,6BAA6B;IAAG,KAAK,EAAE,wBAAwB,CAAC;IAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAAC,QAAQ,CAAC,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC;IAAC,qBAAqB,CAAC,IAAI,IAAI,CAAC;IAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC;IAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;IAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAKjc,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,+BAW5E"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const DEFAULT_LABELS = { startPresentation: 'Start identity presentation', checkPresentation: 'Check presentation', requestCredential: 'Request signed credential', checkIssuance: 'Check credential issuance', retry: 'Try again' };
3
+ function ActionButton({ label, onClick }) { return onClick ? _jsx("button", { onClick: onClick, type: "button", children: label }) : null; }
4
+ export function VerificationJourneyPanel(props) {
5
+ const labels = { ...DEFAULT_LABELS, ...props.labels };
6
+ return _jsxs("section", { "aria-live": "polite", className: props.className, children: [props.requestedClaims.length ? _jsxs("div", { children: [_jsx("h2", { children: "Requested information" }), _jsx("ul", { children: props.requestedClaims.map(claim => _jsx("li", { children: claim }, claim)) })] }) : null, props.phase === 'idle' ? _jsxs("div", { children: [_jsx("h2", { children: "Identity presentation" }), _jsx("p", { children: "A trusted verifier will ask the wallet for the displayed information." }), _jsx(ActionButton, { label: labels.startPresentation, onClick: props.onStartPresentation })] }) : null, props.phase === 'waiting-for-wallet' ? _jsxs("div", { children: [_jsx("h2", { children: "Waiting for wallet" }), _jsx("p", { children: "Review the requested information in the wallet and approve or deny the presentation." }), props.authorizationUri && props.renderQr ? props.renderQr(props.authorizationUri) : null, _jsx(ActionButton, { label: labels.checkPresentation, onClick: props.onRefreshPresentation })] }) : null, props.phase === 'presentation-verified' ? _jsxs("div", { children: [_jsx("h2", { children: "Presentation verified" }), _jsx("p", { children: "The trusted verifier accepted the presentation. This does not issue a new credential. The authorized provider must read its authoritative source before signing." }), _jsx(ActionButton, { label: labels.requestCredential, onClick: props.onRequestCredential })] }) : null, props.phase === 'issuance-pending' ? _jsxs("div", { children: [_jsx("h2", { children: "Credential request pending" }), _jsx("p", { children: "The authoritative provider is validating its source and issuance policy." }), _jsx(ActionButton, { label: labels.checkIssuance, onClick: props.onRefreshIssuance })] }) : null, props.phase === 'credential-issued' ? _jsxs("div", { children: [_jsx("h2", { children: "Credential issued" }), _jsx("p", { children: "The authoritative provider issued the signed credential." }), props.credentialReference ? _jsx("output", { children: props.credentialReference }) : null] }) : null, props.phase === 'denied' || props.phase === 'failed' ? _jsxs("div", { role: "alert", children: [_jsx("h2", { children: props.phase === 'denied' ? 'Request denied' : 'Request failed' }), props.errorMessage ? _jsx("p", { children: props.errorMessage }) : null, _jsx(ActionButton, { label: labels.retry, onClick: props.onRetry })] }) : null] });
7
+ }
package/package.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "antifraud-common-components-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Domain-neutral React screens for portal entry, authentication, profile protection and evidence",
5
+ "license": "Apache-2.0",
6
+ "repository": { "type": "git", "url": "git+https://github.com/antifraudservices/antifraud-common-components-react.git" },
7
+ "bugs": { "url": "https://github.com/antifraudservices/antifraud-common-components-react/issues" },
8
+ "homepage": "https://github.com/antifraudservices/antifraud-common-components-react#readme",
9
+ "type": "module",
10
+ "files": ["dist", "README.md", "CHANGELOG.md", "LICENSE"],
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "./styles.css": "./dist/styles.css" },
14
+ "scripts": { "build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css", "test": "vitest run", "typecheck": "tsc -p tsconfig.json --noEmit", "check": "npm run typecheck && npm test -- --maxWorkers=1 --no-file-parallelism && npm run build", "prepack": "npm run check" },
15
+ "engines": { "node": ">=24.0.0" },
16
+ "peerDependencies": { "react": ">=18.3.0", "react-dom": ">=18.3.0" },
17
+ "devDependencies": { "@testing-library/jest-dom": "6.9.1", "@testing-library/react": "16.3.2", "@testing-library/user-event": "14.6.1", "@types/node": "22.19.15", "@types/react": "19.2.17", "@types/react-dom": "19.2.3", "jsdom": "26.1.0", "react": "19.2.8", "react-dom": "19.2.8", "typescript": "5.9.3", "vitest": "4.1.12" }
18
+ }