@alfadocs/ui-kit 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/_chunks/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
  2. package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
  3. package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
  4. package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
  5. package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
  6. package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
  7. package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
  8. package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
  9. package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
  10. package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
  11. package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
  12. package/dist/_chunks/dialog-BTpZV6It.js +223 -0
  13. package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
  14. package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
  15. package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
  16. package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
  17. package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
  18. package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
  19. package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
  20. package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
  21. package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
  22. package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
  23. package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
  24. package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
  25. package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
  26. package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
  27. package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
  28. package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
  29. package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
  30. package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
  31. package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
  32. package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
  33. package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
  34. package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
  35. package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
  36. package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
  37. package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
  38. package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
  39. package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
  40. package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
  41. package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
  42. package/dist/agent-catalog.json +1 -1
  43. package/dist/components/_shared/calendar-class-names.d.ts +8 -0
  44. package/dist/components/_shared/index.d.ts +2 -0
  45. package/dist/components/_shared/insert-result.d.ts +149 -4
  46. package/dist/components/badge/badge.d.ts +1 -1
  47. package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
  48. package/dist/components/bmi-calculator/index.js +1 -1
  49. package/dist/components/booking/index.js +1 -1
  50. package/dist/components/calculator-dialog/index.js +1 -1
  51. package/dist/components/card/card.d.ts +1 -1
  52. package/dist/components/chart/chart.d.ts +10 -0
  53. package/dist/components/chart/index.js +1 -1
  54. package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
  55. package/dist/components/cycle-calculator/index.js +1 -1
  56. package/dist/components/data-table/index.js +1 -1
  57. package/dist/components/date-picker/date-picker.d.ts +0 -1
  58. package/dist/components/date-picker/index.js +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
  60. package/dist/components/date-range-picker/index.js +1 -1
  61. package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
  62. package/dist/components/date-time-picker/index.js +1 -1
  63. package/dist/components/dialog/dialog.d.ts +1 -0
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
  66. package/dist/components/due-date-calculator/index.js +2 -2
  67. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
  68. package/dist/components/gestational-age-calculator/index.js +1 -1
  69. package/dist/components/header/header.d.ts +8 -0
  70. package/dist/components/header/index.js +1 -1
  71. package/dist/components/index.d.ts +1 -1
  72. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  73. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
  74. package/dist/components/public-header/public-header.d.ts +1 -1
  75. package/dist/components/sign-document/index.js +1 -1
  76. package/dist/components/sign-document/sign-document.d.ts +12 -0
  77. package/dist/components/stat/stat.d.ts +1 -1
  78. package/dist/components/tab-bar/index.d.ts +1 -1
  79. package/dist/components/tab-bar/index.js +1 -1
  80. package/dist/components/tab-bar/tab-bar.d.ts +44 -1
  81. package/dist/components/unit-converter/index.js +1 -1
  82. package/dist/components/unit-converter/unit-converter.d.ts +6 -0
  83. package/dist/index.js +504 -502
  84. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  85. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
  86. package/dist/patterns/patient-shell/index.js +1 -1
  87. package/dist/tokens.css +1411 -2
  88. package/package.json +1 -1
  89. package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
  90. package/dist/_chunks/dialog-Cee13rHU.js +0 -215
  91. package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
  92. package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
  93. package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
  94. package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
