@alfadocs/ui-kit 0.37.0 → 0.38.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 (196) hide show
  1. package/dist/_chunks/Alfadocs_Logo_Mark-7o3L3WBI.js +56 -0
  2. package/dist/_chunks/{alia-sidebar-BEoMl6UL.js → alia-sidebar-DXsYPinm.js} +2 -2
  3. package/dist/_chunks/{ar-D1RwVZFj.js → ar-Cn_NxqkN.js} +2 -2
  4. package/dist/_chunks/bmi-BxD-tFzU.js +32 -0
  5. package/dist/_chunks/bmi-calculator-BRUru9QX.js +213 -0
  6. package/dist/_chunks/{booking-DqXsd1Mv.js → booking-DK_BPHnQ.js} +4 -4
  7. package/dist/_chunks/calculator-dialog-B74fqpFZ.js +40 -0
  8. package/dist/_chunks/{chat-message-D53_fH2w.js → chat-message-ASgGtj-L.js} +30 -39
  9. package/dist/_chunks/{contact-profile-card-BA6fgS45.js → contact-profile-card-DHyuAPXM.js} +14 -13
  10. package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +185 -0
  11. package/dist/_chunks/{date-picker-CXFpu-qY.js → date-picker-CvQfs6Xh.js} +2 -2
  12. package/dist/_chunks/{date-range-picker-I-q5rifj.js → date-range-picker-U9fn1g9d.js} +3 -3
  13. package/dist/_chunks/{date-time-picker-CqpGPlcH.js → date-time-picker-Cva0ZCWw.js} +2 -2
  14. package/dist/_chunks/{de-HTQ4b4-J.js → de-BMM2H7Bs.js} +2 -2
  15. package/dist/_chunks/dependent-selector-CRWgieHm.js +324 -0
  16. package/dist/_chunks/document-scanner-CdHQ6lTN.js +702 -0
  17. package/dist/_chunks/due-date-calculator-CUspKSTw.js +171 -0
  18. package/dist/_chunks/{editable-currency-cell-renderer-DnjwZNZP.js → editable-currency-cell-renderer-DGKuRNVG.js} +2 -2
  19. package/dist/_chunks/{el-Dr1pjuDq.js → el-BYPonAaK.js} +2 -2
  20. package/dist/_chunks/{es-CvyTjLS0.js → es-CMkVCQ4F.js} +2 -2
  21. package/dist/_chunks/{file-upload-CdozCPct.js → file-upload-CnzRcErt.js} +2 -1
  22. package/dist/_chunks/fiscal-code-input-BZ0FxwUl.js +540 -0
  23. package/dist/_chunks/{fr-CS7aqaFR.js → fr-BcuWxqft.js} +2 -2
  24. package/dist/_chunks/gestation-BXEgDGmP.js +50 -0
  25. package/dist/_chunks/gestational-age-calculator-CsQ05qDy.js +165 -0
  26. package/dist/_chunks/heart-C0faivFf.js +20 -0
  27. package/dist/_chunks/{hi-3uy8KpsH.js → hi-wkq_rQAh.js} +2 -2
  28. package/dist/_chunks/image-C6RM5hfF.js +16 -0
  29. package/dist/_chunks/insert-result-yJ0QavoN.js +133 -0
  30. package/dist/_chunks/{isSameWeek-DRpMibi9.js → isSameWeek-Bim5ftRd.js} +2 -2
  31. package/dist/_chunks/{it-B_RF5VSw.js → it-GiQrQ9p4.js} +3 -3
  32. package/dist/_chunks/{ja-C1mEYy35.js → ja-qfYg3Rua.js} +2 -2
  33. package/dist/_chunks/{logo-_Z-jLq80.js → logo-yituK7sE.js} +42 -91
  34. package/dist/_chunks/{marketplace-app-shell-DXHxy9dj.js → marketplace-app-shell-BnClrL2B.js} +2 -2
  35. package/dist/_chunks/{nl-Dl7lO2t3.js → nl-xOogO4sZ.js} +2 -2
  36. package/dist/_chunks/{patient-shell-CDvMw_Nk.js → patient-shell-Bz3CdO84.js} +2 -2
  37. package/dist/_chunks/{pl-Dgsogljx.js → pl-GnOW6eGK.js} +3 -3
  38. package/dist/_chunks/{practice-results-BFM_lyUs.js → practice-results-C8ciLQap.js} +3 -2
  39. package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +209 -0
  40. package/dist/_chunks/{privacy-lock-DD-wHxBg.js → privacy-lock-BmX_gkvt.js} +2 -2
  41. package/dist/_chunks/{pt-Dm2JF4bc.js → pt-_bV5b5RW.js} +2 -2
  42. package/dist/_chunks/{public-footer.agent-Cjfe5jus.js → public-footer.agent-zw1vFin_.js} +2 -2
  43. package/dist/_chunks/qr-code-DNXhi6se.js +568 -0
  44. package/dist/_chunks/{react-day-picker-DYDdR8Vv.js → react-day-picker-CdtIiKjx.js} +24 -24
  45. package/dist/_chunks/{rich-text-editor-CHmr9Bz8.js → rich-text-editor-DLbg2852.js} +114 -124
  46. package/dist/_chunks/{ro-BXFZ_xIX.js → ro-BEcyh5Nj.js} +2 -2
  47. package/dist/_chunks/rotate-ccw-BWANpitO.js +15 -0
  48. package/dist/_chunks/{ru-BPQkNRRV.js → ru-Bi86hqMf.js} +3 -3
  49. package/dist/_chunks/session-countdown-LPnhTHjn.js +214 -0
  50. package/dist/_chunks/{shield-check-BhHyReu8.js → shield-check-C73ma9Cs.js} +8 -24
  51. package/dist/_chunks/{sign-in-with-alfadocs-button-BI0fVonM.js → sign-in-with-alfadocs-button-DeHBFRNS.js} +2 -2
  52. package/dist/_chunks/social-sign-in-button-X54ySJr1.js +243 -0
  53. package/dist/_chunks/{sq-ChTlGFcJ.js → sq-BujHSAWu.js} +2 -2
  54. package/dist/_chunks/subDays-_T9YeKPX.js +8 -0
  55. package/dist/_chunks/{sv-Do_gs6ir.js → sv-C8AeDrTA.js} +2 -2
  56. package/dist/_chunks/{tr-da_UnkYH.js → tr-CMSs_Vgf.js} +2 -2
  57. package/dist/_chunks/unit-converter-EUwO6QYq.js +168 -0
  58. package/dist/_chunks/wallet-pay-button-DK4ESYge.js +250 -0
  59. package/dist/_chunks/{zh-CN-C9qi5oak.js → zh-CN-eXB-PFu4.js} +3 -3
  60. package/dist/agent-catalog.json +203 -1
  61. package/dist/brand/provider-marks/apple-pay.d.ts +12 -0
  62. package/dist/brand/provider-marks/apple.d.ts +12 -0
  63. package/dist/brand/provider-marks/google-pay.d.ts +12 -0
  64. package/dist/brand/provider-marks/google.d.ts +13 -0
  65. package/dist/components/_shared/insert-result.d.ts +47 -0
  66. package/dist/components/bmi-calculator/bmi-calculator.d.ts +3 -0
  67. package/dist/components/bmi-calculator/index.js +6 -5
  68. package/dist/components/booking/index.js +1 -1
  69. package/dist/components/calculator-dialog/calculator-dialog.d.ts +26 -0
  70. package/dist/components/calculator-dialog/index.d.ts +3 -0
  71. package/dist/components/calculator-dialog/index.js +5 -0
  72. package/dist/components/chat-message/index.js +1 -1
  73. package/dist/components/contact-profile-card/index.js +1 -1
  74. package/dist/components/cycle-calculator/cycle-calculator.d.ts +21 -0
  75. package/dist/components/cycle-calculator/cycle.d.ts +37 -0
  76. package/dist/components/cycle-calculator/index.d.ts +4 -0
  77. package/dist/components/cycle-calculator/index.js +7 -0
  78. package/dist/components/data-table/index.js +1 -1
  79. package/dist/components/date-picker/index.js +1 -1
  80. package/dist/components/date-range-picker/index.js +1 -1
  81. package/dist/components/date-time-picker/index.js +1 -1
  82. package/dist/components/dependent-selector/dependent-selector.agent.d.ts +4 -0
  83. package/dist/components/dependent-selector/dependent-selector.d.ts +72 -0
  84. package/dist/components/dependent-selector/index.d.ts +4 -0
  85. package/dist/components/dependent-selector/index.js +6 -0
  86. package/dist/components/document-scanner/document-scanner.agent.d.ts +4 -0
  87. package/dist/components/document-scanner/document-scanner.d.ts +93 -0
  88. package/dist/components/document-scanner/index.d.ts +4 -0
  89. package/dist/components/document-scanner/index.js +6 -0
  90. package/dist/components/due-date-calculator/due-date-calculator.d.ts +3 -0
  91. package/dist/components/due-date-calculator/gestation.d.ts +16 -0
  92. package/dist/components/due-date-calculator/index.d.ts +1 -1
  93. package/dist/components/due-date-calculator/index.js +10 -7
  94. package/dist/components/file-upload/index.js +1 -1
  95. package/dist/components/fiscal-code-input/calculate-codice-fiscale.d.ts +24 -0
  96. package/dist/components/fiscal-code-input/fiscal-code-input.agent.d.ts +4 -0
  97. package/dist/components/fiscal-code-input/fiscal-code-input.d.ts +61 -0
  98. package/dist/components/fiscal-code-input/index.d.ts +6 -0
  99. package/dist/components/fiscal-code-input/index.js +11 -0
  100. package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts +21 -0
  101. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +27 -0
  102. package/dist/components/gestational-age-calculator/index.d.ts +3 -0
  103. package/dist/components/gestational-age-calculator/index.js +5 -0
  104. package/dist/components/index.d.ts +13 -0
  105. package/dist/components/logo/index.js +1 -1
  106. package/dist/components/practice-results/index.js +1 -1
  107. package/dist/components/pregnancy-weight-gain/index.d.ts +4 -0
  108. package/dist/components/pregnancy-weight-gain/index.js +9 -0
  109. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +19 -0
  110. package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +41 -0
  111. package/dist/components/privacy-lock/index.js +1 -1
  112. package/dist/components/public-footer/index.js +1 -1
  113. package/dist/components/qr-code/index.d.ts +5 -0
  114. package/dist/components/qr-code/index.js +8 -0
  115. package/dist/components/qr-code/qr-code.agent.d.ts +3 -0
  116. package/dist/components/qr-code/qr-code.d.ts +59 -0
  117. package/dist/components/qr-code/qr-encode.d.ts +46 -0
  118. package/dist/components/rich-text-editor/index.js +1 -1
  119. package/dist/components/session-countdown/index.d.ts +4 -0
  120. package/dist/components/session-countdown/index.js +6 -0
  121. package/dist/components/session-countdown/session-countdown.agent.d.ts +3 -0
  122. package/dist/components/session-countdown/session-countdown.d.ts +38 -0
  123. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  124. package/dist/components/social-sign-in-button/index.d.ts +3 -0
  125. package/dist/components/social-sign-in-button/index.js +5 -0
  126. package/dist/components/social-sign-in-button/social-sign-in-button.d.ts +56 -0
  127. package/dist/components/unit-converter/index.d.ts +4 -0
  128. package/dist/components/unit-converter/index.js +9 -0
  129. package/dist/components/unit-converter/unit-converter.d.ts +21 -0
  130. package/dist/components/unit-converter/units.d.ts +18 -0
  131. package/dist/components/wallet-pay-button/index.d.ts +3 -0
  132. package/dist/components/wallet-pay-button/index.js +5 -0
  133. package/dist/components/wallet-pay-button/wallet-pay-button.d.ts +63 -0
  134. package/dist/i18n/locales/ar.d.ts +252 -0
  135. package/dist/i18n/locales/ar.js +249 -0
  136. package/dist/i18n/locales/de.d.ts +252 -0
  137. package/dist/i18n/locales/de.js +249 -0
  138. package/dist/i18n/locales/el.d.ts +252 -0
  139. package/dist/i18n/locales/el.js +249 -0
  140. package/dist/i18n/locales/en.d.ts +252 -0
  141. package/dist/i18n/locales/en.js +252 -0
  142. package/dist/i18n/locales/es.d.ts +252 -0
  143. package/dist/i18n/locales/es.js +249 -0
  144. package/dist/i18n/locales/fr.d.ts +252 -0
  145. package/dist/i18n/locales/fr.js +249 -0
  146. package/dist/i18n/locales/hi.d.ts +252 -0
  147. package/dist/i18n/locales/hi.js +249 -0
  148. package/dist/i18n/locales/it.d.ts +252 -0
  149. package/dist/i18n/locales/it.js +249 -0
  150. package/dist/i18n/locales/ja.d.ts +252 -0
  151. package/dist/i18n/locales/ja.js +245 -0
  152. package/dist/i18n/locales/nl.d.ts +252 -0
  153. package/dist/i18n/locales/nl.js +249 -0
  154. package/dist/i18n/locales/pl.d.ts +252 -0
  155. package/dist/i18n/locales/pl.js +249 -0
  156. package/dist/i18n/locales/pt.d.ts +252 -0
  157. package/dist/i18n/locales/pt.js +252 -0
  158. package/dist/i18n/locales/ro.d.ts +252 -0
  159. package/dist/i18n/locales/ro.js +249 -0
  160. package/dist/i18n/locales/ru.d.ts +252 -0
  161. package/dist/i18n/locales/ru.js +249 -0
  162. package/dist/i18n/locales/sq.d.ts +252 -0
  163. package/dist/i18n/locales/sq.js +249 -0
  164. package/dist/i18n/locales/sv.d.ts +252 -0
  165. package/dist/i18n/locales/sv.js +249 -0
  166. package/dist/i18n/locales/tr.d.ts +252 -0
  167. package/dist/i18n/locales/tr.js +249 -0
  168. package/dist/i18n/locales/zh.d.ts +252 -0
  169. package/dist/i18n/locales/zh.js +245 -0
  170. package/dist/index.js +587 -535
  171. package/dist/locales/ar.json +252 -0
  172. package/dist/locales/de.json +252 -0
  173. package/dist/locales/el.json +252 -0
  174. package/dist/locales/en.json +252 -0
  175. package/dist/locales/es.json +252 -0
  176. package/dist/locales/fr.json +252 -0
  177. package/dist/locales/hi.json +252 -0
  178. package/dist/locales/it.json +252 -0
  179. package/dist/locales/ja.json +252 -0
  180. package/dist/locales/nl.json +252 -0
  181. package/dist/locales/pl.json +252 -0
  182. package/dist/locales/pt.json +252 -0
  183. package/dist/locales/ro.json +252 -0
  184. package/dist/locales/ru.json +252 -0
  185. package/dist/locales/sq.json +252 -0
  186. package/dist/locales/sv.json +252 -0
  187. package/dist/locales/tr.json +252 -0
  188. package/dist/locales/zh.json +252 -0
  189. package/dist/patterns/alia-assistant/index.js +1 -1
  190. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  191. package/dist/patterns/patient-shell/index.js +1 -1
  192. package/dist/tokens.css +1 -1
  193. package/package.json +49 -1
  194. package/dist/_chunks/bmi-calculator-DQD5_nE-.js +0 -214
  195. package/dist/_chunks/due-date-calculator-kf9U_g7O.js +0 -173
  196. package/dist/_chunks/subDays-D-WYRpdW.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "0.37.0",
