sos-portal-components-react 0.3.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -145
- package/README.md +255 -233
- package/dist/PortalCurrentSubject.d.ts +29 -0
- package/dist/PortalCurrentSubject.d.ts.map +1 -0
- package/dist/PortalCurrentSubject.js +62 -0
- package/dist/PortalCurrentSubject.js.map +1 -0
- package/dist/PortalHeader.d.ts +10 -0
- package/dist/PortalHeader.d.ts.map +1 -0
- package/dist/PortalHeader.js +11 -0
- package/dist/PortalHeader.js.map +1 -0
- package/dist/PortalSettingsPanel.d.ts +8 -0
- package/dist/PortalSettingsPanel.d.ts.map +1 -0
- package/dist/PortalSettingsPanel.js +10 -0
- package/dist/PortalSettingsPanel.js.map +1 -0
- package/dist/care/AnimalCardArtifact.d.ts +42 -0
- package/dist/care/AnimalCardArtifact.d.ts.map +1 -0
- package/dist/care/AnimalCardArtifact.js +32 -0
- package/dist/care/AnimalCardArtifact.js.map +1 -0
- package/dist/care/BrowserRealtimeCallPanel.d.ts +39 -0
- package/dist/care/BrowserRealtimeCallPanel.d.ts.map +1 -0
- package/dist/care/BrowserRealtimeCallPanel.js +43 -0
- package/dist/care/BrowserRealtimeCallPanel.js.map +1 -0
- package/dist/care/CardPreview.d.ts +6 -0
- package/dist/care/CardPreview.d.ts.map +1 -0
- package/dist/care/CardPreview.js +6 -0
- package/dist/care/CardPreview.js.map +1 -0
- package/dist/care/CommunicationsWorkspace.d.ts +18 -0
- package/dist/care/CommunicationsWorkspace.d.ts.map +1 -0
- package/dist/care/CommunicationsWorkspace.js +13 -0
- package/dist/care/CommunicationsWorkspace.js.map +1 -0
- package/dist/care/EmergencyTaskHub.d.ts +27 -0
- package/dist/care/EmergencyTaskHub.d.ts.map +1 -0
- package/dist/care/EmergencyTaskHub.js +25 -0
- package/dist/care/EmergencyTaskHub.js.map +1 -0
- package/dist/care/LegalMarkdownDocument.d.ts +6 -0
- package/dist/care/LegalMarkdownDocument.d.ts.map +1 -0
- package/dist/care/LegalMarkdownDocument.js +57 -0
- package/dist/care/LegalMarkdownDocument.js.map +1 -0
- package/dist/care/NotificationComposer.d.ts +49 -0
- package/dist/care/NotificationComposer.d.ts.map +1 -0
- package/dist/care/NotificationComposer.js +83 -0
- package/dist/care/NotificationComposer.js.map +1 -0
- package/dist/care/ProtectedIndexEmergencyData.d.ts +32 -0
- package/dist/care/ProtectedIndexEmergencyData.d.ts.map +1 -0
- package/dist/care/ProtectedIndexEmergencyData.js +13 -0
- package/dist/care/ProtectedIndexEmergencyData.js.map +1 -0
- package/dist/care/SelectedSubjectWorkspace.d.ts +32 -0
- package/dist/care/SelectedSubjectWorkspace.d.ts.map +1 -0
- package/dist/care/SelectedSubjectWorkspace.js +32 -0
- package/dist/care/SelectedSubjectWorkspace.js.map +1 -0
- package/dist/care/SoschainWorkspace.d.ts +119 -0
- package/dist/care/SoschainWorkspace.d.ts.map +1 -0
- package/dist/care/SoschainWorkspace.js +61 -0
- package/dist/care/SoschainWorkspace.js.map +1 -0
- package/dist/care/SubjectCommunicationCenter.d.ts +45 -0
- package/dist/care/SubjectCommunicationCenter.d.ts.map +1 -0
- package/dist/care/SubjectCommunicationCenter.js +40 -0
- package/dist/care/SubjectCommunicationCenter.js.map +1 -0
- package/dist/care/SubjectDemographicsFields.d.ts +42 -0
- package/dist/care/SubjectDemographicsFields.d.ts.map +1 -0
- package/dist/care/SubjectDemographicsFields.js +71 -0
- package/dist/care/SubjectDemographicsFields.js.map +1 -0
- package/dist/care/SubjectSectionIndex.d.ts +22 -0
- package/dist/care/SubjectSectionIndex.d.ts.map +1 -0
- package/dist/care/SubjectSectionIndex.js +34 -0
- package/dist/care/SubjectSectionIndex.js.map +1 -0
- package/dist/care/SubjectWorkspace.d.ts +29 -0
- package/dist/care/SubjectWorkspace.d.ts.map +1 -0
- package/dist/care/SubjectWorkspace.js +59 -0
- package/dist/care/SubjectWorkspace.js.map +1 -0
- package/dist/care/care.css +215 -0
- package/dist/care/index.d.ts +16 -0
- package/dist/care/index.d.ts.map +1 -0
- package/dist/care/index.js +16 -0
- package/dist/care/index.js.map +1 -0
- package/dist/care/notification-bff-client.d.ts +44 -0
- package/dist/care/notification-bff-client.d.ts.map +1 -0
- package/dist/care/notification-bff-client.js +89 -0
- package/dist/care/notification-bff-client.js.map +1 -0
- package/dist/clinical/BrowserClinicalSpeechInput.d.ts +25 -0
- package/dist/clinical/BrowserClinicalSpeechInput.d.ts.map +1 -0
- package/dist/clinical/BrowserClinicalSpeechInput.js +32 -0
- package/dist/clinical/BrowserClinicalSpeechInput.js.map +1 -0
- package/dist/clinical/ClinicalActionButton.d.ts +9 -0
- package/dist/clinical/ClinicalActionButton.d.ts.map +1 -0
- package/dist/clinical/ClinicalActionButton.js +13 -0
- package/dist/clinical/ClinicalActionButton.js.map +1 -0
- package/dist/clinical/ClinicalArtifactEditor.d.ts +147 -0
- package/dist/clinical/ClinicalArtifactEditor.d.ts.map +1 -0
- package/dist/clinical/ClinicalArtifactEditor.js +382 -0
- package/dist/clinical/ClinicalArtifactEditor.js.map +1 -0
- package/dist/clinical/ClinicalArtifactEditorV2.d.ts +77 -0
- package/dist/clinical/ClinicalArtifactEditorV2.d.ts.map +1 -0
- package/dist/clinical/ClinicalArtifactEditorV2.js +89 -0
- package/dist/clinical/ClinicalArtifactEditorV2.js.map +1 -0
- package/dist/clinical/ClinicalArtifactPropertiesV2.d.ts +83 -0
- package/dist/clinical/ClinicalArtifactPropertiesV2.d.ts.map +1 -0
- package/dist/clinical/ClinicalArtifactPropertiesV2.js +46 -0
- package/dist/clinical/ClinicalArtifactPropertiesV2.js.map +1 -0
- package/dist/clinical/ClinicalBundleDraftEditor.d.ts +99 -0
- package/dist/clinical/ClinicalBundleDraftEditor.d.ts.map +1 -0
- package/dist/clinical/ClinicalBundleDraftEditor.js +225 -0
- package/dist/clinical/ClinicalBundleDraftEditor.js.map +1 -0
- package/dist/clinical/ClinicalEditorLayer.d.ts +8 -0
- package/dist/clinical/ClinicalEditorLayer.d.ts.map +1 -0
- package/dist/clinical/ClinicalEditorLayer.js +12 -0
- package/dist/clinical/ClinicalEditorLayer.js.map +1 -0
- package/dist/clinical/ClinicalSectionSummary.d.ts +36 -0
- package/dist/clinical/ClinicalSectionSummary.d.ts.map +1 -0
- package/dist/clinical/ClinicalSectionSummary.js +24 -0
- package/dist/clinical/ClinicalSectionSummary.js.map +1 -0
- package/dist/clinical/ClinicalSpeechInput.d.ts +58 -0
- package/dist/clinical/ClinicalSpeechInput.d.ts.map +1 -0
- package/dist/clinical/ClinicalSpeechInput.js +84 -0
- package/dist/clinical/ClinicalSpeechInput.js.map +1 -0
- package/dist/clinical/ClinicalTimeline.d.ts +52 -0
- package/dist/clinical/ClinicalTimeline.d.ts.map +1 -0
- package/dist/clinical/ClinicalTimeline.js +48 -0
- package/dist/clinical/ClinicalTimeline.js.map +1 -0
- package/dist/clinical/ImmunizationArtifactEditorV2.d.ts +15 -0
- package/dist/clinical/ImmunizationArtifactEditorV2.d.ts.map +1 -0
- package/dist/clinical/ImmunizationArtifactEditorV2.js +62 -0
- package/dist/clinical/ImmunizationArtifactEditorV2.js.map +1 -0
- package/dist/clinical/IpsBundleSummary.d.ts +34 -0
- package/dist/clinical/IpsBundleSummary.d.ts.map +1 -0
- package/dist/clinical/IpsBundleSummary.js +75 -0
- package/dist/clinical/IpsBundleSummary.js.map +1 -0
- package/dist/clinical/SchemaClinicalArtifactEditorV2.d.ts +11 -0
- package/dist/clinical/SchemaClinicalArtifactEditorV2.d.ts.map +1 -0
- package/dist/clinical/SchemaClinicalArtifactEditorV2.js +62 -0
- package/dist/clinical/SchemaClinicalArtifactEditorV2.js.map +1 -0
- package/dist/clinical/clinical.css +148 -0
- package/dist/clinical/index.d.ts +14 -0
- package/dist/clinical/index.d.ts.map +1 -0
- package/dist/clinical/index.js +14 -0
- package/dist/clinical/index.js.map +1 -0
- package/dist/encounter-journey.css +91 -91
- package/dist/identity/AnimalIdentityDetailsV2.d.ts +43 -0
- package/dist/identity/AnimalIdentityDetailsV2.d.ts.map +1 -0
- package/dist/identity/AnimalIdentityDetailsV2.js +9 -0
- package/dist/identity/AnimalIdentityDetailsV2.js.map +1 -0
- package/dist/identity/AnimalIdentityOnboarding.d.ts +91 -0
- package/dist/identity/AnimalIdentityOnboarding.d.ts.map +1 -0
- package/dist/identity/AnimalIdentityOnboarding.js +73 -0
- package/dist/identity/AnimalIdentityOnboarding.js.map +1 -0
- package/dist/identity/AnimalIdentityOnboardingV2.d.ts +56 -0
- package/dist/identity/AnimalIdentityOnboardingV2.d.ts.map +1 -0
- package/dist/identity/AnimalIdentityOnboardingV2.js +174 -0
- package/dist/identity/AnimalIdentityOnboardingV2.js.map +1 -0
- package/dist/identity/current-subject.css +11 -0
- package/dist/identity/identity.css +64 -0
- package/dist/identity/index.d.ts +9 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +10 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/preferences.d.ts +12 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +57 -0
- package/dist/preferences.js.map +1 -0
- package/dist/styles.css +24 -0
- package/dist/usePortalUiPreferences.d.ts +9 -0
- package/dist/usePortalUiPreferences.d.ts.map +1 -0
- package/dist/usePortalUiPreferences.js +39 -0
- package/dist/usePortalUiPreferences.js.map +1 -0
- package/package.json +127 -110
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { normalizeNotificationComposerDraft, NotificationAttachmentMediaTypes, PublicAlertPriorities, } from 'sos-data-utils-ts/public-notifications';
|
|
5
|
+
import { LegalMarkdownDocument } from './LegalMarkdownDocument.js';
|
|
6
|
+
/**
|
|
7
|
+
* Channel-neutral notification editor. The host supplies BFF-authorized
|
|
8
|
+
* audiences plus upload/send adapters; this component never accepts direct
|
|
9
|
+
* recipient addresses, subscriber lists or publishing authority.
|
|
10
|
+
*/
|
|
11
|
+
export function NotificationComposer(input) {
|
|
12
|
+
const id = useId();
|
|
13
|
+
const [audienceId, setAudienceId] = useState(input.audiences[0]?.id ?? '');
|
|
14
|
+
const [subject, setSubject] = useState('');
|
|
15
|
+
const [bodyMarkdown, setBodyMarkdown] = useState('');
|
|
16
|
+
const [priority, setPriority] = useState('routine');
|
|
17
|
+
const [validUntil, setValidUntil] = useState('');
|
|
18
|
+
const [attachments, setAttachments] = useState([]);
|
|
19
|
+
const [working, setWorking] = useState(false);
|
|
20
|
+
const [status, setStatus] = useState('');
|
|
21
|
+
const [error, setError] = useState('');
|
|
22
|
+
const audience = input.audiences.find((candidate) => candidate.id === audienceId);
|
|
23
|
+
const disabled = Boolean(input.disabled || working);
|
|
24
|
+
const publicAlertForm = Boolean(input.formSchema);
|
|
25
|
+
const priorityOptions = input.formSchema?.properties.priority?.enum ?? PublicAlertPriorities;
|
|
26
|
+
const subjectMaxLength = input.formSchema?.properties.subject?.maxLength;
|
|
27
|
+
const bodyMaxLength = input.formSchema?.properties.bodyMarkdown?.maxLength;
|
|
28
|
+
const attachmentLimit = input.formSchema?.properties.attachments?.maxItems;
|
|
29
|
+
async function addAttachments(files) {
|
|
30
|
+
if (!files?.length)
|
|
31
|
+
return;
|
|
32
|
+
setError('');
|
|
33
|
+
const selectedFiles = Array.from(files);
|
|
34
|
+
if (attachmentLimit !== undefined && attachments.length + selectedFiles.length > attachmentLimit) {
|
|
35
|
+
setError(input.copy.unsupportedAttachment);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (selectedFiles.some((file) => !NotificationAttachmentMediaTypes.includes(file.type))) {
|
|
39
|
+
setError(input.copy.unsupportedAttachment);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setWorking(true);
|
|
43
|
+
try {
|
|
44
|
+
const uploaded = await Promise.all(selectedFiles.map((file) => input.uploadAttachment(file)));
|
|
45
|
+
setAttachments((current) => Object.freeze([...current, ...uploaded]));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
setError(input.copy.attachmentUploadFailed);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
setWorking(false);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function submit() {
|
|
55
|
+
if (!audience || !subject.trim() || !bodyMarkdown.trim())
|
|
56
|
+
return;
|
|
57
|
+
setWorking(true);
|
|
58
|
+
setStatus('');
|
|
59
|
+
setError('');
|
|
60
|
+
try {
|
|
61
|
+
const draft = normalizeNotificationComposerDraft({
|
|
62
|
+
audience: audience.audience,
|
|
63
|
+
subject,
|
|
64
|
+
bodyMarkdown,
|
|
65
|
+
attachments,
|
|
66
|
+
...(publicAlertForm ? {
|
|
67
|
+
priority,
|
|
68
|
+
validUntil: new Date(validUntil).toISOString(),
|
|
69
|
+
} : {}),
|
|
70
|
+
});
|
|
71
|
+
await input.onSubmit(draft);
|
|
72
|
+
setStatus(input.copy.sent);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
setError(input.copy.sendFailed);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
setWorking(false);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return _jsxs("section", { className: "uhcp-notification-composer", "aria-labelledby": `${id}-title`, "data-form-schema": input.formSchema?.$id, children: [_jsx("header", { children: _jsx("h2", { id: `${id}-title`, children: input.copy.title }) }), _jsx("label", { htmlFor: `${id}-audience`, children: input.copy.audience }), _jsx("select", { id: `${id}-audience`, value: audienceId, disabled: disabled, onChange: (event) => setAudienceId(event.currentTarget.value), children: input.audiences.map((option) => _jsx("option", { value: option.id, children: option.label }, option.id)) }), audience?.description ? _jsx("p", { className: "uhcp-muted", children: audience.description }) : null, _jsx("label", { htmlFor: `${id}-subject`, children: input.copy.subject }), _jsx("input", { id: `${id}-subject`, value: subject, maxLength: subjectMaxLength, disabled: disabled, onChange: (event) => setSubject(event.currentTarget.value) }), publicAlertForm ? _jsxs(_Fragment, { children: [_jsx("label", { htmlFor: `${id}-priority`, children: input.copy.priority || 'Priority' }), _jsx("select", { id: `${id}-priority`, value: priority, disabled: disabled, onChange: (event) => setPriority(event.currentTarget.value), children: priorityOptions.map((value) => _jsx("option", { value: value, children: value }, value)) }), _jsx("label", { htmlFor: `${id}-valid-until`, children: input.copy.validUntil || 'Valid until' }), _jsx("input", { id: `${id}-valid-until`, type: "datetime-local", value: validUntil, required: true, disabled: disabled, onChange: (event) => setValidUntil(event.currentTarget.value) })] }) : null, _jsxs("div", { className: "uhcp-notification-composer-body", children: [_jsxs("div", { children: [_jsx("label", { htmlFor: `${id}-body`, children: input.copy.bodyMarkdown }), _jsx("textarea", { id: `${id}-body`, value: bodyMarkdown, maxLength: bodyMaxLength, disabled: disabled, onChange: (event) => setBodyMarkdown(event.currentTarget.value) })] }), _jsxs("section", { "aria-labelledby": `${id}-preview`, children: [_jsx("h3", { id: `${id}-preview`, children: input.copy.preview }), _jsx(LegalMarkdownDocument, { source: bodyMarkdown })] })] }), _jsxs("fieldset", { disabled: disabled, children: [_jsx("legend", { children: input.copy.attachments }), _jsx("label", { htmlFor: `${id}-attachments`, children: input.copy.addAttachments }), _jsx("input", { id: `${id}-attachments`, type: "file", multiple: true, accept: NotificationAttachmentMediaTypes.join(','), onChange: (event) => void addAttachments(event.currentTarget.files) }), attachments.length > 0 ? _jsx("ul", { children: attachments.map((attachment) => _jsxs("li", { children: [_jsx("span", { children: attachment.fileName }), _jsx("button", { type: "button", onClick: () => setAttachments((current) => current.filter((item) => item.attachmentId !== attachment.attachmentId)), children: input.copy.removeAttachment })] }, attachment.attachmentId)) }) : null] }), _jsx("button", { type: "button", disabled: disabled || !audience || !subject.trim() || !bodyMarkdown.trim() || (publicAlertForm && !validUntil), onClick: () => void submit(), children: working ? input.copy.sending : input.copy.send }), status ? _jsx("p", { role: "status", children: status }) : null, error ? _jsx("p", { role: "alert", children: error }) : null] });
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=NotificationComposer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationComposer.js","sourceRoot":"","sources":["../../src/care/NotificationComposer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,qBAAqB,GAKtB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAuClE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAOnC;IACA,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAClB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACpD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAsB,SAAS,CAAC,CAAA;IACxE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAChD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAoC,EAAE,CAAC,CAAA;IACrF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,MAAM,EAAE,SAAS,CAA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I,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,IAAI,CAAC,UAAU,CAAC,EAC9G,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,YAC5B,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAU,EACzD,MAAM,CAAC,CAAC,CAAC,YAAG,IAAI,EAAC,QAAQ,YAAE,MAAM,GAAK,CAAC,CAAC,CAAC,IAAI,EAC7C,KAAK,CAAC,CAAC,CAAC,YAAG,IAAI,EAAC,OAAO,YAAE,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,IACnC,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type ProtectedIndexEmergencyItem = Readonly<{
|
|
2
|
+
identifier: string;
|
|
3
|
+
title: string;
|
|
4
|
+
categoryLabel: string;
|
|
5
|
+
sourceLabel?: string;
|
|
6
|
+
creatorLabel?: string;
|
|
7
|
+
/** True only after the backend confirms emergency-copy consent and policy. */
|
|
8
|
+
emergencyAvailable: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type ProtectedIndexEmergencyCopy = Readonly<{
|
|
11
|
+
title: string;
|
|
12
|
+
body: string;
|
|
13
|
+
securePinTitle: string;
|
|
14
|
+
securePinBody: string;
|
|
15
|
+
emergencyPinTitle: string;
|
|
16
|
+
emergencyPinBody: string;
|
|
17
|
+
emergencyOnly: string;
|
|
18
|
+
protectedOnly: string;
|
|
19
|
+
empty: string;
|
|
20
|
+
sourcePrefix: string;
|
|
21
|
+
creatorPrefix: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Presents backend-confirmed protected-index copies and their independent
|
|
25
|
+
* emergency availability. The component never infers emergency consent from
|
|
26
|
+
* individual authorship, storage, a selected card or browser state.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ProtectedIndexEmergencyData({ copy, items, }: Readonly<{
|
|
29
|
+
copy: ProtectedIndexEmergencyCopy;
|
|
30
|
+
items: readonly ProtectedIndexEmergencyItem[];
|
|
31
|
+
}>): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=ProtectedIndexEmergencyData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtectedIndexEmergencyData.d.ts","sourceRoot":"","sources":["../../src/care/ProtectedIndexEmergencyData.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,8EAA8E;IAC9E,kBAAkB,EAAE,OAAO,CAAA;CAC5B,CAAC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,IAAI,EACJ,KAAK,GACN,EAAE,QAAQ,CAAC;IACV,IAAI,EAAE,2BAA2B,CAAA;IACjC,KAAK,EAAE,SAAS,2BAA2B,EAAE,CAAA;CAC9C,CAAC,+BAkCD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Presents backend-confirmed protected-index copies and their independent
|
|
4
|
+
* emergency availability. The component never infers emergency consent from
|
|
5
|
+
* individual authorship, storage, a selected card or browser state.
|
|
6
|
+
*/
|
|
7
|
+
export function ProtectedIndexEmergencyData({ copy, items, }) {
|
|
8
|
+
return (_jsxs("section", { className: "uhcp-emergency-copy", "aria-labelledby": "protected-index-emergency-title", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("h2", { id: "protected-index-emergency-title", children: copy.title }), _jsx("p", { children: copy.body })] }), _jsxs("div", { className: "uhcp-emergency-copy-legend", "aria-label": copy.title, children: [_jsx(Pin, { kind: "secure", label: copy.securePinTitle, help: copy.securePinBody }), _jsx(Pin, { kind: "emergency", label: copy.emergencyPinTitle, help: copy.emergencyPinBody })] })] }), items.length === 0 ? _jsx("p", { className: "uhcp-emergency-copy-empty", children: copy.empty }) : (_jsx("ul", { className: "uhcp-emergency-copy-list", children: items.map((item) => (_jsxs("li", { children: [_jsxs("div", { className: "uhcp-emergency-copy-item-heading", children: [_jsx("span", { className: "uhcp-emergency-copy-category", children: item.categoryLabel }), _jsxs("span", { className: "uhcp-emergency-copy-pins", children: [_jsx(Pin, { kind: "secure", label: copy.securePinTitle, help: copy.securePinBody, compact: true }), item.emergencyAvailable ? _jsx(Pin, { kind: "emergency", label: copy.emergencyPinTitle, help: copy.emergencyPinBody, compact: true }) : null] })] }), _jsx("strong", { children: item.title }), _jsx("small", { children: item.emergencyAvailable ? copy.emergencyOnly : copy.protectedOnly }), item.sourceLabel ? _jsxs("span", { children: [copy.sourcePrefix, ": ", item.sourceLabel] }) : null, item.creatorLabel ? _jsxs("span", { children: [copy.creatorPrefix, ": ", item.creatorLabel] }) : null] }, item.identifier))) }))] }));
|
|
9
|
+
}
|
|
10
|
+
function Pin({ kind, label, help, compact = false, }) {
|
|
11
|
+
return (_jsxs("span", { className: `uhcp-emergency-copy-pin uhcp-emergency-copy-pin-${kind}`, role: "img", "aria-label": label, title: help, children: [_jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "M12 17v5m-5-9 2-2V5L7 3h10l-2 2v6l2 2H7Z" }) }), compact ? null : _jsx("span", { children: label })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ProtectedIndexEmergencyData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtectedIndexEmergencyData.js","sourceRoot":"","sources":["../../src/care/ProtectedIndexEmergencyData.tsx"],"names":[],"mappings":";AAwBA;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,IAAI,EACJ,KAAK,GAIL;IACA,OAAO,CACL,mBAAS,SAAS,EAAC,qBAAqB,qBAAiB,iCAAiC,aACxF,6BACE,0BACE,aAAI,EAAE,EAAC,iCAAiC,YAAE,IAAI,CAAC,KAAK,GAAM,EAC1D,sBAAI,IAAI,CAAC,IAAI,GAAK,IACd,EACN,eAAK,SAAS,EAAC,4BAA4B,gBAAa,IAAI,CAAC,KAAK,aAChE,KAAC,GAAG,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,GAAI,EAC3E,KAAC,GAAG,IAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,GAAI,IAChF,IACC,EACR,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,2BAA2B,YAAE,IAAI,CAAC,KAAK,GAAK,CAAC,CAAC,CAAC,CAChF,aAAI,SAAS,EAAC,0BAA0B,YACrC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,yBACE,eAAK,SAAS,EAAC,kCAAkC,aAC/C,eAA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AAI,CAAC,CAAC,CAAC,yBAAO,KAAK,GAAQ,IACjC,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const SELECTED_SUBJECT_AREAS: readonly ["identity", "health", "insurance", "appointments-tasks", "communications", "contacts-permissions"];
|
|
3
|
+
export type SelectedSubjectArea = (typeof SELECTED_SUBJECT_AREAS)[number];
|
|
4
|
+
export type SelectedSubjectAction = 'search' | 'read' | 'create' | 'update' | 'delete';
|
|
5
|
+
export type SelectedSubjectAreaCapability = Readonly<{
|
|
6
|
+
area: SelectedSubjectArea;
|
|
7
|
+
actions: readonly SelectedSubjectAction[];
|
|
8
|
+
recordCount?: number;
|
|
9
|
+
}>;
|
|
10
|
+
export type SelectedSubjectWorkspaceCopy = Readonly<{
|
|
11
|
+
card: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
identity: string;
|
|
14
|
+
health: string;
|
|
15
|
+
insurance: string;
|
|
16
|
+
appointmentsTasks: string;
|
|
17
|
+
communications: string;
|
|
18
|
+
contactsPermissions: string;
|
|
19
|
+
records: string;
|
|
20
|
+
}>;
|
|
21
|
+
/** Capability-driven professional subject shell; selection never grants an action. */
|
|
22
|
+
export declare function SelectedSubjectWorkspace({ subject, capabilities, copy, content, initialArea }: Readonly<{
|
|
23
|
+
subject: Readonly<{
|
|
24
|
+
id: string;
|
|
25
|
+
display: string;
|
|
26
|
+
}>;
|
|
27
|
+
capabilities: readonly SelectedSubjectAreaCapability[];
|
|
28
|
+
copy: SelectedSubjectWorkspaceCopy;
|
|
29
|
+
content?: Partial<Record<SelectedSubjectArea, ReactNode>>;
|
|
30
|
+
initialArea?: 'card' | SelectedSubjectArea;
|
|
31
|
+
}>): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=SelectedSubjectWorkspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectedSubjectWorkspace.d.ts","sour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E,SAAS,CAAC,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAC3C,CAAC,+BAmBD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
+
export const SELECTED_SUBJECT_AREAS = ['identity', 'health', 'insurance', 'appointments-tasks', 'communications', 'contacts-permissions'];
|
|
5
|
+
const copyKey = { identity: 'identity', health: 'health', insurance: 'insurance', 'appointments-tasks': 'appointmentsTasks', communications: 'communications', 'contacts-permissions': 'contactsPermissions' };
|
|
6
|
+
function mergeCapabilities(capabilities) {
|
|
7
|
+
const merged = new Map();
|
|
8
|
+
for (const capability of capabilities) {
|
|
9
|
+
if (!capability.actions.length)
|
|
10
|
+
continue;
|
|
11
|
+
const previous = merged.get(capability.area);
|
|
12
|
+
const recordCount = capability.actions.includes('search') ? capability.recordCount ?? previous?.recordCount : previous?.recordCount;
|
|
13
|
+
merged.set(capability.area, { area: capability.area, actions: [...new Set([...(previous?.actions ?? []), ...capability.actions])], ...(recordCount === undefined ? {} : { recordCount }) });
|
|
14
|
+
}
|
|
15
|
+
return merged;
|
|
16
|
+
}
|
|
17
|
+
/** Capability-driven professional subject shell; selection never grants an action. */
|
|
18
|
+
export function SelectedSubjectWorkspace({ subject, capabilities, copy, content = {}, initialArea = 'card' }) {
|
|
19
|
+
const capabilityByArea = useMemo(() => mergeCapabilities(capabilities), [capabilities]);
|
|
20
|
+
const visibleAreas = SELECTED_SUBJECT_AREAS.filter((area) => capabilityByArea.has(area));
|
|
21
|
+
const [selectedArea, setSelectedArea] = useState(initialArea);
|
|
22
|
+
useEffect(() => { if (selectedArea !== 'card' && !capabilityByArea.has(selectedArea))
|
|
23
|
+
setSelectedArea('card'); }, [capabilityByArea, selectedArea]);
|
|
24
|
+
const labelFor = (area) => {
|
|
25
|
+
const label = copy[copyKey[area]];
|
|
26
|
+
const capability = capabilityByArea.get(area);
|
|
27
|
+
return capability?.actions.includes('search') && capability.recordCount !== undefined ? `${label}, ${capability.recordCount} ${copy.records}` : label;
|
|
28
|
+
};
|
|
29
|
+
const selectedCapability = selectedArea === 'card' ? undefined : capabilityByArea.get(selectedArea);
|
|
30
|
+
return _jsxs("section", { className: "uhcp-selected-subject-workspace", "aria-labelledby": "uhcp-selected-subject-title", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("span", { children: copy.summary }), _jsx("h2", { id: "uhcp-selected-subject-title", children: subject.display })] }), _jsx("code", { children: subject.id })] }), _jsxs("div", { className: "uhcp-selected-subject-tabs", role: "tablist", "aria-label": subject.display, children: [_jsx("button", { type: "button", role: "tab", "aria-selected": selectedArea === 'card', onClick: () => setSelectedArea('card'), children: copy.card }), visibleAreas.map((area) => _jsx("button", { type: "button", role: "tab", "aria-selected": selectedArea === area, onClick: () => setSelectedArea(area), children: labelFor(area) }, area))] }), _jsx("div", { role: "tabpanel", children: selectedArea === 'card' ? _jsxs("div", { children: [_jsx("h3", { children: copy.summary }), _jsx("ul", { children: visibleAreas.map((area) => _jsx("li", { children: labelFor(area) }, area)) })] }) : selectedCapability?.actions.includes('read') ? content[selectedArea] : null })] });
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=SelectedSubjectWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectedSubjectWorkspace.js","sourceRoot":"","sources":["../../src/care/SelectedSubjectWorkspace.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAEpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,CAAU,CAAA;AAMlJ,MAAM,OAAO,GAA8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,OAAO,CAAC,EAAE,GAAQ,IAAS,EAC3I,eAAK,SAAS,EAAC,4BAA4B,EAAC,IAAI,EAAC,SAAS,gBAAa,OAAO,CAAC,OAAO,aACpF,iBAAQ,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,mBAAgB,YAAY,KAAK,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,YAAG,IAAI,CAAC,IAAI,GAAU,EACpI,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,mBAA2B,YAAY,KAAK,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,YAAG,QAAQ,CAAC,IAAI,CAAC,IAAjG,IAAI,CAAuG,CAAC,IAC1K,EACN,cAAK,IAAI,EAAC,UAAU,YAAE,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,0BAAK,uBAAK,IAAI,CAAC,OAAO,GAAM,EAAA,uBAAK,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAgB,QAAQ,CAAC,IAAI,CAAC,IAArB,IAAI,CAAuB,CAAC,GAAM,IAAM,CAAC,CAAC,CAAC,kBAAkB,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,GAAO,IAC1O,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { type ProtectedIndexEmergencyCopy, type ProtectedIndexEmergencyItem } from './ProtectedIndexEmergencyData.js';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export declare const SOSCHAIN_SUBJECT_WORKSPACE_AREAS: readonly ["overview", "health-summary", "care-journey", "emergency-data", "communications", "places", "products"];
|
|
4
|
+
export type SoschainWorkspaceArea = typeof SOSCHAIN_SUBJECT_WORKSPACE_AREAS[number];
|
|
5
|
+
export type SoschainCardSummary = Readonly<{
|
|
6
|
+
identifier: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
kindLabel: string;
|
|
9
|
+
subjectKind?: 'person' | 'animal';
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
openHref: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type SoschainAssociationSummary = Readonly<{
|
|
14
|
+
identifier: string;
|
|
15
|
+
name: string;
|
|
16
|
+
kindLabel: string;
|
|
17
|
+
detail: string;
|
|
18
|
+
statusLabel: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type SoschainCommunicationSummary = Readonly<{
|
|
21
|
+
identifier: string;
|
|
22
|
+
sender: string;
|
|
23
|
+
categoryLabel: string;
|
|
24
|
+
subject: string;
|
|
25
|
+
body: string;
|
|
26
|
+
occurredAt: string;
|
|
27
|
+
placeLabel?: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Minimum Encounter projection suitable for a controller/member timeline.
|
|
31
|
+
* The host must already have removed room, bed, diagnosis and other details
|
|
32
|
+
* that the current actor is not authorized to read.
|
|
33
|
+
*/
|
|
34
|
+
export type SoschainCareJourneyEntry = Readonly<{
|
|
35
|
+
identifier: string;
|
|
36
|
+
statusLabel: string;
|
|
37
|
+
serviceLabel: string;
|
|
38
|
+
periodStart: string;
|
|
39
|
+
periodEnd?: string;
|
|
40
|
+
locationLabel?: string;
|
|
41
|
+
detail?: string;
|
|
42
|
+
}>;
|
|
43
|
+
export type SoschainWorkspaceCopy = Readonly<{
|
|
44
|
+
cardsTitle: string;
|
|
45
|
+
cardsDescription: string;
|
|
46
|
+
openCard: string;
|
|
47
|
+
selectedCard: string;
|
|
48
|
+
workspaceEyebrow: string;
|
|
49
|
+
noCardTitle: string;
|
|
50
|
+
noCardBody: string;
|
|
51
|
+
areas: Record<SoschainWorkspaceArea, string>;
|
|
52
|
+
overviewTitle: string;
|
|
53
|
+
overviewBody: string;
|
|
54
|
+
healthSummaryTitle: string;
|
|
55
|
+
healthSummaryBody: string;
|
|
56
|
+
emptyHealthSummary: string;
|
|
57
|
+
careJourneyTitle: string;
|
|
58
|
+
careJourneyBody: string;
|
|
59
|
+
emptyCareJourney: string;
|
|
60
|
+
emergencyDataTitle: string;
|
|
61
|
+
emergencyDataBody: string;
|
|
62
|
+
emergencyData: ProtectedIndexEmergencyCopy;
|
|
63
|
+
placesTitle: string;
|
|
64
|
+
placesBody: string;
|
|
65
|
+
productsTitle: string;
|
|
66
|
+
productsBody: string;
|
|
67
|
+
communicationsTitle: string;
|
|
68
|
+
communicationsBody: string;
|
|
69
|
+
addPlace: string;
|
|
70
|
+
addProduct: string;
|
|
71
|
+
emptyPlaces: string;
|
|
72
|
+
emptyProducts: string;
|
|
73
|
+
emptyCommunications: string;
|
|
74
|
+
readOnly: string;
|
|
75
|
+
importCard?: string;
|
|
76
|
+
}>;
|
|
77
|
+
export type SoschainWorkspaceProps = Readonly<{
|
|
78
|
+
copy: SoschainWorkspaceCopy;
|
|
79
|
+
cards: readonly SoschainCardSummary[];
|
|
80
|
+
selectedCard?: SoschainCardSummary;
|
|
81
|
+
activeArea: SoschainWorkspaceArea;
|
|
82
|
+
areaHrefs: Record<SoschainWorkspaceArea, string>;
|
|
83
|
+
places: readonly SoschainAssociationSummary[];
|
|
84
|
+
products: readonly SoschainAssociationSummary[];
|
|
85
|
+
communications: readonly SoschainCommunicationSummary[];
|
|
86
|
+
/** Shared channels/topics screen composed with host-owned BFF adapters. */
|
|
87
|
+
communicationsContent?: ReactNode;
|
|
88
|
+
/** Host-authorized IPS/clinical projection, normally `IpsBundleSummary`. */
|
|
89
|
+
healthSummary?: ReactNode;
|
|
90
|
+
/** False only when the host has already resolved a current write capability. */
|
|
91
|
+
clinicalReadOnly?: boolean;
|
|
92
|
+
careJourneyContent?: ReactNode;
|
|
93
|
+
careJourney?: readonly SoschainCareJourneyEntry[];
|
|
94
|
+
emergencyData?: readonly ProtectedIndexEmergencyItem[];
|
|
95
|
+
canManageAssociations: boolean;
|
|
96
|
+
addPlaceHref?: string;
|
|
97
|
+
addProductHref?: string;
|
|
98
|
+
importCardHref?: string;
|
|
99
|
+
/** Host-composed primary workflows for the selected subject overview. */
|
|
100
|
+
overviewContent?: ReactNode;
|
|
101
|
+
/** Areas kept visible; remaining areas move into the accessible More menu. */
|
|
102
|
+
primaryAreas?: readonly SoschainWorkspaceArea[];
|
|
103
|
+
/** Host-authorized areas. Omitted areas are not rendered or linked. */
|
|
104
|
+
availableAreas?: readonly SoschainWorkspaceArea[];
|
|
105
|
+
moreLabel?: string;
|
|
106
|
+
/** Raw provider identifiers are hidden by SOSChain portals by default. */
|
|
107
|
+
showCardIdentifier?: boolean;
|
|
108
|
+
/** Selects a card in host-owned state without exposing its identifier in a URL. */
|
|
109
|
+
onSelectCard?: (identifier: string) => void;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Shared subject-first SOSChain workspace for personal and professional apps.
|
|
113
|
+
*
|
|
114
|
+
* The host supplies already-authorized cards, associations, capabilities and
|
|
115
|
+
* communications. This presentational component never derives authority from
|
|
116
|
+
* a selected role, card, tab or browser-controlled value.
|
|
117
|
+
*/
|
|
118
|
+
export declare function SoschainWorkspace({ copy, cards, selectedCard, activeArea, areaHrefs, places, products, communications, communicationsContent, healthSummary, clinicalReadOnly, careJourney, careJourneyContent, emergencyData, canManageAssociations, addPlaceHref, addProductHref, importCardHref, overviewContent, primaryAreas, availableAreas, moreLabel, showCardIdentifier, onSelectCard, }: SoschainWorkspaceProps): import("react").JSX.Element;
|
|
119
|
+
//# sourceMappingURL=SoschainWorkspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoschainWorkspace.d.ts","sourceRoot":"","sources":["../../src/care/SoschainWorkspace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,2BAA2B,EAAE,KAAK,2BAA2B,EAAE,MAAM,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EACN,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,gBAAuB,EACvB,WAAgB,EAChB,kBAAkB,EAClB,aAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAiD,EACjD,SAAkB,EAClB,kBAAyB,EACzB,YAAY,GACb,EAAE,sBAAsB,+BAqJxB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ProtectedIndexEmergencyData } from './ProtectedIndexEmergencyData.js';
|
|
3
|
+
export const SOSCHAIN_SUBJECT_WORKSPACE_AREAS = [
|
|
4
|
+
'overview',
|
|
5
|
+
'health-summary',
|
|
6
|
+
'care-journey',
|
|
7
|
+
'emergency-data',
|
|
8
|
+
'communications',
|
|
9
|
+
'places',
|
|
10
|
+
'products',
|
|
11
|
+
];
|
|
12
|
+
function AssociationList({ items, empty }) {
|
|
13
|
+
if (items.length === 0)
|
|
14
|
+
return _jsx("p", { className: "uhcp-sos-empty", children: empty });
|
|
15
|
+
return (_jsx("ul", { className: "uhcp-sos-entity-list", children: items.map((item) => (_jsxs("li", { children: [_jsx("span", { className: "uhcp-sos-kind", children: item.kindLabel }), _jsx("strong", { children: item.name }), _jsx("span", { children: item.detail }), _jsx("small", { children: item.statusLabel })] }, item.identifier))) }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Shared subject-first SOSChain workspace for personal and professional apps.
|
|
19
|
+
*
|
|
20
|
+
* The host supplies already-authorized cards, associations, capabilities and
|
|
21
|
+
* communications. This presentational component never derives authority from
|
|
22
|
+
* a selected role, card, tab or browser-controlled value.
|
|
23
|
+
*/
|
|
24
|
+
export function SoschainWorkspace({ copy, cards, selectedCard, activeArea, areaHrefs, places, products, communications, communicationsContent, healthSummary, clinicalReadOnly = true, careJourney = [], careJourneyContent, emergencyData = [], canManageAssociations, addPlaceHref, addProductHref, importCardHref, overviewContent, primaryAreas, availableAreas = SOSCHAIN_SUBJECT_WORKSPACE_AREAS, moreLabel = 'More', showCardIdentifier = true, onSelectCard, }) {
|
|
25
|
+
if (!selectedCard) {
|
|
26
|
+
return (_jsxs("section", { className: "uhcp-sos-wrap", "aria-labelledby": "sos-card-picker-title", children: [_jsxs("header", { className: "uhcp-sos-heading", children: [_jsx("span", { children: copy.workspaceEyebrow }), _jsx("h1", { id: "sos-card-picker-title", children: copy.cardsTitle }), _jsx("p", { children: copy.cardsDescription }), importCardHref && copy.importCard ? _jsxs("a", { href: importCardHref, children: [copy.importCard, " \u2192"] }) : null] }), cards.length === 0 ? (_jsxs("div", { className: "uhcp-sos-empty-panel", children: [_jsx("h2", { children: copy.noCardTitle }), _jsx("p", { children: copy.noCardBody })] })) : (_jsx("ul", { className: "uhcp-sos-card-grid", children: cards.map((card) => (_jsx("li", { children: onSelectCard ? _jsxs("button", { type: "button", onClick: () => onSelectCard(card.identifier), children: [_jsx("span", { children: card.kindLabel }), _jsx("strong", { children: card.displayName }), showCardIdentifier ? _jsx("small", { children: card.identifier }) : null, _jsxs("b", { children: [copy.openCard, " \u2192"] })] }) : _jsxs("a", { href: card.openHref, children: [_jsx("span", { children: card.kindLabel }), _jsx("strong", { children: card.displayName }), showCardIdentifier ? _jsx("small", { children: card.identifier }) : null, _jsxs("b", { children: [copy.openCard, " \u2192"] })] }) }, card.identifier))) }))] }));
|
|
27
|
+
}
|
|
28
|
+
const resolvedActiveArea = availableAreas.includes(activeArea) ? activeArea : availableAreas[0] ?? 'overview';
|
|
29
|
+
const visiblePrimaryAreas = (primaryAreas ?? availableAreas).filter(area => availableAreas.includes(area));
|
|
30
|
+
const secondaryAreas = availableAreas.filter(area => !visiblePrimaryAreas.includes(area));
|
|
31
|
+
const title = resolvedActiveArea === 'places'
|
|
32
|
+
? copy.placesTitle
|
|
33
|
+
: resolvedActiveArea === 'products'
|
|
34
|
+
? copy.productsTitle
|
|
35
|
+
: resolvedActiveArea === 'communications'
|
|
36
|
+
? copy.communicationsTitle
|
|
37
|
+
: resolvedActiveArea === 'health-summary'
|
|
38
|
+
? copy.healthSummaryTitle
|
|
39
|
+
: resolvedActiveArea === 'care-journey'
|
|
40
|
+
? copy.careJourneyTitle
|
|
41
|
+
: resolvedActiveArea === 'emergency-data'
|
|
42
|
+
? copy.emergencyDataTitle
|
|
43
|
+
: copy.overviewTitle;
|
|
44
|
+
const body = resolvedActiveArea === 'places'
|
|
45
|
+
? copy.placesBody
|
|
46
|
+
: resolvedActiveArea === 'products'
|
|
47
|
+
? copy.productsBody
|
|
48
|
+
: resolvedActiveArea === 'communications'
|
|
49
|
+
? copy.communicationsBody
|
|
50
|
+
: resolvedActiveArea === 'health-summary'
|
|
51
|
+
? copy.healthSummaryBody
|
|
52
|
+
: resolvedActiveArea === 'care-journey'
|
|
53
|
+
? copy.careJourneyBody
|
|
54
|
+
: resolvedActiveArea === 'emergency-data'
|
|
55
|
+
? copy.emergencyDataBody
|
|
56
|
+
: copy.overviewBody;
|
|
57
|
+
const clinicalAreaIsReadOnly = resolvedActiveArea === 'care-journey' || (resolvedActiveArea === 'health-summary' && clinicalReadOnly);
|
|
58
|
+
const associationAreaIsReadOnly = !canManageAssociations && (resolvedActiveArea === 'overview' || resolvedActiveArea === 'places' || resolvedActiveArea === 'products');
|
|
59
|
+
return (_jsxs("section", { className: "uhcp-sos-wrap", children: [_jsxs("header", { className: "uhcp-sos-heading", children: [_jsx("span", { children: copy.selectedCard }), _jsx("h1", { children: selectedCard.displayName }), _jsxs("p", { children: [selectedCard.kindLabel, showCardIdentifier ? ` · ${selectedCard.identifier}` : ''] })] }), _jsxs("nav", { className: "uhcp-sos-tabs", "aria-label": copy.workspaceEyebrow, children: [visiblePrimaryAreas.map((area) => (_jsx("a", { href: areaHrefs[area], "aria-current": resolvedActiveArea === area ? 'page' : undefined, children: copy.areas[area] }, area))), secondaryAreas.length ? _jsxs("details", { className: "uhcp-sos-more", children: [_jsx("summary", { children: moreLabel }), _jsx("div", { children: secondaryAreas.map((area) => (_jsx("a", { href: areaHrefs[area], "aria-current": resolvedActiveArea === area ? 'page' : undefined, children: copy.areas[area] }, area))) })] }) : null] }), _jsxs("div", { className: "uhcp-sos-panel", children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("h2", { children: title }), _jsx("p", { children: body })] }), (clinicalAreaIsReadOnly || associationAreaIsReadOnly) && (_jsx("span", { className: "uhcp-sos-readonly", children: copy.readOnly })), canManageAssociations && resolvedActiveArea === 'places' && addPlaceHref && _jsx("a", { href: addPlaceHref, children: copy.addPlace }), canManageAssociations && resolvedActiveArea === 'products' && addProductHref && _jsx("a", { href: addProductHref, children: copy.addProduct })] }), resolvedActiveArea === 'overview' && (overviewContent ?? (_jsxs("div", { className: "uhcp-sos-overview-grid", children: [availableAreas.includes('places') ? _jsxs("article", { children: [_jsx("strong", { children: places.length }), _jsx("span", { children: copy.areas.places })] }) : null, availableAreas.includes('products') ? _jsxs("article", { children: [_jsx("strong", { children: products.length }), _jsx("span", { children: copy.areas.products })] }) : null, availableAreas.includes('communications') ? _jsxs("article", { children: [_jsx("strong", { children: communications.length }), _jsx("span", { children: copy.areas.communications })] }) : null, availableAreas.includes('care-journey') ? _jsxs("article", { children: [_jsx("strong", { children: careJourney.length }), _jsx("span", { children: copy.areas['care-journey'] })] }) : null] }))), resolvedActiveArea === 'health-summary' && (healthSummary ?? _jsx("p", { className: "uhcp-sos-empty", children: copy.emptyHealthSummary })), resolvedActiveArea === 'care-journey' && (careJourneyContent ?? (careJourney.length === 0 ? _jsx("p", { className: "uhcp-sos-empty", children: copy.emptyCareJourney }) : (_jsx("ol", { className: "uhcp-sos-timeline uhcp-sos-care-journey", children: careJourney.map((encounter) => (_jsxs("li", { children: [_jsxs("div", { children: [_jsx("span", { children: encounter.statusLabel }), _jsx("time", { dateTime: encounter.periodStart, children: encounter.periodStart })] }), _jsx("strong", { children: encounter.serviceLabel }), encounter.detail ? _jsx("p", { children: encounter.detail }) : null, encounter.locationLabel || encounter.periodEnd ? _jsx("small", { children: [encounter.locationLabel, encounter.periodEnd].filter(Boolean).join(' · ') }) : null] }, encounter.identifier))) })))), resolvedActiveArea === 'emergency-data' && _jsx(ProtectedIndexEmergencyData, { copy: copy.emergencyData, items: emergencyData }), resolvedActiveArea === 'places' && _jsx(AssociationList, { items: places, empty: copy.emptyPlaces }), resolvedActiveArea === 'products' && _jsx(AssociationList, { items: products, empty: copy.emptyProducts }), resolvedActiveArea === 'communications' && (communicationsContent ?? (communications.length === 0 ? _jsx("p", { className: "uhcp-sos-empty", children: copy.emptyCommunications }) : (_jsx("ol", { className: "uhcp-sos-timeline", children: communications.map((message) => (_jsxs("li", { children: [_jsxs("div", { children: [_jsx("span", { children: message.categoryLabel }), _jsx("time", { children: message.occurredAt })] }), _jsx("strong", { children: message.subject }), _jsx("p", { children: message.body }), _jsxs("small", { children: [message.sender, message.placeLabel ? ` · ${message.placeLabel}` : ''] })] }, message.identifier))) }))))] })] }));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=SoschainWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoschainWorkspace.js","sourceRoot":"","sources":["../../src/care/SoschainWorkspace.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAsE,MAAM,kCAAkC,CAAA;AAGlJ,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,QAAQ;IACR,UAAU;CACF,CAAA;AAoHV,SAAS,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAGrC;IACA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAG,SAAS,EAAC,gBAAgB,YAAE,KAAK,GAAK,CAAA;IACxE,OAAO,CACL,aAAI,SAAS,EAAC,sBAAsB,YACjC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,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KAAK,gBAAgB,IAAI,CAC1C,qBAAqB,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,gBAAgB,YAAE,IAAI,CAAC,mBAAmB,GAAK,CAAC,CAAC,CAAC,CACrH,aAAI,SAAS,EAAC,mBAAmB,YAC9B,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC/B,yBACE,0BAAK,yBAAO,OAAO,CAAC,aAAa,GAAQ,EAAA,yBAAO,OAAO,CAAC,UAAU,GAAQ,IAAM,EAChF,2BAAS,OAAO,CAAC,OAAO,GAAU,EAClC,sBAAI,OAAO,CAAC,IAAI,GAAK,EACrB,4BAAQ,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAS,KAJ9E,OAAO,CAAC,UAAU,CAKtB,CACN,CAAC,GACC,CACN,CAAC,CACH,IACG,IACE,CACX,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type SubjectCommunicationKind = 'message' | 'audio' | 'audio-call' | 'video-call' | 'appointment';
|
|
3
|
+
export type SubjectCommunicationCategory = 'emergency' | 'care' | 'other';
|
|
4
|
+
export type SubjectCommunicationFilter = 'all' | 'messages' | 'calls' | 'emergency';
|
|
5
|
+
export type SubjectCommunicationItem = Readonly<{
|
|
6
|
+
id: string;
|
|
7
|
+
kind: SubjectCommunicationKind;
|
|
8
|
+
category: SubjectCommunicationCategory;
|
|
9
|
+
title: string;
|
|
10
|
+
summary?: string;
|
|
11
|
+
timestamp?: string;
|
|
12
|
+
status?: string;
|
|
13
|
+
action?: ReactNode;
|
|
14
|
+
direction?: 'incoming' | 'outgoing' | 'system';
|
|
15
|
+
senderLabel?: string;
|
|
16
|
+
avatarUrl?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type SubjectCommunicationComposer = Readonly<{
|
|
19
|
+
placeholder: string;
|
|
20
|
+
sendLabel: string;
|
|
21
|
+
attachLabel?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
onSend(text: string): void | Promise<void>;
|
|
24
|
+
onAttach?(): void | Promise<void>;
|
|
25
|
+
}>;
|
|
26
|
+
export type SubjectCommunicationCenterCopy = Readonly<{
|
|
27
|
+
heading(subjectLabel: string): string;
|
|
28
|
+
filters: Readonly<Record<SubjectCommunicationFilter, string>>;
|
|
29
|
+
empty: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `SubjectConversationChat`. Kept only as a source-compatible
|
|
33
|
+
* migration bridge; hosts must not maintain this as a parallel active surface.
|
|
34
|
+
*/
|
|
35
|
+
export declare function SubjectCommunicationCenter({ subjectLabel, items, copy, composer }: Readonly<{
|
|
36
|
+
subjectLabel: string;
|
|
37
|
+
items: readonly SubjectCommunicationItem[];
|
|
38
|
+
copy?: SubjectCommunicationCenterCopy;
|
|
39
|
+
composer?: SubjectCommunicationComposer;
|
|
40
|
+
}>): import("react").JSX.Element;
|
|
41
|
+
/** Reusable message composer; product BFF adapters retain delivery authority. */
|
|
42
|
+
export declare function SubjectCommunicationComposerPanel({ composer }: Readonly<{
|
|
43
|
+
composer: SubjectCommunicationComposer;
|
|
44
|
+
}>): import("react").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=SubjectCommunicationCenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubjectCommunicationCenter.d.ts","sourceRoot":"","sources":["../../src/care/SubjectCommunicationCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,OAAO,CAAA;AAEhE,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAAA;AACxG,MAAM,MAAM,4BAA4B,G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AAK,EAAE,IAAmB,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC;IAC1G,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,SAAS,wBAAwB,EAAE,CAAA;IAC1C,IAAI,CAAC,EAAE,8BAA8B,CAAA;IACrC,QAAQ,CAAC,EAAE,4BAA4B,CAAA;CACxC,CAAC,+BA2BD;AAED,iFAAiF;AACjF,wBAAgB,iCAAiC,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC;IACvE,QAAQ,EAAE,4BAA4B,CAAA;CACvC,CAAC,+BAwBD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useMemo, useState } from 'react';
|
|
3
|
+
const DEFAULT_COPY = {
|
|
4
|
+
heading: subjectLabel => `Communications for ${subjectLabel}`,
|
|
5
|
+
filters: { all: 'All', messages: 'Messages', calls: 'Calls', emergency: 'Emergency' },
|
|
6
|
+
empty: 'There are no communications in this view.',
|
|
7
|
+
};
|
|
8
|
+
const FILTERS = ['all', 'messages', 'calls', 'emergency'];
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `SubjectConversationChat`. Kept only as a source-compatible
|
|
11
|
+
* migration bridge; hosts must not maintain this as a parallel active surface.
|
|
12
|
+
*/
|
|
13
|
+
export function SubjectCommunicationCenter({ subjectLabel, items, copy = DEFAULT_COPY, composer }) {
|
|
14
|
+
const [filter, setFilter] = useState('all');
|
|
15
|
+
const visibleItems = useMemo(() => items.filter(item => matchesFilter(item, filter)), [filter, items]);
|
|
16
|
+
return _jsxs("section", { className: "subject-communication-center", "aria-labelledby": "subject-communication-center-title", children: [_jsx("h2", { id: "subject-communication-center-title", children: copy.heading(subjectLabel) }), _jsx("div", { className: "subject-communication-filters", "aria-label": copy.heading(subjectLabel), children: FILTERS.map(value => _jsx("button", { type: "button", "aria-pressed": filter === value, onClick: () => setFilter(value), children: copy.filters[value] }, value)) }), visibleItems.length === 0 ? _jsx("p", { className: "subject-communication-empty", children: copy.empty }) : _jsx("ol", { className: "subject-communication-list", role: "log", children: visibleItems.map(item => _jsxs("li", { "data-kind": item.kind, "data-category": item.category, "data-direction": item.direction || 'system', children: [item.avatarUrl ? _jsx("img", { className: "subject-communication-avatar", src: item.avatarUrl, alt: item.senderLabel || item.title }) : null, _jsxs("div", { className: "subject-communication-bubble", children: [item.senderLabel ? _jsx("span", { className: "subject-communication-sender", children: item.senderLabel }) : null, _jsx("strong", { children: item.title }), item.summary ? _jsx("p", { children: item.summary }) : null] }), _jsxs("div", { className: "subject-communication-meta", children: [item.timestamp ? _jsx("time", { dateTime: item.timestamp, children: item.timestamp }) : null, item.status ? _jsx("span", { children: item.status }) : null, item.action] })] }, item.id)) }), composer ? _jsx(SubjectCommunicationComposerPanel, { composer: composer }) : null] });
|
|
17
|
+
}
|
|
18
|
+
/** Reusable message composer; product BFF adapters retain delivery authority. */
|
|
19
|
+
export function SubjectCommunicationComposerPanel({ composer }) {
|
|
20
|
+
const inputId = useId();
|
|
21
|
+
const [draft, setDraft] = useState('');
|
|
22
|
+
return _jsxs("form", { className: "subject-communication-composer", onSubmit: event => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
const text = draft.trim();
|
|
25
|
+
if (!text || composer.disabled)
|
|
26
|
+
return;
|
|
27
|
+
void composer.onSend(text);
|
|
28
|
+
setDraft('');
|
|
29
|
+
}, children: [_jsx("label", { className: "subject-communication-composer-label", htmlFor: inputId, children: composer.placeholder }), _jsx("textarea", { id: inputId, "aria-label": composer.placeholder, placeholder: composer.placeholder, value: draft, disabled: composer.disabled, onChange: event => setDraft(event.target.value) }), _jsxs("div", { className: "subject-communication-composer-actions", children: [composer.onAttach && composer.attachLabel ? _jsx("button", { type: "button", disabled: composer.disabled, onClick: () => void composer.onAttach?.(), children: composer.attachLabel }) : null, _jsx("button", { type: "submit", disabled: composer.disabled || !draft.trim(), children: composer.sendLabel })] })] });
|
|
30
|
+
}
|
|
31
|
+
function matchesFilter(item, filter) {
|
|
32
|
+
if (filter === 'all')
|
|
33
|
+
return true;
|
|
34
|
+
if (filter === 'emergency')
|
|
35
|
+
return item.category === 'emergency';
|
|
36
|
+
if (filter === 'calls')
|
|
37
|
+
return item.kind === 'audio-call' || item.kind === 'video-call';
|
|
38
|
+
return item.kind === 'message' || item.kind === 'audio' || item.kind === 'appointment';
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=SubjectCommunicationCenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubjectCommunicationCenter.js","sourceRoot":"","sources":["../../src/care/SubjectCommunicationCenter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAmChE,MAAM,YAAY,GAAmC;IACnD,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,sBAAsB,YAAY,EAAE;IAC7D,OAAO,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE;IACrF,KAAK,EAAE,2CAA2C;CACnD,CAAA;AAED,MAAM,OAAO,GAA0C,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;AAEhG;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,GAAG,YAAY,EAAE,QAAQ,EAK7F;IACA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA6B,KAAK,CAAC,CAAA;IACvE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;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raceOptions?: readonly SubjectDemographicsOption[];
|
|
8
|
+
ethnicityOptions?: readonly SubjectDemographicsOption[];
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
subjectKind: 'animal';
|
|
11
|
+
speciesOptions: readonly SubjectDemographicsOption[];
|
|
12
|
+
breedOptions: readonly SubjectDemographicsOption[];
|
|
13
|
+
}>;
|
|
14
|
+
export type SubjectDemographicsCopy = Readonly<{
|
|
15
|
+
race?: string;
|
|
16
|
+
ethnicity?: string;
|
|
17
|
+
addRace?: string;
|
|
18
|
+
addEthnicity?: string;
|
|
19
|
+
species?: string;
|
|
20
|
+
breed?: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Shared presentation slot for human or animal demographics.
|
|
24
|
+
*
|
|
25
|
+
* Profiles preserve different field names and option catalogues so visual
|
|
26
|
+
* reuse can never turn race into species or ethnicity into breed. Hosts map
|
|
27
|
+
* the submitted fields to their own canonical persistence adapters.
|
|
28
|
+
*/
|
|
29
|
+
export declare function SubjectDemographicsFields({ mode, profile, copy, values, onValuesChange, }: Readonly<{
|
|
30
|
+
mode: 'edit' | 'read';
|
|
31
|
+
profile: SubjectDemographicsProfile;
|
|
32
|
+
copy: SubjectDemographicsCopy;
|
|
33
|
+
values?: Readonly<{
|
|
34
|
+
primary?: string;
|
|
35
|
+
secondary?: string;
|
|
36
|
+
}>;
|
|
37
|
+
onValuesChange?: (values: Readonly<{
|
|
38
|
+
primary?: string;
|
|
39
|
+
secondary?: string;
|
|
40
|
+
}>) => void;
|
|
41
|
+
}>): import("react").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=SubjectDemographicsFields.d.ts.map
|