@alfadocs/ui-kit 0.48.0 → 0.49.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.
Files changed (176) hide show
  1. package/dist/_chunks/{address-autocomplete-CSjMrBvu.js → address-autocomplete-CT-9AOli.js} +2 -2
  2. package/dist/_chunks/{ai-consent-banner-DO5ingMq.js → ai-consent-banner-F2md5JD3.js} +2 -2
  3. package/dist/_chunks/{ai-tools-rail-CxYG04cw.js → ai-tools-rail-CYLWrRmm.js} +6 -6
  4. package/dist/_chunks/{alert-ywPR59NE.js → alert-CUTxnym2.js} +56 -35
  5. package/dist/_chunks/antenatal-schedule-timeline-Dg0m0yFl.js +412 -0
  6. package/dist/_chunks/{ar-DEz65ZJW.js → ar-C68WKG5a.js} +2 -2
  7. package/dist/_chunks/{audio-recorder-DC-v9YFW.js → audio-recorder-DVJXV7_k.js} +2 -2
  8. package/dist/_chunks/bishop-score-2MzAz8NE.js +185 -0
  9. package/dist/_chunks/{booking-WV2GSru5.js → booking-DljH0JkS.js} +5 -5
  10. package/dist/_chunks/circle-arrow-up-CC_85SuH.js +16 -0
  11. package/dist/_chunks/cycle-calculator-oOkj5wlB.js +252 -0
  12. package/dist/_chunks/{date-picker-Bq7xhMA-.js → date-picker-BfHblqwA.js} +2 -2
  13. package/dist/_chunks/{date-picker-variants-DLi1Va_e.js → date-picker-variants-CXEAx3O_.js} +22 -22
  14. package/dist/_chunks/{date-range-picker-DcXuI9y7.js → date-range-picker-hcAMs1wO.js} +3 -3
  15. package/dist/_chunks/{date-time-picker-RimumeLR.js → date-time-picker-H-3Pwqlb.js} +9 -9
  16. package/dist/_chunks/{de-bTBGdjPS.js → de-DK4A9_a8.js} +2 -2
  17. package/dist/_chunks/{document-scanner-BqLsGs4Y.js → document-scanner-Cxqvq7GR.js} +2 -2
  18. package/dist/_chunks/due-date-calculator-tDqZXPWO.js +256 -0
  19. package/dist/_chunks/{editable-currency-cell-renderer-CLil9B29.js → editable-currency-cell-renderer-Bh48OHRv.js} +2 -2
  20. package/dist/_chunks/{el-BWG5RXxa.js → el-B29HXhG5.js} +2 -2
  21. package/dist/_chunks/{es-DfO_G435.js → es-BOwPVwWn.js} +2 -2
  22. package/dist/_chunks/fetal-weight-Da-B4P4k.js +122 -0
  23. package/dist/_chunks/{fr-BTn24bs8.js → fr-DoDBtn0T.js} +2 -2
  24. package/dist/_chunks/{freemium-paywall-DzpD63WY.js → freemium-paywall-BWaLWje-.js} +2 -2
  25. package/dist/_chunks/gestational-age-calculator-DbDfTJU2.js +311 -0
  26. package/dist/_chunks/hcg-doubling-DAnpbale.js +170 -0
  27. package/dist/_chunks/{hi-Dj3oYd84.js → hi-DGByrKby.js} +2 -2
  28. package/dist/_chunks/{isSameWeek-HfxKk6Lz.js → isSameWeek-B1odL2vR.js} +2 -2
  29. package/dist/_chunks/{it-Y85ofIQQ.js → it-B16rEecm.js} +3 -3
  30. package/dist/_chunks/{ja-CQ7J6YoA.js → ja-B0viOgft.js} +2 -2
  31. package/dist/_chunks/{marketplace-app-shell-Gfsf78ge.js → marketplace-app-shell-UKSLx9K_.js} +3 -3
  32. package/dist/_chunks/{nl-D9kHCmp3.js → nl-cBxEX2QU.js} +2 -2
  33. package/dist/_chunks/{patient-search-CocVcGJ3.js → patient-search-BJOmTmDA.js} +2 -2
  34. package/dist/_chunks/{patient-shell-CnT4L8gn.js → patient-shell-DUmhXnFq.js} +2 -2
  35. package/dist/_chunks/{payment-form-BNTx4876.js → payment-form-xmeCkxas.js} +2 -2
  36. package/dist/_chunks/{pdf-viewer-G8SU6Azw.js → pdf-viewer-q1D3Uion.js} +2 -2
  37. package/dist/_chunks/{pl-B3Smqpkr.js → pl-DtS08ioY.js} +3 -3
  38. package/dist/_chunks/{practice-results-BFL_mcDW.js → practice-results-Cq1y8JFD.js} +2 -2
  39. package/dist/_chunks/pregnancy-weight-gain-CCGrvarh.js +322 -0
  40. package/dist/_chunks/product-hub-panel-CkfZBA3t.js +620 -0
  41. package/dist/_chunks/{pt-D3J-1c_7.js → pt-yFXs1VvH.js} +2 -2
  42. package/dist/_chunks/{ro-BKAbbEA3.js → ro-DsCzSrzR.js} +2 -2
  43. package/dist/_chunks/{ru-BeG8f0Ep.js → ru-DgDxL0pc.js} +3 -3
  44. package/dist/_chunks/{sidebar-_vJXI9rB.js → sidebar-h78cTNLh.js} +440 -338
  45. package/dist/_chunks/{sign-document-DPI2pY9V.js → sign-document-CZkAf28g.js} +2 -2
  46. package/dist/_chunks/{sq-_hRPaeUy.js → sq-DHlCYN67.js} +2 -2
  47. package/dist/_chunks/subDays-Bs00akhK.js +8 -0
  48. package/dist/_chunks/{sv-g009fSpe.js → sv-O0QaQs_s.js} +2 -2
  49. package/dist/_chunks/{tr-OKUOuhMW.js → tr-BmNDRuio.js} +2 -2
  50. package/dist/_chunks/warning-stack-CXfoAT-_.js +220 -0
  51. package/dist/_chunks/{workflow-map-ZXw-zsZ8.js → workflow-map-DzX_LI4y.js} +2 -2
  52. package/dist/_chunks/{zh-CN-De4zwEhx.js → zh-CN-CgVJZEzz.js} +3 -3
  53. package/dist/agent-catalog.json +44 -1
  54. package/dist/components/_shared/antenatal-schedule-timeline.d.ts +18 -0
  55. package/dist/components/_shared/antenatal-schedule.d.ts +68 -0
  56. package/dist/components/_shared/index.d.ts +3 -0
  57. package/dist/components/_shared/obstetrics.d.ts +138 -0
  58. package/dist/components/address-autocomplete/index.js +1 -1
  59. package/dist/components/ai-consent-banner/index.js +1 -1
  60. package/dist/components/ai-tools-rail/index.js +1 -1
  61. package/dist/components/alert/alert.d.ts +2 -2
  62. package/dist/components/alert/index.js +1 -1
  63. package/dist/components/audio-recorder/index.js +1 -1
  64. package/dist/components/bishop-score/bishop-score.d.ts +27 -0
  65. package/dist/components/bishop-score/bishop.d.ts +30 -0
  66. package/dist/components/bishop-score/index.d.ts +4 -0
  67. package/dist/components/bishop-score/index.js +10 -0
  68. package/dist/components/booking/index.js +1 -1
  69. package/dist/components/cycle-calculator/cycle.d.ts +5 -0
  70. package/dist/components/cycle-calculator/index.js +1 -1
  71. package/dist/components/data-table/index.js +1 -1
  72. package/dist/components/date-picker/index.js +1 -1
  73. package/dist/components/date-range-picker/index.js +1 -1
  74. package/dist/components/date-time-picker/index.js +1 -1
  75. package/dist/components/document-scanner/index.js +1 -1
  76. package/dist/components/due-date-calculator/due-date-calculator.d.ts +13 -1
  77. package/dist/components/due-date-calculator/gestation.d.ts +1 -59
  78. package/dist/components/due-date-calculator/index.d.ts +1 -1
  79. package/dist/components/due-date-calculator/index.js +16 -10
  80. package/dist/components/fetal-weight/efw.d.ts +25 -0
  81. package/dist/components/fetal-weight/fetal-weight.d.ts +27 -0
  82. package/dist/components/fetal-weight/index.d.ts +4 -0
  83. package/dist/components/fetal-weight/index.js +6 -0
  84. package/dist/components/freemium-paywall/index.js +1 -1
  85. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +25 -1
  86. package/dist/components/gestational-age-calculator/index.js +1 -1
  87. package/dist/components/hcg-doubling/hcg-doubling.d.ts +31 -0
  88. package/dist/components/hcg-doubling/hcg.d.ts +33 -0
  89. package/dist/components/hcg-doubling/index.d.ts +4 -0
  90. package/dist/components/hcg-doubling/index.js +7 -0
  91. package/dist/components/index.d.ts +4 -0
  92. package/dist/components/patient-search/index.js +1 -1
  93. package/dist/components/payment-form/index.js +1 -1
  94. package/dist/components/pdf-viewer/index.js +1 -1
  95. package/dist/components/practice-results/index.js +1 -1
  96. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  97. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +7 -0
  98. package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +33 -8
  99. package/dist/components/product-hub-tray/index.d.ts +8 -0
  100. package/dist/components/product-hub-tray/index.js +10 -0
  101. package/dist/components/product-hub-tray/product-hub-panel.agent.d.ts +4 -0
  102. package/dist/components/product-hub-tray/product-hub-panel.d.ts +54 -0
  103. package/dist/components/product-hub-tray/product-hub-tray.agent.d.ts +4 -0
  104. package/dist/components/product-hub-tray/product-hub-tray.d.ts +115 -0
  105. package/dist/components/sidebar/index.d.ts +2 -2
  106. package/dist/components/sidebar/index.js +12 -11
  107. package/dist/components/sidebar/sidebar.d.ts +14 -1
  108. package/dist/components/sign-document/index.js +1 -1
  109. package/dist/components/warning-stack/index.js +1 -1
  110. package/dist/components/workflow/index.js +1 -1
  111. package/dist/i18n/locales/ar.d.ts +210 -1
  112. package/dist/i18n/locales/ar.js +209 -2
  113. package/dist/i18n/locales/de.d.ts +210 -1
  114. package/dist/i18n/locales/de.js +209 -2
  115. package/dist/i18n/locales/el.d.ts +210 -1
  116. package/dist/i18n/locales/el.js +209 -2
  117. package/dist/i18n/locales/en.d.ts +210 -1
  118. package/dist/i18n/locales/en.js +209 -2
  119. package/dist/i18n/locales/es.d.ts +210 -1
  120. package/dist/i18n/locales/es.js +209 -2
  121. package/dist/i18n/locales/fr.d.ts +210 -1
  122. package/dist/i18n/locales/fr.js +209 -2
  123. package/dist/i18n/locales/hi.d.ts +210 -1
  124. package/dist/i18n/locales/hi.js +209 -2
  125. package/dist/i18n/locales/it.d.ts +210 -1
  126. package/dist/i18n/locales/it.js +209 -2
  127. package/dist/i18n/locales/ja.d.ts +210 -1
  128. package/dist/i18n/locales/ja.js +209 -2
  129. package/dist/i18n/locales/nl.d.ts +210 -1
  130. package/dist/i18n/locales/nl.js +209 -2
  131. package/dist/i18n/locales/pl.d.ts +210 -1
  132. package/dist/i18n/locales/pl.js +209 -2
  133. package/dist/i18n/locales/pt.d.ts +210 -1
  134. package/dist/i18n/locales/pt.js +209 -2
  135. package/dist/i18n/locales/ro.d.ts +210 -1
  136. package/dist/i18n/locales/ro.js +209 -2
  137. package/dist/i18n/locales/ru.d.ts +210 -1
  138. package/dist/i18n/locales/ru.js +209 -2
  139. package/dist/i18n/locales/sq.d.ts +210 -1
  140. package/dist/i18n/locales/sq.js +209 -2
  141. package/dist/i18n/locales/sv.d.ts +210 -1
  142. package/dist/i18n/locales/sv.js +209 -2
  143. package/dist/i18n/locales/tr.d.ts +210 -1
  144. package/dist/i18n/locales/tr.js +209 -2
  145. package/dist/i18n/locales/zh.d.ts +210 -1
  146. package/dist/i18n/locales/zh.js +209 -2
  147. package/dist/index.js +658 -631
  148. package/dist/locales/ar.json +211 -2
  149. package/dist/locales/de.json +211 -2
  150. package/dist/locales/el.json +211 -2
  151. package/dist/locales/en.json +211 -2
  152. package/dist/locales/es.json +211 -2
  153. package/dist/locales/fr.json +211 -2
  154. package/dist/locales/hi.json +211 -2
  155. package/dist/locales/it.json +211 -2
  156. package/dist/locales/ja.json +211 -2
  157. package/dist/locales/nl.json +211 -2
  158. package/dist/locales/pl.json +211 -2
  159. package/dist/locales/pt.json +211 -2
  160. package/dist/locales/ro.json +211 -2
  161. package/dist/locales/ru.json +211 -2
  162. package/dist/locales/sq.json +211 -2
  163. package/dist/locales/sv.json +211 -2
  164. package/dist/locales/tr.json +211 -2
  165. package/dist/locales/zh.json +211 -2
  166. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  167. package/dist/patterns/patient-shell/index.js +1 -1
  168. package/dist/tokens.css +1 -1
  169. package/package.json +17 -1
  170. package/dist/_chunks/cycle-calculator-DYvGm_m1.js +0 -211
  171. package/dist/_chunks/due-date-calculator-BXd3ANj7.js +0 -216
  172. package/dist/_chunks/gestation-mWF4AXea.js +0 -50
  173. package/dist/_chunks/gestational-age-calculator-Crj6FgZw.js +0 -203
  174. package/dist/_chunks/pregnancy-weight-gain-C7dK89jE.js +0 -246
  175. package/dist/_chunks/subDays-Dv7q9S7u.js +0 -8
  176. package/dist/_chunks/warning-stack-DNR3-IbP.js +0 -180
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -95,10 +95,22 @@
95
95
  "types": "./dist/components/benefit-card/index.d.ts",