3
+ "version": "0.38.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,6 +95,26 @@
95
95
  "types": "./dist/components/bmi-calculator/index.d.ts",
96
96
  "import": "./dist/components/bmi-calculator/index.js"
97
97
  },
98
+ "./calculator-dialog": {
99
+ "types": "./dist/components/calculator-dialog/index.d.ts",
100
+ "import": "./dist/components/calculator-dialog/index.js"
101
+ },
102
+ "./cycle-calculator": {
103
+ "types": "./dist/components/cycle-calculator/index.d.ts",
104
+ "import": "./dist/components/cycle-calculator/index.js"
105
+ },
106
+ "./gestational-age-calculator": {
107
+ "types": "./dist/components/gestational-age-calculator/index.d.ts",
108
+ "import": "./dist/components/gestational-age-calculator/index.js"
109
+ },
110
+ "./pregnancy-weight-gain": {
111
+ "types": "./dist/components/pregnancy-weight-gain/index.d.ts",
112
+ "import": "./dist/components/pregnancy-weight-gain/index.js"
113
+ },
114
+ "./unit-converter": {
115
+ "types": "./dist/components/unit-converter/index.d.ts",
116
+ "import": "./dist/components/unit-converter/index.js"
117
+ },
98
118
  "./booking": {
99
119
  "types": "./dist/components/booking/index.d.ts",
100
120
  "import": "./dist/components/booking/index.js"
@@ -187,6 +207,10 @@
187
207
  "types": "./dist/components/date-time-picker/index.d.ts",
188
208
  "import": "./dist/components/date-time-picker/index.js"
189
209
  },
