antifraud-hosting-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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 - 2026-10-21
4
+
5
+ - Add the shared Demo, Test Network and Production entry screen and controlled
6
+ controller sign-in presentation.
7
+ - Add controlled host organization directory and non-cascading organization
8
+ lifecycle screens.
9
+ - Keep sector, tenant, environment, authentication and persistence authority
10
+ in the consuming BFF.
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,11 @@
1
- # Temporary Holding Version
1
+ # Antifraud Hosting 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
+ Sector-neutral controlled React screens for organization controllers and host
4
+ operators. The package owns presentation only. Applications retain
5
+ authentication, authorization, tenant resolution, network selection, BFF
6
+ calls, persistence and signing.
7
+
8
+ The package is intentionally separate from clinical/personal portal screens
9
+ and from education/qualification professional screens. Legacy professional
10
+ portals may consume these controller screens during migration; a later release
11
+ can remove their controller routes without moving UI again.
@@ -0,0 +1,60 @@
1
+ import type { FormEvent } from 'react';
2
+ export type HostingBrand = Readonly<{
3
+ productName: string;
4
+ organizationName: string;
5
+ homeHref: string;
6
+ mark: Readonly<{
7
+ src: string;
8
+ alt: string;
9
+ width: number;
10
+ height: number;
11
+ }>;
12
+ }>;
13
+ export type HostingAccessOption = Readonly<{
14
+ id: string;
15
+ href: string;
16
+ title: string;
17
+ description: string;
18
+ requirement: string;
19
+ }>;
20
+ export type HostingSignInCopy = Readonly<{
21
+ eyebrow: string;
22
+ title: string;
23
+ description: string;
24
+ provider: string;
25
+ unavailable: string;
26
+ separator?: string;
27
+ email?: string;
28
+ sendEmailCode?: string;
29
+ emailCode?: string;
30
+ verifyEmailCode?: string;
31
+ changeEmail?: string;
32
+ emailCodeSent?: string;
33
+ passkeyHint?: string;
34
+ passkey?: string;
35
+ demoEmail?: string;
36
+ demoCode?: string;
37
+ demoSubmit?: string;
38
+ demoHint?: string;
39
+ busy?: string;
40
+ }>;
41
+ export type HostingSignInPanelProps = Readonly<{
42
+ mode?: 'trusted' | 'demo';
43
+ copy: HostingSignInCopy;
44
+ email?: string;
45
+ emailCode?: string;
46
+ emailCodeRequested?: boolean;
47
+ busy: boolean;
48
+ error?: string;
49
+ providerEnabled?: boolean;
50
+ actionsEnabled?: boolean;
51
+ onEmailChange?(value: string): void;
52
+ onEmailCodeChange?(value: string): void;
53
+ onProvider?(): void | Promise<void>;
54
+ onRequestEmailCode?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
55
+ onVerifyEmailCode?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
56
+ onChangeEmail?(): void;
57
+ onPasskey?(): void | Promise<void>;
58
+ onDemo?(event: FormEvent<HTMLFormElement>): void | Promise<void>;
59
+ }>;
60
+ //# 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,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,QAAQ,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC5E,CAAC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAClF,CAAC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACtD,CAAC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACzB,IAAI,EAAE,iBAAiB,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,iBAAiB,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,kBAAkB,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5E,iBAAiB,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3E,aAAa,CAAC,IAAI,IAAI,CAAA;IACtB,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,MAAM,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjE,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,54 @@
1
+ export type HostOrganizationStatus = 'active' | 'suspended' | 'revoked';
2
+ export type HostOrganizationLifecycleAction = '_status' | '_disable' | '_enable' | '_purge';
3
+ export type HostOrganizationDirectoryItem = Readonly<{
4
+ id: string;
5
+ legalName: string;
6
+ identifierType: string;
7
+ identifierValue: string;
8
+ jurisdiction: string;
9
+ sector: string;
10
+ status: HostOrganizationStatus;
11
+ sameAs?: string;
12
+ }>;
13
+ export type HostOrganizationDirectorySearch = Readonly<{
14
+ legalName: string;
15
+ sector: string;
16
+ status: HostOrganizationStatus | '';
17
+ cursor?: string;
18
+ }>;
19
+ export type HostOrganizationDirectoryCopy = Readonly<{
20
+ title: string;
21
+ description: string;
22
+ organizationSingular: string;
23
+ organizationPlural: string;
24
+ name: string;
25
+ sector: string;
26
+ status: string;
27
+ allStatuses: string;
28
+ active: string;
29
+ suspended: string;
30
+ revoked: string;
31
+ search: string;
32
+ loading: string;
33
+ empty: string;
34
+ statusAction: string;
35
+ suspend: string;
36
+ reactivate: string;
37
+ purge: string;
38
+ next: string;
39
+ purgeConfirmation: string;
40
+ }>;
41
+ export type HostOrganizationDirectoryProps = Readonly<{
42
+ copy: HostOrganizationDirectoryCopy;
43
+ allowedSectors: readonly string[];
44
+ total: number;
45
+ busy: boolean;
46
+ error?: string;
47
+ organizations: readonly HostOrganizationDirectoryItem[];
48
+ nextCursor?: string;
49
+ onSearch(input: HostOrganizationDirectorySearch): void | Promise<void>;
50
+ onLifecycle(action: HostOrganizationLifecycleAction, organization: HostOrganizationDirectoryItem): void | Promise<void>;
51
+ }>;
52
+ /** Controlled host directory. The host application owns all authority, I/O and persistence. */
53
+ export declare function HostOrganizationDirectory({ copy, allowedSectors, total, busy, error, organizations, nextCursor, onSearch, onLifecycle }: HostOrganizationDirectoryProps): import("react").JSX.Element;
54
+ //# sourceMappingURL=host-organization-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-organization-directory.d.ts","sourceRoot":"","sources":["../src/host-organization-directory.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;AACvE,MAAM,MAAM,+BAA+B,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;AAC3F,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAC/N,MAAM,MAAM,+BAA+B,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,sBAAsB,GAAG,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACnJ,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAChb,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,6BAA6B,CAAC;IAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,+BAA+B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,WAAW,CAAC,MAAM,EAAE,+BAA+B,EAAE,YAAY,EAAE,6BAA6B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAA;AAE9b,+FAA+F;AAC/F,wBAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,8BAA8B,+BAKvK"}
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ /** Controlled host directory. The host application owns all authority, I/O and persistence. */
5
+ export function HostOrganizationDirectory({ copy, allowedSectors, total, busy, error, organizations, nextCursor, onSearch, onLifecycle }) {
6
+ const [query, setQuery] = useState('');
7
+ const [sector, setSector] = useState(allowedSectors[0] || '');
8
+ const [status, setStatus] = useState('');
9
+ function search(event) { event.preventDefault(); void onSearch({ legalName: query, sector, status }); }
10
+ function lifecycle(action, organization) { if (action === '_purge' && !window.confirm(copy.purgeConfirmation.replace('{organization}', organization.legalName || organization.identifierValue)))
11
+ return; void onLifecycle(action, organization); }
12
+ return _jsxs("section", { className: "afhc-panel host-directory", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("h1", { children: copy.title }), _jsx("p", { children: copy.description })] }), _jsxs("strong", { children: [total, " ", total === 1 ? copy.organizationSingular : copy.organizationPlural] })] }), _jsxs("form", { onSubmit: search, className: "host-directory-filters", children: [_jsxs("label", { children: [copy.name, _jsx("input", { value: query, onChange: event => setQuery(event.target.value) })] }), _jsxs("label", { children: [copy.sector, _jsx("select", { value: sector, onChange: event => setSector(event.target.value), children: allowedSectors.map(value => _jsx("option", { value: value, children: value }, value)) })] }), _jsxs("label", { children: [copy.status, _jsxs("select", { value: status, onChange: event => setStatus(event.target.value), children: [_jsx("option", { value: "", children: copy.allStatuses }), _jsx("option", { value: "active", children: copy.active }), _jsx("option", { value: "suspended", children: copy.suspended }), _jsx("option", { value: "revoked", children: copy.revoked })] })] }), _jsx("button", { disabled: busy || !sector, children: busy ? copy.loading : copy.search })] }), error ? _jsx("p", { role: "alert", className: "authority-boundary", children: error }) : null, _jsx("div", { className: "host-directory-list", children: organizations.map(organization => _jsxs("article", { children: [_jsxs("div", { children: [_jsx("h2", { children: organization.legalName || organization.identifierValue }), _jsxs("p", { children: [organization.identifierType, ": ", organization.identifierValue] }), _jsxs("small", { children: [organization.jurisdiction, " \u00B7 ", organization.sector] })] }), _jsx("span", { "data-status": organization.status, children: organization.status }), _jsxs("div", { className: "host-lifecycle-actions", children: [_jsx("button", { disabled: busy, onClick: () => lifecycle('_status', organization), children: copy.statusAction }), _jsx("button", { disabled: busy || organization.status === 'revoked', onClick: () => lifecycle(organization.status === 'suspended' ? '_enable' : '_disable', organization), children: organization.status === 'suspended' ? copy.reactivate : copy.suspend }), _jsx("button", { disabled: busy || organization.status !== 'suspended', onClick: () => lifecycle('_purge', organization), children: copy.purge })] })] }, organization.id)) }), !busy && organizations.length === 0 ? _jsx("p", { className: "structure-empty", children: copy.empty }) : null, nextCursor ? _jsx("button", { className: "workspace-back", type: "button", onClick: () => void onSearch({ legalName: query, sector, status, cursor: nextCursor }), children: copy.next }) : null] });
13
+ }
@@ -0,0 +1,4 @@
1
+ import type { HostingSignInPanelProps } from './contracts.js';
2
+ /** Controlled controller authentication UI; the host owns every identity adapter and session. */
3
+ export declare function HostingSignInPanel({ mode, copy, email, emailCode, emailCodeRequested, busy, error, providerEnabled, actionsEnabled, onEmailChange, onEmailCodeChange, onProvider, onRequestEmailCode, onVerifyEmailCode, onChangeEmail, onPasskey, onDemo }: HostingSignInPanelProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=hosting-sign-in-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosting-sign-in-panel.d.ts","sourceRoot":"","sources":["../src/hosting-sign-in-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAE7D,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,EAAE,IAAgB,EAAE,IAAI,EAAE,KAAU,EAAE,SAAc,EAAE,kBAA0B,EAAE,IAAI,EAAE,KAAK,EAAE,eAAuB,EAAE,cAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,uBAAuB,+BAUjU"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /** Controlled controller authentication UI; the host owns every identity adapter and session. */
4
+ export function HostingSignInPanel({ mode = 'trusted', copy, email = '', emailCode = '', emailCodeRequested = false, busy, error, providerEnabled = false, actionsEnabled = true, onEmailChange, onEmailCodeChange, onProvider, onRequestEmailCode, onVerifyEmailCode, onChangeEmail, onPasskey, onDemo }) {
5
+ const canUseEmail = Boolean(onEmailChange && onEmailCodeChange);
6
+ return _jsxs("section", { className: "afhc-sign-in", "aria-busy": busy || undefined, children: [_jsx("p", { className: "afhc-eyebrow", children: copy.eyebrow }), _jsx("h1", { children: copy.title }), _jsx("p", { children: copy.description }), mode === 'trusted' ? _jsxs(_Fragment, { children: [_jsx("button", { type: "button", disabled: !actionsEnabled || !providerEnabled || busy || !onProvider, onClick: onProvider, children: copy.provider }), !providerEnabled && !onRequestEmailCode ? _jsx("p", { role: "status", className: "afhc-muted", children: copy.unavailable }) : null, canUseEmail && onRequestEmailCode ? _jsxs(_Fragment, { children: [_jsx("div", { className: "afhc-auth-separator", children: _jsx("span", { children: copy.separator || 'or' }) }), !emailCodeRequested ? _jsxs("form", { onSubmit: onRequestEmailCode, children: [_jsxs("label", { children: [copy.email || 'Email', _jsx("input", { type: "email", autoComplete: "username webauthn", value: email, onChange: event => onEmailChange(event.target.value), required: true, disabled: busy })] }), _jsx("button", { disabled: !actionsEnabled || busy, children: copy.sendEmailCode || 'Send email code' }), onPasskey ? _jsxs(_Fragment, { children: [_jsx("p", { className: "afhc-muted", children: copy.passkeyHint }), _jsx("button", { type: "button", className: "afhc-secondary", onClick: onPasskey, disabled: !actionsEnabled || busy, children: copy.passkey || 'Use passkey' })] }) : null] }) : _jsxs("form", { onSubmit: onVerifyEmailCode, children: [_jsx("p", { className: "afhc-muted", children: (copy.emailCodeSent || 'Enter the code sent to {email}.').replace('{email}', email) }), _jsxs("label", { children: [copy.emailCode || 'Email code', _jsx("input", { 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", { disabled: !actionsEnabled || busy || emailCode.length !== 6, children: copy.verifyEmailCode || 'Verify code' }), _jsx("button", { type: "button", className: "afhc-secondary", onClick: onChangeEmail, disabled: busy || !onChangeEmail, children: copy.changeEmail || 'Change email' })] })] }) : null] }) : _jsxs("form", { onSubmit: onDemo, children: [_jsxs("label", { children: [copy.demoEmail || 'Demo email', _jsx("input", { type: "email", autoComplete: "off", value: email, onChange: event => onEmailChange?.(event.target.value), required: true, disabled: busy })] }), _jsxs("label", { children: [copy.demoCode || 'Demo code', _jsx("input", { 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: "afhc-muted", children: copy.demoHint }), _jsx("button", { disabled: !actionsEnabled || busy || emailCode.length !== 6 || !onDemo, children: copy.demoSubmit || 'Enter demo' })] }), busy ? _jsx("p", { role: "status", children: copy.busy || 'Connecting…' }) : null, error ? _jsx("p", { role: "alert", children: error }) : null] });
7
+ }
@@ -0,0 +1,4 @@
1
+ export * from './host-organization-directory.js';
2
+ export * from './organization-lifecycle-administration.js';
3
+ export * from './organization-workforce-administration.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,4CAA4C,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './host-organization-directory.js';
2
+ export * from './organization-lifecycle-administration.js';
3
+ export * from './organization-workforce-administration.js';
@@ -0,0 +1,41 @@
1
+ export type OrganizationLifecycleAction = 'disable-organization' | 'enable-organization' | 'purge-organization';
2
+ export type OrganizationLifecycleSnapshot = Readonly<{
3
+ status: string;
4
+ canDisable: boolean;
5
+ canPurge: boolean;
6
+ operationReference?: string;
7
+ descendants: Readonly<{
8
+ activeEmployees: number;
9
+ activeIndividuals: number;
10
+ unpurgedEmployees: number;
11
+ unpurgedIndividuals: number;
12
+ }>;
13
+ }>;
14
+ export type OrganizationLifecycleCopy = Readonly<{
15
+ eyebrow: string;
16
+ title: string;
17
+ description: string;
18
+ refresh: string;
19
+ unknown: string;
20
+ organizationStatus: string;
21
+ operationReference: string;
22
+ activeEmployees: string;
23
+ activeIndividuals: string;
24
+ remainingEmployees: string;
25
+ remainingIndividuals: string;
26
+ descendantsRemain: string;
27
+ disable: string;
28
+ enable: string;
29
+ purge: string;
30
+ purgeConfirmation: string;
31
+ }>;
32
+ export type OrganizationLifecycleAdministrationProps = Readonly<{
33
+ lifecycle: OrganizationLifecycleSnapshot | null;
34
+ busy: boolean;
35
+ copy: OrganizationLifecycleCopy;
36
+ onRefresh(): void | Promise<void>;
37
+ onAction(action: OrganizationLifecycleAction): void | Promise<void>;
38
+ }>;
39
+ /** Controlled non-cascading lifecycle screen shared by embedded and standalone controllers. */
40
+ export declare function OrganizationLifecycleAdministration({ lifecycle, busy, copy, onRefresh, onAction }: OrganizationLifecycleAdministrationProps): import("react").JSX.Element;
41
+ //# sourceMappingURL=organization-lifecycle-administration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-lifecycle-administration.d.ts","sourceRoot":"","sources":["../src/organization-lifecycle-administration.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAAG,qBAAqB,GAAG,oBAAoB,CAAA;AAC/G,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,QAAQ,CAAC;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AACpR,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AACvZ,MAAM,MAAM,wCAAwC,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,6BAA6B,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,yBAAyB,CAAC;IAAC,SAAS,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAA;AAE5Q,+FAA+F;AAC/F,wBAAgB,mCAAmC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,wCAAwC,+BAG3I"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /** Controlled non-cascading lifecycle screen shared by embedded and standalone controllers. */
3
+ export function OrganizationLifecycleAdministration({ lifecycle, busy, copy, onRefresh, onAction }) {
4
+ const counts = lifecycle?.descendants;
5
+ const descendantsRemain = Boolean(counts && (counts.activeEmployees > 0 || counts.activeIndividuals > 0 || counts.unpurgedEmployees > 0 || counts.unpurgedIndividuals > 0));
6
+ return _jsxs("section", { className: "panel organization-danger-zone", children: [_jsxs("div", { className: "workspace-heading", children: [_jsxs("div", { children: [_jsx("div", { className: "badge", children: copy.eyebrow }), _jsx("h2", { children: copy.title }), _jsx("p", { className: "muted", children: copy.description })] }), _jsx("button", { type: "button", className: "secondary", "data-portal-action": "refresh-organization-lifecycle", disabled: busy, onClick: () => void onRefresh(), children: copy.refresh })] }), !lifecycle ? _jsx("p", { className: "technical-note", children: copy.unknown }) : _jsxs(_Fragment, { children: [_jsxs("p", { className: "technical-note", children: [copy.organizationStatus, ": ", _jsx("strong", { children: lifecycle.status })] }), lifecycle.operationReference ? _jsxs("p", { className: "technical-note", children: [copy.operationReference, ": ", _jsx("code", { children: lifecycle.operationReference })] }) : null, _jsxs("div", { className: "metric-grid", role: "status", children: [_jsxs("article", { children: [_jsx("strong", { children: counts.activeEmployees }), _jsx("span", { children: copy.activeEmployees })] }), _jsxs("article", { children: [_jsx("strong", { children: counts.activeIndividuals }), _jsx("span", { children: copy.activeIndividuals })] }), _jsxs("article", { children: [_jsx("strong", { children: counts.unpurgedEmployees }), _jsx("span", { children: copy.remainingEmployees })] }), _jsxs("article", { children: [_jsx("strong", { children: counts.unpurgedIndividuals }), _jsx("span", { children: copy.remainingIndividuals })] })] }), descendantsRemain ? _jsx("div", { className: "notice", role: "note", children: copy.descendantsRemain }) : null, _jsxs("div", { className: "danger-step", children: [_jsx("button", { type: "button", className: "danger", "data-portal-action": "disable-organization", disabled: busy || !lifecycle.canDisable || lifecycle.status !== 'active', onClick: () => void onAction('disable-organization'), children: copy.disable }), _jsx("button", { type: "button", "data-portal-action": "enable-organization", disabled: busy || lifecycle.status !== 'suspended', onClick: () => void onAction('enable-organization'), children: copy.enable }), _jsx("button", { type: "button", className: "danger", "data-portal-action": "purge-organization", disabled: busy || !lifecycle.canPurge, onClick: () => { if (window.confirm(copy.purgeConfirmation))
7
+ void onAction('purge-organization'); }, children: copy.purge })] })] })] });
8
+ }
@@ -0,0 +1,82 @@
1
+ export type WorkforceLicenseSummary = Readonly<{
2
+ total: number;
3
+ used: number;
4
+ free: number;
5
+ }>;
6
+ export type WorkforceEmployee = Readonly<{
7
+ id: string;
8
+ licenseId: string;
9
+ email: string;
10
+ role: string;
11
+ status: 'active' | 'inactive';
12
+ deviceCount?: number;
13
+ }>;
14
+ export type WorkforceInvitation = Readonly<{
15
+ id: string;
16
+ email: string;
17
+ role: string;
18
+ status: 'pending' | 'accepted' | 'cancelled';
19
+ sentAt?: string;
20
+ }>;
21
+ export type WorkforceRoleOption = Readonly<{
22
+ value: string;
23
+ label: string;
24
+ }>;
25
+ export type OrganizationWorkforceCopy = Readonly<{
26
+ title: string;
27
+ description: string;
28
+ totalLicenses: string;
29
+ usedLicenses: string;
30
+ freeLicenses: string;
31
+ employeesTitle: string;
32
+ invitationsTitle: string;
33
+ inviteTitle: string;
34
+ emailLabel: string;
35
+ roleLabel: string;
36
+ unlockSecretLabel: string;
37
+ invite: string;
38
+ inviting: string;
39
+ noFreeLicenses: string;
40
+ noEmployees: string;
41
+ noInvitations: string;
42
+ licenseColumn: string;
43
+ employeeColumn: string;
44
+ roleColumn: string;
45
+ statusColumn: string;
46
+ devicesColumn: string;
47
+ actionsColumn: string;
48
+ active: string;
49
+ inactive: string;
50
+ pending: string;
51
+ accepted: string;
52
+ cancelled: string;
53
+ disable: string;
54
+ reactivate: string;
55
+ purge: string;
56
+ confirmDisable: string;
57
+ confirmReactivate: string;
58
+ confirmPurge: string;
59
+ devicesLater: string;
60
+ }>;
61
+ export type OrganizationWorkforceAdministrationProps = Readonly<{
62
+ copy: OrganizationWorkforceCopy;
63
+ summary: WorkforceLicenseSummary;
64
+ employees: readonly WorkforceEmployee[];
65
+ invitations: readonly WorkforceInvitation[];
66
+ roles: readonly WorkforceRoleOption[];
67
+ email: string;
68
+ role: string;
69
+ unlockSecret: string;
70
+ busyAction?: string;
71
+ error?: string;
72
+ onEmailChange(value: string): void;
73
+ onRoleChange(value: string): void;
74
+ onUnlockSecretChange(value: string): void;
75
+ onInvite(): void | Promise<void>;
76
+ onDisable(employeeId: string): void | Promise<void>;
77
+ onReactivate(employeeId: string): void | Promise<void>;
78
+ onPurge(employeeId: string): void | Promise<void>;
79
+ }>;
80
+ /** Controlled workforce screen. The host owns authorization, persistence and lifecycle commands. */
81
+ export declare function OrganizationWorkforceAdministration(props: OrganizationWorkforceAdministrationProps): import("react").JSX.Element;
82
+ //# sourceMappingURL=organization-workforce-administration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-workforce-administration.d.ts","sourceRoot":"","sources":["../src/organization-workforce-administration.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /** Controlled workforce screen. The host owns authorization, persistence and lifecycle commands. */
3
+ export function OrganizationWorkforceAdministration(props) {
4
+ const { copy, summary, employees, invitations, roles, email, role, unlockSecret, busyAction, error } = props;
5
+ const noCapacity = summary.free < 1;
6
+ const inviting = busyAction === 'invite';
7
+ const canInvite = !noCapacity && !inviting && Boolean(email.trim() && role && unlockSecret);
8
+ function submit(event) { event.preventDefault(); if (canInvite)
9
+ void props.onInvite(); }
10
+ function confirm(message, action) { if (window.confirm(message))
11
+ void action(); }
12
+ return _jsxs("section", { className: "afpc-workforce", "aria-labelledby": "afpc-workforce-title", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("h1", { id: "afpc-workforce-title", children: copy.title }), _jsx("p", { children: copy.description })] }), _jsxs("dl", { className: "afpc-license-summary", children: [_jsxs("div", { children: [_jsx("dt", { children: copy.totalLicenses }), _jsx("dd", { children: summary.total })] }), _jsxs("div", { children: [_jsx("dt", { children: copy.usedLicenses }), _jsx("dd", { children: summary.used })] }), _jsxs("div", { children: [_jsx("dt", { children: copy.freeLicenses }), _jsx("dd", { children: summary.free })] })] })] }), _jsxs("section", { className: "afpc-workforce-panel", "aria-labelledby": "afpc-invite-title", children: [_jsx("h2", { id: "afpc-invite-title", children: copy.inviteTitle }), noCapacity ? _jsx("p", { role: "status", className: "afpc-workforce-warning", children: copy.noFreeLicenses }) : null, _jsxs("form", { onSubmit: submit, children: [_jsxs("label", { children: [_jsx("span", { children: copy.emailLabel }), _jsx("input", { type: "email", required: true, value: email, onChange: event => props.onEmailChange(event.currentTarget.value) })] }), _jsxs("label", { children: [_jsx("span", { children: copy.roleLabel }), _jsxs("select", { required: true, value: role, onChange: event => props.onRoleChange(event.currentTarget.value), children: [_jsx("option", { value: "" }), roles.map(option => _jsx("option", { value: option.value, children: option.label }, option.value))] })] }), _jsxs("label", { children: [_jsx("span", { children: copy.unlockSecretLabel }), _jsx("input", { type: "password", required: true, value: unlockSecret, onChange: event => props.onUnlockSecretChange(event.currentTarget.value) })] }), _jsx("button", { type: "submit", disabled: !canInvite, children: inviting ? copy.inviting : copy.invite })] })] }), _jsxs("section", { className: "afpc-workforce-panel", "aria-labelledby": "afpc-employees-title", children: [_jsx("h2", { id: "afpc-employees-title", children: copy.employeesTitle }), employees.length === 0 ? _jsx("p", { children: copy.noEmployees }) : _jsx("div", { className: "afpc-table-scroll", children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: copy.licenseColumn }), _jsx("th", { children: copy.employeeColumn }), _jsx("th", { children: copy.roleColumn }), _jsx("th", { children: copy.statusColumn }), _jsx("th", { children: copy.devicesColumn }), _jsx("th", { children: copy.actionsColumn })] }) }), _jsx("tbody", { children: employees.map(employee => _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: employee.licenseId }) }), _jsx("td", { children: employee.email }), _jsx("td", { children: employee.role }), _jsx("td", { children: _jsx("span", { className: `afpc-status afpc-status-${employee.status}`, children: employee.status === 'active' ? copy.active : copy.inactive }) }), _jsx("td", { children: employee.deviceCount === undefined ? copy.devicesLater : employee.deviceCount }), _jsx("td", { className: "afpc-row-actions", children: employee.status === 'active' ? _jsx("button", { type: "button", className: "afpc-warning-action", disabled: busyAction === employee.id, onClick: () => confirm(copy.confirmDisable, () => props.onDisable(employee.id)), children: copy.disable }) : _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "afpc-primary-action", disabled: busyAction === employee.id, onClick: () => confirm(copy.confirmReactivate, () => props.onReactivate(employee.id)), children: copy.reactivate }), _jsx("button", { type: "button", className: "afpc-danger", disabled: busyAction === employee.id, onClick: () => confirm(copy.confirmPurge, () => props.onPurge(employee.id)), children: copy.purge })] }) })] }, employee.id)) })] }) })] }), _jsxs("section", { className: "afpc-workforce-panel", "aria-labelledby": "afpc-invitations-title", children: [_jsx("h2", { id: "afpc-invitations-title", children: copy.invitationsTitle }), invitations.length === 0 ? _jsx("p", { children: copy.noInvitations }) : _jsx("ul", { className: "afpc-invitation-list", children: invitations.map(invitation => _jsxs("li", { children: [_jsxs("span", { children: [_jsx("strong", { children: invitation.email }), _jsx("small", { children: invitation.role })] }), _jsx("span", { className: `afpc-status afpc-status-${invitation.status}`, children: copy[invitation.status] })] }, invitation.id)) })] }), error ? _jsx("p", { role: "alert", className: "afpc-error", children: error }) : null] });
13
+ }
@@ -0,0 +1,13 @@
1
+ import type { HostingAccessOption, HostingBrand } from './contracts.js';
2
+ export declare function HostingPortalEntryHero({ brand, eyebrow, title, description }: Readonly<{
3
+ brand: HostingBrand;
4
+ eyebrow: string;
5
+ title: string;
6
+ description: string;
7
+ }>): import("react").JSX.Element;
8
+ /** Every option is a real route. Browser selection never changes backend authority. */
9
+ export declare function HostingAccessChooser({ label, options }: Readonly<{
10
+ label: string;
11
+ options: readonly HostingAccessOption[];
12
+ }>): import("react").JSX.Element;
13
+ //# 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,mBAAmB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEvE,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,+BAEpK;AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAAE,CAAC,+BAE5H"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function HostingPortalEntryHero({ brand, eyebrow, title, description }) {
3
+ return _jsxs("section", { className: "afhc-entry-hero", children: [_jsx("div", { className: "afhc-hero-mark", "aria-hidden": "true", children: _jsx("img", { src: brand.mark.src, alt: "", width: brand.mark.width, height: brand.mark.height }) }), _jsxs("div", { className: "afhc-entry-copy", children: [_jsx("div", { className: "afhc-badge", children: eyebrow }), _jsx("h1", { children: title }), _jsx("p", { children: description }), _jsxs("small", { children: [brand.productName, " \u00B7 ", brand.organizationName] })] })] });
4
+ }
5
+ /** Every option is a real route. Browser selection never changes backend authority. */
6
+ export function HostingAccessChooser({ label, options }) {
7
+ return _jsx("nav", { className: "afhc-access-grid", "aria-label": label, children: options.map((option, index) => _jsxs("a", { className: "afhc-access-card", href: option.href, children: [_jsx("span", { className: "afhc-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,18 @@
1
+ :root { --afhc-text:#081b3a; --afhc-muted:#61718a; --afhc-line:#d9e1eb; --afhc-surface:#fff; --afhc-panel:#f8fafc; --afhc-accent:#075f68; }
2
+ .afhc-entry-hero { display:grid; grid-template-columns:minmax(12rem,24rem) minmax(0,1fr); gap:clamp(2rem,6vw,6rem); align-items:center; margin:0 auto; max-width:1160px; padding:clamp(2rem,7vw,6rem) clamp(1rem,4vw,3rem); color:var(--afhc-text); }
3
+ .afhc-hero-mark { display:grid; place-items:center; min-height:16rem; border-radius:50%; background:color-mix(in srgb,var(--afhc-accent) 9%,#fff); }
4
+ .afhc-hero-mark img { max-width:72%; height:auto; object-fit:contain; }
5
+ .afhc-badge,.afhc-eyebrow { color:var(--afhc-accent); font-size:.8rem; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
6
+ .afhc-entry-copy h1 { margin:1rem 0; font-size:clamp(2.25rem,5vw,4.75rem); letter-spacing:-.045em; line-height:.98; }
7
+ .afhc-entry-copy p { color:var(--afhc-muted); font-size:clamp(1rem,2vw,1.25rem); line-height:1.7; }
8
+ .afhc-access-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; margin:0 auto; max-width:1160px; padding:clamp(1rem,4vw,3rem); }
9
+ .afhc-access-card { display:grid; gap:.65rem; min-height:13rem; padding:1.5rem; border:1px solid var(--afhc-line); border-radius:1.25rem; color:var(--afhc-text); background:var(--afhc-surface); text-decoration:none; }
10
+ .afhc-access-number { color:var(--afhc-accent); font-weight:900; }
11
+ .afhc-access-card strong { font-size:1.25rem; }.afhc-access-card small,.afhc-access-card>span:not(.afhc-access-number),.afhc-muted { color:var(--afhc-muted); }
12
+ .afhc-sign-in { display:grid; gap:1rem; margin:clamp(2rem,6vw,5rem) auto; max-width:38rem; padding:clamp(1.5rem,4vw,3rem); color:var(--afhc-text); }
13
+ .afhc-sign-in form,.afhc-sign-in label { display:grid; gap:.7rem; }.afhc-sign-in input { min-height:2.8rem; padding:0 .85rem; border:1px solid var(--afhc-line); border-radius:.8rem; font:inherit; }
14
+ .afhc-sign-in button,.host-directory button { min-height:2.8rem; padding:.7rem 1rem; border:0; border-radius:999px; color:#fff; background:var(--afhc-accent); font:inherit; font-weight:800; }.afhc-sign-in button:disabled,.host-directory button:disabled { opacity:.55; }.afhc-sign-in .afhc-secondary { border:1px solid var(--afhc-line); color:var(--afhc-text); background:transparent; }
15
+ .afhc-auth-separator { display:flex; align-items:center; gap:1rem; color:var(--afhc-muted); }.afhc-auth-separator::before,.afhc-auth-separator::after { content:""; flex:1; border-top:1px solid var(--afhc-line); }
16
+ .afhc-panel { padding:clamp(1.5rem,4vw,2.75rem); border:1px solid var(--afhc-line); border-radius:1.5rem; background:var(--afhc-surface); color:var(--afhc-text); }
17
+ @media(max-width:760px){.afhc-entry-hero,.afhc-access-grid{grid-template-columns:1fr}.afhc-hero-mark{min-height:11rem}}
18
+ .afpc-workforce{color:var(--afpc-text,#10213a);display:grid;gap:1.25rem}.afpc-workforce>header{align-items:end;display:flex;gap:2rem;justify-content:space-between}.afpc-workforce h1,.afpc-workforce h2,.afpc-workforce p{margin:0}.afpc-workforce>header p,.afpc-workforce-panel>p{color:var(--afpc-muted,#526174);margin-top:.45rem}.afpc-license-summary{display:grid;gap:.65rem;grid-template-columns:repeat(3,minmax(6rem,1fr));margin:0}.afpc-license-summary div,.afpc-workforce-panel{background:var(--afpc-panel,#fff);border:1px solid var(--afpc-border,#cbd5e1);border-radius:1rem;padding:.8rem 1rem}.afpc-license-summary dt{color:var(--afpc-muted,#526174);font-size:.72rem;font-weight:800;text-transform:uppercase}.afpc-license-summary dd{font-size:1.65rem;font-weight:900;margin:.2rem 0 0}.afpc-workforce-panel{border-radius:1.5rem;padding:1.25rem}.afpc-workforce-panel form{align-items:end;display:grid;gap:.8rem;grid-template-columns:2fr 1.3fr 1.2fr auto;margin-top:1rem}.afpc-workforce-panel label{display:grid;font-weight:700;gap:.35rem}.afpc-workforce-panel input,.afpc-workforce-panel select{border:1px solid var(--afpc-border,#cbd5e1);border-radius:.75rem;font:inherit;min-width:0;padding:.75rem}.afpc-workforce button{background:linear-gradient(135deg,#0f9ca8,#2563a9);border:0;border-radius:.75rem;color:#fff;cursor:pointer;font:inherit;font-weight:800;padding:.75rem 1rem}.afpc-workforce button:disabled{cursor:not-allowed;opacity:.45}.afpc-workforce button.afpc-warning-action{background:#facc15;color:#422006}.afpc-workforce button.afpc-primary-action{background:#2563eb}.afpc-workforce button.afpc-danger{background:#9e3535}.afpc-workforce-warning{color:#a44d00!important;font-weight:800}.afpc-table-scroll{overflow-x:auto}.afpc-workforce table{border-collapse:collapse;margin-top:1rem;width:100%}.afpc-workforce th,.afpc-workforce td{border-bottom:1px solid var(--afpc-border,#cbd5e1);padding:.75rem .5rem;text-align:left}.afpc-workforce th{color:var(--afpc-muted,#526174);font-size:.75rem;text-transform:uppercase}.afpc-row-actions{display:flex;gap:.5rem}.afpc-status{border-radius:999px;display:inline-flex;font-size:.75rem;font-weight:800;padding:.3rem .6rem}.afpc-invitation-list{display:grid;gap:.6rem;list-style:none;margin:1rem 0 0;padding:0}.afpc-invitation-list li{align-items:center;border-bottom:1px solid var(--afpc-border,#cbd5e1);display:flex;justify-content:space-between;padding:.65rem 0}.afpc-invitation-list li>span:first-child{display:grid;gap:.2rem}.afpc-error{color:#c64747!important}@media(max-width:820px){.afpc-workforce>header{align-items:stretch;flex-direction:column}.afpc-workforce-panel form{grid-template-columns:1fr}}
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "antifraud-hosting-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": "Sector-neutral React screens for organization and host controller portals",
5
+ "license": "Apache-2.0",
6
+ "repository": { "type": "git", "url": "git+https://github.com/antifraudservices/antifraud-hosting-components-react.git" },
7
+ "bugs": { "url": "https://github.com/antifraudservices/antifraud-hosting-components-react/issues" },
8
+ "homepage": "https://github.com/antifraudservices/antifraud-hosting-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": {
14
+ ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
15
+ "./styles.css": "./dist/styles.css"
16
+ },
17
+ "scripts": {
18
+ "build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css",
19
+ "test": "vitest run",
20
+ "typecheck": "tsc -p tsconfig.json --noEmit",
21
+ "check": "npm run typecheck && npm test -- --maxWorkers=1 --no-file-parallelism && npm run build",
22
+ "prepack": "npm run check"
23
+ },
24
+ "engines": { "node": ">=24.0.0" },
25
+ "peerDependencies": { "react": ">=18.3.0", "react-dom": ">=18.3.0" },
26
+ "devDependencies": {
27
+ "@testing-library/jest-dom": "6.9.1",
28
+ "@testing-library/react": "16.3.2",
29
+ "@testing-library/user-event": "14.6.1",
30
+ "@types/node": "22.19.15",
31
+ "@types/react": "19.2.17",
32
+ "@types/react-dom": "19.2.3",
33
+ "jsdom": "26.1.0",
34
+ "react": "19.2.8",
35
+ "react-dom": "19.2.8",
36
+ "typescript": "5.9.3",
37
+ "vitest": "4.1.12"
38
+ }
39
+ }