@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
package/package.json
CHANGED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as P, useId as R, useState as r, useMemo as Y, useEffect as _ } from "react";
|
|
3
|
-
import { c as q } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as J } from "react-i18next";
|
|
5
|
-
import { R as T } from "./radio-TWf9Q-mp.js";
|
|
6
|
-
import { R as Q } from "./radio-group-CLjK-SlK.js";
|
|
7
|
-
import { F as S } from "./form-field-BOm9hK35.js";
|
|
8
|
-
import { N as h } from "./number-input-Dj5L3pXK.js";
|
|
9
|
-
import { C as X } from "./chart-Cbt0_sKv.js";
|
|
10
|
-
import { B as Z } from "./badge-zsf5i5bH.js";
|
|
11
|
-
import { I as aa } from "./insert-result-DtQQeSSf.js";
|
|
12
|
-
import { a as la, b as ea, e as ta, c as ia, f as G, l as k, k as ra } from "./bmi-BxD-tFzU.js";
|
|
13
|
-
const sa = q("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
14
|
-
variants: {
|
|
15
|
-
width: {
|
|
16
|
-
full: "ds:w-full",
|
|
17
|
-
auto: "ds:inline-flex"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: { width: "full" }
|
|
21
|
-
}), oa = {
|
|
22
|
-
underweight: "info",
|
|
23
|
-
normal: "success",
|
|
24
|
-
overweight: "warning",
|
|
25
|
-
obese: "error"
|
|
26
|
-
}, p = (f) => Math.round(f * 10) / 10, na = P(
|
|
27
|
-
({
|
|
28
|
-
defaultUnitSystem: f = "metric",
|
|
29
|
-
onResultChange: u,
|
|
30
|
-
onInsert: y,
|
|
31
|
-
insertVariant: v = "insert",
|
|
32
|
-
onCopy: A,
|
|
33
|
-
onError: H,
|
|
34
|
-
id: K,
|
|
35
|
-
width: D,
|
|
36
|
-
className: E
|
|
37
|
-
}, L) => {
|
|
38
|
-
const { t: a, i18n: x } = J(), N = R(), [s, M] = r(f), [d, w] = r(null), [g, F] = r(null), [o, $] = r(null), [n, B] = r(null), [m, I] = r(null), V = (z) => {
|
|
39
|
-
const C = z;
|
|
40
|
-
if (C !== s) {
|
|
41
|
-
if (C === "imperial") {
|
|
42
|
-
if (d !== null) {
|
|
43
|
-
const { ft: U, in: O } = ia(d);
|
|
44
|
-
$(U), B(p(O));
|
|
45
|
-
}
|
|
46
|
-
g !== null && I(p(ra(g)));
|
|
47
|
-
} else
|
|
48
|
-
(o !== null || n !== null) && w(p(G(o ?? 0, n ?? 0))), m !== null && F(p(k(m)));
|
|
49
|
-
M(C);
|
|
50
|
-
}
|
|
51
|
-
}, W = s === "metric" ? d : o !== null || n !== null ? G(o ?? 0, n ?? 0) : null, j = s === "metric" ? g : m !== null ? k(m) : null, t = ta(j, W), e = t !== null ? ea(t) : null, b = Y(
|
|
52
|
-
() => new Intl.NumberFormat(x.language, {
|
|
53
|
-
minimumFractionDigits: 1,
|
|
54
|
-
maximumFractionDigits: 1
|
|
55
|
-
}),
|
|
56
|
-
[x.language]
|
|
57
|
-
);
|
|
58
|
-
_(() => {
|
|
59
|
-
u == null || u(
|
|
60
|
-
t !== null && e !== null ? { bmi: t, category: e } : null
|
|
61
|
-
);
|
|
62
|
-
}, [t, e, u]);
|
|
63
|
-
const c = s === "metric";
|
|
64
|
-
return /* @__PURE__ */ i(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
ref: L,
|
|
68
|
-
"data-component": "bmi-calculator",
|
|
69
|
-
"data-component-id": K,
|
|
70
|
-
className: sa({ width: D, className: E }),
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ i(
|
|
73
|
-
Q,
|
|
74
|
-
{
|
|
75
|
-
label: a("bmiCalculator.unitSystem.label"),
|
|
76
|
-
variant: "horizontal",
|
|
77
|
-
value: s,
|
|
78
|
-
onValueChange: V,
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ l(T, { label: a("bmiCalculator.unitSystem.metric"), value: "metric" }),
|
|
81
|
-
/* @__PURE__ */ l(
|
|
82
|
-
T,
|
|
83
|
-
{
|
|
84
|
-
label: a("bmiCalculator.unitSystem.imperial"),
|
|
85
|
-
value: "imperial"
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ i("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
92
|
-
c ? /* @__PURE__ */ l(
|
|
93
|
-
S,
|
|
94
|
-
{
|
|
95
|
-
label: `${a("bmiCalculator.height")} (${a("bmiCalculator.units.cm")})`,
|
|
96
|
-
children: /* @__PURE__ */ l(
|
|
97
|
-
h,
|
|
98
|
-
{
|
|
99
|
-
mode: "decimal",
|
|
100
|
-
min: 0,
|
|
101
|
-
step: 0.5,
|
|
102
|
-
value: d,
|
|
103
|
-
onChange: w
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
) : /* @__PURE__ */ i("div", { role: "group", "aria-labelledby": N, children: [
|
|
108
|
-
/* @__PURE__ */ l(
|
|
109
|
-
"span",
|
|
110
|
-
{
|
|
111
|
-
id: N,
|
|
112
|
-
className: "type-label ds:mb-[var(--spacing-xs)] ds:block ds:text-foreground",
|
|
113
|
-
children: a("bmiCalculator.height")
|
|
114
|
-
}
|
|
115
|
-
),
|
|
116
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
117
|
-
/* @__PURE__ */ l(
|
|
118
|
-
h,
|
|
119
|
-
{
|
|
120
|
-
mode: "integer",
|
|
121
|
-
min: 0,
|
|
122
|
-
value: o,
|
|
123
|
-
onChange: $,
|
|
124
|
-
"aria-label": a("bmiCalculator.feet")
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: a("bmiCalculator.units.ft") }),
|
|
128
|
-
/* @__PURE__ */ l(
|
|
129
|
-
h,
|
|
130
|
-
{
|
|
131
|
-
mode: "decimal",
|
|
132
|
-
min: 0,
|
|
133
|
-
max: 11.9,
|
|
134
|
-
step: 0.5,
|
|
135
|
-
value: n,
|
|
136
|
-
onChange: B,
|
|
137
|
-
"aria-label": a("bmiCalculator.inches")
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: a("bmiCalculator.units.in") })
|
|
141
|
-
] })
|
|
142
|
-
] }),
|
|
143
|
-
/* @__PURE__ */ l(
|
|
144
|
-
S,
|
|
145
|
-
{
|
|
146
|
-
label: `${a("bmiCalculator.weight")} (${a(
|
|
147
|
-
c ? "bmiCalculator.units.kg" : "bmiCalculator.units.lb"
|
|
148
|
-
)})`,
|
|
149
|
-
children: /* @__PURE__ */ l(
|
|
150
|
-
h,
|
|
151
|
-
{
|
|
152
|
-
mode: "decimal",
|
|
153
|
-
min: 0,
|
|
154
|
-
step: c ? 0.1 : 0.5,
|
|
155
|
-
value: c ? g : m,
|
|
156
|
-
onChange: c ? F : I
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
] }),
|
|
162
|
-
/* @__PURE__ */ l("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t !== null && e !== null ? a("bmiCalculator.gaugeAria", {
|
|
163
|
-
bmi: b.format(t),
|
|
164
|
-
category: a(`bmiCalculator.category.${e}`)
|
|
165
|
-
}) : "" }),
|
|
166
|
-
t !== null && e !== null ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]", children: [
|
|
167
|
-
/* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
168
|
-
/* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: a("bmiCalculator.category.label") }),
|
|
169
|
-
/* @__PURE__ */ l(Z, { variant: oa[e], size: "lg", children: a(`bmiCalculator.category.${e}`) }),
|
|
170
|
-
/* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: a(`bmiCalculator.range.${e}`) })
|
|
171
|
-
] }),
|
|
172
|
-
/* @__PURE__ */ l("div", { className: "ds:w-[240px] ds:max-w-full", children: /* @__PURE__ */ l(
|
|
173
|
-
X,
|
|
174
|
-
{
|
|
175
|
-
type: "radialBar",
|
|
176
|
-
title: a("bmiCalculator.gaugeAria", {
|
|
177
|
-
bmi: b.format(t),
|
|
178
|
-
category: a(`bmiCalculator.category.${e}`)
|
|
179
|
-
}),
|
|
180
|
-
series: [la(t)],
|
|
181
|
-
labels: [a(`bmiCalculator.category.${e}`)],
|
|
182
|
-
radialValueFormatter: () => b.format(t),
|
|
183
|
-
height: 240
|
|
184
|
-
}
|
|
185
|
-
) }),
|
|
186
|
-
v === "copy" || y ? /* @__PURE__ */ l(
|
|
187
|
-
aa,
|
|
188
|
-
{
|
|
189
|
-
onInsert: y,
|
|
190
|
-
variant: v,
|
|
191
|
-
onCopy: A,
|
|
192
|
-
onError: H,
|
|
193
|
-
card: {
|
|
194
|
-
title: a("insert.title.bmi"),
|
|
195
|
-
highlight: a(`bmiCalculator.category.${e}`),
|
|
196
|
-
fields: [
|
|
197
|
-
{
|
|
198
|
-
label: a("insert.title.bmi"),
|
|
199
|
-
value: b.format(t)
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
label: a("bmiCalculator.category.label"),
|
|
203
|
-
value: a(`bmiCalculator.category.${e}`)
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
) : null
|
|
209
|
-
] }) : /* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: a("bmiCalculator.empty") })
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
);
|
|
215
|
-
na.displayName = "BmiCalculator";
|
|
216
|
-
export {
|
|
217
|
-
na as B
|
|
218
|
-
};
|
|
219
|
-
//# sourceMappingURL=bmi-calculator-D4juUcyF.js.map
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as R, useEffect as T, useMemo as O, forwardRef as d, useContext as j, createContext as z } from "react";
|
|
3
|
-
import * as t from "@radix-ui/react-dialog";
|
|
4
|
-
import { c as k } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { useTranslation as E } from "react-i18next";
|
|
6
|
-
import { I } from "./icon-button-CKEOrN37.js";
|
|
7
|
-
import { u as B } from "./use-controllable-state-BiY4xTzM.js";
|
|
8
|
-
import { u as S } from "./registry-nPAVE19X.js";
|
|
9
|
-
import { X as A } from "./x-CCcI3eJp.js";
|
|
10
|
-
const H = {
|
|
11
|
-
id: "dialog",
|
|
12
|
-
capabilities: ["open", "close", "dismiss"],
|
|
13
|
-
state: {
|
|
14
|
-
isOpen: {
|
|
15
|
-
type: "boolean",
|
|
16
|
-
description: "True when the dialog is currently open.",
|
|
17
|
-
read: (o) => o.getIsOpen()
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
actions: {
|
|
21
|
-
open: {
|
|
22
|
-
safety: "read",
|
|
23
|
-
description: "Open the dialog.",
|
|
24
|
-
invoke: (o) => {
|
|
25
|
-
o.open();
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
close: {
|
|
29
|
-
safety: "write",
|
|
30
|
-
description: "Close the dialog. Reversible by reopening.",
|
|
31
|
-
invoke: (o) => {
|
|
32
|
-
o.close();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
dismiss: {
|
|
36
|
-
safety: "destructive",
|
|
37
|
-
description: "Dismiss the dialog. Loses any in-progress input that has not been committed.",
|
|
38
|
-
invoke: (o) => {
|
|
39
|
-
o.close();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
domHooks: {
|
|
44
|
-
root: { attr: "data-component", value: "dialog" },
|
|
45
|
-
instanceId: {
|
|
46
|
-
attr: "data-component-id",
|
|
47
|
-
sourceProp: "id",
|
|
48
|
-
description: "Sourced from the id prop on Dialog.Root."
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, V = [
|
|
52
|
-
"ds:fixed ds:inset-0 ds:z-[var(--z-modal-backdrop)]",
|
|
53
|
-
"ds:bg-[var(--background)]/[var(--opacity-70)]",
|
|
54
|
-
"ds:backdrop-blur-sm",
|
|
55
|
-
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0",
|
|
56
|
-
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0",
|
|
57
|
-
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
58
|
-
].join(" "), F = [
|
|
59
|
-
"ds:fixed ds:z-[var(--z-modal)]",
|
|
60
|
-
"ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]",
|
|
61
|
-
"ds:shadow-[var(--shadow-xl)]",
|
|
62
|
-
"ds:p-[var(--spacing-lg)]",
|
|
63
|
-
"ds:focus-visible:outline-none",
|
|
64
|
-
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95",
|
|
65
|
-
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95",
|
|
66
|
-
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
67
|
-
].join(" "), g = "ds:start-1/2 ds:top-1/2 ds:-translate-x-1/2 ds:-translate-y-1/2 ds:w-[calc(100%-var(--spacing-lg)*2)]", L = k(F, {
|
|
68
|
-
variants: {
|
|
69
|
-
size: {
|
|
70
|
-
sm: `${g} ds:max-w-[448px] ds:rounded-[var(--radius-lg)] ds:overflow-y-auto ds:max-h-[85dvh]`,
|
|
71
|
-
md: `${g} ds:max-w-[560px] ds:rounded-[var(--radius-lg)] ds:overflow-y-auto ds:max-h-[85dvh]`,
|
|
72
|
-
lg: `${g} ds:max-w-[720px] ds:rounded-[var(--radius-lg)] ds:overflow-y-auto ds:max-h-[85dvh]`,
|
|
73
|
-
fullscreen: "ds:start-0 ds:top-0 ds:w-[100dvw] ds:h-[100dvh] ds:max-w-none ds:rounded-none ds:overflow-y-auto"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
defaultVariants: { size: "md" }
|
|
77
|
-
}), f = z(void 0), u = ({
|
|
78
|
-
children: o,
|
|
79
|
-
id: e,
|
|
80
|
-
open: a,
|
|
81
|
-
defaultOpen: r,
|
|
82
|
-
onOpenChange: c,
|
|
83
|
-
...p
|
|
84
|
-
}) => {
|
|
85
|
-
const [m, n] = B({
|
|
86
|
-
value: a,
|
|
87
|
-
defaultValue: r ?? !1,
|
|
88
|
-
onChange: c
|
|
89
|
-
}), i = m ?? !1, l = R(i);
|
|
90
|
-
T(() => {
|
|
91
|
-
l.current = i;
|
|
92
|
-
}, [i]);
|
|
93
|
-
const N = O(
|
|
94
|
-
() => ({
|
|
95
|
-
getIsOpen: () => l.current,
|
|
96
|
-
open: () => n(!0),
|
|
97
|
-
close: () => n(!1)
|
|
98
|
-
}),
|
|
99
|
-
[n]
|
|
100
|
-
);
|
|
101
|
-
return S(H, N, e), /* @__PURE__ */ s(f.Provider, { value: e, children: /* @__PURE__ */ s(t.Root, { open: i, onOpenChange: n, ...p, children: o }) });
|
|
102
|
-
};
|
|
103
|
-
u.displayName = "Dialog.Root";
|
|
104
|
-
const h = d(({ children: o, ...e }, a) => /* @__PURE__ */ s(t.Trigger, { ref: a, ...e, children: o }));
|
|
105
|
-
h.displayName = "Dialog.Trigger";
|
|
106
|
-
const x = d(({ children: o, ...e }, a) => /* @__PURE__ */ s(t.Close, { ref: a, ...e, children: o }));
|
|
107
|
-
x.displayName = "Dialog.Close";
|
|
108
|
-
const y = d(
|
|
109
|
-
({
|
|
110
|
-
size: o = "md",
|
|
111
|
-
variant: e = "default",
|
|
112
|
-
hideCloseButton: a = !0,
|
|
113
|
-
className: r,
|
|
114
|
-
children: c,
|
|
115
|
-
...p
|
|
116
|
-
}, m) => {
|
|
117
|
-
const { t: n } = E(), i = j(f), l = e === "alert" ? { role: "alertdialog" } : {};
|
|
118
|
-
return /* @__PURE__ */ v(t.Portal, { children: [
|
|
119
|
-
/* @__PURE__ */ s(
|
|
120
|
-
t.Overlay,
|
|
121
|
-
{
|
|
122
|
-
"data-component": "dialog-overlay",
|
|
123
|
-
className: V
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
/* @__PURE__ */ v(
|
|
127
|
-
t.Content,
|
|
128
|
-
{
|
|
129
|
-
ref: m,
|
|
130
|
-
...l,
|
|
131
|
-
"data-component": "dialog",
|
|
132
|
-
"data-component-id": i,
|
|
133
|
-
className: L({ size: o, className: r }),
|
|
134
|
-
...p,
|
|
135
|
-
children: [
|
|
136
|
-
c,
|
|
137
|
-
!a && /* @__PURE__ */ s("div", { className: "ds:absolute ds:end-[var(--spacing-md)] ds:top-[var(--spacing-md)]", children: /* @__PURE__ */ s(t.Close, { asChild: !0, children: /* @__PURE__ */ s(
|
|
138
|
-
I,
|
|
139
|
-
{
|
|
140
|
-
icon: /* @__PURE__ */ s(A, {}),
|
|
141
|
-
intent: "ghost",
|
|
142
|
-
size: "sm",
|
|
143
|
-
"aria-label": n("common.close", "Close")
|
|
144
|
-
}
|
|
145
|
-
) }) })
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] });
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
y.displayName = "Dialog.Content";
|
|
153
|
-
const D = d(
|
|
154
|
-
({ className: o, ...e }, a) => /* @__PURE__ */ s(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
ref: a,
|
|
158
|
-
className: [
|
|
159
|
-
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:pe-[var(--spacing-xl)]",
|
|
160
|
-
o
|
|
161
|
-
].filter(Boolean).join(" "),
|
|
162
|
-
...e
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
);
|
|
166
|
-
D.displayName = "Dialog.Header";
|
|
167
|
-
const b = d(({ className: o, ...e }, a) => /* @__PURE__ */ s(
|
|
168
|
-
t.Title,
|
|
169
|
-
{
|
|
170
|
-
ref: a,
|
|
171
|
-
className: ["type-title-card ds:break-words", o].filter(Boolean).join(" "),
|
|
172
|
-
...e
|
|
173
|
-
}
|
|
174
|
-
));
|
|
175
|
-
b.displayName = "Dialog.Title";
|
|
176
|
-
const C = d(({ className: o, ...e }, a) => /* @__PURE__ */ s(
|
|
177
|
-
t.Description,
|
|
178
|
-
{
|
|
179
|
-
ref: a,
|
|
180
|
-
className: ["type-body-sm ds:text-[var(--muted-foreground)]", o].filter(Boolean).join(" "),
|
|
181
|
-
...e
|
|
182
|
-
}
|
|
183
|
-
));
|
|
184
|
-
C.displayName = "Dialog.Description";
|
|
185
|
-
const w = d(
|
|
186
|
-
({ className: o, divider: e = !1, ...a }, r) => /* @__PURE__ */ s(
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
ref: r,
|
|
190
|
-
className: [
|
|
191
|
-
"ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]",
|
|
192
|
-
"ds:mt-[var(--spacing-md)]",
|
|
193
|
-
e && "ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-md)]",
|
|
194
|
-
o
|
|
195
|
-
].filter(Boolean).join(" "),
|
|
196
|
-
...a
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
);
|
|
200
|
-
w.displayName = "Dialog.Footer";
|
|
201
|
-
const J = Object.assign(u, {
|
|
202
|
-
Root: u,
|
|
203
|
-
Trigger: h,
|
|
204
|
-
Content: y,
|
|
205
|
-
Header: D,
|
|
206
|
-
Title: b,
|
|
207
|
-
Description: C,
|
|
208
|
-
Footer: w,
|
|
209
|
-
Close: x
|
|
210
|
-
});
|
|
211
|
-
export {
|
|
212
|
-
J as D,
|
|
213
|
-
H as d
|
|
214
|
-
};
|
|
215
|
-
//# sourceMappingURL=dialog-Cee13rHU.js.map
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as L, useState as f, useMemo as m, useEffect as T } from "react";
|
|
3
|
-
import { c as S } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as k } from "react-i18next";
|
|
5
|
-
import { R as h } from "./radio-TWf9Q-mp.js";
|
|
6
|
-
import { R as E } from "./radio-group-CLjK-SlK.js";
|
|
7
|
-
import { F } from "./form-field-BOm9hK35.js";
|
|
8
|
-
import { D as B } from "./date-picker-CvQfs6Xh.js";
|
|
9
|
-
import { B as x } from "./badge-zsf5i5bH.js";
|
|
10
|
-
import { I } from "./insert-result-DtQQeSSf.js";
|
|
11
|
-
import { c as M, g as j, G as R } from "./gestation-BXEgDGmP.js";
|
|
12
|
-
import { s as z } from "./subDays-_T9YeKPX.js";
|
|
13
|
-
import { i as V } from "./react-day-picker-CdtIiKjx.js";
|
|
14
|
-
const _ = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
15
|
-
variants: {
|
|
16
|
-
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: { width: "full" }
|
|
19
|
-
}), O = {
|
|
20
|
-
preconception: "neutral",
|
|
21
|
-
first: "info",
|
|
22
|
-
second: "success",
|
|
23
|
-
third: "warning",
|
|
24
|
-
postterm: "error"
|
|
25
|
-
}, P = L(
|
|
26
|
-
({
|
|
27
|
-
defaultMethod: A = "lmp",
|
|
28
|
-
onResultChange: d,
|
|
29
|
-
onInsert: g,
|
|
30
|
-
insertVariant: u = "insert",
|
|
31
|
-
onCopy: v,
|
|
32
|
-
onError: b,
|
|
33
|
-
id: y,
|
|
34
|
-
width: C,
|
|
35
|
-
className: N
|
|
36
|
-
}, D) => {
|
|
37
|
-
const { t: e, i18n: p } = k(), [o, w] = f(A), [i, $] = f(void 0), n = m(() => /* @__PURE__ */ new Date(), []), t = m(() => {
|
|
38
|
-
if (!i) return null;
|
|
39
|
-
const l = o === "lmp" ? i : z(i, R), r = M({ method: "lmp", date: l }, n);
|
|
40
|
-
return {
|
|
41
|
-
result: {
|
|
42
|
-
gestationalAge: r.gestationalAge,
|
|
43
|
-
trimester: r.trimester,
|
|
44
|
-
dueDate: r.dueDate
|
|
45
|
-
},
|
|
46
|
-
milestones: j(r.gestationalStart)
|
|
47
|
-
};
|
|
48
|
-
}, [o, i, n]), G = m(
|
|
49
|
-
() => new Intl.DateTimeFormat(p.language, { dateStyle: "medium" }),
|
|
50
|
-
[p.language]
|
|
51
|
-
);
|
|
52
|
-
T(() => {
|
|
53
|
-
d == null || d((t == null ? void 0 : t.result) ?? null);
|
|
54
|
-
}, [t, d]);
|
|
55
|
-
const c = (l) => l ? e("gestationalAgeCalculator.gestation", {
|
|
56
|
-
weeks: l.weeks,
|
|
57
|
-
days: l.days
|
|
58
|
-
}) : "—";
|
|
59
|
-
return /* @__PURE__ */ s(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
ref: D,
|
|
63
|
-
"data-component": "gestational-age-calculator",
|
|
64
|
-
"data-component-id": y,
|
|
65
|
-
className: _({ width: C, className: N }),
|
|
66
|
-
children: [
|
|
67
|
-
/* @__PURE__ */ s(
|
|
68
|
-
E,
|
|
69
|
-
{
|
|
70
|
-
label: e("gestationalAgeCalculator.method.label"),
|
|
71
|
-
variant: "horizontal",
|
|
72
|
-
value: o,
|
|
73
|
-
onValueChange: (l) => w(l),
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ a(h, { label: e("gestationalAgeCalculator.method.lmp"), value: "lmp" }),
|
|
76
|
-
/* @__PURE__ */ a(h, { label: e("gestationalAgeCalculator.method.edd"), value: "edd" })
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ a(
|
|
81
|
-
F,
|
|
82
|
-
{
|
|
83
|
-
label: e(
|
|
84
|
-
o === "lmp" ? "gestationalAgeCalculator.lmpDate" : "gestationalAgeCalculator.eddDate"
|
|
85
|
-
),
|
|
86
|
-
children: /* @__PURE__ */ a(
|
|
87
|
-
B,
|
|
88
|
-
{
|
|
89
|
-
value: i,
|
|
90
|
-
onChange: $,
|
|
91
|
-
maxDate: o === "lmp" ? n : void 0
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${e("gestationalAgeCalculator.gestationLabel")}: ${c(
|
|
97
|
-
t.result.gestationalAge
|
|
98
|
-
)}. ${e("gestationalAgeCalculator.trimesterLabel")}: ${e(
|
|
99
|
-
`gestationalAgeCalculator.trimester.${t.result.trimester}`
|
|
100
|
-
)}.` : "" }),
|
|
101
|
-
t ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
102
|
-
/* @__PURE__ */ s("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
103
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
|
|
104
|
-
/* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.trimesterLabel") }),
|
|
105
|
-
/* @__PURE__ */ a("dd", { children: /* @__PURE__ */ a(
|
|
106
|
-
x,
|
|
107
|
-
{
|
|
108
|
-
variant: O[t.result.trimester],
|
|
109
|
-
size: "lg",
|
|
110
|
-
children: e(
|
|
111
|
-
`gestationalAgeCalculator.trimester.${t.result.trimester}`
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
) })
|
|
115
|
-
] }),
|
|
116
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
|
|
117
|
-
/* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.gestationLabel") }),
|
|
118
|
-
/* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children: c(t.result.gestationalAge) })
|
|
119
|
-
] })
|
|
120
|
-
] }),
|
|
121
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
122
|
-
/* @__PURE__ */ a("span", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.milestonesLabel") }),
|
|
123
|
-
/* @__PURE__ */ a("ul", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: t.milestones.map((l) => {
|
|
124
|
-
const r = V(n, l.date);
|
|
125
|
-
return /* @__PURE__ */ s(
|
|
126
|
-
"li",
|
|
127
|
-
{
|
|
128
|
-
className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]",
|
|
129
|
-
children: [
|
|
130
|
-
/* @__PURE__ */ a("span", { className: "type-body ds:text-foreground", children: e(`gestationalAgeCalculator.milestone.${l.key}`) }),
|
|
131
|
-
/* @__PURE__ */ s("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
132
|
-
/* @__PURE__ */ a("span", { className: "type-body ds:text-muted-foreground", children: G.format(l.date) }),
|
|
133
|
-
r ? /* @__PURE__ */ a(x, { variant: "success", children: e("gestationalAgeCalculator.reached") }) : null
|
|
134
|
-
] })
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
l.key
|
|
138
|
-
);
|
|
139
|
-
}) })
|
|
140
|
-
] }),
|
|
141
|
-
u === "copy" || g ? /* @__PURE__ */ a(
|
|
142
|
-
I,
|
|
143
|
-
{
|
|
144
|
-
onInsert: g,
|
|
145
|
-
variant: u,
|
|
146
|
-
onCopy: v,
|
|
147
|
-
onError: b,
|
|
148
|
-
card: {
|
|
149
|
-
title: e("insert.title.gestationalAge"),
|
|
150
|
-
highlight: e(
|
|
151
|
-
`gestationalAgeCalculator.trimester.${t.result.trimester}`
|
|
152
|
-
),
|
|
153
|
-
fields: [
|
|
154
|
-
{
|
|
155
|
-
label: e("gestationalAgeCalculator.gestationLabel"),
|
|
156
|
-
value: c(t.result.gestationalAge)
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
label: e("gestationalAgeCalculator.trimesterLabel"),
|
|
160
|
-
value: e(
|
|
161
|
-
`gestationalAgeCalculator.trimester.${t.result.trimester}`
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
) : null
|
|
168
|
-
] }) : /* @__PURE__ */ a("p", { className: "type-body ds:text-muted-foreground", children: e("gestationalAgeCalculator.empty") })
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
P.displayName = "GestationalAgeCalculator";
|
|
175
|
-
export {
|
|
176
|
-
P as G
|
|
177
|
-
};
|
|
178
|
-
//# sourceMappingURL=gestational-age-calculator-CWOG3bkI.js.map
|