@alfadocs/ui-kit 1.3.13 → 1.4.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/dist/_chunks/agenda-card.agent-Cb5tuEh3.js +28 -0
- package/dist/_chunks/{alia-sidebar-DzNz1gDf.js → alia-sidebar-DSBZMick.js} +3 -3
- package/dist/_chunks/{anamnesis-i18n-CfC0qYzy.js → anamnesis-i18n-BA631X4t.js} +2209 -2144
- package/dist/_chunks/{antenatal-schedule-timeline-BMMpi2lb.js → antenatal-schedule-timeline-u8TsS2QJ.js} +27 -26
- package/dist/_chunks/{appointment-timeline-B630OT_J.js → appointment-timeline-Bqf1sTU5.js} +2 -2
- package/dist/_chunks/{ar-THMLfSoN.js → ar-BR1FGFP2.js} +14 -14
- package/dist/_chunks/{bmi-calculator-CM0-G2mg.js → bmi-calculator-CpyY13MV.js} +2 -2
- package/dist/_chunks/{booking-DjNbd7C1.js → booking-BjsA7j1-.js} +699 -688
- package/dist/_chunks/calculator-dialog-12d3Sxaz.js +48 -0
- package/dist/_chunks/{care-plan-card-1G_f4I5s.js → care-plan-card-BvQy366X.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-DmBsffHS.js → care-plan-entry-card-apk_5B3O.js} +2 -2
- package/dist/_chunks/{chat-container-HlFnoEIl.js → chat-container-CYYego1W.js} +105 -81
- package/dist/_chunks/cycle-calculator-B7fyH-h4.js +425 -0
- package/dist/_chunks/{date-picker-ZHejTVAJ.js → date-picker-Bp64zk2p.js} +19 -19
- package/dist/_chunks/date-picker-variants-pKAJfnWr.js +2089 -0
- package/dist/_chunks/{date-range-picker-pEG3Ln3i.js → date-range-picker-CDrZ8Zh0.js} +27 -27
- package/dist/_chunks/{date-time-picker-695QvBGj.js → date-time-picker-DafkGDGO.js} +10 -10
- package/dist/_chunks/{de-DmZ-8rTN.js → de-3iM4rGqo.js} +7 -7
- package/dist/_chunks/{document-preview-D3gg4MXB.js → document-preview-DOrsqiN1.js} +2 -2
- package/dist/_chunks/due-date-calculator-CnkbbAej.js +571 -0
- package/dist/_chunks/{editor-overlay-DE3esyio.js → editor-overlay-B1tr2i7B.js} +22 -21
- package/dist/_chunks/{el-Bela9mxs.js → el-C96rGJvU.js} +2 -2
- package/dist/_chunks/{es-BNncHKex.js → es-Cxiqjx8r.js} +12 -12
- package/dist/_chunks/fetal-weight-avlj-l-S.js +223 -0
- package/dist/_chunks/format-4HNwNGrN.js +1315 -0
- package/dist/_chunks/{fr-CH8ADfhN.js → fr-Bhr6SYKj.js} +21 -21
- package/dist/_chunks/{freemium-paywall-C_Ue6wxU.js → freemium-paywall-DRDdWuOg.js} +3 -3
- package/dist/_chunks/gestational-age-calculator-BljY_DVJ.js +488 -0
- package/dist/_chunks/hcg-doubling-Cv_vH61p.js +312 -0
- package/dist/_chunks/header-settings-Cn5fPXCE.js +335 -0
- package/dist/_chunks/{hi-Bppfxp8l.js → hi-BxXX26d_.js} +12 -12
- package/dist/_chunks/isSameWeek-B73MagWB.js +13 -0
- package/dist/_chunks/{it-B4ySaRyK.js → it-Xmjomvyj.js} +24 -24
- package/dist/_chunks/{ja-CGF6Io9P.js → ja-mfZvt1ZV.js} +16 -16
- package/dist/_chunks/{link-cell-renderer-C5XLwVXQ.js → link-cell-renderer-CJ_gk7gl.js} +3 -3
- package/dist/_chunks/{locale-picker-BfBUdT1m.js → locale-picker-D9Kv2zrK.js} +153 -132
- package/dist/_chunks/map-view-2yZCQW2l.js +445 -0
- package/dist/_chunks/{marketplace-app-shell-DwcFMxzp.js → marketplace-app-shell-BLRvg-M0.js} +49 -40
- package/dist/_chunks/{nl-DuShqwuV.js → nl-DDs-KEnD.js} +15 -15
- package/dist/_chunks/{notes-panel-DPsgB4Mv.js → notes-panel-CiFN3sLW.js} +2 -2
- package/dist/_chunks/{number-input-DrozbZAU.js → number-input-DOe5VYei.js} +64 -64
- package/dist/_chunks/{optical-prescription-BDHJr8Zz.js → optical-prescription-CRemE8fL.js} +2 -2
- package/dist/_chunks/{parse-DvA97ro9.js → parse-JqixfsU0.js} +43 -43
- package/dist/_chunks/parseISO-fOGpHKXm.js +120 -0
- package/dist/_chunks/{patient-details-DqjjwPmt.js → patient-details-CpunD0qx.js} +3 -3
- package/dist/_chunks/{patient-table-BmIDrLIS.js → patient-table-2eWx-Rrk.js} +2 -2
- package/dist/_chunks/{payment-form-h-BZ8onk.js → payment-form-Ds1I9KqB.js} +308 -231
- package/dist/_chunks/{pdf-viewer-Ddx-T053.js → pdf-viewer-DUIsV9s5.js} +429 -369
- package/dist/_chunks/{pl-CKQwX9Fk.js → pl-BYYMnEWP.js} +18 -18
- package/dist/_chunks/{practice-results-B-HPc13W.js → practice-results-SjCniMd2.js} +2 -2
- package/dist/_chunks/pregnancy-dating-BmpHScZ0.js +770 -0
- package/dist/_chunks/pregnancy-weight-gain-B5KSJzdc.js +553 -0
- package/dist/_chunks/progress-CK8otcQ-.js +343 -0
- package/dist/_chunks/{pt-_njpXyOZ.js → pt-BSPnVrQ7.js} +20 -20
- package/dist/_chunks/{radiograph-panel.agent-BQZ64Riy.js → radiograph-panel.agent-CtFtNMzk.js} +3 -3
- package/dist/_chunks/{rich-text-editor-CfeXPPWs.js → rich-text-editor-BedTpWzL.js} +2 -2
- package/dist/_chunks/{ro-3X6_4FcN.js → ro-BbiylGmG.js} +14 -14
- package/dist/_chunks/{ru-bAcgmnS-.js → ru-BX_qsV67.js} +14 -14
- package/dist/_chunks/{session-countdown-Bc70VXN1.js → session-countdown-BL-Psg8u.js} +2 -2
- package/dist/_chunks/{sign-document-CW_ByDUh.js → sign-document-jF4fZDJ5.js} +2 -2
- package/dist/_chunks/slot-grid-DNiUcXy2.js +640 -0
- package/dist/_chunks/{sparkline-BTY4B5tv.js → sparkline-BmGcEyZO.js} +209 -164
- package/dist/_chunks/{sq-jYFqr4Ga.js → sq-i9UOk4P7.js} +10 -10
- package/dist/_chunks/subDays-CAUv47M1.js +8 -0
- package/dist/_chunks/{sv-BSGEJ-8B.js → sv-CpTdtmDQ.js} +8 -8
- package/dist/_chunks/{tab-bar-Axhk6xzx.js → tab-bar-BYESZINM.js} +83 -77
- package/dist/_chunks/task-card.agent-CF2N_uu4.js +29 -0
- package/dist/_chunks/{tr-CTpgUtw6.js → tr-DXG2QN1K.js} +17 -17
- package/dist/_chunks/{unit-converter-COgkN7YP.js → unit-converter-CHPDuV7W.js} +2 -2
- package/dist/_chunks/{warning-stack-BtjmJChC.js → warning-stack-B7t_8jRE.js} +42 -37
- package/dist/_chunks/{zh-CN-BgM0Io2O.js → zh-CN-vPkPEK6H.js} +18 -18
- package/dist/agent-catalog.json +6426 -3382
- package/dist/agent-i18n/en.json +234 -15
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/chat-container/chat-container.d.ts +14 -0
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.agent.d.ts +4 -0
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +42 -0
- package/dist/components/cycle-calculator/index.d.ts +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.agent.d.ts +4 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +61 -1
- package/dist/components/due-date-calculator/index.d.ts +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/editor-overlay/editor-overlay.d.ts +7 -1
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/fetal-weight/fetal-weight.agent.d.ts +4 -0
- package/dist/components/fetal-weight/fetal-weight.d.ts +26 -0
- package/dist/components/fetal-weight/index.d.ts +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.agent.d.ts +4 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +44 -2
- package/dist/components/gestational-age-calculator/index.d.ts +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/hcg-doubling.agent.d.ts +4 -0
- package/dist/components/hcg-doubling/hcg-doubling.d.ts +30 -0
- package/dist/components/hcg-doubling/index.d.ts +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header-settings/header-settings.d.ts +13 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/locale-picker/locale-picker.d.ts +9 -0
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +22 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/number-input.d.ts +2 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-form/index.d.ts +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/payment-form/payment-form.d.ts +32 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +13 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.d.ts +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-dating/pregnancy-dating.agent.d.ts +4 -0
- package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +65 -1
- package/dist/components/pregnancy-weight-gain/index.d.ts +2 -1
- package/dist/components/pregnancy-weight-gain/index.js +6 -5
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.agent.d.ts +4 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +35 -0
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/progress.d.ts +13 -0
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/slot-grid/index.d.ts +2 -1
- package/dist/components/slot-grid/index.js +5 -4
- package/dist/components/slot-grid/slot-grid.agent.d.ts +4 -0
- package/dist/components/slot-grid/slot-grid.d.ts +34 -0
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.d.ts +10 -0
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts +13 -0
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/index.js +630 -627
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts +27 -8
- package/dist/patterns/anamnesis/anamnesis-format.d.ts +11 -3
- package/dist/patterns/anamnesis/anamnesis-highlight.d.ts +6 -0
- package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts +23 -9
- package/dist/patterns/anamnesis/anamnesis-types.d.ts +7 -0
- package/dist/patterns/anamnesis/anamnesis.d.ts +16 -7
- package/dist/patterns/anamnesis/index.d.ts +3 -2
- package/dist/patterns/anamnesis/index.js +7 -6
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +6 -0
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/agenda-card.agent-mTCrkKSZ.js +0 -27
- package/dist/_chunks/calculator-dialog-DuXMQSdm.js +0 -40
- package/dist/_chunks/cycle-calculator-BwqYVPB4.js +0 -252
- package/dist/_chunks/date-picker-variants-eL6HjWvw.js +0 -3363
- package/dist/_chunks/due-date-calculator-CwfsFd3T.js +0 -256
- package/dist/_chunks/fetal-weight-ePlLjJPc.js +0 -122
- package/dist/_chunks/gestational-age-calculator-DdgbH69Z.js +0 -311
- package/dist/_chunks/hcg-doubling-BBqD2wI2.js +0 -170
- package/dist/_chunks/header-settings--pjYOe6g.js +0 -284
- package/dist/_chunks/isSameDay-DUEiAT0G.js +0 -39
- package/dist/_chunks/isSameWeek-CK4HS9lH.js +0 -14
- package/dist/_chunks/map-view-CsaHfoo6.js +0 -378
- package/dist/_chunks/pregnancy-dating-DzYTlBkT.js +0 -421
- package/dist/_chunks/pregnancy-weight-gain-O6J0sUIi.js +0 -322
- package/dist/_chunks/progress-DA413-zn.js +0 -299
- package/dist/_chunks/slot-grid-CQSULZjd.js +0 -502
- package/dist/_chunks/subDays-BcNi04uf.js +0 -8
- package/dist/_chunks/task-card.agent-Bt14CzUd.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as d, h as o, j as r, k as s } from "./format-4HNwNGrN.js";
|
|
2
2
|
const m = {
|
|
3
3
|
lessThanXSeconds: {
|
|
4
4
|
one: "menos de un segundo",
|
|
@@ -189,7 +189,7 @@ const m = {
|
|
|
189
189
|
evening: "tarde",
|
|
190
190
|
night: "noche"
|
|
191
191
|
}
|
|
192
|
-
},
|
|
192
|
+
}, j = {
|
|
193
193
|
narrow: {
|
|
194
194
|
am: "a",
|
|
195
195
|
pm: "p",
|
|
@@ -220,8 +220,8 @@ const m = {
|
|
|
220
220
|
evening: "de la tarde",
|
|
221
221
|
night: "de la noche"
|
|
222
222
|
}
|
|
223
|
-
},
|
|
224
|
-
ordinalNumber:
|
|
223
|
+
}, W = (e, n) => Number(e) + "º", D = {
|
|
224
|
+
ordinalNumber: W,
|
|
225
225
|
era: o({
|
|
226
226
|
values: v,
|
|
227
227
|
defaultWidth: "wide"
|
|
@@ -242,7 +242,7 @@ const m = {
|
|
|
242
242
|
dayPeriod: o({
|
|
243
243
|
values: M,
|
|
244
244
|
defaultWidth: "wide",
|
|
245
|
-
formattingValues:
|
|
245
|
+
formattingValues: j,
|
|
246
246
|
defaultFormattingWidth: "wide"
|
|
247
247
|
})
|
|
248
248
|
}, k = /^(\d+)(º)?/i, x = /\d+/i, H = {
|
|
@@ -299,13 +299,13 @@ const m = {
|
|
|
299
299
|
short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
|
|
300
300
|
abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
|
|
301
301
|
wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
|
|
302
|
-
},
|
|
302
|
+
}, L = {
|
|
303
303
|
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
304
304
|
any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
|
|
305
|
-
},
|
|
305
|
+
}, N = {
|
|
306
306
|
narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
|
|
307
307
|
any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
|
|
308
|
-
},
|
|
308
|
+
}, E = {
|
|
309
309
|
any: {
|
|
310
310
|
am: /^a/i,
|
|
311
311
|
pm: /^p/i,
|
|
@@ -346,13 +346,13 @@ const m = {
|
|
|
346
346
|
day: r({
|
|
347
347
|
matchPatterns: X,
|
|
348
348
|
defaultMatchWidth: "wide",
|
|
349
|
-
parsePatterns:
|
|
349
|
+
parsePatterns: L,
|
|
350
350
|
defaultParseWidth: "any"
|
|
351
351
|
}),
|
|
352
352
|
dayPeriod: r({
|
|
353
|
-
matchPatterns:
|
|
353
|
+
matchPatterns: N,
|
|
354
354
|
defaultMatchWidth: "any",
|
|
355
|
-
parsePatterns:
|
|
355
|
+
parsePatterns: E,
|
|
356
356
|
defaultParseWidth: "any"
|
|
357
357
|
})
|
|
358
358
|
}, R = {
|
|
@@ -370,4 +370,4 @@ const m = {
|
|
|
370
370
|
export {
|
|
371
371
|
R as es
|
|
372
372
|
};
|
|
373
|
-
//# sourceMappingURL=es-
|
|
373
|
+
//# sourceMappingURL=es-Cxiqjx8r.js.map
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { jsxs as p, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useState as y, useMemo as N, useEffect as E, useRef as O } from "react";
|
|
3
|
+
import { c as P } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as V } from "react-i18next";
|
|
5
|
+
import { u as _ } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { F as D } from "./form-field-M5UpX65Z.js";
|
|
7
|
+
import { N as q } from "./number-input-DOe5VYei.js";
|
|
8
|
+
import { C } from "./card-DPmk26CL.js";
|
|
9
|
+
import { B as z } from "./badge-DCOqV9mI.js";
|
|
10
|
+
import { I as G } from "./insert-result-D074GtHX.js";
|
|
11
|
+
const v = (e) => ({
|
|
12
|
+
oneOf: [{ type: "number", exclusiveMinimum: 0 }, { type: "null" }],
|
|
13
|
+
description: `${e} in millimetres, or null to clear it.`
|
|
14
|
+
}), J = {
|
|
15
|
+
id: "fetal-weight",
|
|
16
|
+
// set_value → the `set_biometry` action + the `biometry` state slot.
|
|
17
|
+
capabilities: ["set_value"],
|
|
18
|
+
state: {
|
|
19
|
+
biometry: {
|
|
20
|
+
type: "{ bpdMm: number | null, hcMm: number | null, acMm: number | null, flMm: number | null }",
|
|
21
|
+
descriptionKey: "ui.agent.fetalWeight.state.biometry",
|
|
22
|
+
description: "The four ultrasound measurements as entered, in millimetres — biparietal diameter, head circumference, abdominal circumference and femur length. Null where unset. Read this to see why a result is still null.",
|
|
23
|
+
read: (e) => e.getBiometry()
|
|
24
|
+
},
|
|
25
|
+
result: {
|
|
26
|
+
type: "{ grams: number, method: 'hadlock4' | 'hadlock1' } | null",
|
|
27
|
+
descriptionKey: "ui.agent.fetalWeight.state.result",
|
|
28
|
+
description: "Estimated fetal weight in grams and which Hadlock regression produced it — `hadlock4` when all four measurements are present, `hadlock1` from AC + FL alone. Null until AC and FL are both set.",
|
|
29
|
+
read: (e) => e.getResult()
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
actions: {
|
|
33
|
+
set_biometry: {
|
|
34
|
+
// Drives the same local input state a user types into; nothing is
|
|
35
|
+
// persisted to a record, and every value is reversible in the same UI.
|
|
36
|
+
safety: "write",
|
|
37
|
+
argsType: "{ bpdMm?: number | null, hcMm?: number | null, acMm?: number | null, flMm?: number | null }",
|
|
38
|
+
argsSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
bpdMm: v("Biparietal diameter"),
|
|
42
|
+
hcMm: v("Head circumference"),
|
|
43
|
+
acMm: v("Abdominal circumference"),
|
|
44
|
+
flMm: v("Femur length")
|
|
45
|
+
},
|
|
46
|
+
additionalProperties: !1
|
|
47
|
+
},
|
|
48
|
+
idempotent: !0,
|
|
49
|
+
returns: "boolean",
|
|
50
|
+
returnsSchema: {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
description: "True when the measurements were applied."
|
|
53
|
+
},
|
|
54
|
+
errors: [
|
|
55
|
+
"Returns false and writes nothing when any supplied measurement is not a positive number — the payload applies all-or-nothing."
|
|
56
|
+
],
|
|
57
|
+
examples: [
|
|
58
|
+
{
|
|
59
|
+
args: { bpdMm: 85, hcMm: 310, acMm: 300, flMm: 62 },
|
|
60
|
+
note: "Full biometry around 32 weeks → the Hadlock 4-parameter estimate."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
args: { acMm: 300, flMm: 62 },
|
|
64
|
+
note: "AC + FL only — the minimum for an estimate, via Hadlock 1."
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
descriptionKey: "ui.agent.fetalWeight.actions.setBiometry",
|
|
68
|
+
description: "Set any subset of the ultrasound biometry in millimetres. Omitted measurements are left unchanged; an explicit null clears one. AC and FL are the minimum for an estimate.",
|
|
69
|
+
invoke: (e, s) => e.setBiometry(s)
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
domHooks: {
|
|
73
|
+
root: {
|
|
74
|
+
attr: "data-component",
|
|
75
|
+
value: "fetal-weight",
|
|
76
|
+
description: "Marks the FetalWeight calculator (estimated fetal weight from ultrasound biometry)."
|
|
77
|
+
},
|
|
78
|
+
instanceId: {
|
|
79
|
+
attr: "data-component-id",
|
|
80
|
+
sourceProp: "id",
|
|
81
|
+
description: "Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven action/state are unreachable."
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
function w(e) {
|
|
86
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e / 10 : null;
|
|
87
|
+
}
|
|
88
|
+
function Q(e) {
|
|
89
|
+
const s = w(e.bpdMm), d = w(e.hcMm), r = w(e.acMm), n = w(e.flMm);
|
|
90
|
+
if (r === null || n === null) return null;
|
|
91
|
+
let c, m;
|
|
92
|
+
return s !== null && d !== null ? (c = 1.3596 - 386e-5 * r * n + 64e-4 * d + 61e-5 * s * r + 0.0424 * r + 0.174 * n, m = "hadlock4") : (c = 1.304 + 0.05281 * r + 0.1938 * n - 4e-3 * r * n, m = "hadlock1"), { grams: Math.round(10 ** c), method: m };
|
|
93
|
+
}
|
|
94
|
+
const U = P("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
95
|
+
variants: {
|
|
96
|
+
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: { width: "full" }
|
|
99
|
+
}), X = (e) => e == null || Number.isFinite(e) && e > 0, Y = R(
|
|
100
|
+
({
|
|
101
|
+
onResultChange: e,
|
|
102
|
+
onInsert: s,
|
|
103
|
+
insertVariant: d = "insert",
|
|
104
|
+
onCopy: r,
|
|
105
|
+
onError: n,
|
|
106
|
+
insertBrand: c,
|
|
107
|
+
id: m,
|
|
108
|
+
width: H,
|
|
109
|
+
className: $
|
|
110
|
+
}, T) => {
|
|
111
|
+
const { t, i18n: F } = V(), [u, k] = y(null), [h, B] = y(null), [f, A] = y(null), [g, L] = y(null), i = N(
|
|
112
|
+
() => Q({ bpdMm: u, hcMm: h, acMm: f, flMm: g }),
|
|
113
|
+
[u, h, f, g]
|
|
114
|
+
);
|
|
115
|
+
E(() => {
|
|
116
|
+
e == null || e(i);
|
|
117
|
+
}, [i, e]);
|
|
118
|
+
const W = O({ bpdMm: u, hcMm: h, acMm: f, flMm: g, result: i });
|
|
119
|
+
W.current = { bpdMm: u, hcMm: h, acMm: f, flMm: g, result: i };
|
|
120
|
+
const S = N(
|
|
121
|
+
() => ({
|
|
122
|
+
getBiometry: () => {
|
|
123
|
+
const { bpdMm: a, hcMm: M, acMm: o, flMm: x } = W.current;
|
|
124
|
+
return { bpdMm: a, hcMm: M, acMm: o, flMm: x };
|
|
125
|
+
},
|
|
126
|
+
getResult: () => W.current.result,
|
|
127
|
+
setBiometry: (a) => {
|
|
128
|
+
const M = [
|
|
129
|
+
["bpdMm", k],
|
|
130
|
+
["hcMm", B],
|
|
131
|
+
["acMm", A],
|
|
132
|
+
["flMm", L]
|
|
133
|
+
];
|
|
134
|
+
for (const [o] of M)
|
|
135
|
+
if (o in a && !X(a[o])) return !1;
|
|
136
|
+
for (const [o, x] of M)
|
|
137
|
+
o in a && x(a[o] ?? null);
|
|
138
|
+
return !0;
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
[]
|
|
142
|
+
);
|
|
143
|
+
_(J, S, m);
|
|
144
|
+
const I = N(
|
|
145
|
+
() => new Intl.NumberFormat(F.language, { maximumFractionDigits: 0 }),
|
|
146
|
+
[F.language]
|
|
147
|
+
), j = t("fetalWeight.units.mm"), b = (a) => t("fetalWeight.efwValue", { grams: I.format(a.grams) }), K = [
|
|
148
|
+
{ label: t("fetalWeight.bpd"), value: u, onChange: k },
|
|
149
|
+
{ label: t("fetalWeight.hc"), value: h, onChange: B },
|
|
150
|
+
{ label: t("fetalWeight.ac"), value: f, onChange: A },
|
|
151
|
+
{ label: t("fetalWeight.fl"), value: g, onChange: L }
|
|
152
|
+
];
|
|
153
|
+
return /* @__PURE__ */ p(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
ref: T,
|
|
157
|
+
"data-component": "fetal-weight",
|
|
158
|
+
"data-component-id": m,
|
|
159
|
+
className: U({ width: H, className: $ }),
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ l("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: K.map((a) => /* @__PURE__ */ l(D, { label: `${a.label} (${j})`, children: /* @__PURE__ */ l(
|
|
162
|
+
q,
|
|
163
|
+
{
|
|
164
|
+
mode: "decimal",
|
|
165
|
+
min: 0,
|
|
166
|
+
step: 0.1,
|
|
167
|
+
value: a.value,
|
|
168
|
+
onChange: a.onChange
|
|
169
|
+
}
|
|
170
|
+
) }, a.label)) }),
|
|
171
|
+
/* @__PURE__ */ l("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: i ? `${t("fetalWeight.efwLabel")}: ${b(i)}.` : "" }),
|
|
172
|
+
i ? /* @__PURE__ */ l(C, { variant: "elevated", children: /* @__PURE__ */ p(C.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
173
|
+
/* @__PURE__ */ p("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
174
|
+
/* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
|
|
175
|
+
/* @__PURE__ */ l("dt", { className: "type-label ds:text-muted-foreground", children: t("fetalWeight.efwLabel") }),
|
|
176
|
+
/* @__PURE__ */ l("dd", { className: "type-metric ds:text-foreground", children: b(i) })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
|
|
179
|
+
/* @__PURE__ */ l("dt", { className: "type-label ds:text-muted-foreground", children: t("fetalWeight.methodLabel") }),
|
|
180
|
+
/* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l(z, { variant: "info", children: t(`fetalWeight.method.${i.method}`) }) })
|
|
181
|
+
] })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ l("p", { className: "type-body-sm ds:text-muted-foreground", children: t("fetalWeight.disclaimer") }),
|
|
184
|
+
d === "copy" || s ? /* @__PURE__ */ l(
|
|
185
|
+
G,
|
|
186
|
+
{
|
|
187
|
+
onInsert: s,
|
|
188
|
+
variant: d,
|
|
189
|
+
onCopy: r,
|
|
190
|
+
onError: n,
|
|
191
|
+
card: {
|
|
192
|
+
title: t("insert.title.fetalWeight"),
|
|
193
|
+
icon: "scale",
|
|
194
|
+
highlight: b(i),
|
|
195
|
+
highlightToken: "--info",
|
|
196
|
+
brand: c,
|
|
197
|
+
fields: [
|
|
198
|
+
{
|
|
199
|
+
icon: "scale",
|
|
200
|
+
label: t("fetalWeight.efwLabel"),
|
|
201
|
+
value: b(i)
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
icon: "activity",
|
|
205
|
+
label: t("fetalWeight.methodLabel"),
|
|
206
|
+
value: t(`fetalWeight.method.${i.method}`)
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
) : null
|
|
212
|
+
] }) }) : /* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: t("fetalWeight.empty") })
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
Y.displayName = "FetalWeight";
|
|
219
|
+
export {
|
|
220
|
+
Y as F,
|
|
221
|
+
Q as e
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=fetal-weight-avlj-l-S.js.map
|