@eka-care/medassist-widget 0.1.109-dev.0 → 0.1.110-dev.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.
- package/dist/{medassist-widget-CardList-CYHOG9Tn.js → medassist-widget-CardList-Dx2bzaVC.js} +1 -1
- package/dist/{medassist-widget-DoctorCard-DH9Bk806.js → medassist-widget-DoctorCard-Cn_E83qL.js} +262 -256
- package/dist/medassist-widget-FocusCarousel-C8sm1Tm0.js +99 -0
- package/dist/medassist-widget.js +1289 -1271
- package/package.json +1 -1
- package/dist/medassist-widget-FocusCarousel-BsLIZftX.js +0 -90
package/package.json
CHANGED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { d as l, A as d, y as N, _ as R, u as r, i as z } from "./medassist-widget.js";
|
|
2
|
-
import { C as A, a as M } from "./medassist-widget-chevron-right-CKYbGWbY.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), [i, 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 o = (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 = i * T, C = (i - c) / 2, w = i > 0 ? C - n * (c + v) : 0;
|
|
19
|
-
return /* @__PURE__ */ r("div", { ref: b, className: z("mt-3 w-full", u), children: i > 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 && o(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: () => o(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: () => o(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
|
-
};
|