uhc-portal-components-react 0.2.17 → 0.2.18
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 +8 -3
- package/README.md +6 -2
- package/dist/AnimalCardArtifact.d.ts +3 -1
- package/dist/AnimalCardArtifact.d.ts.map +1 -1
- package/dist/AnimalCardArtifact.js +7 -3
- package/dist/styles.css +20 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,9 +10,14 @@
|
|
|
10
10
|
animal species context and 21-digit telephone identifier and renders an
|
|
11
11
|
SHC-like identity QR only when the owning provider supplies it already
|
|
12
12
|
signed.
|
|
13
|
-
- Print both faces vertically at 50 x 80 mm
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
- Print both faces vertically at 50 x 80 mm and remove the unreadable printed
|
|
14
|
+
DID while preserving it as the exact face-A QR payload.
|
|
15
|
+
- Present both physical faces side by side whenever the screen has room and
|
|
16
|
+
collapse them to one column only on narrow viewports. Use a white face A,
|
|
17
|
+
one larger SOSCHAIN logo, a compact DID QR, the subject label below it and
|
|
18
|
+
the provider code needed for manual recovery.
|
|
19
|
+
- Keep the reverse free of repeated subject text and format the indivisible
|
|
20
|
+
21-digit telephone identifier as `4 4 4 4 5` without line wrapping.
|
|
16
21
|
|
|
17
22
|
## 0.2.14 - 2026-10-15
|
|
18
23
|
|
package/README.md
CHANGED
|
@@ -205,5 +205,9 @@ encode only the canonical card `did:web`; face B may encode only an already
|
|
|
205
205
|
signed provider-issued identity credential. Presentation code never issues or
|
|
206
206
|
signs the credential. When no signed value is available, the reverse side
|
|
207
207
|
fails closed with an explicit unavailable state. Both faces use the vertical
|
|
208
|
-
50 x 80 mm label format
|
|
209
|
-
|
|
208
|
+
50 x 80 mm label format and appear side by side when the viewport permits.
|
|
209
|
+
Face A uses the supplied SOSCHAIN logo without duplicating its wordmark,
|
|
210
|
+
prints the provider code for manual recovery, and keeps the DID QR compact;
|
|
211
|
+
the long `did:web` is not repeated as unreadable microtext. Face B does not
|
|
212
|
+
repeat the localized subject label and keeps the 21 digits together in
|
|
213
|
+
telephone groups of `4 4 4 4 5`.
|
|
@@ -20,6 +20,8 @@ export type SoschainSmartIdentityCardArtifactProps = Readonly<{
|
|
|
20
20
|
subjectKind?: 'animal' | 'personal';
|
|
21
21
|
subjectLabel?: string;
|
|
22
22
|
cardDid: string;
|
|
23
|
+
/** Nine-digit public provider code printed for manual recovery when the DID QR cannot be read. */
|
|
24
|
+
providerCode?: string;
|
|
23
25
|
speciesId7?: string;
|
|
24
26
|
cardNumber21?: string;
|
|
25
27
|
/** Host-rendered QR whose exact payload is `cardDid`. */
|
|
@@ -36,5 +38,5 @@ export declare function formatSoschainCardNumber21(value: string): string;
|
|
|
36
38
|
* VetChain. The host owns both QR payloads. Face A is deliberately DID-only;
|
|
37
39
|
* face B never invents or signs a credential in presentation code.
|
|
38
40
|
*/
|
|
39
|
-
export declare function SoschainSmartIdentityCardArtifact({ subjectKind, subjectLabel, cardDid, speciesId7, cardNumber21, didQr, identityQr, logoUrl, signedIdentityUnavailableLabel, }: SoschainSmartIdentityCardArtifactProps): import("react").JSX.Element;
|
|
41
|
+
export declare function SoschainSmartIdentityCardArtifact({ subjectKind, subjectLabel, cardDid, providerCode, speciesId7, cardNumber21, didQr, identityQr, logoUrl, signedIdentityUnavailableLabel, }: SoschainSmartIdentityCardArtifactProps): import("react").JSX.Element;
|
|
40
42
|
//# sourceMappingURL=AnimalCardArtifact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimalCardArtifact.d.ts","sourceRoot":"","sources":["../src/AnimalCardArtifact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MA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AsCxC"}
|
|
@@ -11,17 +11,21 @@ export function formatSoschainCardNumber21(value) {
|
|
|
11
11
|
const digits = String(value || '').replace(/[ -]/g, '');
|
|
12
12
|
if (!/^\d{21}$/.test(digits))
|
|
13
13
|
throw new TypeError('cardNumber21 must contain exactly 21 digits.');
|
|
14
|
-
return `${digits.slice(0,
|
|
14
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 8)} ${digits.slice(8, 12)} ${digits.slice(12, 16)} ${digits.slice(16)}`;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Two-sided physical identity artifact shared by SOSChain, PetChain and
|
|
18
18
|
* VetChain. The host owns both QR payloads. Face A is deliberately DID-only;
|
|
19
19
|
* face B never invents or signs a credential in presentation code.
|
|
20
20
|
*/
|
|
21
|
-
export function SoschainSmartIdentityCardArtifact({ subjectKind = 'animal', subjectLabel, cardDid, speciesId7, cardNumber21, didQr, identityQr, logoUrl, signedIdentityUnavailableLabel = 'Signed identity unavailable', }) {
|
|
21
|
+
export function SoschainSmartIdentityCardArtifact({ subjectKind = 'animal', subjectLabel, cardDid, providerCode, speciesId7, cardNumber21, didQr, identityQr, logoUrl, signedIdentityUnavailableLabel = 'Signed identity unavailable', }) {
|
|
22
22
|
const publicLabel = subjectKind === 'personal' ? 'Personal' : String(subjectLabel || 'Animal').trim();
|
|
23
23
|
const formattedCardNumber = cardNumber21 ? formatSoschainCardNumber21(cardNumber21) : undefined;
|
|
24
|
-
|
|
24
|
+
const normalizedProviderCode = providerCode ? String(providerCode).replace(/[ -]/g, '') : undefined;
|
|
25
|
+
if (normalizedProviderCode && !/^\d{9}$/.test(normalizedProviderCode)) {
|
|
26
|
+
throw new TypeError('providerCode must contain exactly 9 digits.');
|
|
27
|
+
}
|
|
28
|
+
return _jsxs("div", { className: "uhcp-smart-id-card-set", "aria-label": `SOSCHAIN Smart Identity Card: ${publicLabel}`, children: [_jsxs("article", { className: "uhcp-smart-id-card uhcp-smart-id-card-front", "data-card-face": "front", children: [_jsx("header", { className: "uhcp-smart-id-brand", children: _jsx("img", { src: logoUrl, alt: "SOSCHAIN" }) }), _jsxs("div", { className: "uhcp-smart-id-front-body", children: [_jsx("div", { className: "uhcp-smart-id-front-qr", "aria-label": "DID QR code", children: didQr }), _jsx("p", { className: "uhcp-smart-id-subject-label", children: publicLabel })] }), normalizedProviderCode ? _jsxs("footer", { children: [_jsx("span", { children: "Provider" }), _jsx("p", { className: "uhcp-smart-id-provider-code", children: normalizedProviderCode })] }) : null] }), _jsxs("article", { className: "uhcp-smart-id-card uhcp-smart-id-card-back", "data-card-face": "back", children: [_jsx("header", { children: _jsx("strong", { children: "SOSCHAIN SMART IDENTITY CARD" }) }), _jsxs("div", { className: "uhcp-smart-id-back-body", children: [_jsxs("dl", { children: [speciesId7 ? _jsxs("div", { children: [_jsx("dt", { children: "Species" }), _jsx("dd", { children: speciesId7 })] }) : null, formattedCardNumber ? _jsxs("div", { children: [_jsx("dt", { children: "Card" }), _jsx("dd", { children: formattedCardNumber })] }) : null] }), identityQr
|
|
25
29
|
? _jsx("div", { className: "uhcp-smart-id-identity-qr", "aria-label": "Signed identity QR code", children: identityQr })
|
|
26
30
|
: _jsx("p", { className: "uhcp-smart-id-unavailable", role: "status", children: signedIdentityUnavailableLabel })] })] })] });
|
|
27
31
|
}
|
package/dist/styles.css
CHANGED
|
@@ -835,28 +835,30 @@ html[data-theme='dark'] .uhcp-brand-artwork-dark { display: block !important; }
|
|
|
835
835
|
.uhcp-animal-card footer { min-width: 0; }
|
|
836
836
|
.uhcp-animal-card footer code { color: inherit; display: block; font-size: .68rem; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
837
837
|
@media(max-width: 480px) { .uhcp-animal-card { aspect-ratio: auto; min-height: 17rem; } .uhcp-animal-card-qr { height: 6.25rem; width: 6.25rem; } }
|
|
838
|
-
.uhcp-smart-id-card-set { display: grid; gap: 1rem; width: min(100%,
|
|
839
|
-
.uhcp-smart-id-card { aspect-ratio: 5 / 8; border: 1px solid #cbd5e1; border-radius: 1.15rem; box-shadow: 0
|
|
840
|
-
.uhcp-smart-id-card-front { background:
|
|
841
|
-
.uhcp-smart-id-
|
|
842
|
-
.uhcp-smart-id-brand {
|
|
843
|
-
.uhcp-smart-id-
|
|
844
|
-
.uhcp-smart-id-
|
|
845
|
-
.uhcp-smart-id-brand span { font-size: .72rem; font-weight: 800; justify-self: end; text-align: end; }
|
|
846
|
-
.uhcp-smart-id-front-qr { align-self: center; aspect-ratio: 1; background: #fff; border: .35rem solid #fff; border-radius: .7rem; box-sizing: border-box; justify-self: center; width: calc(100% - .5rem); }
|
|
838
|
+
.uhcp-smart-id-card-set { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 19rem)); width: min(100%, 39rem); }
|
|
839
|
+
.uhcp-smart-id-card { aspect-ratio: 5 / 8; border: 1px solid #cbd5e1; border-radius: 1.15rem; box-shadow: 0 .8rem 2rem rgb(15 41 66 / 14%); box-sizing: border-box; font-family: Inter, "Helvetica Neue", Arial, sans-serif; line-height: 1.2; overflow: hidden; padding: .9rem; position: relative; width: 100%; }
|
|
840
|
+
.uhcp-smart-id-card-front { background: #fff; color: #0f2942; display: grid; gap: .5rem; grid-template-rows: auto 1fr auto; }
|
|
841
|
+
.uhcp-smart-id-brand { align-items: center; display: flex; justify-content: center; min-height: 4.2rem; }
|
|
842
|
+
.uhcp-smart-id-brand img { display: block; height: 3.7rem; object-fit: contain; width: 5.6rem; }
|
|
843
|
+
.uhcp-smart-id-front-body { align-content: center; display: grid; gap: .55rem; justify-items: center; min-height: 0; }
|
|
844
|
+
.uhcp-smart-id-front-qr { aspect-ratio: 1; background: #fff; border: .2rem solid #fff; box-sizing: border-box; width: 68%; }
|
|
847
845
|
.uhcp-smart-id-front-qr > * { display: block; height: 100%; width: 100%; }
|
|
846
|
+
.uhcp-smart-id-subject-label { color: #0f2942; font-size: 1rem; font-weight: 800; line-height: 1.15; margin: 0; text-align: center; }
|
|
847
|
+
.uhcp-smart-id-card-front > footer { border-top: 1px solid #dbe3eb; display: grid; gap: .12rem; padding-top: .55rem; }
|
|
848
|
+
.uhcp-smart-id-card-front > footer span { color: #526174; font-size: .58rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
|
|
849
|
+
.uhcp-smart-id-provider-code { font-size: .82rem; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .04em; line-height: 1; margin: 0; white-space: nowrap; }
|
|
848
850
|
.uhcp-smart-id-card-back { background: #fff; color: #0f2942; display: grid; gap: .5rem; grid-template-rows: auto 1fr; }
|
|
849
|
-
.uhcp-smart-id-card-back > header {
|
|
850
|
-
.uhcp-smart-id-card-back > header strong { font-size: .68rem; letter-spacing: .
|
|
851
|
-
.uhcp-smart-id-
|
|
852
|
-
.uhcp-smart-id-back-body {
|
|
853
|
-
.uhcp-smart-id-back-body dl { display: grid; gap: .5rem; margin: 0; order: 2; }
|
|
851
|
+
.uhcp-smart-id-card-back > header { border-bottom: 2px solid #0f9ca8; padding-bottom: .45rem; }
|
|
852
|
+
.uhcp-smart-id-card-back > header strong { font-size: .68rem; letter-spacing: .07em; line-height: 1.15; }
|
|
853
|
+
.uhcp-smart-id-back-body { align-content: start; display: grid; gap: .65rem; grid-template-rows: auto auto; min-height: 0; }
|
|
854
|
+
.uhcp-smart-id-back-body dl { display: grid; gap: .4rem; margin: 0; order: 2; }
|
|
854
855
|
.uhcp-smart-id-back-body dt { color: #526174; font-size: .55rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
|
|
855
|
-
.uhcp-smart-id-back-body dd { font-
|
|
856
|
-
.uhcp-smart-id-identity-qr {
|
|
856
|
+
.uhcp-smart-id-back-body dd { font-size: .76rem; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .025em; line-height: 1.05; margin: .1rem 0 0; white-space: nowrap; }
|
|
857
|
+
.uhcp-smart-id-identity-qr { aspect-ratio: 1; background: #fff; box-sizing: border-box; justify-self: center; order: 1; width: 82%; }
|
|
857
858
|
.uhcp-smart-id-identity-qr > * { display: block; height: 100%; width: 100%; }
|
|
858
|
-
.uhcp-smart-id-unavailable {
|
|
859
|
-
@media
|
|
859
|
+
.uhcp-smart-id-unavailable { background: #f1f5f9; border: 1px dashed #94a3b8; border-radius: .6rem; box-sizing: border-box; color: #526174; font-size: .72rem; line-height: 1.25; margin: 0; order: 1; padding: .7rem; text-align: center; }
|
|
860
|
+
@media (max-width: 40rem) { .uhcp-smart-id-card-set { grid-template-columns: minmax(0, 19rem); width: min(100%, 19rem); } }
|
|
861
|
+
@media print { .uhcp-smart-id-card-set { gap: 0; grid-template-columns: 50mm; width: 50mm; } .uhcp-smart-id-card { break-after: page; border-radius: 3mm; box-shadow: none; height: 80mm; padding: 2.5mm; width: 50mm; } .uhcp-smart-id-front-qr { width: 34mm; } .uhcp-smart-id-identity-qr { width: 42mm; } .uhcp-smart-id-card:last-child { break-after: auto; } }
|
|
860
862
|
.uhcp-animal-controller-attestation { border: 1px solid var(--uhcp-border, #d9dee7); border-radius: 1.25rem; display: grid; gap: 1rem; padding: 1rem; }
|
|
861
863
|
.uhcp-animal-controller-attestation header h2, .uhcp-animal-controller-attestation header p { margin: 0; }
|
|
862
864
|
.uhcp-animal-controller-attestation header p { color: var(--uhcp-muted, #5f6875); margin-top: .35rem; }
|
package/package.json
CHANGED