210
+ "./dependent-selector": {
211
+ "types": "./dist/components/dependent-selector/index.d.ts",
212
+ "import": "./dist/components/dependent-selector/index.js"
213
+ },
190
214
  "./description-list": {
191
215
  "types": "./dist/components/description-list/index.d.ts",
192
216
  "import": "./dist/components/description-list/index.js"
@@ -195,6 +219,10 @@
195
219
  "types": "./dist/components/dialog/index.d.ts",
196
220
  "import": "./dist/components/dialog/index.js"
197
221
  },
222
+ "./document-scanner": {
223
+ "types": "./dist/components/document-scanner/index.d.ts",
224
+ "import": "./dist/components/document-scanner/index.js"
225
+ },
198
226
  "./dropdown-menu": {
199
227
  "types": "./dist/components/dropdown-menu/index.d.ts",
200
228
  "import": "./dist/components/dropdown-menu/index.js"
@@ -215,6 +243,10 @@
215
243
  "types": "./dist/components/file-upload/index.d.ts",
216
244
  "import": "./dist/components/file-upload/index.js"
217
245
  },
246
+ "./fiscal-code-input": {
247
+ "types": "./dist/components/fiscal-code-input/index.d.ts",
248
+ "import": "./dist/components/fiscal-code-input/index.js"
249
+ },
218
250
  "./flag": {
219
251
  "types": "./dist/components/flag/index.d.ts",
220
252
  "import": "./dist/components/flag/index.js"
@@ -363,6 +395,10 @@
363
395
  "types": "./dist/components/public-header/index.d.ts",
364
396
  "import": "./dist/components/public-header/index.js"
365
397
  },