96
96
  "import": "./dist/components/benefit-card/index.js"
97
97
  },
98
+ "./bishop-score": {
99
+ "types": "./dist/components/bishop-score/index.d.ts",
100
+ "import": "./dist/components/bishop-score/index.js"
101
+ },
98
102
  "./bmi-calculator": {
99
103
  "types": "./dist/components/bmi-calculator/index.d.ts",
100
104
  "import": "./dist/components/bmi-calculator/index.js"
101
105
  },
106
+ "./fetal-weight": {
107
+ "types": "./dist/components/fetal-weight/index.d.ts",
108
+ "import": "./dist/components/fetal-weight/index.js"
109
+ },
110
+ "./hcg-doubling": {
111
+ "types": "./dist/components/hcg-doubling/index.d.ts",
112
+ "import": "./dist/components/hcg-doubling/index.js"
113
+ },
102
114
  "./calculator-dialog": {
103
115
  "types": "./dist/components/calculator-dialog/index.d.ts",
104
116
  "import": "./dist/components/calculator-dialog/index.js"
@@ -387,6 +399,10 @@
387
399
  "types": "./dist/components/privacy-lock/index.d.ts",
388
400
  "import": "./dist/components/privacy-lock/index.js"
389
401
  },
402
+ "./product-hub-tray": {
403
+ "types": "./dist/components/product-hub-tray/index.d.ts",
404
+ "import": "./dist/components/product-hub-tray/index.js"
405
+ },
390
406
  "./progress": {
391
407
  "types": "./dist/components/progress/index.d.ts",
392
408
  "import": "./dist/components/progress/index.js"
@@ -1,211 +0,0 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as F, useState as L, useMemo as y, 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-DNdi_JYW.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";
15
- /**
16
- * @license lucide-react v1.8.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- const Y = [
22
- [
23
- "path",
24
- {
25
- d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",
26
- key: "c7niix"
27
- }
28
- ]
29
- ], j = G("droplet", Y), x = 28, M = 14, U = 1;
30
- function K(n, c = 3) {
31
- const d = n.cycleLength ?? x, { lastPeriodStart: o } = n, i = s(o, d - M), u = {
32
- start: s(i, -5),
33
- end: s(i, U)
34
- }, f = s(o, d), p = Array.from(
35
- { length: c },
36
- (C, g) => s(o, d * (g + 1))
37
- );
38
- return { nextPeriod: f, ovulation: i, fertileWindow: u, upcomingPeriods: p };
39
- }
40
- const O = $("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
41
- variants: {
42
- width: { full: "ds:w-full", auto: "ds:inline-flex" }
43
- },
44
- defaultVariants: { width: "full" }
45
- }), V = "--accent", q = F(
46
- ({
47
- defaultCycleLength: n = x,
48
- onResultChange: c,
49
- onInsert: d,
50
- insertVariant: o = "insert",
51
- onCopy: i,
52
- onError: u,
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), [h, E] = L(
59
- n
60
- ), t = y(() => m ? K({
61
- lastPeriodStart: m,
62
- cycleLength: h ?? x
63
- }) : null, [m, h]), T = y(
64
- () => new Intl.DateTimeFormat(N.language, { dateStyle: "medium" }),
65
- [N.language]
66
- );
67
- H(() => {
68
- c == null || c(t);
69
- }, [t, c]);
70
- const _ = y(() => /* @__PURE__ */ new Date(), []), l = (W) => T.format(W);
71
- return /* @__PURE__ */ r(
72
- "div",
73
- {
74
- ref: b,
75
- "data-component": "cycle-calculator",
76
- "data-component-id": p,
77
- className: O({ width: C, className: g }),
78
- children: [
79
- /* @__PURE__ */ r("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
80
- /* @__PURE__ */ e(w, { label: a("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
81
- I,
82
- {
83
- value: m,
84
- onChange: D,
85
- maxDate: _
86
- }
87
- ) }),
88
- /* @__PURE__ */ e(
89
- w,
90
- {
91
- label: a("cycleCalculator.cycleLength"),
92
- description: a("cycleCalculator.cycleLengthHint"),
93
- children: /* @__PURE__ */ e(
94
- S,
95
- {
96
- mode: "integer",
97
- min: 20,
98
- max: 45,
99
- value: h,
100
- onChange: E
101
- }
102
- )
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${a("cycleCalculator.ovulation")}: ${l(t.ovulation)}. ${a(
107
- "cycleCalculator.nextPeriod"
108
- )}: ${l(t.nextPeriod)}.` : "" }),
109
- t ? /* @__PURE__ */ e(P, { variant: "elevated", children: /* @__PURE__ */ r(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
110
- /* @__PURE__ */ r("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
111
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
112
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.ovulation") }),
113
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
114
- v,
115
- {
116
- variant: "success",
117
- size: "lg",
118
- leading: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
119
- children: l(t.ovulation)
120
- }
121
- ) })
122
- ] }),
123
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
124
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.fertileWindow") }),
125
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ r(
126
- v,
127
- {
128
- variant: "accent",
129
- size: "lg",
130
- leading: /* @__PURE__ */ e(B, { "aria-hidden": !0 }),
131
- children: [
132
- l(t.fertileWindow.start),
133
- " –",
134
- " ",
135
- l(t.fertileWindow.end)
136
- ]
137
- }
138
- ) })
139
- ] }),
140
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
141
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.nextPeriod") }),
142
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
143
- v,
144
- {
145
- variant: "error",
146
- size: "lg",
147
- leading: /* @__PURE__ */ e(j, { "aria-hidden": !0 }),
148
- children: l(t.nextPeriod)
149
- }
150
- ) })
151
- ] })
152
- ] }),
153
- o === "copy" || d ? /* @__PURE__ */ e(
154
- k,
155
- {
156
- onInsert: d,
157
- variant: o,
158
- onCopy: i,
159
- onError: u,
160
- card: {
161
- title: a("insert.title.cycle"),
162
- icon: "heart",
163
- highlight: `${l(t.fertileWindow.start)} – ${l(
164
- t.fertileWindow.end
165
- )}`,
166
- // Chip reuses the on-screen fertile-window badge's accent
167
- // token so the inserted PNG chip matches the screen.
168
- highlightToken: V,
169
- brand: f,
170
- fields: [
171
- {
172
- // Ovulation is a predicted date → calendar glyph (the
173
- // on-screen badge uses a Check tick, which ICON_GEOMETRY
174
- // does not carry, so the calendar reads the date meaning).
175
- icon: "calendar",
176
- label: a("cycleCalculator.ovulation"),
177
- value: l(t.ovulation)
178
- },
179
- {
180
- // Fertile window → heart glyph, matching the on-screen
181
- // fertile-window badge's Heart icon.
182
- icon: "heart",
183
- label: a("cycleCalculator.fertileWindow"),
184
- value: `${l(t.fertileWindow.start)} – ${l(
185
- t.fertileWindow.end
186
- )}`
187
- },
188
- {
189
- // Next period → droplets glyph, matching the on-screen
190
- // next-period badge's Droplet icon.
191
- icon: "droplets",
192
- label: a("cycleCalculator.nextPeriod"),
193
- value: l(t.nextPeriod)
194
- }
195
- ]
196
- }
197
- }
198
- ) : null
199
- ] }) }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: a("cycleCalculator.empty") })
200
- ]
201
- }
202
- );
203
- }
204
- );
205
- q.displayName = "CycleCalculator";
206
- export {
207
- q as C,
208
- M as L,
209
- K as p
210
- };
211
- //# sourceMappingURL=cycle-calculator-DYvGm_m1.js.map
@@ -1,216 +0,0 @@
1
- import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as F, useState as c, useMemo as p, useEffect as H } from "react";
3
- import { c as G } from "./index-D2ZczOXr.js";
4
- import { useTranslation as R } from "react-i18next";
5
- import { R as s } from "./radio-TWf9Q-mp.js";
6
- import { R as v } from "./radio-group-CLjK-SlK.js";
7
- import { F as b } from "./form-field-BOm9hK35.js";
8
- import { D as S } from "./date-picker-Bq7xhMA-.js";
9
- import { N as M } from "./number-input-Dj5L3pXK.js";
10
- import { C } from "./card-DPmk26CL.js";
11
- import { B as z } from "./badge-zsf5i5bH.js";
12
- import { I as V } from "./insert-result-DNdi_JYW.js";
13
- import { D as y, c as j } from "./gestation-mWF4AXea.js";
14
- const K = G("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
- }), Y = {
20
- preconception: "neutral",
21
- first: "info",
22
- second: "success",
23
- third: "warning",
24
- postterm: "error"
25
- }, O = {
26
- preconception: "--muted",
27
- first: "--info",
28
- second: "--success",
29
- third: "--warning-readable",
30
- postterm: "--destructive"
31
- };
32
- function P(n) {
33
- return O[n];
34
- }
35
- const U = {
36
- lmp: "dueDateCalculator.lmpDate",
37
- conception: "dueDateCalculator.conceptionDate",
38
- ivf: "dueDateCalculator.transferDate"
39
- }, q = F(
40
- ({
41
- defaultMethod: n = "lmp",
42
- onResultChange: d,
43
- onInsert: f,
44
- insertVariant: D = "insert",
45
- onCopy: x,
46
- onError: N,
47
- insertBrand: L,
48
- id: E,
49
- width: w,
50
- className: A
51
- }, T) => {
52
- const { t: e, i18n: h } = R(), [r, k] = c(n), [o, I] = c(void 0), [u, _] = c(
53
- y
54
- ), [m, $] = c(5), t = p(() => o ? j(
55
- {
56
- method: r,
57
- date: o,
58
- cycleLength: u ?? y,
59
- embryoAge: m
60
- },
61
- /* @__PURE__ */ new Date()
62
- ) : null, [r, o, u, m]), i = p(
63
- () => new Intl.DateTimeFormat(h.language, { dateStyle: "long" }),
64
- [h.language]
65
- );
66
- H(() => {
67
- d == null || d(t);
68
- }, [t, d]);
69
- const B = p(() => /* @__PURE__ */ new Date(), []);
70
- return /* @__PURE__ */ l(
71
- "div",
72
- {
73
- ref: T,
74
- "data-component": "due-date-calculator",
75
- "data-component-id": E,
76
- className: K({ width: w, className: A }),
77
- children: [
78
- /* @__PURE__ */ l(
79
- v,
80
- {
81
- label: e("dueDateCalculator.method.label"),
82
- variant: "horizontal",
83
- value: r,
84
- onValueChange: (g) => k(g),
85
- children: [
86
- /* @__PURE__ */ a(s, { label: e("dueDateCalculator.method.lmp"), value: "lmp" }),
87
- /* @__PURE__ */ a(
88
- s,
89
- {
90
- label: e("dueDateCalculator.method.conception"),
91
- value: "conception"
92
- }
93
- ),
94
- /* @__PURE__ */ a(s, { label: e("dueDateCalculator.method.ivf"), value: "ivf" })
95
- ]
96
- }
97
- ),
98
- /* @__PURE__ */ l("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
99
- /* @__PURE__ */ a(b, { label: e(U[r]), children: /* @__PURE__ */ a(S, { value: o, onChange: I, maxDate: B }) }),
100
- r === "lmp" && /* @__PURE__ */ a(
101
- b,
102
- {
103
- label: e("dueDateCalculator.cycleLength"),
104
- description: e("dueDateCalculator.cycleLengthHint"),
105
- children: /* @__PURE__ */ a(
106
- M,
107
- {
108
- mode: "integer",
109
- min: 20,
110
- max: 45,
111
- value: u,
112
- onChange: _
113
- }
114
- )
115
- }
116
- ),
117
- r === "ivf" && /* @__PURE__ */ l(
118
- v,
119
- {
120
- label: e("dueDateCalculator.embryoAge"),
121
- variant: "horizontal",
122
- value: String(m),
123
- onValueChange: (g) => $(Number(g)),
124
- children: [
125
- /* @__PURE__ */ a(s, { label: e("dueDateCalculator.day3"), value: "3" }),
126
- /* @__PURE__ */ a(s, { label: e("dueDateCalculator.day5"), value: "5" })
127
- ]
128
- }
129
- )
130
- ] }),
131
- /* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${e("dueDateCalculator.result.dueDateLabel")}: ${i.format(
132
- t.dueDate
133
- )}. ${e("dueDateCalculator.result.trimesterLabel")}: ${e(
134
- `dueDateCalculator.trimester.${t.trimester}`
135
- )}.` : "" }),
136
- t ? /* @__PURE__ */ a(C, { variant: "elevated", children: /* @__PURE__ */ l(C.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
137
- /* @__PURE__ */ l("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
138
- /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
139
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.trimesterLabel") }),
140
- /* @__PURE__ */ a("dd", { children: /* @__PURE__ */ a(
141
- z,
142
- {
143
- variant: Y[t.trimester],
144
- size: "lg",
145
- children: e(`dueDateCalculator.trimester.${t.trimester}`)
146
- }
147
- ) })
148
- ] }),
149
- /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
150
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.gestationLabel") }),
151
- /* @__PURE__ */ a("dd", { className: "type-body ds:text-foreground", children: t.gestationalAge ? e("dueDateCalculator.result.gestation", {
152
- weeks: t.gestationalAge.weeks,
153
- days: t.gestationalAge.days
154
- }) : "—" })
155
- ] }),
156
- /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
157
- /* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.dueDateLabel") }),
158
- /* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children: i.format(t.dueDate) })
159
- ] })
160
- ] }),
161
- D === "copy" || f ? /* @__PURE__ */ a(
162
- V,
163
- {
164
- variant: D,
165
- onInsert: f,
166
- onCopy: x,
167
- onError: N,
168
- card: {
169
- title: e("insert.title.dueDate"),
170
- icon: "calendar-heart",
171
- highlight: i.format(t.dueDate),
172
- // Chip tinted with the trimester's semantic token so the
173
- // inserted PNG carries the same clinical-stage colour as
174
- // the on-screen trimester badge — with the contrast-safe
175
- // orange override for the `--warning` third trimester.
176
- highlightToken: P(t.trimester),
177
- brand: L,
178
- fields: [
179
- {
180
- // The estimated date of delivery → calendar glyph.
181
- icon: "calendar",
182
- label: e("dueDateCalculator.result.dueDateLabel"),
183
- value: i.format(t.dueDate)
184
- },
185
- {
186
- // Gestational age is an elapsed duration → clock glyph.
187
- icon: "clock",
188
- label: e("dueDateCalculator.result.gestationLabel"),
189
- value: t.gestationalAge ? e("dueDateCalculator.result.gestation", {
190
- weeks: t.gestationalAge.weeks,
191
- days: t.gestationalAge.days
192
- }) : "—"
193
- },
194
- {
195
- // Trimester is a clinical-stage classification → tag.
196
- icon: "tag",
197
- label: e("dueDateCalculator.result.trimesterLabel"),
198
- value: e(
199
- `dueDateCalculator.trimester.${t.trimester}`
200
- )
201
- }
202
- ]
203
- }
204
- }
205
- ) : null
206
- ] }) }) : /* @__PURE__ */ a("p", { className: "type-body ds:text-muted-foreground", children: e("dueDateCalculator.empty") })
207
- ]
208
- }
209
- );
210
- }
211
- );
212
- q.displayName = "DueDateCalculator";
213
- export {
214
- q as D
215
- };
216
- //# sourceMappingURL=due-date-calculator-BXd3ANj7.js.map
@@ -1,50 +0,0 @@
1
- import { a, d as E } from "./date-picker-variants-DLi1Va_e.js";
2
- import { s as i } from "./subDays-Dv7q9S7u.js";
3
- const T = 280, m = 14, u = 266, d = 28;
4
- function p(e) {
5
- if (e < 0) return "preconception";
6
- const t = Math.floor(e / 7);
7
- return t < 14 ? "first" : t < 28 ? "second" : t < 42 ? "third" : "postterm";
8
- }
9
- function S(e, t) {
10
- const { method: f, date: s } = e;
11
- let o, r;
12
- if (f === "lmp") {
13
- const c = e.cycleLength ?? d;
14
- o = s, r = a(s, T + (c - d));
15
- } else if (f === "conception")
16
- o = i(s, m), r = a(s, u);
17
- else {
18
- const c = e.embryoAge ?? 5, l = i(s, c);
19
- o = i(l, m), r = a(l, u);
20
- }
21
- const n = E(t, o), D = n < 0 ? null : {
22
- weeks: Math.floor(n / 7),
23
- days: n % 7,
24
- totalDays: n
25
- };
26
- return {
27
- dueDate: r,
28
- gestationalStart: o,
29
- gestationalAge: D,
30
- trimester: p(n)
31
- };
32
- }
33
- const y = [12, 24, 28, 37, 40];
34
- function g(e) {
35
- return y.map((t) => ({
36
- key: `w${t}`,
37
- week: t,
38
- date: a(e, t * 7)
39
- }));
40
- }
41
- export {
42
- d as D,
43
- T as G,
44
- y as M,
45
- u as T,
46
- S as c,
47
- g,
48
- p as t
49
- };
50
- //# sourceMappingURL=gestation-mWF4AXea.js.map