@mci-ui/mci-ui 0.0.97 → 0.0.98
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.
|
@@ -30,7 +30,7 @@ function G({
|
|
|
30
30
|
extra: w,
|
|
31
31
|
onChange: C
|
|
32
32
|
}) {
|
|
33
|
-
const [s, T] = g(b || t[0]?.id), [z, L] = g({}), d = y([]),
|
|
33
|
+
const [s, T] = g(b || t[0]?.id), [z, L] = g({}), d = y([]), h = y(null), o = _(() => {
|
|
34
34
|
requestAnimationFrame(() => {
|
|
35
35
|
requestAnimationFrame(() => {
|
|
36
36
|
const e = t.findIndex((j) => j?.id === s), i = d.current[e];
|
|
@@ -47,7 +47,7 @@ function G({
|
|
|
47
47
|
});
|
|
48
48
|
}, [s, t]);
|
|
49
49
|
v(() => (o(), window.addEventListener("resize", o), "fonts" in document && document.fonts.ready.then(o), () => window.removeEventListener("resize", o)), [f, o]), v(() => {
|
|
50
|
-
const e =
|
|
50
|
+
const e = h.current;
|
|
51
51
|
if (!e || typeof ResizeObserver > "u") return;
|
|
52
52
|
const i = new ResizeObserver(() => {
|
|
53
53
|
o();
|
|
@@ -58,7 +58,7 @@ function G({
|
|
|
58
58
|
}, [t, o]), v(() => {
|
|
59
59
|
d.current = d.current.slice(0, t.length);
|
|
60
60
|
}, [t]);
|
|
61
|
-
const c = f === "left" || f === "right",
|
|
61
|
+
const c = f === "left" || f === "right", p = typeof r == "string" && r.startsWith("w-") ? r : void 0, N = p ? void 0 : r, R = $(
|
|
62
62
|
() => t.find((e) => e.id === s)?.content,
|
|
63
63
|
[s, t]
|
|
64
64
|
);
|
|
@@ -77,13 +77,13 @@ function G({
|
|
|
77
77
|
className: n(
|
|
78
78
|
r ? "flex-none" : "flex-1",
|
|
79
79
|
c ? "w-full" : !r && "min-w-[520px]",
|
|
80
|
-
|
|
80
|
+
p
|
|
81
81
|
),
|
|
82
82
|
style: N !== void 0 ? { width: N } : void 0,
|
|
83
83
|
children: /* @__PURE__ */ m(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
|
-
ref:
|
|
86
|
+
ref: h,
|
|
87
87
|
className: n(
|
|
88
88
|
"relative flex rounded-xl p-1",
|
|
89
89
|
u ? "bg-neutral-300" : "bg-slate-100",
|
|
@@ -120,7 +120,7 @@ function G({
|
|
|
120
120
|
"relative z-10 flex cursor-pointer items-center justify-center px-3 py-2 text-base font-normal whitespace-nowrap transition-colors duration-300",
|
|
121
121
|
u ? "text-white" : "text-black",
|
|
122
122
|
e?.disabled && (u ? "cursor-not-allowed text-neutral-100/50 opacity-60" : "cursor-not-allowed opacity-50"),
|
|
123
|
-
c ? "w-full justify-start" :
|
|
123
|
+
c ? "w-full justify-start" : "min-w-0 flex-1"
|
|
124
124
|
),
|
|
125
125
|
children: [
|
|
126
126
|
e?.icon && /* @__PURE__ */ l(
|