@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
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useState as x, useMemo as H, useEffect as Z, useRef as Y } from "react";
|
|
3
|
+
import { c as q } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as J } from "react-i18next";
|
|
5
|
+
import { u as Q } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { F as S } from "./form-field-M5UpX65Z.js";
|
|
7
|
+
import { N as P } from "./number-input-DOe5VYei.js";
|
|
8
|
+
import { D as G } from "./date-time-picker-DafkGDGO.js";
|
|
9
|
+
import { C as B } from "./card-DPmk26CL.js";
|
|
10
|
+
import { B as X } from "./badge-DCOqV9mI.js";
|
|
11
|
+
import { I as ee } from "./insert-result-D074GtHX.js";
|
|
12
|
+
import { c as te } from "./date-picker-variants-pKAJfnWr.js";
|
|
13
|
+
import { p as ne } from "./parseISO-fOGpHKXm.js";
|
|
14
|
+
import { t as se, e as h } from "./format-4HNwNGrN.js";
|
|
15
|
+
function ae(e, l) {
|
|
16
|
+
const i = se(e, l == null ? void 0 : l.in);
|
|
17
|
+
if (isNaN(+i))
|
|
18
|
+
throw new RangeError("Invalid time value");
|
|
19
|
+
let r = "", g = "";
|
|
20
|
+
const d = "-", o = ":";
|
|
21
|
+
{
|
|
22
|
+
const c = h(i.getDate(), 2), u = h(i.getMonth() + 1, 2);
|
|
23
|
+
r = `${h(i.getFullYear(), 4)}${d}${u}${d}${c}`;
|
|
24
|
+
}
|
|
25
|
+
{
|
|
26
|
+
const c = i.getTimezoneOffset();
|
|
27
|
+
if (c !== 0) {
|
|
28
|
+
const N = Math.abs(c), m = h(Math.trunc(N / 60), 2), T = h(N % 60, 2);
|
|
29
|
+
g = `${c < 0 ? "+" : "-"}${m}:${T}`;
|
|
30
|
+
} else
|
|
31
|
+
g = "Z";
|
|
32
|
+
const u = h(i.getHours(), 2), v = h(i.getMinutes(), 2), w = h(i.getSeconds(), 2), I = r === "" ? "" : "T", t = [u, v, w].join(o);
|
|
33
|
+
r = `${r}${I}${t}${g}`;
|
|
34
|
+
}
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
const V = (e) => ({
|
|
38
|
+
oneOf: [{ type: "number", exclusiveMinimum: 0 }, { type: "null" }],
|
|
39
|
+
description: `${e} in mIU/mL, or null to clear it.`
|
|
40
|
+
}), j = (e) => ({
|
|
41
|
+
oneOf: [{ type: "string", format: "date-time" }, { type: "null" }],
|
|
42
|
+
description: `${e} as an ISO-8601 timestamp with offset (e.g. 2026-08-01T09:30:00+02:00), not in the future, or null to clear it.`
|
|
43
|
+
}), ie = {
|
|
44
|
+
id: "hcg-doubling",
|
|
45
|
+
// set_value → the `set_samples` action + the `samples` state slot.
|
|
46
|
+
capabilities: ["set_value"],
|
|
47
|
+
state: {
|
|
48
|
+
samples: {
|
|
49
|
+
type: "{ hcg1: number | null, date1: string | null, hcg2: number | null, date2: string | null }",
|
|
50
|
+
descriptionKey: "ui.agent.hcgDoubling.state.samples",
|
|
51
|
+
description: "The two timed β-hCG samples as entered — value in mIU/mL plus the draw time as an ISO-8601 timestamp. Null where unset. Read this to see why a result is still null.",
|
|
52
|
+
read: (e) => e.getSamples()
|
|
53
|
+
},
|
|
54
|
+
result: {
|
|
55
|
+
type: "{ intervalHours: number, ratio: number, percentRise: number, twoDayRisePercent: number, doublingTimeHours: number | null, trend: 'rising-normal' | 'rising-slow' | 'plateau-falling' } | null",
|
|
56
|
+
descriptionKey: "ui.agent.hcgDoubling.state.result",
|
|
57
|
+
description: "Computed doubling time in hours (null when not rising), the rise normalised to 48 hours, and the trend band against the minimal-rise benchmark. Null until both samples are set and the second is after the first.",
|
|
58
|
+
read: (e) => e.getResult()
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
actions: {
|
|
62
|
+
set_samples: {
|
|
63
|
+
// Drives the same local input state a user types into; nothing is
|
|
64
|
+
// persisted to a record, and every value is reversible in the same UI.
|
|
65
|
+
safety: "write",
|
|
66
|
+
argsType: "{ hcg1?: number | null, date1?: string | null, hcg2?: number | null, date2?: string | null }",
|
|
67
|
+
argsSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
hcg1: V("First β-hCG value"),
|
|
71
|
+
date1: j("When the first sample was drawn"),
|
|
72
|
+
hcg2: V("Second β-hCG value"),
|
|
73
|
+
date2: j("When the second sample was drawn")
|
|
74
|
+
},
|
|
75
|
+
additionalProperties: !1
|
|
76
|
+
},
|
|
77
|
+
idempotent: !0,
|
|
78
|
+
returns: "boolean",
|
|
79
|
+
returnsSchema: {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
description: "True when the samples were applied."
|
|
82
|
+
},
|
|
83
|
+
errors: [
|
|
84
|
+
"Returns false and writes nothing when a value is not positive, a timestamp is unparseable, or a timestamp is in the future — the payload applies all-or-nothing.",
|
|
85
|
+
"Applies cleanly but leaves `result` null when the second sample is not strictly after the first — the analysis needs a forward interval."
|
|
86
|
+
],
|
|
87
|
+
examples: [
|
|
88
|
+
{
|
|
89
|
+
args: {
|
|
90
|
+
hcg1: 1200,
|
|
91
|
+
date1: "2026-08-01T09:00:00+02:00",
|
|
92
|
+
hcg2: 2500,
|
|
93
|
+
date2: "2026-08-03T09:00:00+02:00"
|
|
94
|
+
},
|
|
95
|
+
note: "A doubling over 48 hours → the rising-normal band."
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
descriptionKey: "ui.agent.hcgDoubling.actions.setSamples",
|
|
99
|
+
description: "Set any subset of the two timed β-hCG samples. Omitted keys are left unchanged; an explicit null clears one. All four are needed before a trend is computed.",
|
|
100
|
+
invoke: (e, l) => e.setSamples(l)
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
domHooks: {
|
|
104
|
+
root: {
|
|
105
|
+
attr: "data-component",
|
|
106
|
+
value: "hcg-doubling",
|
|
107
|
+
description: "Marks the HcgDoubling calculator (serum β-hCG doubling time from two timed values)."
|
|
108
|
+
},
|
|
109
|
+
instanceId: {
|
|
110
|
+
attr: "data-component-id",
|
|
111
|
+
sourceProp: "id",
|
|
112
|
+
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."
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, le = 1e3 * 60 * 60, re = 35;
|
|
116
|
+
function oe(e) {
|
|
117
|
+
const { hcg1: l, hcg2: i, date1: r, date2: g } = e;
|
|
118
|
+
if (!(l > 0) || !(i > 0)) return null;
|
|
119
|
+
const d = (g.getTime() - r.getTime()) / le;
|
|
120
|
+
if (!(d > 0)) return null;
|
|
121
|
+
const o = i / l, c = (o - 1) * 100, u = (o ** (48 / d) - 1) * 100, v = o > 1 ? d * Math.LN2 / Math.log(o) : null, w = o <= 1 ? "plateau-falling" : u >= re ? "rising-normal" : "rising-slow";
|
|
122
|
+
return {
|
|
123
|
+
intervalHours: d,
|
|
124
|
+
ratio: o,
|
|
125
|
+
percentRise: c,
|
|
126
|
+
twoDayRisePercent: u,
|
|
127
|
+
doublingTimeHours: v,
|
|
128
|
+
trend: w
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const de = q("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
132
|
+
variants: {
|
|
133
|
+
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
134
|
+
},
|
|
135
|
+
defaultVariants: { width: "full" }
|
|
136
|
+
}), ce = {
|
|
137
|
+
"rising-normal": "success",
|
|
138
|
+
"rising-slow": "warning",
|
|
139
|
+
"plateau-falling": "error"
|
|
140
|
+
}, ue = {
|
|
141
|
+
"rising-normal": "--success",
|
|
142
|
+
"rising-slow": "--warning-readable",
|
|
143
|
+
"plateau-falling": "--destructive"
|
|
144
|
+
}, K = (e) => ae(e), ge = (e) => {
|
|
145
|
+
const l = ne(e);
|
|
146
|
+
return Number.isNaN(l.getTime()) ? null : l;
|
|
147
|
+
}, me = (e) => e == null || Number.isFinite(e) && e > 0, he = W(
|
|
148
|
+
({
|
|
149
|
+
defaultDate1: e,
|
|
150
|
+
defaultDate2: l,
|
|
151
|
+
onResultChange: i,
|
|
152
|
+
onInsert: r,
|
|
153
|
+
insertVariant: g = "insert",
|
|
154
|
+
onCopy: d,
|
|
155
|
+
onError: o,
|
|
156
|
+
insertBrand: c,
|
|
157
|
+
id: u,
|
|
158
|
+
width: v,
|
|
159
|
+
className: w
|
|
160
|
+
}, I) => {
|
|
161
|
+
const { t, i18n: N } = J(), [m, T] = x(null), [p, k] = x(e), [D, E] = x(null), [y, _] = x(l), A = H(() => /* @__PURE__ */ new Date(), []), a = H(() => m === null || D === null || !p || !y ? null : oe({ hcg1: m, date1: p, hcg2: D, date2: y }), [m, p, D, y]);
|
|
162
|
+
Z(() => {
|
|
163
|
+
i == null || i(a);
|
|
164
|
+
}, [a, i]);
|
|
165
|
+
const R = Y({ hcg1: m, date1: p, hcg2: D, date2: y, result: a });
|
|
166
|
+
R.current = { hcg1: m, date1: p, hcg2: D, date2: y, result: a };
|
|
167
|
+
const z = H(
|
|
168
|
+
() => ({
|
|
169
|
+
getSamples: () => {
|
|
170
|
+
const n = R.current;
|
|
171
|
+
return {
|
|
172
|
+
hcg1: n.hcg1,
|
|
173
|
+
date1: n.date1 ? K(n.date1) : null,
|
|
174
|
+
hcg2: n.hcg2,
|
|
175
|
+
date2: n.date2 ? K(n.date2) : null
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
getResult: () => R.current.result,
|
|
179
|
+
setSamples: (n) => {
|
|
180
|
+
const U = /* @__PURE__ */ new Date(), $ = {};
|
|
181
|
+
for (const f of ["hcg1", "hcg2"])
|
|
182
|
+
if (f in n && !me(n[f])) return !1;
|
|
183
|
+
for (const f of ["date1", "date2"]) {
|
|
184
|
+
if (!(f in n)) continue;
|
|
185
|
+
const M = n[f];
|
|
186
|
+
if (M == null) {
|
|
187
|
+
$[f] = void 0;
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const L = ge(M);
|
|
191
|
+
if (!L || te(L, U)) return !1;
|
|
192
|
+
$[f] = L;
|
|
193
|
+
}
|
|
194
|
+
return "hcg1" in n && T(n.hcg1 ?? null), "hcg2" in n && E(n.hcg2 ?? null), "date1" in n && k($.date1), "date2" in n && _($.date2), !0;
|
|
195
|
+
}
|
|
196
|
+
}),
|
|
197
|
+
[]
|
|
198
|
+
);
|
|
199
|
+
Q(ie, z, u);
|
|
200
|
+
const C = H(
|
|
201
|
+
() => new Intl.NumberFormat(N.language, { maximumFractionDigits: 0 }),
|
|
202
|
+
[N.language]
|
|
203
|
+
), O = (n) => n.doublingTimeHours === null ? "—" : t("hcgDoubling.hoursValue", {
|
|
204
|
+
hours: C.format(n.doublingTimeHours)
|
|
205
|
+
}), F = (n) => t("hcgDoubling.percentValue", { value: C.format(n.twoDayRisePercent) });
|
|
206
|
+
return /* @__PURE__ */ b(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
ref: I,
|
|
210
|
+
"data-component": "hcg-doubling",
|
|
211
|
+
"data-component-id": u,
|
|
212
|
+
className: de({ width: v, className: w }),
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ b("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
215
|
+
/* @__PURE__ */ s(
|
|
216
|
+
S,
|
|
217
|
+
{
|
|
218
|
+
label: `${t("hcgDoubling.hcg1")} (${t("hcgDoubling.units")})`,
|
|
219
|
+
children: /* @__PURE__ */ s(
|
|
220
|
+
P,
|
|
221
|
+
{
|
|
222
|
+
mode: "decimal",
|
|
223
|
+
min: 0,
|
|
224
|
+
value: m,
|
|
225
|
+
onChange: T
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ s(S, { label: t("hcgDoubling.date1"), children: /* @__PURE__ */ s(G, { value: p, onChange: k, maxDate: A }) }),
|
|
231
|
+
/* @__PURE__ */ s(
|
|
232
|
+
S,
|
|
233
|
+
{
|
|
234
|
+
label: `${t("hcgDoubling.hcg2")} (${t("hcgDoubling.units")})`,
|
|
235
|
+
children: /* @__PURE__ */ s(
|
|
236
|
+
P,
|
|
237
|
+
{
|
|
238
|
+
mode: "decimal",
|
|
239
|
+
min: 0,
|
|
240
|
+
value: D,
|
|
241
|
+
onChange: E
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
/* @__PURE__ */ s(S, { label: t("hcgDoubling.date2"), children: /* @__PURE__ */ s(G, { value: y, onChange: _, maxDate: A }) })
|
|
247
|
+
] }),
|
|
248
|
+
/* @__PURE__ */ s("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a ? `${t("hcgDoubling.doublingLabel")}: ${O(a)}. ${t(
|
|
249
|
+
`hcgDoubling.trend.${a.trend}`
|
|
250
|
+
)}.` : "" }),
|
|
251
|
+
a ? /* @__PURE__ */ s(B, { variant: "elevated", children: /* @__PURE__ */ b(B.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
252
|
+
/* @__PURE__ */ b("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
|
|
253
|
+
/* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
|
|
254
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-muted-foreground", children: t("hcgDoubling.doublingLabel") }),
|
|
255
|
+
/* @__PURE__ */ s("dd", { className: "type-metric ds:text-foreground", children: O(a) })
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
|
|
258
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-muted-foreground", children: t("hcgDoubling.riseLabel") }),
|
|
259
|
+
/* @__PURE__ */ s("dd", { className: "type-body ds:text-foreground", children: F(a) })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
|
|
262
|
+
/* @__PURE__ */ s("dt", { className: "type-label ds:text-muted-foreground", children: t("hcgDoubling.trendLabel") }),
|
|
263
|
+
/* @__PURE__ */ s("dd", { children: /* @__PURE__ */ s(X, { variant: ce[a.trend], size: "lg", children: t(`hcgDoubling.trend.${a.trend}`) }) })
|
|
264
|
+
] })
|
|
265
|
+
] }),
|
|
266
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:text-muted-foreground", children: t("hcgDoubling.disclaimer") }),
|
|
267
|
+
g === "copy" || r ? /* @__PURE__ */ s(
|
|
268
|
+
ee,
|
|
269
|
+
{
|
|
270
|
+
onInsert: r,
|
|
271
|
+
variant: g,
|
|
272
|
+
onCopy: d,
|
|
273
|
+
onError: o,
|
|
274
|
+
card: {
|
|
275
|
+
title: t("insert.title.hcg"),
|
|
276
|
+
icon: "activity",
|
|
277
|
+
highlight: t(`hcgDoubling.trend.${a.trend}`),
|
|
278
|
+
highlightToken: ue[a.trend],
|
|
279
|
+
brand: c,
|
|
280
|
+
fields: [
|
|
281
|
+
{
|
|
282
|
+
icon: "clock",
|
|
283
|
+
label: t("hcgDoubling.doublingLabel"),
|
|
284
|
+
value: O(a)
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
icon: "trending-up",
|
|
288
|
+
label: t("hcgDoubling.riseLabel"),
|
|
289
|
+
value: F(a)
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
icon: "tag",
|
|
293
|
+
label: t("hcgDoubling.trendLabel"),
|
|
294
|
+
value: t(`hcgDoubling.trend.${a.trend}`)
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
) : null
|
|
300
|
+
] }) }) : /* @__PURE__ */ s("p", { className: "type-body ds:text-muted-foreground", children: t("hcgDoubling.empty") })
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
he.displayName = "HcgDoubling";
|
|
307
|
+
export {
|
|
308
|
+
he as H,
|
|
309
|
+
re as M,
|
|
310
|
+
oe as a
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=hcg-doubling-Cv_vH61p.js.map
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I, useRef as c, useImperativeHandle as C, useCallback as R, useMemo as E } from "react";
|
|
3
|
+
import { c as _ } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as K } from "react-i18next";
|
|
5
|
+
import { I as l } from "./icon-button-C_kbcd7I.js";
|
|
6
|
+
import { I as M } from "./icon-button-group-BLHPN6jg.js";
|
|
7
|
+
import { D as r } from "./dropdown-menu-DU-Hrf33.js";
|
|
8
|
+
import { S as N } from "./switch-OILsBLWo.js";
|
|
9
|
+
import { c as S, a as j, L as H } from "./locale-picker-D9Kv2zrK.js";
|
|
10
|
+
import { u as O } from "./use-locale-BkCIHujH.js";
|
|
11
|
+
import { u as P } from "./use-theme-CAuo6EYT.js";
|
|
12
|
+
import { u as V } from "./registry-DvAUVLHh.js";
|
|
13
|
+
import { S as D } from "./settings-d25ju_6L.js";
|
|
14
|
+
import { S as q, M as z } from "./sun-Bj9Mr553.js";
|
|
15
|
+
import { M as F } from "./monitor-xXSrufmP.js";
|
|
16
|
+
const U = {
|
|
17
|
+
id: "header-settings",
|
|
18
|
+
// Each setter persists a single preference value (locale / theme /
|
|
19
|
+
// accessibility) — `set_value` semantics, not an ephemeral view switch.
|
|
20
|
+
capabilities: ["set_value"],
|
|
21
|
+
// Read-back for all three setters. None of these preferences is
|
|
22
|
+
// recoverable from the DOM — `useTheme` resolves preference + OS into
|
|
23
|
+
// a single applied class, so `theme: 'system'` and `theme: 'light'`
|
|
24
|
+
// both paint `.theme-light` — and `set_locale` swallows unknown tags.
|
|
25
|
+
// Without these slots an agent cannot distinguish "switched to
|
|
26
|
+
// Italian" from "the tag was dropped on the floor". All four are UI
|
|
27
|
+
// preferences: no PHI, no patient-identifiable data (§7).
|
|
28
|
+
state: {
|
|
29
|
+
locale: {
|
|
30
|
+
type: "string",
|
|
31
|
+
descriptionKey: "ui.agent.headerSettings.state.locale",
|
|
32
|
+
description: 'Active IETF language tag (e.g. "en", "it", "ar"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',
|
|
33
|
+
read: (e) => e.getLocale()
|
|
34
|
+
},
|
|
35
|
+
theme: {
|
|
36
|
+
type: "'light' | 'dark' | 'system'",
|
|
37
|
+
descriptionKey: "ui.agent.headerSettings.state.theme",
|
|
38
|
+
description: "Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.",
|
|
39
|
+
read: (e) => e.getTheme()
|
|
40
|
+
},
|
|
41
|
+
accessibility: {
|
|
42
|
+
type: "'default' | 'accessible' | 'system'",
|
|
43
|
+
descriptionKey: "ui.agent.headerSettings.state.accessibility",
|
|
44
|
+
description: "Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.",
|
|
45
|
+
read: (e) => e.getAccessibility()
|
|
46
|
+
},
|
|
47
|
+
resolvedTheme: {
|
|
48
|
+
type: "'light' | 'dark' | 'light-accessible' | 'dark-accessible'",
|
|
49
|
+
descriptionKey: "ui.agent.headerSettings.state.resolvedTheme",
|
|
50
|
+
description: 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme("system")` or `set_accessibility("system")` write verifiable.',
|
|
51
|
+
read: (e) => e.getResolvedTheme()
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
actions: {
|
|
55
|
+
set_locale: {
|
|
56
|
+
safety: "write",
|
|
57
|
+
argsType: "{ locale: string }",
|
|
58
|
+
argsSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
locale: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: 'IETF language tag (e.g. "en", "it", "ar"). Unknown tags are silently dropped.'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: ["locale"]
|
|
67
|
+
},
|
|
68
|
+
idempotent: !0,
|
|
69
|
+
descriptionKey: "ui.agent.headerSettings.actions.setLocale",
|
|
70
|
+
description: "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.",
|
|
71
|
+
errors: [
|
|
72
|
+
"Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged."
|
|
73
|
+
],
|
|
74
|
+
examples: [{ args: { locale: "it" }, note: "Switch to Italian." }],
|
|
75
|
+
invoke: (e, s) => {
|
|
76
|
+
e.setLocale(s.locale);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
set_theme: {
|
|
80
|
+
safety: "write",
|
|
81
|
+
argsType: '{ theme: "light" | "dark" | "system" }',
|
|
82
|
+
argsSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: { theme: { enum: ["light", "dark", "system"] } },
|
|
85
|
+
required: ["theme"]
|
|
86
|
+
},
|
|
87
|
+
idempotent: !0,
|
|
88
|
+
descriptionKey: "ui.agent.headerSettings.actions.setTheme",
|
|
89
|
+
description: "Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).",
|
|
90
|
+
examples: [
|
|
91
|
+
{ args: { theme: "dark" }, note: "Switch to the dark theme." }
|
|
92
|
+
],
|
|
93
|
+
invoke: (e, s) => {
|
|
94
|
+
e.setTheme(s.theme);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
set_accessibility: {
|
|
98
|
+
safety: "write",
|
|
99
|
+
argsType: '{ accessibility: "default" | "accessible" | "system" }',
|
|
100
|
+
argsSchema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
accessibility: {
|
|
104
|
+
enum: ["default", "accessible", "system"],
|
|
105
|
+
description: "`'system'` clears the override and follows `prefers-contrast`."
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
required: ["accessibility"]
|
|
109
|
+
},
|
|
110
|
+
idempotent: !0,
|
|
111
|
+
descriptionKey: "ui.agent.headerSettings.actions.setAccessibility",
|
|
112
|
+
description: "Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).",
|
|
113
|
+
examples: [
|
|
114
|
+
{
|
|
115
|
+
args: { accessibility: "accessible" },
|
|
116
|
+
note: "Enable the AAA-accessible profile."
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
invoke: (e, s) => {
|
|
120
|
+
e.setAccessibility(s.accessibility);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
domHooks: {
|
|
125
|
+
root: {
|
|
126
|
+
attr: "data-component",
|
|
127
|
+
value: "header-settings",
|
|
128
|
+
description: "Marks the HeaderSettings wrapper."
|
|
129
|
+
},
|
|
130
|
+
instanceId: {
|
|
131
|
+
attr: "data-component-id",
|
|
132
|
+
sourceProp: "id",
|
|
133
|
+
description: "Sourced from the id prop (forwarded via HTMLAttributes)."
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
function B(e, s) {
|
|
138
|
+
if (!(typeof window > "u"))
|
|
139
|
+
try {
|
|
140
|
+
window.localStorage.setItem(e, s);
|
|
141
|
+
} catch {
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function G(e) {
|
|
145
|
+
if (typeof document > "u") return;
|
|
146
|
+
const s = document.documentElement;
|
|
147
|
+
s.lang = e, s.dir = S[e].dir;
|
|
148
|
+
}
|
|
149
|
+
const W = _("ds:inline-flex ds:items-center", {
|
|
150
|
+
variants: {
|
|
151
|
+
align: {
|
|
152
|
+
start: "",
|
|
153
|
+
end: ""
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: { align: "end" }
|
|
157
|
+
}), Y = [
|
|
158
|
+
"ds:w-[20rem] ds:p-[var(--spacing-xs)]",
|
|
159
|
+
"ds:rounded-[var(--radius-md)] ds:border ds:border-border",
|
|
160
|
+
"ds:bg-background ds:text-foreground ds:shadow-[var(--shadow-lg)]"
|
|
161
|
+
].join(" "), J = I(
|
|
162
|
+
(e, s) => {
|
|
163
|
+
const {
|
|
164
|
+
align: h = "end",
|
|
165
|
+
size: w = "md",
|
|
166
|
+
disabled: T = !1,
|
|
167
|
+
className: k,
|
|
168
|
+
id: g,
|
|
169
|
+
...A
|
|
170
|
+
} = e, { t: i } = K(), n = P(), { locale: m, setLocale: u } = O(), y = c(null);
|
|
171
|
+
C(s, () => y.current, []);
|
|
172
|
+
const f = R(
|
|
173
|
+
(a) => {
|
|
174
|
+
u(a), G(a), B(H, a);
|
|
175
|
+
},
|
|
176
|
+
[u]
|
|
177
|
+
), b = c(f);
|
|
178
|
+
b.current = f;
|
|
179
|
+
const v = c(m);
|
|
180
|
+
v.current = m;
|
|
181
|
+
const o = c(n);
|
|
182
|
+
o.current = n;
|
|
183
|
+
const L = E(
|
|
184
|
+
() => ({
|
|
185
|
+
setLocale: (a) => {
|
|
186
|
+
Object.prototype.hasOwnProperty.call(S, a) && b.current(a);
|
|
187
|
+
},
|
|
188
|
+
setTheme: (a) => o.current.setTheme(a),
|
|
189
|
+
setAccessibility: (a) => o.current.setAccessibility(a),
|
|
190
|
+
// Read-back. None of the three preferences is recoverable from
|
|
191
|
+
// the DOM: `useTheme` resolves preference + OS into one applied
|
|
192
|
+
// class, so `theme: 'system'` and `theme: 'light'` both paint
|
|
193
|
+
// `.theme-light`. Without these an agent cannot tell a switch
|
|
194
|
+
// that landed from one that was dropped.
|
|
195
|
+
getLocale: () => v.current,
|
|
196
|
+
getTheme: () => o.current.theme,
|
|
197
|
+
getAccessibility: () => o.current.accessibility,
|
|
198
|
+
getResolvedTheme: () => o.current.resolvedTheme
|
|
199
|
+
}),
|
|
200
|
+
[]
|
|
201
|
+
);
|
|
202
|
+
V(U, L, g);
|
|
203
|
+
const x = n.accessibility === "accessible";
|
|
204
|
+
return /* @__PURE__ */ t(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
ref: y,
|
|
208
|
+
"data-component": "header-settings",
|
|
209
|
+
"data-component-id": g,
|
|
210
|
+
className: W({ align: h, className: k }),
|
|
211
|
+
...A,
|
|
212
|
+
children: /* @__PURE__ */ p(r.Root, { children: [
|
|
213
|
+
/* @__PURE__ */ t(r.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
214
|
+
l,
|
|
215
|
+
{
|
|
216
|
+
size: w,
|
|
217
|
+
disabled: T,
|
|
218
|
+
icon: /* @__PURE__ */ t(D, { "aria-hidden": !0 }),
|
|
219
|
+
"aria-label": i("navigation.headerSettings.trigger")
|
|
220
|
+
}
|
|
221
|
+
) }),
|
|
222
|
+
/* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ p(
|
|
223
|
+
r.Content,
|
|
224
|
+
{
|
|
225
|
+
align: h,
|
|
226
|
+
sideOffset: 8,
|
|
227
|
+
className: Y,
|
|
228
|
+
onKeyDownCapture: (a) => {
|
|
229
|
+
const d = a.target;
|
|
230
|
+
(d == null ? void 0 : d.tagName) === "INPUT" && // Always allow Escape so the menu can close.
|
|
231
|
+
a.key !== "Escape" && a.stopPropagation();
|
|
232
|
+
},
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ t(r.Label, { children: i("navigation.headerSettings.language.label") }),
|
|
235
|
+
/* @__PURE__ */ t(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
role: "group",
|
|
239
|
+
"aria-label": i("navigation.headerSettings.language.label"),
|
|
240
|
+
className: [
|
|
241
|
+
"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
242
|
+
// Stretch the compact LocalePicker to the full menu
|
|
243
|
+
// width so it reads as a single row affordance (not
|
|
244
|
+
// a centred pill). The picker's root is
|
|
245
|
+
// inline-flex; the `*:` child selector + `flex-1`
|
|
246
|
+
// gives it `flex: 1 1 0%` once it's a child of the
|
|
247
|
+
// flex container we make this div into.
|
|
248
|
+
"ds:flex ds:[&>*]:flex-1"
|
|
249
|
+
].join(" "),
|
|
250
|
+
children: /* @__PURE__ */ t(j, { variant: "compact", popoverSide: "end" })
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ t(r.Separator, {}),
|
|
254
|
+
/* @__PURE__ */ t(r.Label, { children: i("navigation.headerSettings.appearance.label") }),
|
|
255
|
+
/* @__PURE__ */ t(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
role: "group",
|
|
259
|
+
"aria-label": i("navigation.headerSettings.appearance.label"),
|
|
260
|
+
className: "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
261
|
+
children: /* @__PURE__ */ p(
|
|
262
|
+
M,
|
|
263
|
+
{
|
|
264
|
+
role: "radiogroup",
|
|
265
|
+
mode: "toggle-single",
|
|
266
|
+
size: "sm",
|
|
267
|
+
"aria-label": i("navigation.headerSettings.appearance.label"),
|
|
268
|
+
value: n.theme,
|
|
269
|
+
onValueChange: (a) => n.setTheme(a),
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ t(
|
|
272
|
+
l,
|
|
273
|
+
{
|
|
274
|
+
icon: /* @__PURE__ */ t(q, { "aria-hidden": !0 }),
|
|
275
|
+
"aria-label": i("navigation.headerSettings.appearance.light"),
|
|
276
|
+
value: "light"
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
/* @__PURE__ */ t(
|
|
280
|
+
l,
|
|
281
|
+
{
|
|
282
|
+
icon: /* @__PURE__ */ t(z, { "aria-hidden": !0 }),
|
|
283
|
+
"aria-label": i("navigation.headerSettings.appearance.dark"),
|
|
284
|
+
value: "dark"
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ t(
|
|
288
|
+
l,
|
|
289
|
+
{
|
|
290
|
+
icon: /* @__PURE__ */ t(F, { "aria-hidden": !0 }),
|
|
291
|
+
"aria-label": i(
|
|
292
|
+
"navigation.headerSettings.appearance.system"
|
|
293
|
+
),
|
|
294
|
+
value: "system"
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ t(r.Separator, {}),
|
|
303
|
+
/* @__PURE__ */ t(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
role: "group",
|
|
307
|
+
"aria-label": i(
|
|
308
|
+
"navigation.headerSettings.appearance.accessible"
|
|
309
|
+
),
|
|
310
|
+
className: "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
|
|
311
|
+
children: /* @__PURE__ */ t(
|
|
312
|
+
N,
|
|
313
|
+
{
|
|
314
|
+
label: i("navigation.headerSettings.appearance.accessible"),
|
|
315
|
+
labelSide: "start",
|
|
316
|
+
size: "sm",
|
|
317
|
+
checked: x,
|
|
318
|
+
onCheckedChange: (a) => n.setAccessibility(a ? "accessible" : "default")
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
) })
|
|
326
|
+
] })
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
J.displayName = "HeaderSettings";
|
|
332
|
+
export {
|
|
333
|
+
J as H
|
|
334
|
+
};
|
|
335
|
+
//# sourceMappingURL=header-settings-Cn5fPXCE.js.map
|