@eka-care/medassist-widget 0.1.80 → 0.1.82
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.
- package/README.md +2 -2
- package/dist/medassist-widget-CardList-C0T8GBYh.js +223 -0
- package/dist/medassist-widget-ChatComposer-CRm0Bvmo.js +1234 -0
- package/dist/medassist-widget-ChatMessages-CwUlThlh.js +7424 -0
- package/dist/medassist-widget-ConnectionStatus-BubGbavD.js +84 -0
- package/dist/medassist-widget-DispToastHost-D2_0EipW.js +69 -0
- package/dist/medassist-widget-DoctorCard-CX9O7oju.js +443 -0
- package/dist/medassist-widget-FilePreview-Dof_VuUv.js +121 -0
- package/dist/medassist-widget-FocusCarousel-DOkY3kxw.js +90 -0
- package/dist/medassist-widget-MediaCard-3gFJ8G9l.js +85 -0
- package/dist/medassist-widget-MultiSelect-DMYNXiAC.js +414 -0
- package/dist/medassist-widget-ProfileHeader-tjRd6R11.js +142 -0
- package/dist/medassist-widget-VoiceAgentScreen-BfWNcUZp.js +421 -0
- package/dist/medassist-widget-_commonjsHelpers-CqEciG1_.js +31 -0
- package/dist/medassist-widget-avatar-CIkxqi_7.js +233 -0
- package/dist/medassist-widget-check-CBkqbFAl.js +5 -0
- package/dist/medassist-widget-chevron-right-DXVez3hJ.js +7 -0
- package/dist/medassist-widget-html2canvas.esm-CphxV6YW.js +4835 -0
- package/dist/medassist-widget-main-CvBx4wsw.js +10068 -0
- package/dist/medassist-widget-map-pin-QqnPVlgB.js +14 -0
- package/dist/medassist-widget-message-square-plus-D5bJkQm2.js +15 -0
- package/dist/medassist-widget-mic-uIy1yldF.js +9 -0
- package/dist/medassist-widget-x-DptkIHzh.js +8 -0
- package/dist/medassist-widget.css +1 -1
- package/dist/medassist-widget.js +4 -106
- package/package.json +12 -6
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { c as y, u as t, d as h, y as x } from "./medassist-widget-main-CvBx4wsw.js";
|
|
2
|
+
import { X as g } from "./medassist-widget-x-DptkIHzh.js";
|
|
3
|
+
const $ = [
|
|
4
|
+
[
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
8
|
+
key: "1oefj6"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
|
|
12
|
+
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
13
|
+
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
14
|
+
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
15
|
+
], k = y("file-text", $);
|
|
16
|
+
function f({
|
|
17
|
+
file: e,
|
|
18
|
+
onRemove: a,
|
|
19
|
+
isPreview: n = !0,
|
|
20
|
+
className: l = ""
|
|
21
|
+
}) {
|
|
22
|
+
const [c, i] = h(!1), [r, o] = h(""), d = e?.type?.startsWith("image/") ?? !1, p = e?.type === "application/pdf";
|
|
23
|
+
x(() => {
|
|
24
|
+
if (d) {
|
|
25
|
+
const s = URL.createObjectURL(e);
|
|
26
|
+
return o(s), () => URL.revokeObjectURL(s);
|
|
27
|
+
}
|
|
28
|
+
}, [e, d]), x(() => {
|
|
29
|
+
i(!1);
|
|
30
|
+
}, [e]);
|
|
31
|
+
const v = () => d ? "text-green-600" : "text-text-secondary", b = (s) => {
|
|
32
|
+
if (s === 0) return "0 B";
|
|
33
|
+
const u = 1024, w = ["B", "KB", "MB", "GB"], m = Math.floor(Math.log(s) / Math.log(u));
|
|
34
|
+
return `${(s / Math.pow(u, m)).toFixed(1)} ${w[m]}`.toLowerCase();
|
|
35
|
+
};
|
|
36
|
+
return !d || c ? /* @__PURE__ */ t(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: `relative group inline-flex flex-shrink-0 bg-white border border-neutral-300 rounded-lg flex items-center gap-3 px-3 py-2.5 max-w-full ${n ? "hover:bg-neutral-50" : ""} ${l}`,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ t("div", { className: `flex-shrink-0 ${v()}`, children: /* @__PURE__ */ t(k, { className: "h-5 w-5" }) }),
|
|
42
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0 max-w-[200px]", children: [
|
|
43
|
+
e?.name && /* @__PURE__ */ t("div", { className: "text-sm font-medium text-[var(--color-foreground)] truncate", children: e.name }),
|
|
44
|
+
e?.size && /* @__PURE__ */ t("div", { className: "text-xs text-[var(--color-muted-foreground)]", children: b(e.size) })
|
|
45
|
+
] }),
|
|
46
|
+
n && a && /* @__PURE__ */ t(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
onClick: a,
|
|
50
|
+
"aria-label": `Remove ${e.name}`,
|
|
51
|
+
className: "flex-shrink-0 flex items-center justify-center w-5 h-5 text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] transition-colors",
|
|
52
|
+
children: /* @__PURE__ */ t(g, { className: "h-4 w-4" })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
) : /* @__PURE__ */ t("div", { className: `relative group flex-shrink-0 ${l}`, children: [
|
|
58
|
+
/* @__PURE__ */ t(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: `w-20 h-20 bg-white border border-neutral-300 rounded-lg flex items-center justify-center overflow-hidden ${n ? "hover:bg-neutral-100 cursor-pointer" : ""}`,
|
|
62
|
+
children: r && /* @__PURE__ */ t(
|
|
63
|
+
"img",
|
|
64
|
+
{
|
|
65
|
+
src: r,
|
|
66
|
+
alt: e.name,
|
|
67
|
+
className: "w-full h-full object-cover",
|
|
68
|
+
onError: () => i(!0)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
n && a && /* @__PURE__ */ t(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
onClick: a,
|
|
77
|
+
"aria-label": `Remove ${e.name}`,
|
|
78
|
+
className: "absolute top-0 right-0 bg-[var(--color-muted)] text-black rounded-full w-5 h-5 flex items-center justify-center hover:bg-[var(--color-muted-foreground)] transition-colors z-10 transform translate-x-1 -translate-y-1",
|
|
79
|
+
children: /* @__PURE__ */ t(g, { className: "h-3 w-3 text-black" })
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
function j({
|
|
85
|
+
files: e,
|
|
86
|
+
onRemoveFile: a,
|
|
87
|
+
isPreview: n = !0,
|
|
88
|
+
className: l = ""
|
|
89
|
+
}) {
|
|
90
|
+
if (e.length === 0) return null;
|
|
91
|
+
const c = e.filter((r) => r.type?.startsWith("image/")), i = e.filter((r) => !r.type?.startsWith("image/"));
|
|
92
|
+
return /* @__PURE__ */ t("div", { className: `flex flex-wrap justify-end gap-2 max-w-full ${l}`, children: [
|
|
93
|
+
i.map((r) => {
|
|
94
|
+
const o = e.indexOf(r);
|
|
95
|
+
return /* @__PURE__ */ t(
|
|
96
|
+
f,
|
|
97
|
+
{
|
|
98
|
+
file: r,
|
|
99
|
+
onRemove: a ? () => a(o) : void 0,
|
|
100
|
+
isPreview: n
|
|
101
|
+
},
|
|
102
|
+
`${r.name}-${r.size}-${o}`
|
|
103
|
+
);
|
|
104
|
+
}),
|
|
105
|
+
c.length > 0 && /* @__PURE__ */ t("div", { className: "flex gap-2 overflow-x-auto max-w-full p-1 scrollbar-hide", children: c.map((r) => {
|
|
106
|
+
const o = e.indexOf(r);
|
|
107
|
+
return /* @__PURE__ */ t(
|
|
108
|
+
f,
|
|
109
|
+
{
|
|
110
|
+
file: r,
|
|
111
|
+
onRemove: a ? () => a(o) : void 0,
|
|
112
|
+
isPreview: n
|
|
113
|
+
},
|
|
114
|
+
`${r.name}-${r.size}-${o}`
|
|
115
|
+
);
|
|
116
|
+
}) })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
j as F
|
|
121
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { d as l, A as d, y as N, _ as R, u as r, b as z } from "./medassist-widget-main-CvBx4wsw.js";
|
|
2
|
+
import { C as A, a as M } from "./medassist-widget-chevron-right-DXVez3hJ.js";
|
|
3
|
+
const v = 12, T = 0.76, I = 3;
|
|
4
|
+
function k({ count: s, renderItem: h, className: u }) {
|
|
5
|
+
const [n, x] = l(0), [o, m] = l(0), [y, g] = l(() => Math.min(I, s)), b = d(null), f = d(0), p = d(0);
|
|
6
|
+
if (N(() => {
|
|
7
|
+
g((t) => Math.max(t, Math.min(n + 2, s)));
|
|
8
|
+
}, [n, s]), R(() => {
|
|
9
|
+
const t = b.current;
|
|
10
|
+
if (!t) return;
|
|
11
|
+
m(t.clientWidth);
|
|
12
|
+
const e = new ResizeObserver(([a]) => m(a.contentRect.width));
|
|
13
|
+
return e.observe(t), () => e.disconnect();
|
|
14
|
+
}, []), s === 0) return null;
|
|
15
|
+
const i = (t) => x(Math.max(0, Math.min(s - 1, t)));
|
|
16
|
+
if (s === 1)
|
|
17
|
+
return /* @__PURE__ */ r("div", { className: u ?? "mt-3", children: h(0, !0) });
|
|
18
|
+
const c = o * T, C = (o - c) / 2, w = o > 0 ? C - n * (c + v) : 0;
|
|
19
|
+
return /* @__PURE__ */ r("div", { ref: b, className: z("mt-3 w-full", u), children: o > 0 && /* Relative wrapper so buttons sit outside overflow but share the same stacking context */
|
|
20
|
+
/* @__PURE__ */ r("div", { className: "relative w-full", children: [
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: "w-full overflow-hidden py-3",
|
|
25
|
+
onTouchStart: (t) => {
|
|
26
|
+
f.current = t.touches[0].clientX, p.current = t.touches[0].clientY;
|
|
27
|
+
},
|
|
28
|
+
onTouchEnd: (t) => {
|
|
29
|
+
const e = t.changedTouches[0].clientX - f.current, a = t.changedTouches[0].clientY - p.current;
|
|
30
|
+
Math.abs(e) > Math.abs(a) && Math.abs(e) > 50 && i(n + (e < 0 ? 1 : -1));
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ r(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "flex items-stretch",
|
|
36
|
+
style: {
|
|
37
|
+
transform: `translateX(${w}px)`,
|
|
38
|
+
transition: "transform 400ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
39
|
+
gap: `${v}px`
|
|
40
|
+
},
|
|
41
|
+
"aria-live": "polite",
|
|
42
|
+
children: Array.from({ length: y }, (t, e) => {
|
|
43
|
+
const a = e === n;
|
|
44
|
+
return /* @__PURE__ */ r(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
"aria-hidden": !a,
|
|
48
|
+
style: {
|
|
49
|
+
flex: `0 0 ${c}px`,
|
|
50
|
+
position: "relative",
|
|
51
|
+
opacity: a ? 1 : 0.6,
|
|
52
|
+
transform: a ? "scale(1.05)" : "scale(0.9)",
|
|
53
|
+
zIndex: a ? 20 : 10,
|
|
54
|
+
transition: "all 400ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
55
|
+
borderRadius: 12
|
|
56
|
+
},
|
|
57
|
+
children: h(e, a)
|
|
58
|
+
},
|
|
59
|
+
e
|
|
60
|
+
);
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
n > 0 && /* @__PURE__ */ r(
|
|
67
|
+
"button",
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
"aria-label": "Previous",
|
|
71
|
+
onClick: () => i(n - 1),
|
|
72
|
+
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 h-10 w-10 p-2 flex items-center justify-center rounded-full bg-background/90 shadow-md border border-primary text-primary hover:bg-muted transition-colors",
|
|
73
|
+
children: /* @__PURE__ */ r(A, { size: 18 })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
n < s - 1 && /* @__PURE__ */ r(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
"aria-label": "Next",
|
|
81
|
+
onClick: () => i(n + 1),
|
|
82
|
+
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 h-10 w-10 p-2 flex items-center justify-center rounded-full bg-background/90 shadow-md border border-primary text-primary hover:bg-muted transition-colors",
|
|
83
|
+
children: /* @__PURE__ */ r(M, { size: 18 })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }) });
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
k as FocusCarousel
|
|
90
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { c as m, A as u, u as e, f as h, w as f, S as p, B as g } from "./medassist-widget-main-CvBx4wsw.js";
|
|
2
|
+
const x = [
|
|
3
|
+
[
|
|
4
|
+
"path",
|
|
5
|
+
{
|
|
6
|
+
d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
|
|
7
|
+
key: "18u6gg"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
11
|
+
], w = m("camera", x);
|
|
12
|
+
const b = [
|
|
13
|
+
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
14
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
15
|
+
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
16
|
+
], v = m("download", b);
|
|
17
|
+
function i(a) {
|
|
18
|
+
return a.toLowerCase().endsWith(".pdf");
|
|
19
|
+
}
|
|
20
|
+
function y(a) {
|
|
21
|
+
const n = document?.createElement("a");
|
|
22
|
+
n.href = a, n.download = a.split("/").pop() ?? "download.pdf", n.target = "_blank", n.click(), document?.body?.removeChild(n);
|
|
23
|
+
}
|
|
24
|
+
async function N(a) {
|
|
25
|
+
if (!a.current) return;
|
|
26
|
+
const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
|
|
27
|
+
t.href = o.toDataURL("image/png"), t.download = "card.png", t.click();
|
|
28
|
+
}
|
|
29
|
+
async function k(a) {
|
|
30
|
+
if (!a.current) return;
|
|
31
|
+
const n = (await import("./medassist-widget-html2canvas.esm-CphxV6YW.js")).default, o = await n(a.current, { useCORS: !0 }), t = document.createElement("a");
|
|
32
|
+
t.href = o.toDataURL("image/png"), t.download = `screenshot-${Date.now()}.png`, t.click();
|
|
33
|
+
}
|
|
34
|
+
function _({ card: a }) {
|
|
35
|
+
const { title: n, description: o, tags_text: t, banner_text: l, action: c, link: r } = a, s = u(null), d = r && !i(r);
|
|
36
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
h,
|
|
39
|
+
{
|
|
40
|
+
ref: s,
|
|
41
|
+
className: "overflow-hidden rounded-xl border border-border bg-elicitationBg text-card-foreground shadow-sm",
|
|
42
|
+
children: /* @__PURE__ */ e(f, { className: "p-3 space-y-2", children: [
|
|
43
|
+
/* @__PURE__ */ e("div", { className: `flex items-start gap-3 ${d ? "justify-between" : "justify-center"}`, children: [
|
|
44
|
+
/* @__PURE__ */ e("div", { className: `space-y-2 ${d ? "min-w-0 flex-1" : "flex flex-col items-center"}`, children: [
|
|
45
|
+
n && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-sm font-semibold bg-primary text-primary-foreground", children: n }),
|
|
46
|
+
o && /* @__PURE__ */ e("p", { className: `text-sm text-foreground leading-snug ${d ? "" : "text-center"}`, children: o }),
|
|
47
|
+
l && /* @__PURE__ */ e("span", { className: "inline-block rounded-full px-3 py-1 text-xs font-semibold bg-green-600 text-white", children: l })
|
|
48
|
+
] }),
|
|
49
|
+
d && /* @__PURE__ */ e("div", { className: "shrink-0 h-24 w-24 rounded-lg overflow-hidden border border-border", children: /* @__PURE__ */ e(
|
|
50
|
+
"img",
|
|
51
|
+
{
|
|
52
|
+
src: r,
|
|
53
|
+
alt: n ?? "media",
|
|
54
|
+
className: "h-full w-full object-cover"
|
|
55
|
+
}
|
|
56
|
+
) })
|
|
57
|
+
] }),
|
|
58
|
+
t && /* @__PURE__ */ e(p, { children: [
|
|
59
|
+
/* @__PURE__ */ e("div", { className: "border-t border-border" }),
|
|
60
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t })
|
|
61
|
+
] })
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
c && /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e(
|
|
66
|
+
g,
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
variant: "outline",
|
|
70
|
+
size: "sm",
|
|
71
|
+
className: "rounded-md px-5 gap-1.5",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
c === "screenshot" ? k(s) : c === "download" && (r && i(r) ? y(r) : N(s));
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
c === "screenshot" ? /* @__PURE__ */ e(w, { className: "h-4 w-4" }) : /* @__PURE__ */ e(v, { className: "h-4 w-4" }),
|
|
77
|
+
c === "screenshot" ? "Screenshot" : "Download"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
_ as MediaCard
|
|
85
|
+
};
|