@alfadocs/ui-kit 0.43.0 → 0.45.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 (129) hide show
  1. package/dist/_chunks/{alia-sidebar-BpX4z_af.js → alia-sidebar-Be8FhKYd.js} +332 -237
  2. package/dist/_chunks/{autocomplete-DIgdhCGJ.js → autocomplete-CDqxB68B.js} +2 -2
  3. package/dist/_chunks/bmi-calculator-CQqXTVNL.js +258 -0
  4. package/dist/_chunks/{booking-CtLwaxkK.js → booking-DlDVuWMd.js} +2 -2
  5. package/dist/_chunks/{calculator-dialog-DdexHrTP.js → calculator-dialog-D-nfvteH.js} +2 -2
  6. package/dist/_chunks/{cycle-calculator-Dln-y1k_.js → cycle-calculator-KxA8dqDf.js} +73 -54
  7. package/dist/_chunks/dialog-BTpZV6It.js +223 -0
  8. package/dist/_chunks/{due-date-calculator-Cc4dRqTI.js → due-date-calculator-mFxpHLml.js} +73 -49
  9. package/dist/_chunks/{editable-currency-cell-renderer-9jqwDv5x.js → editable-currency-cell-renderer-BEBUQl9P.js} +2 -2
  10. package/dist/_chunks/{freemium-paywall-BLXESpH4.js → freemium-paywall-BYist2sJ.js} +2 -2
  11. package/dist/_chunks/gestational-age-calculator-gWI_uRA1.js +203 -0
  12. package/dist/_chunks/insert-result-C5ABnzDl.js +711 -0
  13. package/dist/_chunks/{marketplace-app-shell-Dc5cTIt8.js → marketplace-app-shell-Gfsf78ge.js} +2 -2
  14. package/dist/_chunks/{patient-search-DPe2ZYEL.js → patient-search-CocVcGJ3.js} +2 -2
  15. package/dist/_chunks/{payment-form-BzVsG6Ks.js → payment-form-DqEiEJRO.js} +247 -195
  16. package/dist/_chunks/{pdf-viewer-B6MC6VTx.js → pdf-viewer-CWEXTlwq.js} +2 -2
  17. package/dist/_chunks/{practice-results-CrLpEiiW.js → practice-results-DDi-kvaD.js} +2 -2
  18. package/dist/_chunks/{pregnancy-weight-gain-zZL5Ir2-.js → pregnancy-weight-gain-BtEHaSqy.js} +78 -56
  19. package/dist/_chunks/{search-bar-CP6wUJFY.js → search-bar-CvN_S0jW.js} +2 -2
  20. package/dist/_chunks/{search-input-C1C3jQpD.js → search-input-D3aMvi4l.js} +2 -2
  21. package/dist/_chunks/{sign-document-B-3k_0LO.js → sign-document-BCyLpFHJ.js} +2 -2
  22. package/dist/_chunks/{sign-in-with-alfadocs-button-DeHBFRNS.js → sign-in-with-alfadocs-button-CuYn_kKP.js} +2 -2
  23. package/dist/_chunks/{social-sign-in-button-X54ySJr1.js → social-sign-in-button-uJYLM366.js} +2 -2
  24. package/dist/_chunks/{spinner-CCByyvcb.js → spinner-OjQNn8oN.js} +7 -3
  25. package/dist/_chunks/{transcript-panel-CR7VY1uw.js → transcript-panel-B4HiC7ed.js} +2 -2
  26. package/dist/_chunks/{unit-converter-CuXCXJhK.js → unit-converter-u3CwNDpP.js} +96 -74
  27. package/dist/_chunks/{wallet-pay-button-DK4ESYge.js → wallet-pay-button-DuDPBlCO.js} +2 -2
  28. package/dist/agent-catalog.json +1 -1
  29. package/dist/components/_shared/banded-gauge.d.ts +193 -0
  30. package/dist/components/_shared/index.d.ts +1 -1
  31. package/dist/components/_shared/insert-result.d.ts +173 -10
  32. package/dist/components/autocomplete/index.js +1 -1
  33. package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
  34. package/dist/components/bmi-calculator/index.js +1 -1
  35. package/dist/components/booking/index.js +1 -1
  36. package/dist/components/calculator-dialog/index.js +1 -1
  37. package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
  38. package/dist/components/cycle-calculator/index.js +1 -1
  39. package/dist/components/data-table/index.js +1 -1
  40. package/dist/components/dialog/dialog.d.ts +1 -0
  41. package/dist/components/dialog/index.js +1 -1
  42. package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
  43. package/dist/components/due-date-calculator/index.js +1 -1
  44. package/dist/components/freemium-paywall/index.js +1 -1
  45. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
  46. package/dist/components/gestational-age-calculator/index.js +1 -1
  47. package/dist/components/index.d.ts +1 -1
  48. package/dist/components/patient-search/index.js +1 -1
  49. package/dist/components/payment-form/index.js +1 -1
  50. package/dist/components/payment-form/payment-form.d.ts +24 -2
  51. package/dist/components/pdf-viewer/index.js +1 -1
  52. package/dist/components/practice-results/index.js +1 -1
  53. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  54. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
  55. package/dist/components/search-bar/index.js +1 -1
  56. package/dist/components/search-input/index.js +1 -1
  57. package/dist/components/sign-document/index.js +1 -1
  58. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  59. package/dist/components/social-sign-in-button/index.js +1 -1
  60. package/dist/components/spinner/index.js +1 -1
  61. package/dist/components/spinner/spinner.d.ts +2 -2
  62. package/dist/components/transcript-panel/index.js +1 -1
  63. package/dist/components/unit-converter/index.js +1 -1
  64. package/dist/components/unit-converter/unit-converter.d.ts +6 -0
  65. package/dist/components/wallet-pay-button/index.js +1 -1
  66. package/dist/i18n/locales/ar.d.ts +1 -1
  67. package/dist/i18n/locales/ar.js +1 -1
  68. package/dist/i18n/locales/de.d.ts +1 -1
  69. package/dist/i18n/locales/de.js +1 -1
  70. package/dist/i18n/locales/el.d.ts +1 -1
  71. package/dist/i18n/locales/el.js +1 -1
  72. package/dist/i18n/locales/en.d.ts +1 -1
  73. package/dist/i18n/locales/en.js +1 -1
  74. package/dist/i18n/locales/es.d.ts +1 -1
  75. package/dist/i18n/locales/es.js +1 -1
  76. package/dist/i18n/locales/fr.d.ts +1 -1
  77. package/dist/i18n/locales/fr.js +1 -1
  78. package/dist/i18n/locales/hi.d.ts +1 -1
  79. package/dist/i18n/locales/hi.js +1 -1
  80. package/dist/i18n/locales/it.d.ts +1 -1
  81. package/dist/i18n/locales/it.js +1 -1
  82. package/dist/i18n/locales/ja.d.ts +1 -1
  83. package/dist/i18n/locales/ja.js +1 -1
  84. package/dist/i18n/locales/nl.d.ts +1 -1
  85. package/dist/i18n/locales/nl.js +1 -1
  86. package/dist/i18n/locales/pl.d.ts +1 -1
  87. package/dist/i18n/locales/pl.js +1 -1
  88. package/dist/i18n/locales/pt.d.ts +1 -1
  89. package/dist/i18n/locales/pt.js +1 -1
  90. package/dist/i18n/locales/ro.d.ts +1 -1
  91. package/dist/i18n/locales/ro.js +1 -1
  92. package/dist/i18n/locales/ru.d.ts +1 -1
  93. package/dist/i18n/locales/ru.js +1 -1
  94. package/dist/i18n/locales/sq.d.ts +1 -1
  95. package/dist/i18n/locales/sq.js +1 -1
  96. package/dist/i18n/locales/sv.d.ts +1 -1
  97. package/dist/i18n/locales/sv.js +1 -1
  98. package/dist/i18n/locales/tr.d.ts +1 -1
  99. package/dist/i18n/locales/tr.js +1 -1
  100. package/dist/i18n/locales/zh.d.ts +1 -1
  101. package/dist/i18n/locales/zh.js +1 -1
  102. package/dist/index.js +497 -496
  103. package/dist/locales/ar.json +1 -1
  104. package/dist/locales/de.json +1 -1
  105. package/dist/locales/el.json +1 -1
  106. package/dist/locales/en.json +1 -1
  107. package/dist/locales/es.json +1 -1
  108. package/dist/locales/fr.json +1 -1
  109. package/dist/locales/hi.json +1 -1
  110. package/dist/locales/it.json +1 -1
  111. package/dist/locales/ja.json +1 -1
  112. package/dist/locales/nl.json +1 -1
  113. package/dist/locales/pl.json +1 -1
  114. package/dist/locales/pt.json +1 -1
  115. package/dist/locales/ro.json +1 -1
  116. package/dist/locales/ru.json +1 -1
  117. package/dist/locales/sq.json +1 -1
  118. package/dist/locales/sv.json +1 -1
  119. package/dist/locales/tr.json +1 -1
  120. package/dist/locales/zh.json +1 -1
  121. package/dist/patterns/alia-assistant/alia-types.d.ts +20 -0
  122. package/dist/patterns/alia-assistant/index.js +1 -1
  123. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  124. package/dist/tokens.css +1 -1
  125. package/package.json +1 -1
  126. package/dist/_chunks/bmi-calculator-DuVSFDuw.js +0 -259
  127. package/dist/_chunks/dialog-DOYgd75U.js +0 -224
  128. package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js +0 -179
  129. package/dist/_chunks/insert-result-DisOY2G-.js +0 -243