398
+ "./qr-code": {
399
+ "types": "./dist/components/qr-code/index.d.ts",
400
+ "import": "./dist/components/qr-code/index.js"
401
+ },
366
402
  "./radio-group": {
367
403
  "types": "./dist/components/radio-group/index.d.ts",
368
404
  "import": "./dist/components/radio-group/index.js"
@@ -407,6 +443,10 @@
407
443
  "types": "./dist/components/separator/index.d.ts",
408
444
  "import": "./dist/components/separator/index.js"
409
445
  },
446
+ "./session-countdown": {
447
+ "types": "./dist/components/session-countdown/index.d.ts",
448
+ "import": "./dist/components/session-countdown/index.js"
449
+ },
410
450
  "./sheet": {
411
451
  "types": "./dist/components/sheet/index.d.ts",
412
452
  "import": "./dist/components/sheet/index.js"
@@ -435,6 +475,10 @@
435
475
  "types": "./dist/components/slot-grid/index.d.ts",
436
476
  "import": "./dist/components/slot-grid/index.js"
437
477
  },
478
+ "./social-sign-in-button": {
479
+ "types": "./dist/components/social-sign-in-button/index.d.ts",
480
+ "import": "./dist/components/social-sign-in-button/index.js"
481
+ },
438
482
  "./sparkline": {
439
483
  "types": "./dist/components/sparkline/index.d.ts",
440
484
  "import": "./dist/components/sparkline/index.js"
@@ -519,6 +563,10 @@
519
563
  "types": "./dist/components/typing-indicator/index.d.ts",
520
564
  "import": "./dist/components/typing-indicator/index.js"
521
565
  },
