@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
@@ -1,243 +0,0 @@
1
- import { jsxs as M, jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as S, useRef as T } from "react";
3
- import { useTranslation as z } from "react-i18next";
4
- import { c as N } from "./index-D2ZczOXr.js";
5
- import { B as _ } from "./button-DD_0Xdmr.js";
6
- import { c as D } from "./createLucideIcon-CrFbzy84.js";
7
- import { I as k } from "./image-C6RM5hfF.js";
8
- /**
9
- * @license lucide-react v1.8.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const E = [
15
- [
16
- "path",
17
- {
18
- d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
19
- key: "zw3jo"
20
- }
21
- ],
22
- [
23
- "path",
24
- {
25
- d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
26
- key: "1wduqc"
27
- }
28
- ],
29
- [
30
- "path",
31
- {
32
- d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
33
- key: "kqbvx6"
34
- }
35
- ]
36
- ], F = D("layers", E);
37
- /**
38
- * @license lucide-react v1.8.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */
43
- const L = [
44
- ["path", { d: "M12 4v16", key: "1654pz" }],
45
- ["path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2", key: "e0r10z" }],
46
- ["path", { d: "M9 20h6", key: "s66wpe" }]
47
- ], H = D("type", L), V = ["fg", "muted", "accent", "border", "bg"], w = 380;
48
- function v(t) {
49
- const e = {
50
- fg: "currentColor",
51
- muted: "currentColor",
52
- accent: "currentColor",
53
- border: "currentColor",
54
- bg: "transparent",
55
- font: "sans-serif"
56
- };
57
- if (!t) return e;
58
- const n = (o) => {
59
- const a = t.querySelector(`[data-k="${o}"]`);
60
- return a && getComputedStyle(a).color || "currentColor";
61
- };
62
- return {
63
- fg: n("fg"),
64
- muted: n("muted"),
65
- accent: n("accent"),
66
- border: n("border"),
67
- bg: n("bg"),
68
- font: getComputedStyle(t).fontFamily || "sans-serif"
69
- };
70
- }
71
- const g = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
72
- function R(t) {
73
- const e = [t.title];
74
- t.highlight && e.push(t.highlight);
75
- for (const n of t.fields) e.push(`• ${n.label}: ${n.value}`);
76
- return e.join(`
77
- `);
78
- }
79
- function P(t) {
80
- const e = t.fields.map((o) => `<li>${g(o.label)}: ${g(o.value)}</li>`).join(""), n = t.highlight ? `<p><strong>${g(t.highlight)}</strong></p>` : "";
81
- return `<p><strong>${g(t.title)}</strong></p>${n}<ul>${e}</ul>`;
82
- }
83
- function U(t) {
84
- return (t.highlight ? 62 : 38) + 28 + t.fields.length * 22 + 8 + 20;
85
- }
86
- function C(t, e) {
87
- const n = w, o = 20, a = o + 18, r = !!t.highlight, s = a + 24, l = (r ? s : a) + 28, c = 22, u = l + t.fields.length * c + 8, h = u + o, p = g(e.font), I = t.fields.map((i, x) => {
88
- const d = l + x * c;
89
- return `<text x="${o}" y="${d}" font-family="${p}" font-size="13"><tspan fill="${e.muted}">${g(
90
- i.label
91
- )}: </tspan><tspan fill="${e.fg}">${g(i.value)}</tspan></text>`;
92
- }).join(""), b = r ? `<text x="${o}" y="${s}" font-family="${p}" font-size="14" font-weight="600" fill="${e.accent}">${g(
93
- t.highlight
94
- )}</text>` : "";
95
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${h}" viewBox="0 0 ${n} ${h}" role="img" aria-label="${g(
96
- t.title
97
- )}"><rect x="0.5" y="0.5" width="${n - 1}" height="${h - 1}" rx="12" fill="${e.bg}" stroke="${e.border}"/><text x="${o}" y="${a}" font-family="${p}" font-size="16" font-weight="700" fill="${e.fg}">${g(
98
- t.title
99
- )}</text>${b}${I}<text x="${o}" y="${u}" font-family="${p}" font-size="10" fill="${e.muted}">AlfaDocs</text></svg>`;
100
- }
101
- function j() {
102
- var t;
103
- return typeof navigator < "u" && typeof ((t = navigator.clipboard) == null ? void 0 : t.write) == "function" && typeof ClipboardItem < "u";
104
- }
105
- function A(t, e, n) {
106
- return new Promise((o, a) => {
107
- const r = new Image();
108
- r.decoding = "async", r.onload = () => {
109
- const s = document.createElement("canvas");
110
- s.width = e, s.height = n;
111
- const l = s.getContext("2d");
112
- if (!l) {
113
- a(new Error("2D canvas context unavailable"));
114
- return;
115
- }
116
- l.drawImage(r, 0, 0, e, n), s.toBlob((c) => {
117
- c ? o(c) : a(new Error("canvas.toBlob produced no PNG"));
118
- }, "image/png");
119
- }, r.onerror = () => a(new Error("SVG failed to decode as an image")), r.src = t;
120
- });
121
- }
122
- async function q(t, e = {}) {
123
- const { colours: n, scale: o = 1 } = e, a = n ?? v(null), r = C(t, a), s = `data:image/svg+xml,${encodeURIComponent(r)}`, l = Math.round(w * o), c = Math.round(U(t) * o), m = await A(s, l, c);
124
- return O(m);
125
- }
126
- function O(t) {
127
- return new Promise((e, n) => {
128
- const o = new FileReader();
129
- o.onload = () => e(String(o.result)), o.onerror = () => n(o.error ?? new Error("FileReader error")), o.readAsDataURL(t);
130
- });
131
- }
132
- async function G(t, e, n) {
133
- const o = R(e), a = new Blob([o], { type: "text/plain" });
134
- if (t === "text")
135
- return new ClipboardItem({ "text/plain": a });
136
- const r = C(e, n), s = `data:image/svg+xml,${encodeURIComponent(r)}`, l = await A(s, w, U(e));
137
- if (t === "image")
138
- return new ClipboardItem({ "image/png": l, "text/plain": a });
139
- const c = new Blob([P(e)], { type: "text/html" });
140
- return new ClipboardItem({
141
- "text/html": c,
142
- "image/png": l,
143
- "text/plain": a
144
- });
145
- }
146
- const W = N(
147
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
148
- {
149
- variants: {
150
- variant: {
151
- insert: "",
152
- copy: ""
153
- }
154
- },
155
- defaultVariants: { variant: "insert" }
156
- }
157
- ), K = ["text", "image", "text-image"], X = {
158
- text: /* @__PURE__ */ f(H, { "aria-hidden": !0 }),
159
- image: /* @__PURE__ */ f(k, { "aria-hidden": !0 }),
160
- "text-image": /* @__PURE__ */ f(F, { "aria-hidden": !0 })
161
- }, B = {
162
- insert: {
163
- text: "insert.text",
164
- image: "insert.image",
165
- "text-image": "insert.textImage"
166
- },
167
- copy: {
168
- text: "insert.copyText",
169
- image: "insert.copyImage",
170
- "text-image": "insert.copyTextImage"
171
- }
172
- }, J = S(
173
- function({
174
- card: e,
175
- variant: n = "insert",
176
- onInsert: o,
177
- onCopy: a,
178
- onError: r,
179
- size: s = "sm",
180
- intent: l = "primary"
181
- }, c) {
182
- const { t: m } = z(), u = T(null), h = (i) => {
183
- const x = R(e), d = P(e);
184
- let y = "", Y = "";
185
- const $ = i === "text" ? null : v(u.current);
186
- return $ && (y = C(e, $), Y = `data:image/svg+xml,${encodeURIComponent(y)}`), { mode: i, text: x, html: d, svg: y, imageDataUri: Y, pngDataUri: () => $ ? q(e, { colours: $ }) : Promise.resolve("") };
187
- }, b = n === "copy" ? (i) => {
188
- if (!j()) {
189
- r == null || r(new Error("Clipboard write unavailable in this context"));
190
- return;
191
- }
192
- const x = v(u.current);
193
- (async () => {
194
- try {
195
- const d = await G(i, e, x);
196
- await navigator.clipboard.write([d]), a == null || a(i);
197
- } catch (d) {
198
- r == null || r(d);
199
- }
200
- })();
201
- } : (i) => {
202
- o == null || o(h(i));
203
- };
204
- return /* @__PURE__ */ M(
205
- "div",
206
- {
207
- ref: c,
208
- "data-component": "insert-result",
209
- "data-variant": n,
210
- className: W({ variant: n }),
211
- children: [
212
- /* @__PURE__ */ f("span", { ref: u, "aria-hidden": !0, className: "ds:sr-only", children: V.map((i) => /* @__PURE__ */ f(
213
- "span",
214
- {
215
- "data-k": i,
216
- className: i === "fg" ? "ds:text-foreground" : i === "muted" ? "ds:text-muted-foreground" : i === "accent" ? "ds:text-[color:var(--primary)]" : i === "border" ? "ds:text-[color:var(--border)]" : "ds:text-[color:var(--card)]"
217
- },
218
- i
219
- )) }),
220
- K.map((i) => /* @__PURE__ */ f(
221
- _,
222
- {
223
- type: "button",
224
- intent: l,
225
- size: s,
226
- startIcon: X[i],
227
- "aria-label": m(B[n][i]),
228
- onClick: () => b(i),
229
- children: m(B[n][i])
230
- },
231
- i
232
- ))
233
- ]
234
- }
235
- );
236
- }
237
- );
238
- J.displayName = "InsertButton";
239
- export {
240
- J as I,
241
- q as s
242
- };
243
- //# sourceMappingURL=insert-result-DisOY2G-.js.map