@@ -0,0 +1,203 @@
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as E, useState as h, useMemo as g, useEffect as L } from "react";
3
+ import { c as I } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as S } from "react-i18next";
5
+ import { R as x } from "./radio-TWf9Q-mp.js";
6
+ import { R as B } from "./radio-group-CLjK-SlK.js";
7
+ import { F } from "./form-field-BOm9hK35.js";
8
+ import { D as M } from "./date-picker-Bq7xhMA-.js";
9
+ import { C as A } from "./card-DPmk26CL.js";
10
+ import { B as v } from "./badge-zsf5i5bH.js";
11
+ import { I as R } from "./insert-result-C5ABnzDl.js";
12
+ import { c as H, g as _, G as j } from "./gestation-mWF4AXea.js";
13
+ import { s as z } from "./subDays-Dv7q9S7u.js";
14
+ import { i as O } from "./date-picker-variants-DLi1Va_e.js";
15
+ const V = I("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
16
+ variants: {
17
+ width: { full: "ds:w-full", auto: "ds:inline-flex" }
18
+ },
19
+ defaultVariants: { width: "full" }
20
+ }), K = {
21
+ preconception: "neutral",
22
+ first: "info",
23
+ second: "success",
24
+ third: "warning",
25
+ postterm: "error"
26
+ }, P = {
27
+ preconception: "--muted",
28
+ first: "--info",
29
+ second: "--success",
30
+ third: "--warning-readable",
31
+ postterm: "--destructive"
32
+ };
33
+ function Y(c) {
34
+ return P[c];
35
+ }
36
+ const q = E(
37
+ ({
38
+ defaultMethod: c = "lmp",
39
+ onResultChange: d,
40
+ onInsert: u,
41
+ insertVariant: p = "insert",
42
+ onCopy: b,
43
+ onError: y,
44
+ insertBrand: C,
45
+ id: N,
46
+ width: D,
47
+ className: T
48
+ }, w) => {
49
+ const { t: e, i18n: f } = S(), [o, G] = h(c), [i, $] = h(void 0), n = g(() => /* @__PURE__ */ new Date(), []), a = g(() => {
50
+ if (!i) return null;
51
+ const s = o === "lmp" ? i : z(i, j), r = H({ method: "lmp", date: s }, n);
52
+ return {
53
+ result: {
54
+ gestationalAge: r.gestationalAge,
55
+ trimester: r.trimester,
56
+ dueDate: r.dueDate
57
+ },
58
+ milestones: _(r.gestationalStart)
59
+ };
60
+ }, [o, i, n]), k = g(
61
+ () => new Intl.DateTimeFormat(f.language, { dateStyle: "medium" }),
62
+ [f.language]
63
+ );
64
+ L(() => {
65
+ d == null || d((a == null ? void 0 : a.result) ?? null);
66
+ }, [a, d]);
67
+ const m = (s) => s ? e("gestationalAgeCalculator.gestation", {
68
+ weeks: s.weeks,
69
+ days: s.days
70
+ }) : "—";
71
+ return /* @__PURE__ */ l(
72
+ "div",
73
+ {
74
+ ref: w,
75
+ "data-component": "gestational-age-calculator",
76
+ "data-component-id": N,
77
+ className: V({ width: D, className: T }),
78
+ children: [
79
+ /* @__PURE__ */ l(
80
+ B,
81
+ {
82
+ label: e("gestationalAgeCalculator.method.label"),
83
+ variant: "horizontal",
84
+ value: o,
85
+ onValueChange: (s) => G(s),
86
+ children: [
87
+ /* @__PURE__ */ t(x, { label: e("gestationalAgeCalculator.method.lmp"), value: "lmp" }),
88
+ /* @__PURE__ */ t(x, { label: e("gestationalAgeCalculator.method.edd"), value: "edd" })
89
+ ]
90
+ }
91
+ ),
92
+ /* @__PURE__ */ t(
93
+ F,
94
+ {
95
+ label: e(
96
+ o === "lmp" ? "gestationalAgeCalculator.lmpDate" : "gestationalAgeCalculator.eddDate"
97
+ ),
98
+ children: /* @__PURE__ */ t(
99
+ M,
100
+ {
101
+ value: i,
102
+ onChange: $,
103
+ maxDate: o === "lmp" ? n : void 0
104
+ }
105
+ )
106
+ }
107
+ ),
108
+ /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a ? `${e("gestationalAgeCalculator.gestationLabel")}: ${m(
109
+ a.result.gestationalAge
110
+ )}. ${e("gestationalAgeCalculator.trimesterLabel")}: ${e(
111
+ `gestationalAgeCalculator.trimester.${a.result.trimester}`
112
+ )}.` : "" }),
113
+ a ? /* @__PURE__ */ t(A, { variant: "elevated", children: /* @__PURE__ */ l(A.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
114
+ /* @__PURE__ */ l("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
115
+ /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
116
+ /* @__PURE__ */ t("dt", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.trimesterLabel") }),
117
+ /* @__PURE__ */ t("dd", { children: /* @__PURE__ */ t(
118
+ v,
119
+ {
120
+ variant: K[a.result.trimester],
121
+ size: "lg",
122
+ children: e(
123
+ `gestationalAgeCalculator.trimester.${a.result.trimester}`
124
+ )
125
+ }
126
+ ) })
127
+ ] }),
128
+ /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
129
+ /* @__PURE__ */ t("dt", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.gestationLabel") }),
130
+ /* @__PURE__ */ t("dd", { className: "type-metric ds:text-foreground", children: m(a.result.gestationalAge) })
131
+ ] })
132
+ ] }),
133
+ /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
134
+ /* @__PURE__ */ t("span", { className: "type-label ds:text-muted-foreground", children: e("gestationalAgeCalculator.milestonesLabel") }),
135
+ /* @__PURE__ */ t("ul", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: a.milestones.map((s) => {
136
+ const r = O(n, s.date);
137
+ return /* @__PURE__ */ l(
138
+ "li",
139
+ {
140
+ className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]",
141
+ children: [
142
+ /* @__PURE__ */ t("span", { className: "type-body ds:text-foreground", children: e(`gestationalAgeCalculator.milestone.${s.key}`) }),
143
+ /* @__PURE__ */ l("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
144
+ /* @__PURE__ */ t("span", { className: "type-body ds:text-muted-foreground", children: k.format(s.date) }),
145
+ r ? /* @__PURE__ */ t(v, { variant: "success", children: e("gestationalAgeCalculator.reached") }) : null
146
+ ] })
147
+ ]
148
+ },
149
+ s.key
150
+ );
151
+ }) })
152
+ ] }),
153
+ p === "copy" || u ? /* @__PURE__ */ t(
154
+ R,
155
+ {
156
+ onInsert: u,
157
+ variant: p,
158
+ onCopy: b,
159
+ onError: y,
160
+ card: {
161
+ title: e("insert.title.gestationalAge"),
162
+ icon: "baby",
163
+ highlight: e(
164
+ `gestationalAgeCalculator.trimester.${a.result.trimester}`
165
+ ),
166
+ // Chip shares the trimester's semantic token so the
167
+ // inserted PNG chip matches the on-screen trimester badge —
168
+ // with the contrast-safe orange override for the
169
+ // `--warning` third trimester.
170
+ highlightToken: Y(
171
+ a.result.trimester
172
+ ),
173
+ brand: C,
174
+ fields: [
175
+ {
176
+ // Gestational age is an elapsed duration → clock glyph.
177
+ icon: "clock",
178
+ label: e("gestationalAgeCalculator.gestationLabel"),
179
+ value: m(a.result.gestationalAge)
180
+ },
181
+ {
182
+ // Trimester is a clinical-stage classification → tag.
183
+ icon: "tag",
184
+ label: e("gestationalAgeCalculator.trimesterLabel"),
185
+ value: e(
186
+ `gestationalAgeCalculator.trimester.${a.result.trimester}`
187
+ )
188
+ }
189
+ ]
190
+ }
191
+ }
192
+ ) : null
193
+ ] }) }) : /* @__PURE__ */ t("p", { className: "type-body ds:text-muted-foreground", children: e("gestationalAgeCalculator.empty") })
194
+ ]
195
+ }
196
+ );
197
+ }
198
+ );
199
+ q.displayName = "GestationalAgeCalculator";
200
+ export {
201
+ q as G
202
+ };
203
+ //# sourceMappingURL=gestational-age-calculator-gWI_uRA1.js.map