566
+ "./wallet-pay-button": {
567
+ "types": "./dist/components/wallet-pay-button/index.d.ts",
568
+ "import": "./dist/components/wallet-pay-button/index.js"
569
+ },
522
570
  "./warning-stack": {
523
571
  "types": "./dist/components/warning-stack/index.d.ts",
524
572
  "import": "./dist/components/warning-stack/index.js"
@@ -1,214 +0,0 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as z, useId as K, useState as o, useMemo as O, useEffect as X } from "react";
3
- import { c as Y } from "./index-D2ZczOXr.js";
4
- import { useTranslation as q } from "react-i18next";
5
- import { R as _ } from "./radio-TWf9Q-mp.js";
6
- import { R as J } from "./radio-group-BcF92GEF.js";
7
- import { F as G } from "./form-field-BOm9hK35.js";
8
- import { N as p } from "./number-input-Dj5L3pXK.js";
9
- import { C as Q } from "./chart-DnHvmiDX.js";
10
- import { B as Z } from "./badge-zsf5i5bH.js";
11
- const A = 0.45359237, S = 2.54, y = 12, T = (a) => a * A, aa = (a) => a / A, ta = (a) => a * S, la = (a) => a / S;
12
- function ea(a) {
13
- const e = la(a), r = Math.floor(e / y);
14
- return { ft: r, in: e - r * y };
15
- }
16
- const $ = (a, e) => ta(a * y + e);
17
- function ia(a, e) {
18
- if (a === null || e === null || !Number.isFinite(a) || !Number.isFinite(e) || a <= 0 || e <= 0)
19
- return null;
20
- const r = e / 100;
21
- return a / (r * r);
22
- }
23
- function na(a) {
24
- return a < 18.5 ? "underweight" : a < 25 ? "normal" : a < 30 ? "overweight" : "obese";
25
- }
26
- const E = 12, ra = 40;
27
- function sa(a) {
28
- const e = (a - E) / (ra - E) * 100;
29
- return Math.min(100, Math.max(0, e));
30
- }
31
- const oa = Y("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
32
- variants: {
33
- width: {
34
- full: "ds:w-full",
35
- auto: "ds:inline-flex"
36
- }
37
- },
38
- defaultVariants: { width: "full" }
39
- }), ca = {
40
- underweight: "info",
41
- normal: "success",
42
- overweight: "warning",
43
- obese: "error"
44
- }, h = (a) => Math.round(a * 10) / 10, ma = z(
45
- ({ defaultUnitSystem: a = "metric", onResultChange: e, id: r, width: k, className: H }, L) => {
46
- const { t, i18n: x } = q(), N = K(), [c, P] = o(a), [b, I] = o(null), [f, F] = o(null), [m, w] = o(null), [u, M] = o(null), [d, B] = o(null), R = (D) => {
47
- const v = D;
48
- if (v !== c) {
49
- if (v === "imperial") {
50
- if (b !== null) {
51
- const { ft: W, in: j } = ea(b);
52
- w(W), M(h(j));
53
- }
54
- f !== null && B(h(aa(f)));
55
- } else
56
- (m !== null || u !== null) && I(h($(m ?? 0, u ?? 0))), d !== null && F(h(T(d)));
57
- P(v);
58
- }
59
- }, U = c === "metric" ? b : m !== null || u !== null ? $(m ?? 0, u ?? 0) : null, V = c === "metric" ? f : d !== null ? T(d) : null, i = ia(V, U), n = i !== null ? na(i) : null, C = O(
60
- () => new Intl.NumberFormat(x.language, {
61
- minimumFractionDigits: 1,
62
- maximumFractionDigits: 1
63
- }),
64
- [x.language]
65
- );
66
- X(() => {
67
- e == null || e(
68
- i !== null && n !== null ? { bmi: i, category: n } : null
69
- );
70
- }, [i, n, e]);
71
- const g = c === "metric";
72
- return /* @__PURE__ */ s(
73
- "div",
74
- {
75
- ref: L,
76
- "data-component": "bmi-calculator",
77
- "data-component-id": r,
78
- className: oa({ width: k, className: H }),
79
- children: [
80
- /* @__PURE__ */ s(
81
- J,
82
- {
83
- label: t("bmiCalculator.unitSystem.label"),
84
- variant: "horizontal",
85
- value: c,
86
- onValueChange: R,
87
- children: [
88
- /* @__PURE__ */ l(_, { label: t("bmiCalculator.unitSystem.metric"), value: "metric" }),
89
- /* @__PURE__ */ l(
90
- _,
91
- {
92
- label: t("bmiCalculator.unitSystem.imperial"),
93
- value: "imperial"
94
- }
95
- )
96
- ]
97
- }
98
- ),
99
- /* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
100
- g ? /* @__PURE__ */ l(
101
- G,
102
- {
103
- label: `${t("bmiCalculator.height")} (${t("bmiCalculator.units.cm")})`,
104
- children: /* @__PURE__ */ l(
105
- p,
106
- {
107
- mode: "decimal",
108
- min: 0,
109
- step: 0.5,
110
- value: b,
111
- onChange: I
112
- }
113
- )
114
- }
115
- ) : /* @__PURE__ */ s("div", { role: "group", "aria-labelledby": N, children: [
116
- /* @__PURE__ */ l(
117
- "span",
118
- {
119
- id: N,
120
- className: "type-label ds:mb-[var(--spacing-xs)] ds:block ds:text-foreground",
121
- children: t("bmiCalculator.height")
122
- }
123
- ),
124
- /* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
125
- /* @__PURE__ */ l(
126
- p,
127
- {
128
- mode: "integer",
129
- min: 0,
130
- value: m,
131
- onChange: w,
132
- "aria-label": t("bmiCalculator.feet")
133
- }
134
- ),
135
- /* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: t("bmiCalculator.units.ft") }),
136
- /* @__PURE__ */ l(
137
- p,
138
- {
139
- mode: "decimal",
140
- min: 0,
141
- max: 11.9,
142
- step: 0.5,
143
- value: u,
144
- onChange: M,
145
- "aria-label": t("bmiCalculator.inches")
146
- }
147
- ),
148
- /* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: t("bmiCalculator.units.in") })
149
- ] })
150
- ] }),
151
- /* @__PURE__ */ l(
152
- G,
153
- {
154
- label: `${t("bmiCalculator.weight")} (${t(
155
- g ? "bmiCalculator.units.kg" : "bmiCalculator.units.lb"
156
- )})`,
157
- children: /* @__PURE__ */ l(
158
- p,
159
- {
160
- mode: "decimal",
161
- min: 0,
162
- step: g ? 0.1 : 0.5,
163
- value: g ? f : d,
164
- onChange: g ? F : B
165
- }
166
- )
167
- }
168
- )
169
- ] }),
170
- /* @__PURE__ */ l("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: i !== null && n !== null ? t("bmiCalculator.gaugeAria", {
171
- bmi: C.format(i),
172
- category: t(`bmiCalculator.category.${n}`)
173
- }) : "" }),
174
- i !== null && n !== null ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)] ds:sm:flex-row ds:sm:items-center ds:sm:gap-[var(--spacing-lg)]", children: [
175
- /* @__PURE__ */ l(
176
- Q,
177
- {
178
- type: "radialBar",
179
- title: t("bmiCalculator.gaugeAria", {
180
- bmi: C.format(i),
181
- category: t(`bmiCalculator.category.${n}`)
182
- }),
183
- series: [sa(i)],
184
- labels: [t(`bmiCalculator.category.${n}`)],
185
- radialValueFormatter: () => C.format(i),
186
- height: 240,
187
- width: 240
188
- }
189
- ),
190
- /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
191
- /* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: t("bmiCalculator.category.label") }),
192
- /* @__PURE__ */ l(Z, { variant: ca[n], size: "lg", children: t(`bmiCalculator.category.${n}`) }),
193
- /* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: t(`bmiCalculator.range.${n}`) })
194
- ] })
195
- ] }) : /* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: t("bmiCalculator.empty") })
196
- ]
197
- }
198
- );
199
- }
200
- );
201
- ma.displayName = "BmiCalculator";
202
- export {
203
- ma as B,
204
- sa as a,
205
- na as b,
206
- ea as c,
207
- la as d,
208
- ia as e,
209
- $ as f,
210
- ta as i,
211
- aa as k,
212
- T as l
213
- };
214
- //# sourceMappingURL=bmi-calculator-DQD5_nE-.js.map
@@ -1,173 +0,0 @@
1
- import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as I, useState as g, useMemo as C, useEffect as M } from "react";
3
- import { c as O } from "./index-D2ZczOXr.js";
4
- import { useTranslation as k } from "react-i18next";
5
- import { R as i } from "./radio-TWf9Q-mp.js";
6
- import { R as A } from "./radio-group-BcF92GEF.js";
7
- import { F as E } from "./form-field-BOm9hK35.js";
8
- import { D as $ } from "./date-picker-CXFpu-qY.js";
9
- import { N as G } from "./number-input-Dj5L3pXK.js";
10
- import { B as R } from "./badge-zsf5i5bH.js";
11
- import { a as b, d as Y } from "./react-day-picker-DYDdR8Vv.js";
12
- import { s as x } from "./subDays-D-WYRpdW.js";
13
- const B = 280, L = 14, T = 266, D = 28;
14
- function V(s) {
15
- if (s < 0) return "preconception";
16
- const l = Math.floor(s / 7);
17
- return l < 14 ? "first" : l < 28 ? "second" : l < 42 ? "third" : "postterm";
18
- }
19
- function z(s, l) {
20
- const { method: u, date: d } = s;
21
- let c, n;
22
- if (u === "lmp") {
23
- const r = s.cycleLength ?? D;
24
- c = d, n = b(d, B + (r - D));
25
- } else if (u === "conception")
26
- c = x(d, L), n = b(d, T);
27
- else {
28
- const r = s.embryoAge ?? 5, f = x(d, r);
29
- c = x(f, L), n = b(f, T);
30
- }
31
- const e = Y(l, c), m = e < 0 ? null : {
32
- weeks: Math.floor(e / 7),
33
- days: e % 7,
34
- totalDays: e
35
- };
36
- return {
37
- dueDate: n,
38
- gestationalStart: c,
39
- gestationalAge: m,
40
- trimester: V(e)
41
- };
42
- }
43
- const P = O("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
44
- variants: {
45
- width: { full: "ds:w-full", auto: "ds:inline-flex" }
46
- },
47
- defaultVariants: { width: "full" }
48
- }), j = {
49
- preconception: "neutral",
50
- first: "info",
51
- second: "success",
52
- third: "warning",
53
- postterm: "error"
54
- }, H = {
55
- lmp: "dueDateCalculator.lmpDate",
56
- conception: "dueDateCalculator.conceptionDate",
57
- ivf: "dueDateCalculator.transferDate"
58
- }, K = I(({ defaultMethod: s = "lmp", onResultChange: l, id: u, width: d, className: c }, n) => {
59
- const { t: e, i18n: m } = k(), [r, f] = g(s), [p, w] = g(void 0), [h, _] = g(
60
- D
61
- ), [y, F] = g(5), a = C(() => p ? z(
62
- {
63
- method: r,
64
- date: p,
65
- cycleLength: h ?? D,
66
- embryoAge: y
67
- },
68
- /* @__PURE__ */ new Date()
69
- ) : null, [r, p, h, y]), N = C(
70
- () => new Intl.DateTimeFormat(m.language, { dateStyle: "long" }),
71
- [m.language]
72
- );
73
- M(() => {
74
- l == null || l(a);
75
- }, [a, l]);
76
- const S = C(() => /* @__PURE__ */ new Date(), []);
77
- return /* @__PURE__ */ o(
78
- "div",
79
- {
80
- ref: n,
81
- "data-component": "due-date-calculator",
82
- "data-component-id": u,
83
- className: P({ width: d, className: c }),
84
- children: [
85
- /* @__PURE__ */ o(
86
- A,
87
- {
88
- label: e("dueDateCalculator.method.label"),
89
- variant: "horizontal",
90
- value: r,
91
- onValueChange: (v) => f(v),
92
- children: [
93
- /* @__PURE__ */ t(i, { label: e("dueDateCalculator.method.lmp"), value: "lmp" }),
94
- /* @__PURE__ */ t(
95
- i,
96
- {
97
- label: e("dueDateCalculator.method.conception"),
98
- value: "conception"
99
- }
100
- ),
101
- /* @__PURE__ */ t(i, { label: e("dueDateCalculator.method.ivf"), value: "ivf" })
102
- ]
103
- }
104
- ),
105
- /* @__PURE__ */ o("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
106
- /* @__PURE__ */ t(E, { label: e(H[r]), children: /* @__PURE__ */ t($, { value: p, onChange: w, maxDate: S }) }),
107
- r === "lmp" && /* @__PURE__ */ t(
108
- E,
109
- {
110
- label: e("dueDateCalculator.cycleLength"),
111
- description: e("dueDateCalculator.cycleLengthHint"),
112
- children: /* @__PURE__ */ t(
113
- G,
114
- {
115
- mode: "integer",
116
- min: 20,
117
- max: 45,
118
- value: h,
119
- onChange: _
120
- }
121
- )
122
- }
123
- ),
124
- r === "ivf" && /* @__PURE__ */ o(
125
- A,
126
- {
127
- label: e("dueDateCalculator.embryoAge"),
128
- variant: "horizontal",
129
- value: String(y),
130
- onValueChange: (v) => F(Number(v)),
131
- children: [
132
- /* @__PURE__ */ t(i, { label: e("dueDateCalculator.day3"), value: "3" }),
133
- /* @__PURE__ */ t(i, { label: e("dueDateCalculator.day5"), value: "5" })
134
- ]
135
- }
136
- )
137
- ] }),
138
- /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a ? `${e("dueDateCalculator.result.dueDateLabel")}: ${N.format(
139
- a.dueDate
140
- )}. ${e("dueDateCalculator.result.trimesterLabel")}: ${e(
141
- `dueDateCalculator.trimester.${a.trimester}`
142
- )}.` : "" }),
143
- a ? /* @__PURE__ */ o("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
144
- /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
145
- /* @__PURE__ */ t("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.dueDateLabel") }),
146
- /* @__PURE__ */ t("dd", { className: "type-metric ds:text-foreground", children: N.format(a.dueDate) })
147
- ] }),
148
- /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
149
- /* @__PURE__ */ t("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.gestationLabel") }),
150
- /* @__PURE__ */ t("dd", { className: "type-body ds:text-foreground", children: a.gestationalAge ? e("dueDateCalculator.result.gestation", {
151
- weeks: a.gestationalAge.weeks,
152
- days: a.gestationalAge.days
153
- }) : "—" })
154
- ] }),
155
- /* @__PURE__ */ o("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
156
- /* @__PURE__ */ t("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.trimesterLabel") }),
157
- /* @__PURE__ */ t("dd", { children: /* @__PURE__ */ t(R, { variant: j[a.trimester], size: "lg", children: e(`dueDateCalculator.trimester.${a.trimester}`) }) })
158
- ] })
159
- ] }) : /* @__PURE__ */ t("p", { className: "type-body ds:text-muted-foreground", children: e("dueDateCalculator.empty") })
160
- ]
161
- }
162
- );
163
- });
164
- K.displayName = "DueDateCalculator";
165
- export {
166
- D,
167
- B as G,
168
- T,
169
- K as a,
170
- z as c,
171
- V as t
172
- };
173
- //# sourceMappingURL=due-date-calculator-kf9U_g7O.js.map
@@ -1,8 +0,0 @@
1
- import { a as o } from "./react-day-picker-DYDdR8Vv.js";
2
- function n(a, s, r) {
3
- return o(a, -s, r);
4
- }
5
- export {
6
- n as s
7
- };
8
- //# sourceMappingURL=subDays-D-WYRpdW.js.map