@@ -1,227 +0,0 @@
1
- import { jsxs as A, jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as P, useRef as S } from "react";
3
- import { useTranslation as z } from "react-i18next";
4
- import { c as M } from "./index-D2ZczOXr.js";
5
- import { B as N } from "./button-DD_0Xdmr.js";
6
- import { c as C } from "./createLucideIcon-CrFbzy84.js";
7
- import { I as _ } 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 k = [
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
- ], T = C("layers", k);
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 E = [
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 = C("type", E), L = ["fg", "muted", "accent", "border", "bg"], I = 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 Y(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 B(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 V(t) {
84
- return (t.highlight ? 62 : 38) + 28 + t.fields.length * 22 + 8 + 20;
85
- }
86
- function D(t, e) {
87
- const n = I, o = 20, a = o + 18, s = !!t.highlight, l = a + 24, r = (s ? l : a) + 28, c = 22, x = r + t.fields.length * c + 8, $ = x + o, m = g(e.font), y = t.fields.map((f, d) => {
88
- const h = r + d * c;
89
- return `<text x="${o}" y="${h}" font-family="${m}" font-size="13"><tspan fill="${e.muted}">${g(
90
- f.label
91
- )}: </tspan><tspan fill="${e.fg}">${g(f.value)}</tspan></text>`;
92
- }).join(""), i = s ? `<text x="${o}" y="${l}" font-family="${m}" 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="${$}" viewBox="0 0 ${n} ${$}" role="img" aria-label="${g(
96
- t.title
97
- )}"><rect x="0.5" y="0.5" width="${n - 1}" height="${$ - 1}" rx="12" fill="${e.bg}" stroke="${e.border}"/><text x="${o}" y="${a}" font-family="${m}" font-size="16" font-weight="700" fill="${e.fg}">${g(
98
- t.title
99
- )}</text>${i}${y}<text x="${o}" y="${x}" font-family="${m}" 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 q(t, e, n) {
106
- return new Promise((o, a) => {
107
- const s = new Image();
108
- s.decoding = "async", s.onload = () => {
109
- const l = document.createElement("canvas");
110
- l.width = e, l.height = n;
111
- const r = l.getContext("2d");
112
- if (!r) {
113
- a(new Error("2D canvas context unavailable"));
114
- return;
115
- }
116
- r.drawImage(s, 0, 0, e, n), l.toBlob((c) => {
117
- c ? o(c) : a(new Error("canvas.toBlob produced no PNG"));
118
- }, "image/png");
119
- }, s.onerror = () => a(new Error("SVG failed to decode as an image")), s.src = t;
120
- });
121
- }
122
- async function F(t, e, n) {
123
- const o = Y(e), a = new Blob([o], { type: "text/plain" });
124
- if (t === "text")
125
- return new ClipboardItem({ "text/plain": a });
126
- const s = D(e, n), l = `data:image/svg+xml,${encodeURIComponent(s)}`, r = await q(l, I, V(e));
127
- if (t === "image")
128
- return new ClipboardItem({ "image/png": r, "text/plain": a });
129
- const c = new Blob([B(e)], { type: "text/html" });
130
- return new ClipboardItem({
131
- "text/html": c,
132
- "image/png": r,
133
- "text/plain": a
134
- });
135
- }
136
- const O = M(
137
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
138
- {
139
- variants: {
140
- variant: {
141
- insert: "",
142
- copy: ""
143
- }
144
- },
145
- defaultVariants: { variant: "insert" }
146
- }
147
- ), U = ["text", "image", "text-image"], G = {
148
- text: /* @__PURE__ */ u(H, { "aria-hidden": !0 }),
149
- image: /* @__PURE__ */ u(_, { "aria-hidden": !0 }),
150
- "text-image": /* @__PURE__ */ u(T, { "aria-hidden": !0 })
151
- }, w = {
152
- insert: {
153
- text: "insert.text",
154
- image: "insert.image",
155
- "text-image": "insert.textImage"
156
- },
157
- copy: {
158
- text: "insert.copyText",
159
- image: "insert.copyImage",
160
- "text-image": "insert.copyTextImage"
161
- }
162
- }, W = P(
163
- function({ card: e, variant: n = "insert", onInsert: o, onCopy: a, onError: s, size: l = "sm" }, r) {
164
- const { t: c } = z(), p = S(null), x = (i) => {
165
- const f = Y(e), d = B(e);
166
- let h = "", b = "";
167
- if (i !== "text") {
168
- const R = v(p.current);
169
- h = D(e, R), b = `data:image/svg+xml,${encodeURIComponent(h)}`;
170
- }
171
- return { mode: i, text: f, html: d, svg: h, imageDataUri: b };
172
- }, y = n === "copy" ? (i) => {
173
- if (!j()) {
174
- s == null || s(new Error("Clipboard write unavailable in this context"));
175
- return;
176
- }
177
- const f = v(p.current);
178
- (async () => {
179
- try {
180
- const d = await F(i, e, f);
181
- await navigator.clipboard.write([d]), a == null || a(i);
182
- } catch (d) {
183
- s == null || s(d);
184
- }
185
- })();
186
- } : (i) => {
187
- o == null || o(x(i));
188
- };
189
- return /* @__PURE__ */ A(
190
- "div",
191
- {
192
- ref: r,
193
- "data-component": "insert-result",
194
- "data-variant": n,
195
- className: O({ variant: n }),
196
- children: [
197
- /* @__PURE__ */ u("span", { ref: p, "aria-hidden": !0, className: "ds:sr-only", children: L.map((i) => /* @__PURE__ */ u(
198
- "span",
199
- {
200
- "data-k": i,
201
- 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)]"
202
- },
203
- i
204
- )) }),
205
- U.map((i) => /* @__PURE__ */ u(
206
- N,
207
- {
208
- type: "button",
209
- intent: "outline",
210
- size: l,
211
- startIcon: G[i],
212
- "aria-label": c(w[n][i]),
213
- onClick: () => y(i),
214
- children: c(w[n][i])
215
- },
216
- i
217
- ))
218
- ]
219
- }
220
- );
221
- }
222
- );
223
- W.displayName = "InsertButton";
224
- export {
225
- W as I
226
- };
227
- //# sourceMappingURL=insert-result-DtQQeSSf.js.map