@alfadocs/ui-kit 0.43.0 → 0.44.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/{bmi-calculator-DuVSFDuw.js → bmi-calculator-DFPWL2OJ.js} +92 -78
- package/dist/_chunks/{calculator-dialog-DdexHrTP.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{cycle-calculator-Dln-y1k_.js → cycle-calculator-ChHBcjet.js} +58 -50
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/{due-date-calculator-Cc4dRqTI.js → due-date-calculator-CYXKLoof.js} +50 -38
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/{pregnancy-weight-gain-zZL5Ir2-.js → pregnancy-weight-gain-C5YhfYnL.js} +66 -57
- package/dist/_chunks/{unit-converter-CuXCXJhK.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/_shared/insert-result.d.ts +100 -10
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/index.js +494 -493
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/dialog-DOYgd75U.js +0 -224
- package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js +0 -179
- package/dist/_chunks/insert-result-DisOY2G-.js +0 -243
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { R as
|
|
6
|
-
import { R as
|
|
7
|
-
import { F as
|
|
2
|
+
import { forwardRef as ee, useId as te, useState as c, useMemo as ae, useEffect as A } from "react";
|
|
3
|
+
import { c as M } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as le } from "react-i18next";
|
|
5
|
+
import { R as G } from "./radio-TWf9Q-mp.js";
|
|
6
|
+
import { R as ie } from "./radio-group-CLjK-SlK.js";
|
|
7
|
+
import { F as k } from "./form-field-BOm9hK35.js";
|
|
8
8
|
import { N as C } from "./number-input-Dj5L3pXK.js";
|
|
9
|
-
import { C as
|
|
10
|
-
import { C as
|
|
11
|
-
import { B as
|
|
12
|
-
import { I as
|
|
13
|
-
import { a as
|
|
14
|
-
const
|
|
9
|
+
import { C as oe } from "./chart-Cg3e9EH9.js";
|
|
10
|
+
import { C as L } from "./card-DPmk26CL.js";
|
|
11
|
+
import { B as re } from "./badge-zsf5i5bH.js";
|
|
12
|
+
import { I as ne } from "./insert-result-CoC1oo6R.js";
|
|
13
|
+
import { a as S, b as se, e as ce, c as me, f as H, l as V, k as ue } from "./bmi-BxD-tFzU.js";
|
|
14
|
+
const de = M("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
15
15
|
variants: {
|
|
16
16
|
width: {
|
|
17
17
|
full: "ds:w-full",
|
|
@@ -19,12 +19,12 @@ const se = K("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: { width: "full" }
|
|
22
|
-
}),
|
|
22
|
+
}), ge = {
|
|
23
23
|
underweight: "info",
|
|
24
24
|
normal: "success",
|
|
25
25
|
overweight: "warning",
|
|
26
26
|
obese: "error"
|
|
27
|
-
},
|
|
27
|
+
}, O = M("", {
|
|
28
28
|
variants: {
|
|
29
29
|
category: {
|
|
30
30
|
underweight: "--info",
|
|
@@ -33,85 +33,89 @@ const se = K("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
33
33
|
obese: "--destructive"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
37
|
-
function
|
|
36
|
+
}), W = "--color-orange-600";
|
|
37
|
+
function be(i) {
|
|
38
38
|
if (typeof document > "u") return;
|
|
39
|
-
const
|
|
40
|
-
return
|
|
39
|
+
const o = document.documentElement, r = getComputedStyle(o), n = i === "overweight" && o.classList.contains("theme-light") && !o.classList.contains("theme-accessible") ? W : O({ category: i });
|
|
40
|
+
return r.getPropertyValue(n).trim() || void 0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
function K(i) {
|
|
43
|
+
return typeof document < "u" && i === "overweight" && document.documentElement.classList.contains("theme-light") && !document.documentElement.classList.contains("theme-accessible") ? W : O({ category: i });
|
|
44
|
+
}
|
|
45
|
+
function he(i) {
|
|
46
|
+
const [o, r] = c(void 0);
|
|
47
|
+
return A(() => {
|
|
45
48
|
if (i === null) {
|
|
46
|
-
|
|
49
|
+
r(void 0);
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
|
-
const n = () =>
|
|
52
|
+
const n = () => r(be(i));
|
|
50
53
|
if (n(), typeof document > "u") return;
|
|
51
54
|
const f = new MutationObserver(n);
|
|
52
55
|
return f.observe(document.documentElement, {
|
|
53
56
|
attributes: !0,
|
|
54
57
|
attributeFilter: ["class"]
|
|
55
58
|
}), () => f.disconnect();
|
|
56
|
-
}, [i]),
|
|
59
|
+
}, [i]), o;
|
|
57
60
|
}
|
|
58
|
-
const y = (i) => Math.round(i * 10) / 10,
|
|
61
|
+
const y = (i) => Math.round(i * 10) / 10, fe = ee(
|
|
59
62
|
({
|
|
60
63
|
defaultUnitSystem: i = "metric",
|
|
61
|
-
onResultChange:
|
|
62
|
-
onInsert:
|
|
64
|
+
onResultChange: o,
|
|
65
|
+
onInsert: r,
|
|
63
66
|
insertVariant: n = "insert",
|
|
64
67
|
onCopy: f,
|
|
65
|
-
onError:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
onError: D,
|
|
69
|
+
insertBrand: _,
|
|
70
|
+
id: j,
|
|
71
|
+
width: z,
|
|
72
|
+
className: P
|
|
73
|
+
}, R) => {
|
|
74
|
+
const { t: e, i18n: w } = le(), N = te(), [m, U] = c(i), [p, T] = c(null), [v, F] = c(null), [u, $] = c(null), [d, I] = c(null), [g, B] = c(null), Y = (Q) => {
|
|
75
|
+
const x = Q;
|
|
72
76
|
if (x !== m) {
|
|
73
77
|
if (x === "imperial") {
|
|
74
|
-
if (
|
|
75
|
-
const { ft:
|
|
76
|
-
$(
|
|
78
|
+
if (p !== null) {
|
|
79
|
+
const { ft: X, in: Z } = me(p);
|
|
80
|
+
$(X), I(y(Z));
|
|
77
81
|
}
|
|
78
|
-
|
|
82
|
+
v !== null && B(y(ue(v)));
|
|
79
83
|
} else
|
|
80
|
-
(u !== null || d !== null) &&
|
|
81
|
-
|
|
84
|
+
(u !== null || d !== null) && T(y(H(u ?? 0, d ?? 0))), g !== null && F(y(V(g)));
|
|
85
|
+
U(x);
|
|
82
86
|
}
|
|
83
|
-
},
|
|
87
|
+
}, q = m === "metric" ? p : u !== null || d !== null ? H(u ?? 0, d ?? 0) : null, J = m === "metric" ? v : g !== null ? V(g) : null, l = ce(J, q), a = l !== null ? se(l) : null, E = he(a), b = ae(
|
|
84
88
|
() => new Intl.NumberFormat(w.language, {
|
|
85
89
|
minimumFractionDigits: 1,
|
|
86
90
|
maximumFractionDigits: 1
|
|
87
91
|
}),
|
|
88
92
|
[w.language]
|
|
89
93
|
);
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
A(() => {
|
|
95
|
+
o == null || o(
|
|
92
96
|
l !== null && a !== null ? { bmi: l, category: a } : null
|
|
93
97
|
);
|
|
94
|
-
}, [l, a,
|
|
95
|
-
const
|
|
98
|
+
}, [l, a, o]);
|
|
99
|
+
const h = m === "metric";
|
|
96
100
|
return /* @__PURE__ */ s(
|
|
97
101
|
"div",
|
|
98
102
|
{
|
|
99
|
-
ref:
|
|
103
|
+
ref: R,
|
|
100
104
|
"data-component": "bmi-calculator",
|
|
101
|
-
"data-component-id":
|
|
102
|
-
className:
|
|
105
|
+
"data-component-id": j,
|
|
106
|
+
className: de({ width: z, className: P }),
|
|
103
107
|
children: [
|
|
104
108
|
/* @__PURE__ */ s(
|
|
105
|
-
|
|
109
|
+
ie,
|
|
106
110
|
{
|
|
107
111
|
label: e("bmiCalculator.unitSystem.label"),
|
|
108
112
|
variant: "horizontal",
|
|
109
113
|
value: m,
|
|
110
|
-
onValueChange:
|
|
114
|
+
onValueChange: Y,
|
|
111
115
|
children: [
|
|
112
|
-
/* @__PURE__ */ t(
|
|
116
|
+
/* @__PURE__ */ t(G, { label: e("bmiCalculator.unitSystem.metric"), value: "metric" }),
|
|
113
117
|
/* @__PURE__ */ t(
|
|
114
|
-
|
|
118
|
+
G,
|
|
115
119
|
{
|
|
116
120
|
label: e("bmiCalculator.unitSystem.imperial"),
|
|
117
121
|
value: "imperial"
|
|
@@ -121,8 +125,8 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
121
125
|
}
|
|
122
126
|
),
|
|
123
127
|
/* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
h ? /* @__PURE__ */ t(
|
|
129
|
+
k,
|
|
126
130
|
{
|
|
127
131
|
label: `${e("bmiCalculator.height")} (${e("bmiCalculator.units.cm")})`,
|
|
128
132
|
children: /* @__PURE__ */ t(
|
|
@@ -131,8 +135,8 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
131
135
|
mode: "decimal",
|
|
132
136
|
min: 0,
|
|
133
137
|
step: 0.5,
|
|
134
|
-
value:
|
|
135
|
-
onChange:
|
|
138
|
+
value: p,
|
|
139
|
+
onChange: T
|
|
136
140
|
}
|
|
137
141
|
)
|
|
138
142
|
}
|
|
@@ -165,7 +169,7 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
165
169
|
max: 11.9,
|
|
166
170
|
step: 0.5,
|
|
167
171
|
value: d,
|
|
168
|
-
onChange:
|
|
172
|
+
onChange: I,
|
|
169
173
|
"aria-label": e("bmiCalculator.inches")
|
|
170
174
|
}
|
|
171
175
|
),
|
|
@@ -173,32 +177,32 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
173
177
|
] })
|
|
174
178
|
] }),
|
|
175
179
|
/* @__PURE__ */ t(
|
|
176
|
-
|
|
180
|
+
k,
|
|
177
181
|
{
|
|
178
182
|
label: `${e("bmiCalculator.weight")} (${e(
|
|
179
|
-
|
|
183
|
+
h ? "bmiCalculator.units.kg" : "bmiCalculator.units.lb"
|
|
180
184
|
)})`,
|
|
181
185
|
children: /* @__PURE__ */ t(
|
|
182
186
|
C,
|
|
183
187
|
{
|
|
184
188
|
mode: "decimal",
|
|
185
189
|
min: 0,
|
|
186
|
-
step:
|
|
187
|
-
value:
|
|
188
|
-
onChange:
|
|
190
|
+
step: h ? 0.1 : 0.5,
|
|
191
|
+
value: h ? v : g,
|
|
192
|
+
onChange: h ? F : B
|
|
189
193
|
}
|
|
190
194
|
)
|
|
191
195
|
}
|
|
192
196
|
)
|
|
193
197
|
] }),
|
|
194
198
|
/* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: l !== null && a !== null ? e("bmiCalculator.gaugeAria", {
|
|
195
|
-
bmi:
|
|
199
|
+
bmi: b.format(l),
|
|
196
200
|
category: e(`bmiCalculator.category.${a}`)
|
|
197
201
|
}) : "" }),
|
|
198
|
-
l !== null && a !== null ? /* @__PURE__ */ t(
|
|
202
|
+
l !== null && a !== null ? /* @__PURE__ */ t(L, { variant: "elevated", children: /* @__PURE__ */ s(L.Body, { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]", children: [
|
|
199
203
|
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
200
204
|
/* @__PURE__ */ t("span", { className: "type-label ds:text-muted-foreground", children: e("bmiCalculator.category.label") }),
|
|
201
|
-
/* @__PURE__ */ t(
|
|
205
|
+
/* @__PURE__ */ t(re, { variant: ge[a], size: "lg", children: e(`bmiCalculator.category.${a}`) }),
|
|
202
206
|
/* @__PURE__ */ t("p", { className: "type-body ds:text-muted-foreground", children: e(`bmiCalculator.range.${a}`) })
|
|
203
207
|
] }),
|
|
204
208
|
/* @__PURE__ */ t(
|
|
@@ -207,36 +211,46 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
207
211
|
"data-bmi-category": a,
|
|
208
212
|
className: "ds:w-[240px] ds:max-w-full",
|
|
209
213
|
children: /* @__PURE__ */ t(
|
|
210
|
-
|
|
214
|
+
oe,
|
|
211
215
|
{
|
|
212
216
|
type: "radialBar",
|
|
213
217
|
title: e("bmiCalculator.gaugeAria", {
|
|
214
|
-
bmi:
|
|
218
|
+
bmi: b.format(l),
|
|
215
219
|
category: e(`bmiCalculator.category.${a}`)
|
|
216
220
|
}),
|
|
217
|
-
series: [
|
|
221
|
+
series: [S(l)],
|
|
218
222
|
labels: [e(`bmiCalculator.category.${a}`)],
|
|
219
|
-
colors:
|
|
220
|
-
radialValueFormatter: () =>
|
|
223
|
+
colors: E ? [E] : void 0,
|
|
224
|
+
radialValueFormatter: () => b.format(l),
|
|
221
225
|
height: 240
|
|
222
226
|
}
|
|
223
227
|
)
|
|
224
228
|
}
|
|
225
229
|
),
|
|
226
|
-
n === "copy" ||
|
|
227
|
-
|
|
230
|
+
n === "copy" || r ? /* @__PURE__ */ t(
|
|
231
|
+
ne,
|
|
228
232
|
{
|
|
229
|
-
onInsert:
|
|
233
|
+
onInsert: r,
|
|
230
234
|
variant: n,
|
|
231
235
|
onCopy: f,
|
|
232
|
-
onError:
|
|
236
|
+
onError: D,
|
|
233
237
|
card: {
|
|
234
238
|
title: e("insert.title.bmi"),
|
|
235
239
|
highlight: e(`bmiCalculator.category.${a}`),
|
|
240
|
+
// Chip + gauge arc share the WHO-category semantic token so
|
|
241
|
+
// the inserted PNG matches the on-screen gauge.
|
|
242
|
+
highlightToken: K(a),
|
|
243
|
+
brand: _,
|
|
244
|
+
gauge: {
|
|
245
|
+
value: b.format(l),
|
|
246
|
+
fraction: S(l) / 100,
|
|
247
|
+
colorToken: K(a),
|
|
248
|
+
label: e(`bmiCalculator.category.${a}`)
|
|
249
|
+
},
|
|
236
250
|
fields: [
|
|
237
251
|
{
|
|
238
252
|
label: e("insert.title.bmi"),
|
|
239
|
-
value:
|
|
253
|
+
value: b.format(l)
|
|
240
254
|
},
|
|
241
255
|
{
|
|
242
256
|
label: e("bmiCalculator.category.label"),
|
|
@@ -252,8 +266,8 @@ const y = (i) => Math.round(i * 10) / 10, be = q(
|
|
|
252
266
|
);
|
|
253
267
|
}
|
|
254
268
|
);
|
|
255
|
-
|
|
269
|
+
fe.displayName = "BmiCalculator";
|
|
256
270
|
export {
|
|
257
|
-
|
|
271
|
+
fe as B
|
|
258
272
|
};
|
|
259
|
-
//# sourceMappingURL=bmi-calculator-
|
|
273
|
+
//# sourceMappingURL=bmi-calculator-DFPWL2OJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
import { D as r } from "./dialog-
|
|
3
|
+
import { D as r } from "./dialog-BTpZV6It.js";
|
|
4
4
|
const u = p(
|
|
5
5
|
({
|
|
6
6
|
trigger: i,
|
|
@@ -37,4 +37,4 @@ u.displayName = "CalculatorDialog";
|
|
|
37
37
|
export {
|
|
38
38
|
u as C
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=calculator-dialog-
|
|
40
|
+
//# sourceMappingURL=calculator-dialog-D-nfvteH.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { F as
|
|
6
|
-
import { D as
|
|
7
|
-
import { N as
|
|
8
|
-
import { C as
|
|
9
|
-
import { B as
|
|
10
|
-
import { I } from "./insert-result-
|
|
11
|
-
import { a as
|
|
2
|
+
import { forwardRef as F, useState as L, useMemo as h, useEffect as H } from "react";
|
|
3
|
+
import { c as $ } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as A } from "react-i18next";
|
|
5
|
+
import { F as w } from "./form-field-BOm9hK35.js";
|
|
6
|
+
import { D as I } from "./date-picker-Bq7xhMA-.js";
|
|
7
|
+
import { N as S } from "./number-input-Dj5L3pXK.js";
|
|
8
|
+
import { C as P } from "./card-DPmk26CL.js";
|
|
9
|
+
import { B as v } from "./badge-zsf5i5bH.js";
|
|
10
|
+
import { I as k } from "./insert-result-CoC1oo6R.js";
|
|
11
|
+
import { a as s } from "./date-picker-variants-DLi1Va_e.js";
|
|
12
12
|
import { C as z } from "./check-DPdL_Sm7.js";
|
|
13
13
|
import { H as B } from "./heart-C0faivFf.js";
|
|
14
|
-
import { c as
|
|
14
|
+
import { c as G } from "./createLucideIcon-CrFbzy84.js";
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v1.8.0 - ISC
|
|
17
17
|
*
|
|
@@ -26,77 +26,78 @@ const Y = [
|
|
|
26
26
|
key: "c7niix"
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
|
-
], j =
|
|
30
|
-
function
|
|
31
|
-
const d = n.cycleLength ??
|
|
32
|
-
start:
|
|
33
|
-
end:
|
|
34
|
-
}, f = i
|
|
29
|
+
], j = G("droplet", Y), x = 28, M = 14, U = 1;
|
|
30
|
+
function K(n, c = 3) {
|
|
31
|
+
const d = n.cycleLength ?? x, { lastPeriodStart: i } = n, o = s(i, d - M), u = {
|
|
32
|
+
start: s(o, -5),
|
|
33
|
+
end: s(o, U)
|
|
34
|
+
}, f = s(i, d), p = Array.from(
|
|
35
35
|
{ length: c },
|
|
36
|
-
(C, g) => i
|
|
36
|
+
(C, g) => s(i, d * (g + 1))
|
|
37
37
|
);
|
|
38
38
|
return { nextPeriod: f, ovulation: o, fertileWindow: u, upcomingPeriods: p };
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const O = $("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
41
41
|
variants: {
|
|
42
42
|
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: { width: "full" }
|
|
45
|
-
}), q =
|
|
45
|
+
}), V = "--accent", q = F(
|
|
46
46
|
({
|
|
47
|
-
defaultCycleLength: n =
|
|
47
|
+
defaultCycleLength: n = x,
|
|
48
48
|
onResultChange: c,
|
|
49
49
|
onInsert: d,
|
|
50
|
-
insertVariant:
|
|
50
|
+
insertVariant: i = "insert",
|
|
51
51
|
onCopy: o,
|
|
52
52
|
onError: u,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
insertBrand: f,
|
|
54
|
+
id: p,
|
|
55
|
+
width: C,
|
|
56
|
+
className: g
|
|
57
|
+
}, b) => {
|
|
58
|
+
const { t: a, i18n: N } = A(), [m, D] = L(void 0), [y, E] = L(
|
|
58
59
|
n
|
|
59
|
-
), t =
|
|
60
|
+
), t = h(() => m ? K({
|
|
60
61
|
lastPeriodStart: m,
|
|
61
|
-
cycleLength: y ??
|
|
62
|
-
}) : null, [m, y]),
|
|
62
|
+
cycleLength: y ?? x
|
|
63
|
+
}) : null, [m, y]), T = h(
|
|
63
64
|
() => new Intl.DateTimeFormat(N.language, { dateStyle: "medium" }),
|
|
64
65
|
[N.language]
|
|
65
66
|
);
|
|
66
|
-
|
|
67
|
+
H(() => {
|
|
67
68
|
c == null || c(t);
|
|
68
69
|
}, [t, c]);
|
|
69
|
-
const _ =
|
|
70
|
+
const _ = h(() => /* @__PURE__ */ new Date(), []), l = (W) => T.format(W);
|
|
70
71
|
return /* @__PURE__ */ r(
|
|
71
72
|
"div",
|
|
72
73
|
{
|
|
73
|
-
ref:
|
|
74
|
+
ref: b,
|
|
74
75
|
"data-component": "cycle-calculator",
|
|
75
|
-
"data-component-id":
|
|
76
|
-
className:
|
|
76
|
+
"data-component-id": p,
|
|
77
|
+
className: O({ width: C, className: g }),
|
|
77
78
|
children: [
|
|
78
79
|
/* @__PURE__ */ r("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
79
|
-
/* @__PURE__ */ e(
|
|
80
|
-
|
|
80
|
+
/* @__PURE__ */ e(w, { label: a("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
|
|
81
|
+
I,
|
|
81
82
|
{
|
|
82
83
|
value: m,
|
|
83
|
-
onChange:
|
|
84
|
+
onChange: D,
|
|
84
85
|
maxDate: _
|
|
85
86
|
}
|
|
86
87
|
) }),
|
|
87
88
|
/* @__PURE__ */ e(
|
|
88
|
-
|
|
89
|
+
w,
|
|
89
90
|
{
|
|
90
91
|
label: a("cycleCalculator.cycleLength"),
|
|
91
92
|
description: a("cycleCalculator.cycleLengthHint"),
|
|
92
93
|
children: /* @__PURE__ */ e(
|
|
93
|
-
|
|
94
|
+
S,
|
|
94
95
|
{
|
|
95
96
|
mode: "integer",
|
|
96
97
|
min: 20,
|
|
97
98
|
max: 45,
|
|
98
99
|
value: y,
|
|
99
|
-
onChange:
|
|
100
|
+
onChange: E
|
|
100
101
|
}
|
|
101
102
|
)
|
|
102
103
|
}
|
|
@@ -105,12 +106,12 @@ const V = T("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
105
106
|
/* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${a("cycleCalculator.ovulation")}: ${l(t.ovulation)}. ${a(
|
|
106
107
|
"cycleCalculator.nextPeriod"
|
|
107
108
|
)}: ${l(t.nextPeriod)}.` : "" }),
|
|
108
|
-
t ? /* @__PURE__ */ e(
|
|
109
|
+
t ? /* @__PURE__ */ e(P, { variant: "elevated", children: /* @__PURE__ */ r(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
109
110
|
/* @__PURE__ */ r("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
|
|
110
111
|
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
111
112
|
/* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.ovulation") }),
|
|
112
113
|
/* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
|
|
113
|
-
|
|
114
|
+
v,
|
|
114
115
|
{
|
|
115
116
|
variant: "success",
|
|
116
117
|
size: "lg",
|
|
@@ -122,7 +123,7 @@ const V = T("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
122
123
|
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
123
124
|
/* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.fertileWindow") }),
|
|
124
125
|
/* @__PURE__ */ e("dd", { children: /* @__PURE__ */ r(
|
|
125
|
-
|
|
126
|
+
v,
|
|
126
127
|
{
|
|
127
128
|
variant: "accent",
|
|
128
129
|
size: "lg",
|
|
@@ -139,7 +140,7 @@ const V = T("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
139
140
|
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
140
141
|
/* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.nextPeriod") }),
|
|
141
142
|
/* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
|
|
142
|
-
|
|
143
|
+
v,
|
|
143
144
|
{
|
|
144
145
|
variant: "error",
|
|
145
146
|
size: "lg",
|
|
@@ -149,15 +150,22 @@ const V = T("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
149
150
|
) })
|
|
150
151
|
] })
|
|
151
152
|
] }),
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
i === "copy" || d ? /* @__PURE__ */ e(
|
|
154
|
+
k,
|
|
154
155
|
{
|
|
155
156
|
onInsert: d,
|
|
156
|
-
variant:
|
|
157
|
+
variant: i,
|
|
157
158
|
onCopy: o,
|
|
158
159
|
onError: u,
|
|
159
160
|
card: {
|
|
160
161
|
title: a("insert.title.cycle"),
|
|
162
|
+
highlight: `${l(t.fertileWindow.start)} – ${l(
|
|
163
|
+
t.fertileWindow.end
|
|
164
|
+
)}`,
|
|
165
|
+
// Chip reuses the on-screen fertile-window badge's accent
|
|
166
|
+
// token so the inserted PNG chip matches the screen.
|
|
167
|
+
highlightToken: V,
|
|
168
|
+
brand: f,
|
|
161
169
|
fields: [
|
|
162
170
|
{
|
|
163
171
|
label: a("cycleCalculator.ovulation"),
|
|
@@ -187,6 +195,6 @@ q.displayName = "CycleCalculator";
|
|
|
187
195
|
export {
|
|
188
196
|
q as C,
|
|
189
197
|
M as L,
|
|
190
|
-
|
|
198
|
+
K as p
|
|
191
199
|
};
|
|
192
|
-
//# sourceMappingURL=cycle-calculator-
|
|
200
|
+
//# sourceMappingURL=cycle-calculator-ChHBcjet.js.map
|