uhc-portal-components-react 0.2.9 → 0.2.11
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 +21 -0
- package/README.md +9 -0
- package/dist/AnimalIdentityDetailsV2.d.ts +28 -0
- package/dist/AnimalIdentityDetailsV2.d.ts.map +1 -0
- package/dist/AnimalIdentityDetailsV2.js +7 -0
- package/dist/AnimalIdentityOnboarding.d.ts +4 -4
- package/dist/AnimalIdentityOnboarding.d.ts.map +1 -1
- package/dist/AnimalIdentityOnboarding.js +1 -1
- package/dist/AnimalIdentityOnboardingV2.d.ts +6 -1
- package/dist/AnimalIdentityOnboardingV2.d.ts.map +1 -1
- package/dist/AnimalIdentityOnboardingV2.js +26 -12
- package/dist/IdentityEntityEditorV2.d.ts +6 -2
- package/dist/IdentityEntityEditorV2.d.ts.map +1 -1
- package/dist/IdentityEntityEditorV2.js +3 -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 +13 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.11 - 2026-10-11
|
|
4
|
+
|
|
5
|
+
- Add a reusable read-only identity projection matching the progressive
|
|
6
|
+
onboarding sections.
|
|
7
|
+
- Start both onboarding sections collapsed, disable submission until required
|
|
8
|
+
identity, contact and image fields are valid, and support host actions in the
|
|
9
|
+
same footer row.
|
|
10
|
+
- Document the UHC Professional newborn-role variation without creating a
|
|
11
|
+
separate component flow.
|
|
12
|
+
|
|
13
|
+
## 0.2.10 - 2026-10-10
|
|
14
|
+
|
|
15
|
+
- Keep animal-controller creation focused on identity and contact data: the
|
|
16
|
+
controller channel already owns its unlock credential, so the form no longer
|
|
17
|
+
asks for a second PIN or requires identity-evidence uploads at creation time.
|
|
18
|
+
- Let hosts require email and telephone independently, start country selection
|
|
19
|
+
without an implicit jurisdiction and keep optional evidence collection for a
|
|
20
|
+
later, explicit post-creation step.
|
|
21
|
+
- Improve the reusable entity editor contrast and distinguish its edit action
|
|
22
|
+
with an accessible icon.
|
|
23
|
+
|
|
3
24
|
## 0.2.9 - 2026-10-10
|
|
4
25
|
|
|
5
26
|
- Add one reusable identity entity editor for animal controllers and related
|
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,28 @@
|
|
|
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
|
+
}>;
|
|
13
|
+
export type AnimalIdentityDetailsV2Value = Readonly<{
|
|
14
|
+
animalName: string;
|
|
15
|
+
species: string;
|
|
16
|
+
identifierType: string;
|
|
17
|
+
identifierValue: string;
|
|
18
|
+
controllerName: string;
|
|
19
|
+
relationship: string;
|
|
20
|
+
}>;
|
|
21
|
+
/** Read-only counterpart of AnimalIdentityOnboardingV2 using the same progressive sections. */
|
|
22
|
+
export declare function AnimalIdentityDetailsV2({ copy, value, onEdit, actions }: Readonly<{
|
|
23
|
+
copy: AnimalIdentityDetailsV2Copy;
|
|
24
|
+
value: AnimalIdentityDetailsV2Value;
|
|
25
|
+
onEdit?: () => void;
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
}>): import("react").JSX.Element;
|
|
28
|
+
//# 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;IAAE,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;CAAE,CAAC,CAAA;AAC5O,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAAE,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,CAAA;CAAE,CAAC,CAAA;AAErL,+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,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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("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 })] })] }), 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 })] }); }
|
|
@@ -17,10 +17,10 @@ export type AnimalIdentityOnboardingInput = Readonly<{
|
|
|
17
17
|
controllerTelephone?: string;
|
|
18
18
|
verificationMethod?: 'pipp' | 'sripp' | 'eid' | 'uripp';
|
|
19
19
|
relationship: AnimalControllerRelationship;
|
|
20
|
-
ownerDocument
|
|
20
|
+
ownerDocument?: File;
|
|
21
21
|
animalDocument: File;
|
|
22
|
-
relationshipDocument
|
|
23
|
-
controllerPin
|
|
22
|
+
relationshipDocument?: File;
|
|
23
|
+
controllerPin?: string;
|
|
24
24
|
}>;
|
|
25
25
|
export type AnimalIdentityOnboardingCopy = Readonly<{
|
|
26
26
|
title: string;
|
|
@@ -48,7 +48,7 @@ export type AnimalIdentityOnboardingCopy = Readonly<{
|
|
|
48
48
|
ownerDocument: string;
|
|
49
49
|
animalDocument: string;
|
|
50
50
|
relationshipDocument: string;
|
|
51
|
-
controllerPin
|
|
51
|
+
controllerPin?: string;
|
|
52
52
|
submit: string;
|
|
53
53
|
}>;
|
|
54
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimalIdentityOnboarding.d.ts","sourceRoot":"","sources":["../src/AnimalIdentityOnboarding.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAE5E,MAAM,MAAM,4BAA4B,GAAG,OAAO,GAAG,WAAW,CAAA;AAEhE,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IAC5C,gBAAgB,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC,yBAAyB,EAAE,MA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displayName.trim().slice(0, 1).toUpperCase() || '•';
|
|
49
49
|
return _jsxs("article", { className: "uhcp-subject-identity-card", children: [_jsxs("header", { children: [subject.imageUrl
|
|
50
50
|
? _jsx("img", { src: subject.imageUrl, alt: "" })
|
|
51
|
-
: _jsx("span", { className: "uhcp-subject-identity-avatar", "aria-hidden": "true", children: initial }), _jsxs("div", { children: [_jsx("small", { children: subject.kind }), _jsx("h3", { children: subject.displayName })] }), canEdit && onEdit && editLabel ? _jsx("button", { type: "button", onClick: onEdit, children:
|
|
51
|
+
: _jsx("span", { className: "uhcp-subject-identity-avatar", "aria-hidden": "true", children: initial }), _jsxs("div", { children: [_jsx("small", { children: subject.kind }), _jsx("h3", { children: subject.displayName })] }), canEdit && onEdit && editLabel ? _jsx("button", { className: "uhcp-subject-identity-edit", type: "button", "aria-label": editLabel, title: editLabel, onClick: onEdit, children: _jsx("span", { "aria-hidden": "true", children: "\u270E" }) }) : null] }), _jsx("dl", { children: subject.facts.map(fact => _jsxs("div", { children: [_jsx("dt", { children: fact.label }), _jsx("dd", { children: fact.value })] }, `${fact.label}:${fact.value}`)) }), relationship ? _jsxs("section", { className: "uhcp-subject-identity-relationship", children: [_jsx("span", { children: relationship.label }), _jsx("strong", { children: relationship.displayName }), _jsx("small", { className: `uhcp-identity-status uhcp-identity-status-${relationship.status}`, children: statusLabels[relationship.status] })] }) : null] });
|
|
52
52
|
}
|
|
53
53
|
function StepNumber({ value }) {
|
|
54
54
|
return _jsx("span", { className: "uhcp-identity-step-number", "aria-hidden": "true", children: value });
|
|
@@ -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;
|
|
@@ -21,6 +22,7 @@ export type AnimalIdentityOnboardingV2Copy = AnimalIdentityOnboardingCopy & Read
|
|
|
21
22
|
supervisedRemote: string;
|
|
22
23
|
electronicId: string;
|
|
23
24
|
unsupervisedRemote: string;
|
|
25
|
+
countryPlaceholder?: string;
|
|
24
26
|
}>;
|
|
25
27
|
type SelectOption = Readonly<{
|
|
26
28
|
value: string;
|
|
@@ -30,7 +32,7 @@ type SelectOption = Readonly<{
|
|
|
30
32
|
* Progressive animal onboarding presentation. It preserves the V1 payload so
|
|
31
33
|
* hosts can adopt it without changing evidence, authorization or persistence.
|
|
32
34
|
*/
|
|
33
|
-
export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions, countryOptions, regionOptionsByCountry, identifierTypeOptions, showHeader, busy }: Readonly<{
|
|
35
|
+
export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speciesOptions, countryOptions, regionOptionsByCountry, identifierTypeOptions, showHeader, requireEmail, requireTelephone, busy, footerActions }: Readonly<{
|
|
34
36
|
copy: AnimalIdentityOnboardingV2Copy;
|
|
35
37
|
onSubmit: (input: AnimalIdentityOnboardingInput) => Promise<void> | void;
|
|
36
38
|
submitAction?: string;
|
|
@@ -45,7 +47,10 @@ export declare function AnimalIdentityOnboardingV2({ copy, onSubmit, submitActio
|
|
|
45
47
|
organization: readonly SelectOption[];
|
|
46
48
|
}>;
|
|
47
49
|
showHeader?: boolean;
|
|
50
|
+
requireEmail?: boolean;
|
|
51
|
+
requireTelephone?: boolean;
|
|
48
52
|
busy?: boolean;
|
|
53
|
+
footerActions?: ReactNode;
|
|
49
54
|
}>): import("react").JSX.Element;
|
|
50
55
|
export {};
|
|
51
56
|
//# sourceMappingURL=AnimalIdentityOnboardingV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimalIdentityOnboardingV2.d.ts","sourceRoot":"","sources":["../src/AnimalIdentityOnboardingV2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,4BAA4B,EAC5B,6BAA6B,EA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AAA;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, 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);
|
|
@@ -85,24 +96,22 @@ export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speci
|
|
|
85
96
|
controllerRegion: optionalText(form, 'controllerRegion'),
|
|
86
97
|
controllerEmail,
|
|
87
98
|
controllerTelephone,
|
|
88
|
-
verificationMethod: requiredText(form, 'verificationMethod'),
|
|
89
99
|
relationship: requiredText(form, 'relationship'),
|
|
90
|
-
ownerDocument:
|
|
100
|
+
ownerDocument: optionalFile(formElement, 'ownerDocument'),
|
|
91
101
|
animalDocument: animalDocument || requiredFile(formElement, 'animalDocument'),
|
|
92
|
-
relationshipDocument:
|
|
93
|
-
controllerPin: requiredText(form, 'controllerPin'),
|
|
102
|
+
relationshipDocument: optionalFile(formElement, 'relationshipDocument'),
|
|
94
103
|
});
|
|
95
104
|
}
|
|
96
105
|
finally {
|
|
97
106
|
setSubmitting(false);
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
|
-
const disabled = busy || submitting;
|
|
101
|
-
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
|
|
102
111
|
? _jsx("img", { src: previewUrl, alt: copy.animalPreview.replace('{name}', animalName || copy.animalName) })
|
|
103
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
|
|
104
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)) })
|
|
105
|
-
: _jsx("input", { name: "taxonomyId", required: true, inputMode: "numeric", pattern: "[1-9][0-9]{0,6}", defaultValue: "9615" })] }), _jsxs("label", { children: [copy.birthDate, _jsx("input", { name: "birthDate", type: "date" })] }), _jsxs("label", { children: [copy.sex, _jsxs("select", { name: "sex", defaultValue: "unknown", children: [_jsx("option", { value: "unknown", children: copy.sexUnknown }), _jsx("option", { value: "female", children: copy.sexFemale }), _jsx("option", { value: "male", children: copy.sexMale }), _jsx("option", { value: "other", children: copy.sexOther })] })] }), _jsxs("label", { children: [copy.identifierSystem, _jsxs("select", { name: "identifierSystem", defaultValue: "urn:iso:std:iso:11784:11785", children: [_jsx("option", { value: "urn:iso:std:iso:11784:11785", children: "ISO 11784/11785" }), _jsx("option", { value: "https://europa.eu/pet-passport", children: "EU pet passport" }), _jsx("option", { value: "https://vetchain.app/identifier/tattoo", children: "Tattoo" })] })] }), _jsxs("label", { children: [copy.identifierValue, _jsx("input", { name: "identifierValue", required: true, maxLength: 80, autoComplete: "off" })] })] })] })] }), _jsxs("details", { "aria-labelledby": "animal-onboarding-v2-controller-step", children: [_jsxs("summary", { id: "animal-onboarding-v2-controller-step", children: [_jsx(StepNumber, { value: 2 }), " ", copy.controllerStep] }), _jsx(IdentityEntityEditorV2, { mode: "controller", countryOptions: countryOptions, regionOptionsByCountry: regionOptionsByCountry, identifierTypeOptions: identifierTypeOptions, contactError: contactError, copy: {
|
|
114
|
+
: _jsx("input", { name: "taxonomyId", required: true, inputMode: "numeric", pattern: "[1-9][0-9]{0,6}", defaultValue: "9615" })] }), _jsxs("label", { children: [copy.birthDate, _jsx("input", { name: "birthDate", type: "date" })] }), _jsxs("label", { children: [copy.sex, _jsxs("select", { name: "sex", defaultValue: "unknown", children: [_jsx("option", { value: "unknown", children: copy.sexUnknown }), _jsx("option", { value: "female", children: copy.sexFemale }), _jsx("option", { value: "male", children: copy.sexMale }), _jsx("option", { value: "other", children: copy.sexOther })] })] }), _jsxs("label", { children: [copy.identifierSystem, _jsxs("select", { name: "identifierSystem", defaultValue: "urn:iso:std:iso:11784:11785", children: [_jsx("option", { value: "urn:iso:std:iso:11784:11785", children: "ISO 11784/11785" }), _jsx("option", { value: "https://europa.eu/pet-passport", children: "EU pet passport" }), _jsx("option", { value: "https://vetchain.app/identifier/tattoo", children: "Tattoo" })] })] }), _jsxs("label", { children: [copy.identifierValue, _jsx("input", { name: "identifierValue", required: true, maxLength: 80, autoComplete: "off" })] })] })] })] }), _jsxs("details", { "aria-labelledby": "animal-onboarding-v2-controller-step", children: [_jsxs("summary", { id: "animal-onboarding-v2-controller-step", children: [_jsx(StepNumber, { value: 2 }), " ", copy.controllerStep] }), _jsx(IdentityEntityEditorV2, { mode: "controller", showEvidence: false, countryOptions: countryOptions, regionOptionsByCountry: regionOptionsByCountry, identifierTypeOptions: identifierTypeOptions, contactError: contactError, requireEmail: requireEmail, requireTelephone: requireTelephone, copy: {
|
|
106
115
|
entityType: copy.ownerKind, personEntity: copy.personOwner, organizationEntity: copy.organizationOwner,
|
|
107
116
|
fullLegalName: copy.controllerLegalName, country: copy.controllerCountry, regionalIdentifier: copy.regionalIdentifier,
|
|
108
117
|
region: copy.controllerRegion, identifierType: copy.controllerIdentifierType, identifierValue: copy.controllerIdentifierValue,
|
|
@@ -110,9 +119,9 @@ export function AnimalIdentityOnboardingV2({ copy, onSubmit, submitAction, speci
|
|
|
110
119
|
responsibleParty: copy.responsibleParty ?? copy.owner, evidence: copy.evidenceStep,
|
|
111
120
|
verificationMethod: copy.verificationMethod, physicalInPerson: copy.physicalInPerson,
|
|
112
121
|
supervisedRemote: copy.supervisedRemote, electronicId: copy.electronicId, unsupervisedRemote: copy.unsupervisedRemote,
|
|
113
|
-
identityDocument: copy.ownerDocument, relationshipDocument: copy.relationshipDocument,
|
|
114
|
-
controllerConfirmation: copy.controllerIsLegalRepresentative,
|
|
115
|
-
} })] }), _jsx("button", { type: "submit", className: "uhcp-animal-onboarding-submit", "data-portal-action": submitAction, disabled: disabled, children: copy.submit })] })] });
|
|
122
|
+
identityDocument: copy.ownerDocument, relationshipDocument: copy.relationshipDocument,
|
|
123
|
+
countryPlaceholder: copy.countryPlaceholder, controllerConfirmation: copy.controllerIsLegalRepresentative,
|
|
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 })] })] })] });
|
|
116
125
|
}
|
|
117
126
|
function StepNumber({ value }) {
|
|
118
127
|
return _jsx("span", { className: "uhcp-identity-step-number", "aria-hidden": "true", children: value });
|
|
@@ -134,6 +143,11 @@ function requiredFile(form, name) {
|
|
|
134
143
|
throw new Error(`animal_identity_${name}_required`);
|
|
135
144
|
return value;
|
|
136
145
|
}
|
|
146
|
+
function optionalFile(form, name) {
|
|
147
|
+
const input = form.elements.namedItem(name);
|
|
148
|
+
const value = input instanceof HTMLInputElement ? input.files?.[0] : undefined;
|
|
149
|
+
return value && value.size > 0 ? value : undefined;
|
|
150
|
+
}
|
|
137
151
|
async function readImageDimensions(file) {
|
|
138
152
|
if (typeof createImageBitmap === 'function') {
|
|
139
153
|
const bitmap = await createImageBitmap(file);
|
|
@@ -24,15 +24,16 @@ export type IdentityEntityEditorV2Copy = Readonly<{
|
|
|
24
24
|
unsupervisedRemote: string;
|
|
25
25
|
identityDocument: string;
|
|
26
26
|
relationshipDocument: string;
|
|
27
|
-
pin
|
|
27
|
+
pin?: string;
|
|
28
28
|
controllerConfirmation: string;
|
|
29
|
+
countryPlaceholder?: string;
|
|
29
30
|
}>;
|
|
30
31
|
/**
|
|
31
32
|
* Reusable identity-and-evidence editor for one controller or related entity.
|
|
32
33
|
* A controller has a fixed responsible-party relationship; related entities
|
|
33
34
|
* receive their host-governed relationship choices.
|
|
34
35
|
*/
|
|
35
|
-
export declare function IdentityEntityEditorV2({ copy, mode, countryOptions, regionOptionsByCountry, identifierTypeOptions, relationshipOptions, fieldPrefix, contactError, }: Readonly<{
|
|
36
|
+
export declare function IdentityEntityEditorV2({ copy, mode, countryOptions, regionOptionsByCountry, identifierTypeOptions, relationshipOptions, fieldPrefix, contactError, requireEmail, requireTelephone, showEvidence, }: Readonly<{
|
|
36
37
|
copy: IdentityEntityEditorV2Copy;
|
|
37
38
|
mode: 'controller' | 'related';
|
|
38
39
|
countryOptions?: readonly IdentityEntitySelectOption[];
|
|
@@ -44,5 +45,8 @@ export declare function IdentityEntityEditorV2({ copy, mode, countryOptions, reg
|
|
|
44
45
|
relationshipOptions?: readonly IdentityEntitySelectOption[];
|
|
45
46
|
fieldPrefix?: string;
|
|
46
47
|
contactError?: string;
|
|
48
|
+
requireEmail?: boolean;
|
|
49
|
+
requireTelephone?: boolean;
|
|
50
|
+
showEvidence?: boolean;
|
|
47
51
|
}>): import("react").JSX.Element;
|
|
48
52
|
//# sourceMappingURL=IdentityEntityEditorV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityEntityEditorV2.d.ts","sourceRoot":"","sources":["../src/IdentityEntityEditorV2.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEnF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IACh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AAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC,+BAyCD"}
|
|
@@ -5,13 +5,13 @@ import { useState } from 'react';
|
|
|
5
5
|
* A controller has a fixed responsible-party relationship; related entities
|
|
6
6
|
* receive their host-governed relationship choices.
|
|
7
7
|
*/
|
|
8
|
-
export function IdentityEntityEditorV2({ copy, mode, countryOptions = [], regionOptionsByCountry = {}, identifierTypeOptions, relationshipOptions = [], fieldPrefix = '', contactError, }) {
|
|
8
|
+
export function IdentityEntityEditorV2({ copy, mode, countryOptions = [], regionOptionsByCountry = {}, identifierTypeOptions, relationshipOptions = [], fieldPrefix = '', contactError, requireEmail = false, requireTelephone = false, showEvidence = true, }) {
|
|
9
9
|
const [entityType, setEntityType] = useState('person');
|
|
10
|
-
const [country, setCountry] = useState(
|
|
10
|
+
const [country, setCountry] = useState('');
|
|
11
11
|
const [regional, setRegional] = useState(false);
|
|
12
12
|
const regions = regionOptionsByCountry[country] ?? [];
|
|
13
13
|
const name = (value) => fieldPrefix ? `${fieldPrefix}.${value}` : value;
|
|
14
14
|
return _jsxs("div", { className: "uhcp-identity-entity-editor", children: [_jsxs("div", { className: "uhcp-identity-entity-heading-row", children: [_jsxs("fieldset", { className: "uhcp-animal-owner-kind", children: [_jsx("legend", { children: copy.entityType }), _jsxs("label", { children: [_jsx("input", { type: "radio", name: name('controllerKind'), value: "person", checked: entityType === 'person', onChange: () => setEntityType('person') }), " ", copy.personEntity] }), _jsxs("label", { children: [_jsx("input", { type: "radio", name: name('controllerKind'), value: "organization", checked: entityType === 'organization', onChange: () => setEntityType('organization') }), " ", copy.organizationEntity] })] }), _jsxs("div", { className: "uhcp-identity-entity-relationship", children: [_jsx("span", { children: copy.relationship }), mode === 'controller'
|
|
15
15
|
? _jsxs(_Fragment, { children: [_jsx("strong", { children: copy.responsibleParty }), _jsx("input", { type: "hidden", name: name('relationship'), value: "owner" })] })
|
|
16
|
-
: _jsx("select", { name: name('relationship'), "aria-label": copy.relationship, required: true, defaultValue: relationshipOptions[0]?.value, children: relationshipOptions.map(option => _jsx("option", { value: option.value, children: option.label }, option.value)) })] })] }), _jsxs("div", { className: "uhcp-animal-onboarding-fields", children: [_jsxs("label", { className: "uhcp-animal-owner-name", children: [copy.fullLegalName, _jsx("input", { name: name('controllerLegalName'), required: true, maxLength: 160, autoComplete: entityType === 'person' ? 'name' : 'organization' })] }), _jsxs("label", { children: [copy.country, countryOptions.length ?
|
|
16
|
+
: _jsx("select", { name: name('relationship'), "aria-label": copy.relationship, required: true, defaultValue: relationshipOptions[0]?.value, children: relationshipOptions.map(option => _jsx("option", { value: option.value, children: option.label }, option.value)) })] })] }), _jsxs("div", { className: "uhcp-animal-onboarding-fields", children: [_jsxs("label", { className: "uhcp-animal-owner-name", children: [copy.fullLegalName, _jsx("input", { name: name('controllerLegalName'), required: true, maxLength: 160, autoComplete: entityType === 'person' ? 'name' : 'organization' })] }), _jsxs("label", { children: [copy.country, countryOptions.length ? _jsxs("select", { name: name('controllerCountry'), required: true, value: country, onChange: event => setCountry(event.currentTarget.value), children: [_jsx("option", { value: "", disabled: true, children: copy.countryPlaceholder ?? copy.country }), countryOptions.map(option => _jsx("option", { value: option.value, children: option.label }, option.value))] }) : _jsx("input", { name: name('controllerCountry'), required: true, pattern: "[A-Za-z]{2}", maxLength: 2, autoComplete: "country", onChange: event => setCountry(event.currentTarget.value.toUpperCase()) })] }), _jsxs("label", { className: "uhcp-animal-regional-identifier", children: [_jsx("input", { type: "checkbox", checked: regional, disabled: !regions.length, onChange: event => setRegional(event.currentTarget.checked) }), " ", copy.regionalIdentifier] }), _jsxs("label", { children: [copy.region, _jsxs("select", { name: name('controllerRegion'), required: regional, disabled: !regional, children: [_jsx("option", { value: "" }), regions.map(option => _jsx("option", { value: option.value, children: option.label }, option.value))] })] }), _jsxs("label", { children: [copy.identifierType, identifierTypeOptions ? _jsx("select", { name: name('controllerIdentifierType'), required: true, children: identifierTypeOptions[entityType].map(option => _jsx("option", { value: option.value, children: option.label }, option.value)) }, entityType) : _jsx("input", { name: name('controllerIdentifierType'), required: true, defaultValue: "national_identity_card", maxLength: 80 })] }), _jsxs("label", { children: [copy.identifierValue, _jsx("input", { name: name('controllerIdentifierValue'), required: true, maxLength: 120, autoComplete: "off" })] }), _jsxs("label", { className: "uhcp-identity-entity-contact-wide", children: [copy.email, _jsx("input", { name: name('controllerEmail'), type: "email", autoComplete: "email", required: requireEmail })] }), _jsxs("label", { children: [copy.telephone, _jsx("input", { name: name('controllerTelephone'), type: "tel", autoComplete: "tel", required: requireTelephone })] }), mode === 'controller' ? _jsxs("label", { className: "uhcp-animal-controller-confirmation", children: [_jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, "aria-disabled": "true" }), " ", copy.controllerConfirmation] }) : null, contactError ? _jsx("p", { role: "alert", children: contactError }) : null] }), showEvidence ? _jsxs("fieldset", { className: "uhcp-identity-entity-evidence", children: [_jsx("legend", { children: copy.evidence }), _jsxs("div", { className: "uhcp-animal-onboarding-fields", children: [_jsxs("label", { children: [copy.verificationMethod, _jsxs("select", { name: name('verificationMethod'), defaultValue: "pipp", children: [_jsx("option", { value: "pipp", children: copy.physicalInPerson }), _jsx("option", { value: "sripp", children: copy.supervisedRemote }), _jsx("option", { value: "eid", children: copy.electronicId }), _jsx("option", { value: "uripp", children: copy.unsupervisedRemote })] })] }), _jsxs("label", { children: [copy.identityDocument, _jsx("input", { name: name('ownerDocument'), type: "file", accept: "application/pdf,image/jpeg,image/png" })] }), _jsxs("label", { children: [copy.relationshipDocument, _jsx("input", { name: name('relationshipDocument'), type: "file", accept: "application/pdf,image/jpeg,image/png" })] })] })] }) : null] });
|
|
17
17
|
}
|
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,0BAA0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CAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,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
|
@@ -799,10 +799,13 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
799
799
|
.uhcp-identity-entity-heading-row { align-items:stretch; display:grid; gap:1rem; grid-template-columns:minmax(0,1fr) minmax(12rem,.7fr); }
|
|
800
800
|
.uhcp-identity-entity-relationship { align-content:center; background:var(--uhcp-panel-muted, #f4f7fa); border:1px solid var(--uhcp-border, #d9dee7); border-radius:1rem; display:grid; gap:.35rem; padding:1rem; }
|
|
801
801
|
.uhcp-identity-entity-relationship span { color:var(--uhcp-muted, #5f6875); font-size:.85rem; font-weight:750; }
|
|
802
|
-
.uhcp-identity-entity-
|
|
802
|
+
.uhcp-identity-entity-editor input,.uhcp-identity-entity-editor select { background:var(--uhcp-panel); border:1px solid var(--uhcp-border); border-radius:.75rem; color:var(--uhcp-text); font:inherit; padding:.7rem .8rem; }
|
|
803
|
+
.uhcp-identity-entity-evidence { background:var(--uhcp-panel-muted); border:1px solid var(--uhcp-border); border-radius:1rem; color:var(--uhcp-text); margin:0; padding:1rem; }
|
|
804
|
+
.uhcp-identity-entity-evidence legend { color:var(--uhcp-text); font-weight:800; padding:0 .35rem; }
|
|
805
|
+
.uhcp-identity-entity-contact-wide,.uhcp-animal-controller-confirmation { grid-column:1/-1; }
|
|
803
806
|
.uhcp-animal-owner-name { grid-column:1/-1; }
|
|
804
|
-
.uhcp-animal-controller-confirmation { align-items:center; background:var(--uhcp-
|
|
805
|
-
.uhcp-animal-controller-confirmation input { min-height:auto
|
|
807
|
+
.uhcp-animal-controller-confirmation { align-items:center; background:color-mix(in srgb,var(--uhcp-turquoise) 12%,var(--uhcp-panel)); border:1px solid color-mix(in srgb,var(--uhcp-turquoise) 30%,var(--uhcp-border)); border-radius:.75rem; color:var(--uhcp-text); display:flex!important; padding:.75rem; }
|
|
808
|
+
.uhcp-animal-controller-confirmation input { accent-color:var(--uhcp-turquoise); min-height:auto!important; width:auto!important; }
|
|
806
809
|
@media (max-width: 42rem) { .uhcp-animal-onboarding-primary,.uhcp-identity-entity-heading-row { grid-template-columns:1fr; } .uhcp-animal-photo { justify-self:center; max-width:15rem; width:100%; } }
|
|
807
810
|
.uhcp-animal-card { aspect-ratio: 1.586; background: linear-gradient(145deg, #0a4169 0%, #087f8d 60%, #18a4a6 100%); border: 1px solid color-mix(in srgb, #fff 32%, transparent); border-radius: 1.15rem; box-shadow: 0 1rem 2.5rem rgb(2 30 51 / 22%); box-sizing: border-box; color: #fff; display: grid; gap: .8rem; grid-template-rows: auto 1fr auto; max-width: 33.5rem; min-height: 18.25rem; overflow: hidden; padding: 1.25rem; position: relative; width: 100%; }
|
|
808
811
|
.uhcp-animal-card::after { background: radial-gradient(circle, rgb(255 255 255 / 18%), transparent 68%); content: ''; height: 18rem; inset: -8rem -7rem auto auto; pointer-events: none; position: absolute; width: 18rem; }
|
|
@@ -841,6 +844,8 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
841
844
|
.uhcp-emergency-task-hub > header h1 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 0; }
|
|
842
845
|
.uhcp-subject-identity-card { border: 1px solid var(--uhcp-border, #d9dee7); border-radius: 1rem; display: grid; gap: 1rem; padding: 1rem; }
|
|
843
846
|
.uhcp-subject-identity-card > header { align-items: center; display: grid; gap: .8rem; grid-template-columns: auto 1fr auto; }
|
|
847
|
+
.uhcp-subject-identity-edit { align-items: center; background: var(--uhcp-action-soft, #e8f3ff); border: 1px solid var(--uhcp-action-end, #2563a9); border-radius: 50%; color: var(--uhcp-action-end, #2563a9); cursor: pointer; display: inline-flex; font: inherit; font-size: 1.25rem; height: 2.75rem; justify-content: center; width: 2.75rem; }
|
|
848
|
+
.uhcp-subject-identity-edit:hover, .uhcp-subject-identity-edit:focus-visible { background: var(--uhcp-action-end, #2563a9); color: #fff; }
|
|
844
849
|
.uhcp-subject-identity-card img, .uhcp-subject-identity-avatar { align-items: center; aspect-ratio: 1; border-radius: 50%; display: flex; height: 3.5rem; justify-content: center; object-fit: cover; width: 3.5rem; }
|
|
845
850
|
.uhcp-current-subject { margin-inline-start:auto; position:relative; }
|
|
846
851
|
.uhcp-current-subject-trigger { align-items:center; background:var(--uhcp-surface, #fff); border:1px solid var(--uhcp-border, #d8e0e8); border-radius:999px; color:inherit; cursor:pointer; display:flex; gap:.55rem; min-height:2.75rem; padding:.3rem .7rem .3rem .3rem; }
|
|
@@ -888,6 +893,11 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
888
893
|
.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; }
|
|
889
894
|
.uhcp-professional-access button:disabled { cursor: wait; opacity: .55; }
|
|
890
895
|
.uhcp-professional-access .uhcp-secondary { background: transparent; border: 1px solid var(--uhcp-line, #cbd5e1); color: inherit; }
|
|
896
|
+
.uhcp-animal-onboarding-actions { align-items:center; display:flex; flex-wrap:wrap; gap:.75rem; justify-content:flex-end; }
|
|
897
|
+
.uhcp-animal-identity-readonly-grid { display:grid; gap:1rem; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; padding:1rem; }
|
|
898
|
+
.uhcp-animal-identity-readonly-grid div { background:var(--uhcp-surface,#fff); border:1px solid var(--uhcp-border,#cbd5e1); border-radius:.8rem; padding:.8rem; }
|
|
899
|
+
.uhcp-animal-identity-readonly-grid dt { color:var(--uhcp-muted,#475569); font-size:.82rem; font-weight:700; }
|
|
900
|
+
.uhcp-animal-identity-readonly-grid dd { color:var(--uhcp-text,#0f172a); font-weight:750; margin:.25rem 0 0; overflow-wrap:anywhere; }
|
|
891
901
|
.uhcp-eyebrow { color: var(--uhcp-action-end, #2563a9); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
|
|
892
902
|
.uhcp-muted { color: var(--uhcp-muted, #526174); line-height: 1.55; }
|
|
893
903
|
.uhcp-auth-separator { align-items: center; color: var(--uhcp-muted, #526174); display: flex; gap: .75rem; }
|
package/package.json
CHANGED