uhc-portal-components-react 0.2.10 → 0.2.12
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 +19 -0
- package/README.md +9 -0
- package/dist/AnimalIdentityDetailsV2.d.ts +43 -0
- package/dist/AnimalIdentityDetailsV2.d.ts.map +1 -0
- package/dist/AnimalIdentityDetailsV2.js +8 -0
- package/dist/AnimalIdentityOnboardingV2.d.ts +3 -1
- package/dist/AnimalIdentityOnboardingV2.d.ts.map +1 -1
- package/dist/AnimalIdentityOnboardingV2.js +16 -5
- package/dist/ClinicalArtifactEditorV2.js +1 -1
- package/dist/ClinicalBundleDraftEditor.d.ts +5 -0
- package/dist/ClinicalBundleDraftEditor.d.ts.map +1 -1
- package/dist/ClinicalBundleDraftEditor.js +10 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/styles.css +12 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.12 - 2026-10-11
|
|
4
|
+
|
|
5
|
+
- Show the animal portrait and optional public legal-organization owner data,
|
|
6
|
+
including jurisdiction, legal identifier, official address, telephone,
|
|
7
|
+
email and public-profile provenance, in the shared read-only identity view.
|
|
8
|
+
- Keep per-resource credential content inside its owning clinical draft entry.
|
|
9
|
+
- Place the constructive V2 editor action first with the shared green action
|
|
10
|
+
treatment and keep cancellation visually distinct.
|
|
11
|
+
|
|
12
|
+
## 0.2.11 - 2026-10-11
|
|
13
|
+
|
|
14
|
+
- Add a reusable read-only identity projection matching the progressive
|
|
15
|
+
onboarding sections.
|
|
16
|
+
- Start both onboarding sections collapsed, disable submission until required
|
|
17
|
+
identity, contact and image fields are valid, and support host actions in the
|
|
18
|
+
same footer row.
|
|
19
|
+
- Document the UHC Professional newborn-role variation without creating a
|
|
20
|
+
separate component flow.
|
|
21
|
+
|
|
3
22
|
## 0.2.10 - 2026-10-10
|
|
4
23
|
|
|
5
24
|
- Keep animal-controller creation focused on identity and contact data: the
|
package/README.md
CHANGED
|
@@ -14,6 +14,15 @@ The package owns visual shell behavior only. Authentication, protected-profile
|
|
|
14
14
|
storage, PIN verification and actor authorization remain in the host portal
|
|
15
15
|
through `ProfileRuntime`, `LoadedProfileWorkspace` and actor-scoped SDK facades.
|
|
16
16
|
|
|
17
|
+
`AnimalIdentityOnboardingV2` and `AnimalIdentityDetailsV2` define one shared
|
|
18
|
+
progressive create/read pattern. VetChain uses it for an animal and responsible
|
|
19
|
+
party. UHC Professional must reuse the same contract for a newborn and
|
|
20
|
+
responsible person, changing only governed role policy and copy: an attending
|
|
21
|
+
physician, midwife, nurse or paramedic may prepare the identity and default
|
|
22
|
+
permission proposal where the jurisdiction authorizes that occupation. The
|
|
23
|
+
proposal remains pending until the responsible authority confirms it; showing
|
|
24
|
+
or submitting the UI never grants access by itself.
|
|
25
|
+
|
|
17
26
|
```tsx
|
|
18
27
|
import {
|
|
19
28
|
PortalShell,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type AnimalIdentityDetailsV2Copy = Readonly<{
|
|
3
|
+
animalStep: string;
|
|
4
|
+
controllerStep: string;
|
|
5
|
+
animalName: string;
|
|
6
|
+
species: string;
|
|
7
|
+
identifierType: string;
|
|
8
|
+
identifierValue: string;
|
|
9
|
+
controllerName: string;
|
|
10
|
+
relationship: string;
|
|
11
|
+
edit?: string;
|
|
12
|
+
jurisdiction?: string;
|
|
13
|
+
legalIdentifier?: string;
|
|
14
|
+
officialAddress?: string;
|
|
15
|
+
telephone?: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
source?: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type AnimalIdentityDetailsV2Value = Readonly<{
|
|
20
|
+
animalName: string;
|
|
21
|
+
species: string;
|
|
22
|
+
identifierType: string;
|
|
23
|
+
identifierValue: string;
|
|
24
|
+
animalPhotoUrl?: string;
|
|
25
|
+
animalPhotoAlt?: string;
|
|
26
|
+
controllerName: string;
|
|
27
|
+
relationship: string;
|
|
28
|
+
controllerKind?: 'person' | 'organization';
|
|
29
|
+
controllerJurisdiction?: string;
|
|
30
|
+
controllerIdentifier?: string;
|
|
31
|
+
controllerOfficialAddress?: string;
|
|
32
|
+
controllerTelephone?: string;
|
|
33
|
+
controllerEmail?: string;
|
|
34
|
+
controllerSource?: string;
|
|
35
|
+
}>;
|
|
36
|
+
/** Read-only counterpart of AnimalIdentityOnboardingV2 using the same progressive sections. */
|
|
37
|
+
export declare function AnimalIdentityDetailsV2({ copy, value, onEdit, actions }: Readonly<{
|
|
38
|
+
copy: AnimalIdentityDetailsV2Copy;
|
|
39
|
+
value: AnimalIdentityDetailsV2Value;
|
|
40
|
+
onEdit?: () => void;
|
|
41
|
+
actions?: ReactNode;
|
|
42
|
+
}>): import("react").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=AnimalIdentityDetailsV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimalIdentityDetailsV2.d.ts","sourceRoot":"","sources":["../src/AnimalIdentityDetailsV2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,UAAU,EAAC,MAAM,CAAC;IAAC,cAAc,EAAC,MAAM,CAAC;IAAC,UAAU,EAAC,MAAM,CAAC;IAAC,OAAO,EAAC,MAAM,CAAC;IAAC,cAAc,EAAC,MAAM,CAAC;IAAC,eAAe,EAAC,MAAM,CAAC;IAAC,cAAc,EAAC,MAAM,CAAC;IAAC,YAAY,EAAC,MAAM,CAAC;IAAC,IAAI,CAAC,EAAC,MAAM,CAAA;IACpL,YAAY,CAAC,EAAC,MAAM,CAAC;IAAC,eAAe,CAAC,EAAC,MAAM,CAAC;IAAC,eAAe,CAAC,EAAC,MAAM,CAAC;IAAC,SAAS,CAAC,EAAC,MAAM,CAAC;IAAC,KAAK,CAAC,EAAC,MAAM,CAAC;IAAC,MAAM,CAAC,EAAC,MAAM,CAAA;CACzH,CAAC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,UAAU,EAAC,MAAM,CAAC;IAAC,OAAO,EAAC,MAAM,CAAC;IAAC,cAAc,EAAC,MAAM,CAAC;IAAC,eAAe,EAAC,MAAM,CAAC;IAAC,cAAc,CAAC,EAAC,MAAM,CAAC;IAAC,cAAc,CAAC,EAAC,MAAM,CAAA;IAChI,cAAc,EAAC,MAAM,CAAC;IAAC,YAAY,EAAC,MAAM,CAAC;IAAC,cAAc,CAAC,EAAC,QAAQ,GAAC,cAAc,CAAC;IAAC,sBAAsB,CAAC,EAAC,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAC,MAAM,CAAA;IACjJ,yBAAyB,CAAC,EAAC,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAC,MAAM,CAAC;IAAC,eAAe,CAAC,EAAC,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAC,MAAM,CAAA;CAClH,CAAC,CAAA;AAEF,+FAA+F;AAC/F,wBAAgB,uBAAuB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC;IAAE,IAAI,EAAC,2BAA2B,CAAC;IAAC,KAAK,EAAC,4BAA4B,CAAC;IAAC,MAAM,CAAC,EAAC,MAAI,IAAI,CAAC;IAAC,OAAO,CAAC,EAAC,SAAS,CAAA;CAAE,CAAC,+BAMjM"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/** Read-only counterpart of AnimalIdentityOnboardingV2 using the same progressive sections. */
|
|
3
|
+
export function AnimalIdentityDetailsV2({ copy, value, onEdit, actions }) {
|
|
4
|
+
return _jsxs("section", { className: "uhcp-animal-onboarding uhcp-animal-onboarding-v2 uhcp-animal-identity-details-v2", children: [_jsxs("details", { children: [_jsxs("summary", { children: [_jsx(StepNumber, { value: 1 }), " ", copy.animalStep] }), _jsxs("div", { className: "uhcp-animal-identity-readonly", children: [_jsx(_Fragment, { children: value.animalPhotoUrl ? _jsx("img", { className: "uhcp-animal-identity-photo", src: value.animalPhotoUrl, alt: value.animalPhotoAlt ?? value.animalName }) : null }), _jsxs("dl", { className: "uhcp-animal-identity-readonly-grid", children: [_jsx(Fact, { label: copy.animalName, value: value.animalName }), _jsx(Fact, { label: copy.species, value: value.species }), _jsx(Fact, { label: copy.identifierType, value: value.identifierType }), _jsx(Fact, { label: copy.identifierValue, value: value.identifierValue })] })] })] }), _jsxs("details", { children: [_jsxs("summary", { children: [_jsx(StepNumber, { value: 2 }), " ", copy.controllerStep] }), _jsxs("dl", { className: "uhcp-animal-identity-readonly-grid", children: [_jsx(Fact, { label: copy.controllerName, value: value.controllerName }), _jsx(Fact, { label: copy.relationship, value: value.relationship }), _jsx(OptionalFact, { label: copy.jurisdiction, value: value.controllerJurisdiction }), _jsx(OptionalFact, { label: copy.legalIdentifier, value: value.controllerIdentifier }), _jsx(OptionalFact, { label: copy.officialAddress, value: value.controllerOfficialAddress }), _jsx(OptionalFact, { label: copy.telephone, value: value.controllerTelephone }), _jsx(OptionalFact, { label: copy.email, value: value.controllerEmail }), _jsx(OptionalFact, { label: copy.source, value: value.controllerSource })] })] }), onEdit || actions ? _jsxs("div", { className: "uhcp-animal-onboarding-actions", children: [actions, onEdit ? _jsx("button", { type: "button", onClick: onEdit, "aria-label": copy.edit, title: copy.edit, children: copy.edit }) : null] }) : null] });
|
|
5
|
+
}
|
|
6
|
+
function StepNumber({ value }) { return _jsx("span", { className: "uhcp-identity-step-number", "aria-hidden": "true", children: value }); }
|
|
7
|
+
function Fact({ label, value }) { return _jsxs("div", { children: [_jsx("dt", { children: label }), _jsx("dd", { children: value })] }); }
|
|
8
|
+
function OptionalFact({ label, value }) { return label && value ? _jsx(Fact, { label: label, value: value }) : null; }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
import type { AnimalIdentityOnboardingCopy, AnimalIdentityOnboardingInput } from './AnimalIdentityOnboarding.js';
|
|
2
3
|
export type AnimalIdentityOnboardingV2Copy = AnimalIdentityOnboardingCopy & Readonly<{
|
|
3
4
|
controllerIsLegalRepresentative: string;
|
|
@@ -31,7 +32,7 @@ type SelectOption = Readonly<{
|
|
|
31
32
|
* Progressive animal onboarding presentation. It preserves the V1 payload so
|
|
32
33
|
* hosts can adopt it without changing evidence, authorization or persistence.
|
|
33
34
|
*/
|
|
34
|
-
export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions, countryOptions, regionOptionsByCountry, identifierTypeOptions, showHeader, requireEmail, requireTelephone, busy }: Readonly<{
|
|
35
|
+
export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions, countryOptions, regionOptionsByCountry, identifierTypeOptions, showHeader, requireEmail, requireTelephone, busy, footerActions }: Readonly<{
|
|
35
36
|
copy: AnimalIdentityOnboardingV2Copy;
|
|
36
37
|
onSubmit: (input: AnimalIdentityOnboardingInput) => Promise<void> | void;
|
|
37
38
|
submitAction?: string;
|
|
@@ -49,6 +50,7 @@ export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitActio
|
|
|
49
50
|
requireEmail?: boolean;
|
|
50
51
|
requireTelephone?: boolean;
|
|
51
52
|
busy?: boolean;
|
|
53
|
+
footerActions?: ReactNode;
|
|
52
54
|
}>): import("react").JSX.Element;
|
|
53
55
|
export {};
|
|
54
56
|
//# sourceMappingURL=AnimalIdentityOnboardingV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimalIdentityOnboardingV2.d.ts","sourceRoot":"","sources":["../src/AnimalIdentityOnboardingV2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AmB,EAAE,sBAA2B,EAAE,qBAAqB,EAAE,UAAiB,EAAE,YAAoB,EAAE,gBAAwB,EAAE,IAAY,EAAE,aAAa,EAAE,EAAE,QAAQ,CAAC;IAClR,IAAI,EAAE,8BAA8B,CAAA;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACxE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,SAAS,QAAQ,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;IAC3E,cAAc,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,sBAAsB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC,CAAA;IAC1E,qBAAqB,CAAC,EAAE,QAAQ,CAAC;QAAE,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;QAAC,YAAY,EAAE,SAAS,YAAY,EAAE,CAAA;KAAE,CAAC,CAAA;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B,CAAC,+BA4ID"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// Copyright 2026 Connecting Solution & Applications Ltd under the Apache License, Version 2.0.
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { IdentityEntityEditorV2 } from './IdentityEntityEditorV2.js';
|
|
4
5
|
const MAX_ANIMAL_PHOTO_BYTES = 2 * 1024 * 1024;
|
|
5
6
|
/**
|
|
6
7
|
* Progressive animal onboarding presentation. It preserves the V1 payload so
|
|
7
8
|
* hosts can adopt it without changing evidence, authorization or persistence.
|
|
8
9
|
*/
|
|
9
|
-
export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions = [], countryOptions = [], regionOptionsByCountry = {}, identifierTypeOptions, showHeader = true, requireEmail = false, requireTelephone = false, busy = false }) {
|
|
10
|
+
export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions = [], countryOptions = [], regionOptionsByCountry = {}, identifierTypeOptions, showHeader = true, requireEmail = false, requireTelephone = false, busy = false, footerActions }) {
|
|
11
|
+
const formRef = useRef(null);
|
|
10
12
|
const [submitting, setSubmitting] = useState(false);
|
|
11
13
|
const [animalName, setAnimalName] = useState('');
|
|
12
14
|
const [previewUrl, setPreviewUrl] = useState('');
|
|
13
15
|
const [animalDocument, setAnimalDocument] = useState();
|
|
14
16
|
const [photoError, setPhotoError] = useState('');
|
|
15
17
|
const [contactError, setContactError] = useState('');
|
|
18
|
+
const [formReady, setFormReady] = useState(false);
|
|
19
|
+
function refreshFormReady(formElement = formRef.current) {
|
|
20
|
+
if (!formElement)
|
|
21
|
+
return setFormReady(false);
|
|
22
|
+
const form = new FormData(formElement);
|
|
23
|
+
const hasContact = Boolean(optionalText(form, 'controllerEmail') || optionalText(form, 'controllerTelephone'));
|
|
24
|
+
setFormReady(formElement.checkValidity() && hasContact && Boolean(animalDocument));
|
|
25
|
+
}
|
|
26
|
+
useEffect(() => { refreshFormReady(); }, [animalDocument]);
|
|
16
27
|
useEffect(() => () => {
|
|
17
28
|
if (previewUrl.startsWith('blob:'))
|
|
18
29
|
URL.revokeObjectURL(previewUrl);
|
|
@@ -95,8 +106,8 @@ export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speci
|
|
|
95
106
|
setSubmitting(false);
|
|
96
107
|
}
|
|
97
108
|
}
|
|
98
|
-
const disabled = busy || submitting;
|
|
99
|
-
return _jsxs("section", { className: "uhcp-animal-onboarding uhcp-animal-onboarding-v2", "aria-labelledby": showHeader ? 'animal-identity-onboarding-v2-title' : undefined, "aria-label": showHeader ? undefined : copy.title, children: [showHeader ? _jsxs("header", { children: [_jsx("h2", { id: "animal-identity-onboarding-v2-title", children: copy.title }), _jsx("p", { children: copy.intro })] }) : null, _jsxs("form", { onSubmit: submit, children: [_jsxs("details", {
|
|
109
|
+
const disabled = busy || submitting || !formReady;
|
|
110
|
+
return _jsxs("section", { className: "uhcp-animal-onboarding uhcp-animal-onboarding-v2", "aria-labelledby": showHeader ? 'animal-identity-onboarding-v2-title' : undefined, "aria-label": showHeader ? undefined : copy.title, children: [showHeader ? _jsxs("header", { children: [_jsx("h2", { id: "animal-identity-onboarding-v2-title", children: copy.title }), _jsx("p", { children: copy.intro })] }) : null, _jsxs("form", { ref: formRef, onInput: event => refreshFormReady(event.currentTarget), onChange: event => refreshFormReady(event.currentTarget), onSubmit: submit, children: [_jsxs("details", { "aria-labelledby": "animal-onboarding-v2-animal-step", children: [_jsxs("summary", { id: "animal-onboarding-v2-animal-step", children: [_jsx(StepNumber, { value: 1 }), " ", copy.animalStep] }), _jsxs("div", { className: "uhcp-animal-onboarding-primary", children: [_jsxs("div", { className: "uhcp-animal-photo", children: [_jsxs("label", { className: "uhcp-animal-photo-dropzone", role: "button", "aria-label": copy.addAnimalPhoto, onDragOver: event => event.preventDefault(), onDrop: event => { event.preventDefault(); void previewAnimal(event.dataTransfer.files?.[0]); }, children: [previewUrl
|
|
100
111
|
? _jsx("img", { src: previewUrl, alt: copy.animalPreview.replace('{name}', animalName || copy.animalName) })
|
|
101
112
|
: _jsx("span", { "aria-hidden": "true", children: "\uFF0B" }), _jsx("input", { name: "animalDocument", type: "file", accept: "image/jpeg,image/png", required: !animalDocument, "aria-label": copy.addAnimalPhoto, onChange: event => void previewAnimal(event.currentTarget.files?.[0]) })] }), previewUrl ? _jsx("button", { type: "button", className: "uhcp-animal-photo-remove", "aria-label": copy.removeAnimalPhoto, title: copy.removeAnimalPhoto, onClick: removeAnimalPhoto, children: "\u00D7" }) : null, _jsx("small", { children: copy.photoHelp }), photoError ? _jsx("p", { role: "alert", children: photoError }) : null] }), _jsxs("div", { className: "uhcp-animal-onboarding-fields", children: [_jsxs("label", { children: [copy.animalName, _jsx("input", { name: "animalName", required: true, maxLength: 80, value: animalName, onChange: event => setAnimalName(event.currentTarget.value) })] }), _jsxs("label", { children: [copy.taxonomyId, speciesOptions.length > 0
|
|
102
113
|
? _jsx("select", { name: "taxonomyId", required: true, defaultValue: speciesOptions[0]?.taxonomyId, children: speciesOptions.map(option => _jsx("option", { value: option.taxonomyId, children: option.label }, option.taxonomyId)) })
|
|
@@ -110,7 +121,7 @@ export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speci
|
|
|
110
121
|
supervisedRemote: copy.supervisedRemote, electronicId: copy.electronicId, unsupervisedRemote: copy.unsupervisedRemote,
|
|
111
122
|
identityDocument: copy.ownerDocument, relationshipDocument: copy.relationshipDocument,
|
|
112
123
|
countryPlaceholder: copy.countryPlaceholder, controllerConfirmation: copy.controllerIsLegalRepresentative,
|
|
113
|
-
} })] }), _jsx("button", { type: "submit", className: "uhcp-animal-onboarding-submit", "data-portal-action": submitAction, disabled: disabled, children: copy.submit })] })] });
|
|
124
|
+
} })] }), _jsxs("div", { className: "uhcp-animal-onboarding-actions", children: [footerActions, _jsx("button", { type: "submit", className: "uhcp-animal-onboarding-submit", "data-portal-action": submitAction, disabled: disabled, children: copy.submit })] })] })] });
|
|
114
125
|
}
|
|
115
126
|
function StepNumber({ value }) {
|
|
116
127
|
return _jsx("span", { className: "uhcp-identity-step-number", "aria-hidden": "true", children: value });
|
|
@@ -59,7 +59,7 @@ export function ClinicalArtifactEditorV2({ request, authoringContext, copy, fiel
|
|
|
59
59
|
delete next[field.codeClaim]; if (field.displayClaim)
|
|
60
60
|
delete next[field.displayClaim]; return next; }); }, children: "\u00D7" }) : null, field.kind === 'documents' ? _jsx(DocumentReferencesPropertyV2, { copy: copy, attachments: attachments, onFiles: files => { void Promise.all(files.map(readClinicalAttachment)).then(next => setAttachments(current => [...current, ...next])).catch(reason => setError(reason instanceof Error ? reason.message : String(reason))); }, onRemove: id => setAttachments(current => current.filter(attachment => attachment.id !== id)) })
|
|
61
61
|
: _jsx(ClinicalProperty, { field: field, label: fieldLabel(field.claim), resourceType: request.resourceType, value: claims[field.claim] ?? '', claims: claims, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, copy: copy, update: update, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources })] }, field.claim)), _jsx(OptionalFieldsV2, { label: copy.addField, choose: copy.chooseField, add: copy.addSelectedField, options: optional, value: selectedOptional, onValueChange: setSelectedOptional, onAdd: () => { if (!selectedOptional)
|
|
62
|
-
return; setVisibleClaims(current => [...current, selectedOptional]); setSelectedOptional(''); } }), error ? _jsx("p", { className: "uhcp-clinical-editor-error", role: "alert", children: error }) : null, _jsxs("footer", { children: [_jsx("button", { type: "
|
|
62
|
+
return; setVisibleClaims(current => [...current, selectedOptional]); setSelectedOptional(''); } }), error ? _jsx("p", { className: "uhcp-clinical-editor-error", role: "alert", children: error }) : null, _jsxs("footer", { children: [_jsx("button", { className: "uhcp-clinical-editor-submit", type: "submit", disabled: saving, children: saving ? copy.saving : copy.save }), _jsx("button", { className: "uhcp-clinical-editor-cancel", type: "button", onClick: onCancel, children: copy.cancel })] })] })] }) });
|
|
63
63
|
}
|
|
64
64
|
function ClinicalProperty({ field, label, resourceType, value, claims, locale, timeZone, taxonomyId, copy, update, searchTerminology, loadTerminologySources }) {
|
|
65
65
|
if (field.kind === 'date-time')
|
|
@@ -74,6 +74,11 @@ export type ClinicalBundleDraftEditorProps = Readonly<{
|
|
|
74
74
|
draft: ClinicalArtifactDraftV2;
|
|
75
75
|
bundle: ClinicalBundleDraft;
|
|
76
76
|
}>) => void;
|
|
77
|
+
/** Renders the created credential inside its owning clinical entry. */
|
|
78
|
+
renderCreated?: (input: Readonly<{
|
|
79
|
+
draft: ClinicalArtifactDraftV2;
|
|
80
|
+
bundle: ClinicalBundleDraft;
|
|
81
|
+
}>) => ReactNode;
|
|
77
82
|
}>;
|
|
78
83
|
/** Host-owned document actions rendered beside the final submit action. */
|
|
79
84
|
documentActions?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClinicalBundleDraftEditor.d.ts","sourceRoot":"","sources":["../src/ClinicalBundleDraftEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAMpE,OAAO,4DAA4D,CAAA;AACnE,OAAO,kDAAkD,CAAA;AACzD,OAAO,2DAA2D,CAAA;AAClE,OAAO,qDAAqD,CAAA;AAC5D,OAAO,6DAA6D,CAAA;AACpE,OAAO,oDAAoD,CAAA;AAC3D,OAAO,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AACnG,OAAO,EAEL,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAE/B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACrC,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAG5E,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,MAAM,EAAE,sBAAsB,CAAA;IAC9B,eAAe,EAAE,2BAA2B,CAAA;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,YAAY,EAAE,QAAQ,CAAA;IACtB,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,SAAS,OAAO,EAA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AsDrB;AAED,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,8BAA8B,EAAE,eAAe,GAAG,cAAc,CAAC,GAAG,QAAQ,CAAC;IAC/H,YAAY,EAAE,gCAAgC,CAAA;CAC/C,CAAC,CAAA;AAEF,kFAAkF;AAClF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,+BAElF"}
|
|
@@ -27,6 +27,7 @@ import { SchemaClinicalArtifactEditorV2 } from './SchemaClinicalArtifactEditorV2
|
|
|
27
27
|
export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, locale = 'en', timeZone, taxonomyId, fieldLabel, resourceTypeLabel, searchTerminology, loadTerminologySources, initialBundle, onDraftChange, onSubmitDraft, editorVersion = 'v1', editorV2Copy, artifactCredentialAction, documentActions, }) {
|
|
28
28
|
const [artifacts, setArtifacts] = useState(() => importedArtifacts(initialBundle, schemas));
|
|
29
29
|
const [editor, setEditor] = useState();
|
|
30
|
+
const [expandedCredentialId, setExpandedCredentialId] = useState();
|
|
30
31
|
const [resourceChooser, setResourceChooser] = useState();
|
|
31
32
|
const [notice, setNotice] = useState('');
|
|
32
33
|
const [error, setError] = useState('');
|
|
@@ -104,17 +105,23 @@ export function ClinicalBundleDraftEditor({ schemas, authoringContext, copy, loc
|
|
|
104
105
|
setResourceChooser(undefined);
|
|
105
106
|
}, children: copy.chooseResource || copy.add })] }) : null, sectionArtifacts.length === 0 ? _jsx("p", { children: copy.empty }) : _jsx("ul", { children: sectionArtifacts.map((artifact) => {
|
|
106
107
|
const title = artifactTitle(artifact.draft);
|
|
108
|
+
const credentialDraft = artifact.draft;
|
|
109
|
+
const credentialBundle = combineClinicalDrafts([artifact], authoringContext, copy.title);
|
|
107
110
|
return _jsxs("li", { children: [_jsxs("span", { children: [_jsx("strong", { children: title }), _jsx("small", { children: artifact.draft.resourceType })] }), _jsxs("span", { children: [artifactCredentialAction ? _jsx("button", { type: "button", className: "uhcp-clinical-entry-credential-action", onClick: () => {
|
|
108
|
-
const draft =
|
|
109
|
-
const bundle =
|
|
111
|
+
const draft = credentialDraft;
|
|
112
|
+
const bundle = credentialBundle;
|
|
110
113
|
if (artifactCredentialAction.isCreated(draft)) {
|
|
111
114
|
artifactCredentialAction.onView({ draft, bundle });
|
|
115
|
+
setExpandedCredentialId(current => current === draft.id ? undefined : draft.id);
|
|
112
116
|
return;
|
|
113
117
|
}
|
|
114
118
|
void Promise.resolve(artifactCredentialAction.onCreate({ draft, bundle })).then(nextDraft => {
|
|
115
119
|
setArtifacts(current => current.map(candidate => candidate.draft.id === draft.id ? { ...candidate, draft: nextDraft } : candidate));
|
|
120
|
+
setExpandedCredentialId(nextDraft.id);
|
|
116
121
|
}).catch(reason => setError(reason instanceof Error ? reason.message : String(reason)));
|
|
117
|
-
}, children: artifactCredentialAction.isCreated(
|
|
122
|
+
}, children: artifactCredentialAction.isCreated(credentialDraft) ? artifactCredentialAction.viewLabel : artifactCredentialAction.createLabel }) : null, _jsx(ClinicalActionButton, { kind: "edit", label: `${copy.edit} ${title}`, onClick: () => setEditor({ schema: artifact.schema, draft: artifact.draft }) }), _jsx(ClinicalActionButton, { kind: "delete", label: `${copy.remove} ${title}`, onClick: () => setArtifacts((current) => current.filter((candidate) => candidate.draft.id !== artifact.draft.id)) })] }), artifactCredentialAction?.renderCreated && artifactCredentialAction.isCreated(credentialDraft) && expandedCredentialId === credentialDraft.id
|
|
123
|
+
? _jsx("div", { className: "uhcp-clinical-entry-credential-panel", children: artifactCredentialAction.renderCreated({ draft: credentialDraft, bundle: credentialBundle }) })
|
|
124
|
+
: null] }, artifact.draft.id);
|
|
118
125
|
}) })] }, label);
|
|
119
126
|
}), activeSections.length === 0 ? _jsx("p", { children: copy.empty }) : null, _jsxs("footer", { "data-testid": "clinical-document-actions", children: [documentActions ? _jsx("div", { className: "uhcp-clinical-document-secondary-actions", children: documentActions }) : null, _jsx("button", { type: "button", className: "uhcp-clinical-document-submit", disabled: artifacts.length === 0 || submitting, onClick: () => void submitDraft(), children: submitting ? copy.submitting : copy.submit })] }), editor && editorVersion === 'v2' && editor.schema.schema.resourceType === 'Immunization' && editorV2Copy ? _jsx(ImmunizationArtifactEditorV2, { request: editorRequest(editor), authoringContext: authoringContext, copy: editorV2Copy, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, fieldLabel: fieldLabel, resourceTypeLabel: resourceTypeLabel?.(editor.schema.schema.resourceType) || editor.schema.artifactLabel, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources, saveArtifact: async (draft) => stageArtifact(draft), onCancel: () => setEditor(undefined), onReadback: () => setEditor(undefined) }) : editor && editorVersion === 'v2' && editorV2Copy ? _jsx(SchemaClinicalArtifactEditorV2, { request: editorRequest(editor), schema: editor.schema.schema, authoringContext: authoringContext, copy: editorV2Copy, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, fieldLabel: fieldLabel, resourceTypeLabel: resourceTypeLabel?.(editor.schema.schema.resourceType) || editor.schema.artifactLabel, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources, saveArtifact: async (draft) => stageArtifact(draft), onCancel: () => setEditor(undefined), onReadback: () => setEditor(undefined) }) : editor ? _jsx(ClinicalArtifactEditor, { request: editorRequest(editor), schema: editor.schema.schema, operationSchema: editor.schema.operationSchema, authoringContext: authoringContext, copy: copy.editor, locale: locale, timeZone: timeZone, taxonomyId: taxonomyId, fieldLabel: fieldLabel, resourceTypeLabel: resourceTypeLabel?.(editor.schema.schema.resourceType) || editor.schema.artifactLabel, searchTerminology: searchTerminology, loadTerminologySources: loadTerminologySources, saveArtifact: async (draft) => stageArtifact(draft), onCancel: () => setEditor(undefined), onReadback: () => setEditor(undefined) }) : null] });
|
|
120
127
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from './IdentityEvidenceDocumentPanel.js';
|
|
|
38
38
|
export * from './IdentityEvidenceDeclarationForm.js';
|
|
39
39
|
export * from './AnimalIdentityOnboarding.js';
|
|
40
40
|
export * from './AnimalIdentityOnboardingV2.js';
|
|
41
|
+
export * from './AnimalIdentityDetailsV2.js';
|
|
41
42
|
export * from './IdentityEntityEditorV2.js';
|
|
42
43
|
export * from './AnimalCardArtifact.js';
|
|
43
44
|
export * from './AnimalControllerAttestationPanel.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wCAAwC,CAAA;AACtD,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,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AAc,kCAAkC,CAAA;AAChD,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA;AAClD,cAAc,sCAAsC,CAAA;AACpD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,uCAAuC,CAAA;AACrD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,8BAA8B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ export * from './IdentityEvidenceDocumentPanel.js';
|
|
|
38
38
|
export * from './IdentityEvidenceDeclarationForm.js';
|
|
39
39
|
export * from './AnimalIdentityOnboarding.js';
|
|
40
40
|
export * from './AnimalIdentityOnboardingV2.js';
|
|
41
|
+
export * from './AnimalIdentityDetailsV2.js';
|
|
41
42
|
export * from './IdentityEntityEditorV2.js';
|
|
42
43
|
export * from './AnimalCardArtifact.js';
|
|
43
44
|
export * from './AnimalControllerAttestationPanel.js';
|
package/dist/styles.css
CHANGED
|
@@ -229,7 +229,12 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
229
229
|
.uhcp-clinical-editor-wide,.uhcp-clinical-editor-error,.uhcp-clinical-editor footer { grid-column:1/-1; }
|
|
230
230
|
.uhcp-clinical-editor footer { background:var(--uhcp-panel); bottom:0; display:flex; gap:.75rem; justify-content:flex-end; padding:.75rem 0; position:sticky; z-index:2; }
|
|
231
231
|
.uhcp-clinical-editor footer button,.uhcp-terminology-results button { border:1px solid var(--uhcp-border); border-radius:.7rem; cursor:pointer; font:inherit; padding:.7rem 1rem; }
|
|
232
|
-
.uhcp-clinical-editor footer
|
|
232
|
+
.uhcp-clinical-editor footer .uhcp-clinical-editor-submit { background:linear-gradient(135deg,color-mix(in srgb,var(--uhcp-emerald) 90%,#fff),var(--uhcp-emerald)); border-color:var(--uhcp-emerald); color:#fff; font-weight:800; }
|
|
233
|
+
.uhcp-clinical-editor footer .uhcp-clinical-editor-cancel { background:color-mix(in srgb,#b42318 12%,var(--uhcp-panel)); border-color:color-mix(in srgb,#b42318 52%,var(--uhcp-border)); color:color-mix(in srgb,#b42318 84%,var(--uhcp-text)); }
|
|
234
|
+
.uhcp-clinical-entry-credential-panel { background:var(--uhcp-panel); border:1px solid var(--uhcp-border); border-radius:.85rem; grid-column:1/-1; margin-top:.75rem; padding:1rem; width:100%; }
|
|
235
|
+
.uhcp-animal-identity-readonly { align-items:start; display:grid; gap:1rem; grid-template-columns:minmax(8rem,12rem) minmax(0,1fr); }
|
|
236
|
+
.uhcp-animal-identity-photo { aspect-ratio:3/4; border:1px solid var(--uhcp-border); border-radius:1rem; display:block; object-fit:cover; width:100%; }
|
|
237
|
+
@media (max-width:620px) { .uhcp-animal-identity-readonly { grid-template-columns:minmax(0,1fr); } .uhcp-animal-identity-photo { max-width:12rem; } }
|
|
233
238
|
.uhcp-clinical-editor-error { color:#b42318; font-weight:700; }
|
|
234
239
|
.uhcp-emergency-contact-directory>header { align-items:center; display:flex; gap:1rem; justify-content:space-between; }
|
|
235
240
|
.uhcp-emergency-contact-directory>ul { display:grid; gap:.75rem; list-style:none; margin:1rem 0; padding:0; }
|
|
@@ -552,7 +557,7 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
552
557
|
.uhcp-clinical-bundle-draft .uhcp-add-entry-button { background:var(--uhcp-emerald); border:0; border-radius:.65rem; color:#fff; cursor:pointer; font-size:1.3rem; font-weight:900; height:2.5rem; margin-top:.65rem; width:2.5rem; }
|
|
553
558
|
.uhcp-clinical-bundle-draft .uhcp-remove-section-button { background:color-mix(in srgb,#c64747 12%,var(--uhcp-panel)); border:1px solid color-mix(in srgb,#c64747 42%,var(--uhcp-border)); border-radius:.6rem; color:#a72f2f; cursor:pointer; font-size:1.25rem; font-weight:900; height:2.25rem; position:absolute; right:.7rem; top:.55rem; width:2.25rem; }
|
|
554
559
|
.uhcp-clinical-bundle-draft ul { display:grid; gap:.55rem; list-style:none; margin:.8rem 0 0; padding:0; }
|
|
555
|
-
.uhcp-clinical-bundle-draft li { align-items:center; background:var(--uhcp-panel); border:1px solid var(--uhcp-border); border-radius:.8rem; display:
|
|
560
|
+
.uhcp-clinical-bundle-draft li { align-items:center; background:var(--uhcp-panel); border:1px solid var(--uhcp-border); border-radius:.8rem; display:grid; gap:1rem; grid-template-columns:minmax(0,1fr) auto; justify-content:space-between; padding:.7rem; }
|
|
556
561
|
.uhcp-clinical-bundle-draft li>span { display:flex; gap:.45rem; }
|
|
557
562
|
.uhcp-clinical-bundle-draft li>span:first-child { align-items:flex-start; flex-direction:column; min-width:0; }
|
|
558
563
|
.uhcp-clinical-bundle-draft li strong { overflow-wrap:anywhere; }
|
|
@@ -893,6 +898,11 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
893
898
|
.uhcp-professional-access button { background: linear-gradient(135deg, var(--uhcp-action-start, #0f9ca8), var(--uhcp-action-end, #2563a9)); border: 0; border-radius: 999px; color: #fff; cursor: pointer; font: inherit; font-weight: 800; min-height: 2.8rem; padding: .7rem 1rem; }
|
|
894
899
|
.uhcp-professional-access button:disabled { cursor: wait; opacity: .55; }
|
|
895
900
|
.uhcp-professional-access .uhcp-secondary { background: transparent; border: 1px solid var(--uhcp-line, #cbd5e1); color: inherit; }
|
|
901
|
+
.uhcp-animal-onboarding-actions { align-items:center; display:flex; flex-wrap:wrap; gap:.75rem; justify-content:flex-end; }
|
|
902
|
+
.uhcp-animal-identity-readonly-grid { display:grid; gap:1rem; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; padding:1rem; }
|
|
903
|
+
.uhcp-animal-identity-readonly-grid div { background:var(--uhcp-surface,#fff); border:1px solid var(--uhcp-border,#cbd5e1); border-radius:.8rem; padding:.8rem; }
|
|
904
|
+
.uhcp-animal-identity-readonly-grid dt { color:var(--uhcp-muted,#475569); font-size:.82rem; font-weight:700; }
|
|
905
|
+
.uhcp-animal-identity-readonly-grid dd { color:var(--uhcp-text,#0f172a); font-weight:750; margin:.25rem 0 0; overflow-wrap:anywhere; }
|
|
896
906
|
.uhcp-eyebrow { color: var(--uhcp-action-end, #2563a9); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
|
|
897
907
|
.uhcp-muted { color: var(--uhcp-muted, #526174); line-height: 1.55; }
|
|
898
908
|
.uhcp-auth-separator { align-items: center; color: var(--uhcp-muted, #526174); display: flex; gap: .75rem; }
|
package/package.json
CHANGED