@alfadocs/ui-kit 0.42.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/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
- package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
- package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
- package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
- package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
- package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
- package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
- package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
- package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
- package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
- package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
- package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
- package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
- package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
- package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
- package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
- package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
- package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
- package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
- package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
- package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
- package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
- package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
- package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
- package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
- package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
- package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
- package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
- package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
- package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
- package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
- package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/calendar-class-names.d.ts +8 -0
- package/dist/components/_shared/index.d.ts +2 -0
- package/dist/components/_shared/insert-result.d.ts +149 -4
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- 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/card/card.d.ts +1 -1
- package/dist/components/chart/chart.d.ts +10 -0
- package/dist/components/chart/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/data-table/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts +0 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
- package/dist/components/date-time-picker/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 +2 -2
- 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/header/header.d.ts +8 -0
- package/dist/components/header/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/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/sign-document/sign-document.d.ts +12 -0
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/tab-bar/index.d.ts +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts +44 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/index.js +504 -502
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1411 -2
- package/package.json +1 -1
- package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
- package/dist/_chunks/dialog-Cee13rHU.js +0 -215
- package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
- package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
- package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
- package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as x, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as X, useId as tt, useMemo as d, useRef as et, useState as $, useEffect as k, useImperativeHandle as ot } from "react";
|
|
3
|
+
import { c as at } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as rt } from "react-i18next";
|
|
5
|
+
import nt from "react-apexcharts";
|
|
6
|
+
import G from "apexcharts";
|
|
7
|
+
import { u as st, g as H } from "./apexcharts-theme-BJigns_V.js";
|
|
8
|
+
import { u as it } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
9
|
+
import { u as ct } from "./registry-nPAVE19X.js";
|
|
10
|
+
const dt = {
|
|
11
11
|
id: "chart",
|
|
12
12
|
capabilities: [],
|
|
13
13
|
state: {},
|
|
@@ -34,7 +34,7 @@ const ct = {
|
|
|
34
34
|
description: "Sourced from the id prop."
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, lt = at("ds:relative ds:block ds:w-full", {
|
|
38
38
|
variants: {
|
|
39
39
|
density: {
|
|
40
40
|
compact: "ds:min-h-[var(--chart-min-height-compact)]",
|
|
@@ -46,65 +46,66 @@ const ct = {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
defaultVariants: { density: "comfortable" }
|
|
49
|
-
}),
|
|
49
|
+
}), mt = [
|
|
50
50
|
"verticalLines",
|
|
51
51
|
"horizontalLines",
|
|
52
52
|
"slantedLines",
|
|
53
53
|
"squares",
|
|
54
54
|
"circles"
|
|
55
|
-
],
|
|
56
|
-
function
|
|
57
|
-
return
|
|
55
|
+
], ut = ["line", "bar", "area"], ht = ["pie", "donut", "radialBar"];
|
|
56
|
+
function R(r) {
|
|
57
|
+
return ht.includes(r);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function pt(r) {
|
|
60
|
+
return ut.includes(r);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function ft(r, l) {
|
|
63
|
+
return R(l) ? [
|
|
64
64
|
{
|
|
65
65
|
name: "",
|
|
66
66
|
data: r
|
|
67
67
|
}
|
|
68
68
|
] : r;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const bt = X(
|
|
71
71
|
({
|
|
72
72
|
title: r,
|
|
73
73
|
id: l,
|
|
74
74
|
type: o,
|
|
75
75
|
series: p,
|
|
76
|
-
categories:
|
|
77
|
-
labels:
|
|
78
|
-
height:
|
|
79
|
-
width:
|
|
80
|
-
patterns:
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
categories: g,
|
|
77
|
+
labels: v,
|
|
78
|
+
height: O,
|
|
79
|
+
width: _,
|
|
80
|
+
patterns: A = !1,
|
|
81
|
+
colors: T,
|
|
82
|
+
toolbar: S = !1,
|
|
83
|
+
locale: M,
|
|
83
84
|
radialValueFormatter: m,
|
|
84
|
-
density:
|
|
85
|
-
className:
|
|
86
|
-
},
|
|
87
|
-
const { t: a, i18n:
|
|
88
|
-
() => `chart-${
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
|
|
92
|
-
const h =
|
|
85
|
+
density: U,
|
|
86
|
+
className: D
|
|
87
|
+
}, W) => {
|
|
88
|
+
const { t: a, i18n: Y } = rt(), z = tt(), u = d(
|
|
89
|
+
() => `chart-${z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
90
|
+
[z]
|
|
91
|
+
), y = `${u}-summary`, I = et(null), [N, Z] = $(0);
|
|
92
|
+
st(I);
|
|
93
|
+
const h = M ?? Y.language ?? "en", [B, j] = $(
|
|
93
94
|
() => {
|
|
94
95
|
try {
|
|
95
|
-
return
|
|
96
|
+
return H();
|
|
96
97
|
} catch {
|
|
97
98
|
return {};
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
|
-
|
|
102
|
+
k(() => {
|
|
102
103
|
if (typeof document > "u") return;
|
|
103
104
|
let t;
|
|
104
105
|
const e = new MutationObserver(() => {
|
|
105
106
|
clearTimeout(t), t = setTimeout(() => {
|
|
106
107
|
try {
|
|
107
|
-
|
|
108
|
+
j(H());
|
|
108
109
|
} catch {
|
|
109
110
|
}
|
|
110
111
|
}, 50);
|
|
@@ -115,36 +116,36 @@ const ft = Q(
|
|
|
115
116
|
}), () => {
|
|
116
117
|
clearTimeout(t), e.disconnect();
|
|
117
118
|
};
|
|
118
|
-
}, []),
|
|
119
|
-
const t =
|
|
119
|
+
}, []), k(() => {
|
|
120
|
+
const t = I.current;
|
|
120
121
|
if (!t || typeof ResizeObserver > "u") return;
|
|
121
122
|
const e = new ResizeObserver((n) => {
|
|
122
123
|
const s = n[0];
|
|
123
|
-
s &&
|
|
124
|
+
s && Z(Math.floor(s.contentRect.width));
|
|
124
125
|
});
|
|
125
126
|
return e.observe(t), () => e.disconnect();
|
|
126
127
|
}, []);
|
|
127
|
-
const
|
|
128
|
+
const C = d(
|
|
128
129
|
() => ({
|
|
129
130
|
async dataURI() {
|
|
130
|
-
const t =
|
|
131
|
+
const t = G.getChartByID(u);
|
|
131
132
|
return t ? (await t.dataURI()).imgURI : "";
|
|
132
133
|
},
|
|
133
134
|
updateSeries(t) {
|
|
134
|
-
const e =
|
|
135
|
-
e && (
|
|
135
|
+
const e = G.getChartByID(u);
|
|
136
|
+
e && (R(o), e.updateSeries(t));
|
|
136
137
|
}
|
|
137
138
|
}),
|
|
138
139
|
[u, o]
|
|
139
140
|
);
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
() =>
|
|
141
|
+
ot(W, () => C, [C]), ct(dt, C, l);
|
|
142
|
+
const w = typeof document < "u" && document.documentElement.dir === "rtl", E = d(
|
|
143
|
+
() => ft(p, o),
|
|
143
144
|
[p, o]
|
|
144
145
|
), f = d(
|
|
145
146
|
() => new Intl.NumberFormat(h),
|
|
146
147
|
[h]
|
|
147
|
-
),
|
|
148
|
+
), P = d(
|
|
148
149
|
() => ({
|
|
149
150
|
name: h,
|
|
150
151
|
options: {
|
|
@@ -163,24 +164,24 @@ const ft = Q(
|
|
|
163
164
|
}
|
|
164
165
|
}),
|
|
165
166
|
[h, a]
|
|
166
|
-
),
|
|
167
|
+
), L = it(), q = d(() => {
|
|
167
168
|
var n, s, b;
|
|
168
|
-
const t =
|
|
169
|
+
const t = B, e = {
|
|
169
170
|
...t,
|
|
170
171
|
chart: {
|
|
171
172
|
...t.chart,
|
|
172
173
|
id: u,
|
|
173
|
-
toolbar: { show:
|
|
174
|
-
zoom: { enabled:
|
|
174
|
+
toolbar: { show: S },
|
|
175
|
+
zoom: { enabled: S },
|
|
175
176
|
animations: {
|
|
176
|
-
enabled: !
|
|
177
|
-
dynamicAnimation: { enabled: !
|
|
177
|
+
enabled: !L,
|
|
178
|
+
dynamicAnimation: { enabled: !L }
|
|
178
179
|
},
|
|
179
|
-
locales: [
|
|
180
|
+
locales: [P],
|
|
180
181
|
defaultLocale: h,
|
|
181
182
|
parentHeightOffset: 0
|
|
182
183
|
},
|
|
183
|
-
labels:
|
|
184
|
+
labels: v,
|
|
184
185
|
legend: {
|
|
185
186
|
...t.legend,
|
|
186
187
|
position: "bottom",
|
|
@@ -188,7 +189,7 @@ const ft = Q(
|
|
|
188
189
|
// to the chart's own text flow. For RTL we flip via `yaxis.opposite`
|
|
189
190
|
// and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored
|
|
190
191
|
// to the inline-start by asking for 'left' on LTR and 'right' on RTL.
|
|
191
|
-
horizontalAlign:
|
|
192
|
+
horizontalAlign: w ? "right" : "left",
|
|
192
193
|
fontFamily: "inherit"
|
|
193
194
|
},
|
|
194
195
|
tooltip: {
|
|
@@ -201,12 +202,12 @@ const ft = Q(
|
|
|
201
202
|
text: a("chart.noData")
|
|
202
203
|
}
|
|
203
204
|
};
|
|
204
|
-
if (
|
|
205
|
+
if (T && T.length > 0 && (e.colors = T), pt(o) && (e.xaxis = {
|
|
205
206
|
...t.xaxis,
|
|
206
|
-
categories:
|
|
207
|
+
categories: g ?? []
|
|
207
208
|
}, e.yaxis = {
|
|
208
209
|
...t.yaxis,
|
|
209
|
-
opposite:
|
|
210
|
+
opposite: w,
|
|
210
211
|
labels: {
|
|
211
212
|
formatter: (i) => f.format(i)
|
|
212
213
|
}
|
|
@@ -223,17 +224,17 @@ const ft = Q(
|
|
|
223
224
|
...((n = i.radialBar) == null ? void 0 : n.dataLabels) ?? {},
|
|
224
225
|
value: {
|
|
225
226
|
...((b = (s = i.radialBar) == null ? void 0 : s.dataLabels) == null ? void 0 : b.value) ?? {},
|
|
226
|
-
formatter: (
|
|
227
|
+
formatter: (Q) => m(Number(Q))
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
232
|
}
|
|
232
|
-
return
|
|
233
|
+
return A ? e.fill = {
|
|
233
234
|
type: "pattern",
|
|
234
235
|
opacity: o === "area" ? 0.3 : 1,
|
|
235
236
|
pattern: {
|
|
236
|
-
style: [...
|
|
237
|
+
style: [...mt],
|
|
237
238
|
strokeWidth: 2
|
|
238
239
|
}
|
|
239
240
|
} : o === "area" && (e.fill = {
|
|
@@ -241,69 +242,70 @@ const ft = Q(
|
|
|
241
242
|
opacity: 0.3
|
|
242
243
|
}), e;
|
|
243
244
|
}, [
|
|
244
|
-
|
|
245
|
+
B,
|
|
245
246
|
u,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
S,
|
|
248
|
+
L,
|
|
249
|
+
P,
|
|
249
250
|
h,
|
|
250
|
-
|
|
251
|
+
v,
|
|
251
252
|
f,
|
|
252
253
|
a,
|
|
253
254
|
o,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
g,
|
|
256
|
+
w,
|
|
257
|
+
A,
|
|
258
|
+
T,
|
|
257
259
|
m
|
|
258
|
-
]),
|
|
259
|
-
const t =
|
|
260
|
-
return /* @__PURE__ */
|
|
260
|
+
]), V = _ ?? (N > 0 ? N : "100%"), F = O ?? 320, J = d(() => {
|
|
261
|
+
const t = R(o) ? v ?? [] : g ?? [], e = E;
|
|
262
|
+
return /* @__PURE__ */ x("table", { id: y, className: "ds:sr-only", children: [
|
|
261
263
|
/* @__PURE__ */ c("caption", { children: r }),
|
|
262
|
-
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ x("tr", { children: [
|
|
263
265
|
/* @__PURE__ */ c("th", { scope: "col", children: a("chart.table.series") }),
|
|
264
266
|
t.map((n, s) => /* @__PURE__ */ c("th", { scope: "col", children: n }, `${n}-${s}`))
|
|
265
267
|
] }) }),
|
|
266
|
-
/* @__PURE__ */ c("tbody", { children: e.map((n, s) => /* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ c("tbody", { children: e.map((n, s) => /* @__PURE__ */ x("tr", { children: [
|
|
267
269
|
/* @__PURE__ */ c("th", { scope: "row", children: n.name || a("chart.table.value") }),
|
|
268
270
|
n.data.map((b, i) => /* @__PURE__ */ c("td", { children: o === "radialBar" && m ? m(b) : f.format(b) }, `${s}-${i}`))
|
|
269
271
|
] }, `${n.name}-${s}`)) })
|
|
270
272
|
] });
|
|
271
273
|
}, [
|
|
272
274
|
o,
|
|
273
|
-
|
|
274
|
-
g,
|
|
275
|
+
E,
|
|
275
276
|
v,
|
|
276
|
-
|
|
277
|
+
g,
|
|
278
|
+
y,
|
|
277
279
|
r,
|
|
278
280
|
a,
|
|
279
281
|
f,
|
|
280
282
|
m
|
|
281
|
-
]),
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
+
]), K = d(() => (R(o), p), [p, o]);
|
|
284
|
+
return /* @__PURE__ */ x(
|
|
283
285
|
"div",
|
|
284
286
|
{
|
|
285
|
-
ref:
|
|
287
|
+
ref: I,
|
|
286
288
|
role: "img",
|
|
287
289
|
"aria-label": r,
|
|
288
|
-
"aria-describedby":
|
|
289
|
-
className:
|
|
290
|
+
"aria-describedby": y,
|
|
291
|
+
className: lt({
|
|
290
292
|
// Explicit height wins over the density min-height unless the
|
|
291
293
|
// caller also asked for a density explicitly.
|
|
292
|
-
density:
|
|
293
|
-
className:
|
|
294
|
+
density: U ?? (O !== void 0 ? "none" : void 0),
|
|
295
|
+
className: D
|
|
294
296
|
}),
|
|
295
297
|
"data-component": "chart",
|
|
296
298
|
"data-component-id": l,
|
|
297
299
|
children: [
|
|
298
|
-
|
|
300
|
+
J,
|
|
299
301
|
/* @__PURE__ */ c(
|
|
300
|
-
|
|
302
|
+
nt,
|
|
301
303
|
{
|
|
302
304
|
type: o,
|
|
303
|
-
series:
|
|
304
|
-
options:
|
|
305
|
-
width:
|
|
306
|
-
height:
|
|
305
|
+
series: K,
|
|
306
|
+
options: q,
|
|
307
|
+
width: V,
|
|
308
|
+
height: F,
|
|
307
309
|
"aria-hidden": "true"
|
|
308
310
|
}
|
|
309
311
|
)
|
|
@@ -312,10 +314,10 @@ const ft = Q(
|
|
|
312
314
|
);
|
|
313
315
|
}
|
|
314
316
|
);
|
|
315
|
-
|
|
317
|
+
bt.displayName = "Chart";
|
|
316
318
|
export {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
319
|
+
bt as C,
|
|
320
|
+
lt as a,
|
|
321
|
+
dt as c
|
|
320
322
|
};
|
|
321
|
-
//# sourceMappingURL=chart-
|
|
323
|
+
//# sourceMappingURL=chart-Cg3e9EH9.js.map
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as F, useState as L, useMemo as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { F as
|
|
6
|
-
import { D as
|
|
7
|
-
import { N 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";
|
|
8
9
|
import { B as v } from "./badge-zsf5i5bH.js";
|
|
9
|
-
import { I as
|
|
10
|
-
import { a as
|
|
11
|
-
import { C as
|
|
12
|
-
import { H as
|
|
13
|
-
import { c as
|
|
10
|
+
import { I as k } from "./insert-result-CoC1oo6R.js";
|
|
11
|
+
import { a as s } from "./date-picker-variants-DLi1Va_e.js";
|
|
12
|
+
import { C as z } from "./check-DPdL_Sm7.js";
|
|
13
|
+
import { H as B } from "./heart-C0faivFf.js";
|
|
14
|
+
import { c as G } from "./createLucideIcon-CrFbzy84.js";
|
|
14
15
|
/**
|
|
15
16
|
* @license lucide-react v1.8.0 - ISC
|
|
16
17
|
*
|
|
17
18
|
* This source code is licensed under the ISC license.
|
|
18
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
20
|
*/
|
|
20
|
-
const
|
|
21
|
+
const Y = [
|
|
21
22
|
[
|
|
22
23
|
"path",
|
|
23
24
|
{
|
|
@@ -25,77 +26,78 @@ const B = [
|
|
|
25
26
|
key: "c7niix"
|
|
26
27
|
}
|
|
27
28
|
]
|
|
28
|
-
],
|
|
29
|
-
function
|
|
30
|
-
const d = n.cycleLength ??
|
|
31
|
-
start:
|
|
32
|
-
end:
|
|
33
|
-
}, 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(
|
|
34
35
|
{ length: c },
|
|
35
|
-
(C, g) => i
|
|
36
|
+
(C, g) => s(i, d * (g + 1))
|
|
36
37
|
);
|
|
37
38
|
return { nextPeriod: f, ovulation: o, fertileWindow: u, upcomingPeriods: p };
|
|
38
39
|
}
|
|
39
|
-
const
|
|
40
|
+
const O = $("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
40
41
|
variants: {
|
|
41
42
|
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
42
43
|
},
|
|
43
44
|
defaultVariants: { width: "full" }
|
|
44
|
-
}), V = F(
|
|
45
|
+
}), V = "--accent", q = F(
|
|
45
46
|
({
|
|
46
|
-
defaultCycleLength: n =
|
|
47
|
+
defaultCycleLength: n = x,
|
|
47
48
|
onResultChange: c,
|
|
48
49
|
onInsert: d,
|
|
49
|
-
insertVariant:
|
|
50
|
+
insertVariant: i = "insert",
|
|
50
51
|
onCopy: o,
|
|
51
52
|
onError: u,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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(
|
|
57
59
|
n
|
|
58
|
-
), t =
|
|
60
|
+
), t = h(() => m ? K({
|
|
59
61
|
lastPeriodStart: m,
|
|
60
|
-
cycleLength: y ??
|
|
61
|
-
}) : null, [m, y]),
|
|
62
|
+
cycleLength: y ?? x
|
|
63
|
+
}) : null, [m, y]), T = h(
|
|
62
64
|
() => new Intl.DateTimeFormat(N.language, { dateStyle: "medium" }),
|
|
63
65
|
[N.language]
|
|
64
66
|
);
|
|
65
|
-
|
|
67
|
+
H(() => {
|
|
66
68
|
c == null || c(t);
|
|
67
69
|
}, [t, c]);
|
|
68
|
-
const
|
|
70
|
+
const _ = h(() => /* @__PURE__ */ new Date(), []), l = (W) => T.format(W);
|
|
69
71
|
return /* @__PURE__ */ r(
|
|
70
72
|
"div",
|
|
71
73
|
{
|
|
72
|
-
ref:
|
|
74
|
+
ref: b,
|
|
73
75
|
"data-component": "cycle-calculator",
|
|
74
|
-
"data-component-id":
|
|
75
|
-
className:
|
|
76
|
+
"data-component-id": p,
|
|
77
|
+
className: O({ width: C, className: g }),
|
|
76
78
|
children: [
|
|
77
79
|
/* @__PURE__ */ r("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
78
|
-
/* @__PURE__ */ e(
|
|
79
|
-
|
|
80
|
+
/* @__PURE__ */ e(w, { label: a("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
|
|
81
|
+
I,
|
|
80
82
|
{
|
|
81
83
|
value: m,
|
|
82
|
-
onChange:
|
|
83
|
-
maxDate:
|
|
84
|
+
onChange: D,
|
|
85
|
+
maxDate: _
|
|
84
86
|
}
|
|
85
87
|
) }),
|
|
86
88
|
/* @__PURE__ */ e(
|
|
87
|
-
|
|
89
|
+
w,
|
|
88
90
|
{
|
|
89
91
|
label: a("cycleCalculator.cycleLength"),
|
|
90
92
|
description: a("cycleCalculator.cycleLengthHint"),
|
|
91
93
|
children: /* @__PURE__ */ e(
|
|
92
|
-
|
|
94
|
+
S,
|
|
93
95
|
{
|
|
94
96
|
mode: "integer",
|
|
95
97
|
min: 20,
|
|
96
98
|
max: 45,
|
|
97
99
|
value: y,
|
|
98
|
-
onChange:
|
|
100
|
+
onChange: E
|
|
99
101
|
}
|
|
100
102
|
)
|
|
101
103
|
}
|
|
@@ -104,7 +106,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
104
106
|
/* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${a("cycleCalculator.ovulation")}: ${l(t.ovulation)}. ${a(
|
|
105
107
|
"cycleCalculator.nextPeriod"
|
|
106
108
|
)}: ${l(t.nextPeriod)}.` : "" }),
|
|
107
|
-
t ? /* @__PURE__ */
|
|
109
|
+
t ? /* @__PURE__ */ e(P, { variant: "elevated", children: /* @__PURE__ */ r(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
108
110
|
/* @__PURE__ */ r("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
|
|
109
111
|
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
110
112
|
/* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.ovulation") }),
|
|
@@ -113,7 +115,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
113
115
|
{
|
|
114
116
|
variant: "success",
|
|
115
117
|
size: "lg",
|
|
116
|
-
leading: /* @__PURE__ */ e(
|
|
118
|
+
leading: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
|
|
117
119
|
children: l(t.ovulation)
|
|
118
120
|
}
|
|
119
121
|
) })
|
|
@@ -125,7 +127,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
125
127
|
{
|
|
126
128
|
variant: "accent",
|
|
127
129
|
size: "lg",
|
|
128
|
-
leading: /* @__PURE__ */ e(
|
|
130
|
+
leading: /* @__PURE__ */ e(B, { "aria-hidden": !0 }),
|
|
129
131
|
children: [
|
|
130
132
|
l(t.fertileWindow.start),
|
|
131
133
|
" –",
|
|
@@ -142,21 +144,28 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
142
144
|
{
|
|
143
145
|
variant: "error",
|
|
144
146
|
size: "lg",
|
|
145
|
-
leading: /* @__PURE__ */ e(
|
|
147
|
+
leading: /* @__PURE__ */ e(j, { "aria-hidden": !0 }),
|
|
146
148
|
children: l(t.nextPeriod)
|
|
147
149
|
}
|
|
148
150
|
) })
|
|
149
151
|
] })
|
|
150
152
|
] }),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
i === "copy" || d ? /* @__PURE__ */ e(
|
|
154
|
+
k,
|
|
153
155
|
{
|
|
154
156
|
onInsert: d,
|
|
155
|
-
variant:
|
|
157
|
+
variant: i,
|
|
156
158
|
onCopy: o,
|
|
157
159
|
onError: u,
|
|
158
160
|
card: {
|
|
159
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,
|
|
160
169
|
fields: [
|
|
161
170
|
{
|
|
162
171
|
label: a("cycleCalculator.ovulation"),
|
|
@@ -176,16 +185,16 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
176
185
|
}
|
|
177
186
|
}
|
|
178
187
|
) : null
|
|
179
|
-
] }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: a("cycleCalculator.empty") })
|
|
188
|
+
] }) }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: a("cycleCalculator.empty") })
|
|
180
189
|
]
|
|
181
190
|
}
|
|
182
191
|
);
|
|
183
192
|
}
|
|
184
193
|
);
|
|
185
|
-
|
|
194
|
+
q.displayName = "CycleCalculator";
|
|
186
195
|
export {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
196
|
+
q as C,
|
|
197
|
+
M as L,
|
|
198
|
+
K as p
|
|
190
199
|
};
|
|
191
|
-
//# sourceMappingURL=cycle-calculator-
|
|
200
|
+
//# sourceMappingURL=cycle-calculator-ChHBcjet.js.map
|