asterui 0.12.16 → 0.12.18
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/components/Card.d.ts +14 -2
- package/dist/components/Checkbox.d.ts +3 -1
- package/dist/components/Form.d.ts +7 -1
- package/dist/components/Input.d.ts +10 -2
- package/dist/components/Select.d.ts +8 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +134 -136
- package/dist/index.js.map +1 -1
- package/dist/index10.js +70 -65
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +43 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +11 -44
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +12 -10
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -14
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +12 -7
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +29 -11
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +16 -29
- package/dist/index106.js.map +1 -1
- package/dist/index13.js +86 -68
- package/dist/index13.js.map +1 -1
- package/dist/index34.js +198 -158
- package/dist/index34.js.map +1 -1
- package/dist/index42.js +185 -148
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +19 -19
- package/dist/index43.js.map +1 -1
- package/dist/index46.js +134 -18
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +10 -134
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +35 -13
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +34 -35
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +81 -34
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +166 -71
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +144 -167
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +11 -152
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +20 -10
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +14 -22
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +7 -14
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +333 -6
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -334
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +122 -47
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +108 -120
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +167 -107
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +29 -167
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +120 -30
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +80 -116
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +19 -85
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +73 -19
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +54 -71
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +44 -56
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +49 -42
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +121 -50
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +102 -118
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +72 -105
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +68 -41
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +19 -66
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +55 -18
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +251 -55
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -254
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -22
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +93 -30
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +324 -89
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +73 -322
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +39 -79
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +23 -40
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +93 -21
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +148 -87
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +152 -147
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +63 -159
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -65
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +234 -35
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +31 -231
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +210 -34
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +198 -195
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +241 -159
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +166 -283
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +253 -173
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +14 -258
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +31 -12
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -32
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +13 -5
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Label.d.ts +0 -15
- package/dist/index107.js +0 -21
- package/dist/index107.js.map +0 -1
package/dist/index77.js
CHANGED
|
@@ -1,257 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
className:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const s = e.reduce((l, n) => l + (n ?? 0), 0), r = e.filter((l) => l === void 0).length, a = Math.max(0, 100 - s), t = r > 0 ? a / r : 0;
|
|
23
|
-
return e.map((l) => l ?? t);
|
|
24
|
-
}
|
|
25
|
-
const i = 100 / m;
|
|
26
|
-
return Array(m).fill(i);
|
|
27
|
-
}, [$, m, u]), [k, Y] = J(j), ee = y(() => {
|
|
28
|
-
const e = u.map((t) => t.props.size);
|
|
29
|
-
if (!e.some((t) => t !== void 0)) return null;
|
|
30
|
-
const i = e.reduce((t, l) => t + (l ?? 0), 0), s = e.filter((t) => t === void 0).length, r = Math.max(0, 100 - i), a = s > 0 ? r / s : 0;
|
|
31
|
-
return e.map((t, l) => t ?? k[l] ?? a);
|
|
32
|
-
}, [u, k]), d = P || ee() || k;
|
|
33
|
-
Q(() => {
|
|
34
|
-
!P && k.length !== m && Y(j());
|
|
35
|
-
}, [m, P, k.length, j]), Q(() => {
|
|
36
|
-
const e = u.map(
|
|
37
|
-
(i, s) => i.props.collapsed ?? f[s] ?? !1
|
|
38
|
-
);
|
|
39
|
-
e.some((i, s) => i !== f[s]) && W(e);
|
|
40
|
-
}, [u.map((e) => e.props.collapsed).join(",")]);
|
|
41
|
-
const b = y(
|
|
42
|
-
(e) => {
|
|
43
|
-
P || Y(e), F?.(e);
|
|
44
|
-
},
|
|
45
|
-
[P, F]
|
|
46
|
-
), _ = y(
|
|
47
|
-
(e) => {
|
|
48
|
-
const o = u[e];
|
|
49
|
-
if (!o?.props.collapsible) return;
|
|
50
|
-
const s = !f[e], r = [...f];
|
|
51
|
-
if (r[e] = s, W(r), o.props.onCollapse?.(s), s) {
|
|
52
|
-
X.current = [...d];
|
|
53
|
-
const a = 0, t = d[e] - a, l = d.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]);
|
|
54
|
-
if (l.length > 0) {
|
|
55
|
-
const n = t / l.length, c = d.map((p, w) => w === e ? a : r[w] ? p : p + n);
|
|
56
|
-
b(c);
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
const a = X.current[e] || 100 / m, l = d.map((n, c) => ({ size: n, index: c })).filter((n, c) => c !== e && !r[c]).reduce((n, c) => n + c.size, 0);
|
|
60
|
-
if (l > 0) {
|
|
61
|
-
const n = d.map((c, p) => {
|
|
62
|
-
if (p === e) return a;
|
|
63
|
-
if (!r[p]) {
|
|
64
|
-
const w = c / l;
|
|
65
|
-
return c - a * w;
|
|
66
|
-
}
|
|
67
|
-
return c;
|
|
68
|
-
});
|
|
69
|
-
b(n);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
[u, f, d, m, b]
|
|
74
|
-
), te = y(
|
|
75
|
-
(e, o) => {
|
|
76
|
-
const i = u[e]?.props || {}, s = u[e + 1]?.props || {};
|
|
77
|
-
if (i.resizable === !1 || s.resizable === !1 || f[e] || f[e + 1])
|
|
78
|
-
return;
|
|
79
|
-
o.preventDefault();
|
|
80
|
-
const r = z === "horizontal" ? o.clientX : o.clientY;
|
|
81
|
-
x.current = {
|
|
82
|
-
index: e,
|
|
83
|
-
startPos: r,
|
|
84
|
-
startSizes: [...d]
|
|
85
|
-
};
|
|
86
|
-
const a = (l) => {
|
|
87
|
-
if (!x.current || !D.current) return;
|
|
88
|
-
const { index: n, startPos: c, startSizes: p } = x.current, w = D.current.getBoundingClientRect(), se = z === "horizontal" ? w.width : w.height, re = z === "horizontal" ? l.clientX : l.clientY, le = (m - 1) * R, N = se - le, q = (re - c) / N * 100, G = u[n]?.props || {}, H = u[n + 1]?.props || {}, ae = G.minSize ?? E, ce = H.minSize ?? E, A = ae / N * 100, B = ce / N * 100;
|
|
89
|
-
let v = p[n] + q, C = p[n + 1] - q;
|
|
90
|
-
v < A && (v = A, C = p[n] + p[n + 1] - A), C < B && (C = B, v = p[n] + p[n + 1] - B);
|
|
91
|
-
const O = G.maxSize, V = H.maxSize;
|
|
92
|
-
if (O) {
|
|
93
|
-
const S = O / N * 100;
|
|
94
|
-
v > S && (v = S, C = p[n] + p[n + 1] - S);
|
|
95
|
-
}
|
|
96
|
-
if (V) {
|
|
97
|
-
const S = V / N * 100;
|
|
98
|
-
C > S && (C = S, v = p[n] + p[n + 1] - S);
|
|
99
|
-
}
|
|
100
|
-
const U = [...p];
|
|
101
|
-
U[n] = v, U[n + 1] = C, b(U);
|
|
102
|
-
}, t = () => {
|
|
103
|
-
x.current = null, document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", t), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
104
|
-
};
|
|
105
|
-
document.addEventListener("mousemove", a), document.addEventListener("mouseup", t), document.body.style.cursor = z === "horizontal" ? "col-resize" : "row-resize", document.body.style.userSelect = "none";
|
|
106
|
-
},
|
|
107
|
-
[z, d, m, R, u, E, b, f]
|
|
108
|
-
), oe = y(
|
|
109
|
-
(e, o) => {
|
|
110
|
-
if (f[e] || f[e + 1])
|
|
111
|
-
return;
|
|
112
|
-
const i = o.shiftKey ? 10 : 1;
|
|
113
|
-
let s = 0;
|
|
114
|
-
if (z === "horizontal" ? o.key === "ArrowLeft" ? s = -i : o.key === "ArrowRight" && (s = i) : o.key === "ArrowUp" ? s = -i : o.key === "ArrowDown" && (s = i), s !== 0) {
|
|
115
|
-
o.preventDefault();
|
|
116
|
-
const r = [...d], a = 5;
|
|
117
|
-
let t = r[e] + s, l = r[e + 1] - s;
|
|
118
|
-
t >= a && l >= a && (r[e] = t, r[e + 1] = l, b(r));
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
[z, d, b, f]
|
|
122
|
-
), g = z === "horizontal", ne = (e) => {
|
|
123
|
-
const o = u[e], i = u[e + 1], s = o?.props.collapsible, r = i?.props.collapsible, a = f[e], t = f[e + 1];
|
|
124
|
-
return {
|
|
125
|
-
showStart: s && !t,
|
|
126
|
-
showEnd: r && !a,
|
|
127
|
-
panel1Collapsed: a,
|
|
128
|
-
panel2Collapsed: t
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
return /* @__PURE__ */ h(
|
|
132
|
-
"div",
|
|
133
|
-
{
|
|
134
|
-
ref: D,
|
|
135
|
-
className: `flex ${g ? "flex-row" : "flex-col"} h-full w-full ${Z}`,
|
|
136
|
-
children: u.map((e, o) => {
|
|
137
|
-
const i = e.props, s = o === u.length - 1, r = f[o], a = i.resizable !== !1 && !r;
|
|
138
|
-
return /* @__PURE__ */ K(T.Fragment, { children: [
|
|
139
|
-
/* @__PURE__ */ h(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
ref: (t) => {
|
|
143
|
-
I.current[o] = t;
|
|
144
|
-
},
|
|
145
|
-
className: `overflow-auto ${i.className || ""}`,
|
|
146
|
-
style: {
|
|
147
|
-
[g ? "width" : "height"]: r ? "0px" : `calc(${d[o]}% - ${(m - 1) * R / m}px)`,
|
|
148
|
-
flexShrink: 0,
|
|
149
|
-
overflow: r ? "hidden" : "auto"
|
|
150
|
-
},
|
|
151
|
-
"data-collapsed": r,
|
|
152
|
-
children: i.children
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
!s && /* @__PURE__ */ h(
|
|
156
|
-
"div",
|
|
157
|
-
{
|
|
158
|
-
role: "separator",
|
|
159
|
-
"aria-orientation": g ? "vertical" : "horizontal",
|
|
160
|
-
"aria-valuenow": Math.round(d[o]),
|
|
161
|
-
tabIndex: a ? 0 : -1,
|
|
162
|
-
className: `
|
|
163
|
-
flex-shrink-0 bg-base-300 transition-colors duration-150 relative group
|
|
164
|
-
${a ? "hover:bg-primary/30 active:bg-primary/50" : ""}
|
|
165
|
-
${a ? g ? "cursor-col-resize" : "cursor-row-resize" : "cursor-default"}
|
|
166
|
-
`,
|
|
167
|
-
style: {
|
|
168
|
-
[g ? "width" : "height"]: `${R}px`
|
|
169
|
-
},
|
|
170
|
-
onMouseDown: (t) => te(o, t),
|
|
171
|
-
onKeyDown: (t) => oe(o, t),
|
|
172
|
-
children: (() => {
|
|
173
|
-
const { showStart: t, showEnd: l, panel1Collapsed: n, panel2Collapsed: c } = ne(o);
|
|
174
|
-
return !t && !l ? /* @__PURE__ */ K(
|
|
175
|
-
"div",
|
|
176
|
-
{
|
|
177
|
-
className: `
|
|
178
|
-
absolute inset-0 flex items-center justify-center
|
|
179
|
-
${g ? "flex-col gap-0.5" : "flex-row gap-0.5"}
|
|
180
|
-
`,
|
|
181
|
-
children: [
|
|
182
|
-
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" }),
|
|
183
|
-
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" }),
|
|
184
|
-
/* @__PURE__ */ h("div", { className: "w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60" })
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
) : /* @__PURE__ */ K(
|
|
188
|
-
"div",
|
|
189
|
-
{
|
|
190
|
-
className: `
|
|
191
|
-
absolute inset-0 flex items-center justify-center
|
|
192
|
-
${g ? "flex-col" : "flex-row"}
|
|
193
|
-
`,
|
|
194
|
-
children: [
|
|
195
|
-
t && /* @__PURE__ */ h(
|
|
196
|
-
"button",
|
|
197
|
-
{
|
|
198
|
-
type: "button",
|
|
199
|
-
onClick: (p) => {
|
|
200
|
-
p.stopPropagation(), _(o);
|
|
201
|
-
},
|
|
202
|
-
className: `
|
|
203
|
-
p-0.5 rounded hover:bg-base-content/20 transition-colors
|
|
204
|
-
|
|
205
|
-
`,
|
|
206
|
-
"aria-label": n ? "Expand panel" : "Collapse panel",
|
|
207
|
-
children: /* @__PURE__ */ h(
|
|
208
|
-
"svg",
|
|
209
|
-
{
|
|
210
|
-
className: `w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${n ? g ? "rotate-180" : "-rotate-90" : g ? "rotate-0" : "rotate-90"}`,
|
|
211
|
-
fill: "none",
|
|
212
|
-
viewBox: "0 0 24 24",
|
|
213
|
-
stroke: "currentColor",
|
|
214
|
-
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
215
|
-
}
|
|
216
|
-
)
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
l && /* @__PURE__ */ h(
|
|
220
|
-
"button",
|
|
221
|
-
{
|
|
222
|
-
type: "button",
|
|
223
|
-
onClick: (p) => {
|
|
224
|
-
p.stopPropagation(), _(o + 1);
|
|
225
|
-
},
|
|
226
|
-
className: `
|
|
227
|
-
p-0.5 rounded hover:bg-base-content/20 transition-colors
|
|
228
|
-
`,
|
|
229
|
-
"aria-label": c ? "Expand panel" : "Collapse panel",
|
|
230
|
-
children: /* @__PURE__ */ h(
|
|
231
|
-
"svg",
|
|
232
|
-
{
|
|
233
|
-
className: `w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${c ? g ? "rotate-0" : "rotate-90" : g ? "rotate-180" : "-rotate-90"}`,
|
|
234
|
-
fill: "none",
|
|
235
|
-
viewBox: "0 0 24 24",
|
|
236
|
-
stroke: "currentColor",
|
|
237
|
-
children: /* @__PURE__ */ h("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" })
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
]
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
})()
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
] }, o);
|
|
249
|
-
})
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
};
|
|
253
|
-
ue.Panel = pe;
|
|
1
|
+
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
function o({ children: s, className: a = "", vertical: e = !1, ...i }) {
|
|
3
|
+
const c = [
|
|
4
|
+
"stats",
|
|
5
|
+
e ? "stats-vertical" : "stats-horizontal",
|
|
6
|
+
a
|
|
7
|
+
].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ t("div", { className: c, ...i, children: s });
|
|
9
|
+
}
|
|
10
|
+
function d({ title: s, value: a, desc: e, figure: i, actions: c, className: l = "", ...n }) {
|
|
11
|
+
return /* @__PURE__ */ r("div", { className: `stat ${l}`, ...n, children: [
|
|
12
|
+
i && /* @__PURE__ */ t("div", { className: "stat-figure", children: i }),
|
|
13
|
+
s && /* @__PURE__ */ t("div", { className: "stat-title", children: s }),
|
|
14
|
+
a && /* @__PURE__ */ t("div", { className: "stat-value", children: a }),
|
|
15
|
+
e && /* @__PURE__ */ t("div", { className: "stat-desc", children: e }),
|
|
16
|
+
c && /* @__PURE__ */ t("div", { className: "stat-actions", children: c })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
const v = Object.assign(o, {
|
|
20
|
+
Stat: d
|
|
21
|
+
});
|
|
254
22
|
export {
|
|
255
|
-
|
|
23
|
+
v as Stats
|
|
256
24
|
};
|
|
257
25
|
//# sourceMappingURL=index77.js.map
|
package/dist/index77.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index77.js","sources":["../src/components/Splitter.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback, useEffect } from 'react'\n\nexport interface SplitterPanelProps {\n children: React.ReactNode\n defaultSize?: number\n size?: number\n minSize?: number\n maxSize?: number\n collapsible?: boolean\n collapsed?: boolean\n defaultCollapsed?: boolean\n onCollapse?: (collapsed: boolean) => void\n resizable?: boolean\n className?: string\n}\n\nexport interface SplitterProps {\n children: React.ReactNode\n direction?: 'horizontal' | 'vertical'\n sizes?: number[]\n defaultSizes?: number[]\n onSizesChange?: (sizes: number[]) => void\n gutterSize?: number\n minSize?: number\n className?: string\n}\n\nconst Panel: React.FC<SplitterPanelProps> = ({ children }) => {\n return <>{children}</>\n}\n\nexport const Splitter: React.FC<SplitterProps> & { Panel: typeof Panel } = ({\n children,\n direction = 'horizontal',\n sizes,\n defaultSizes,\n onSizesChange,\n gutterSize = 8,\n minSize = 50,\n className = '',\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const panelsRef = useRef<(HTMLDivElement | null)[]>([])\n const draggingRef = useRef<{ index: number; startPos: number; startSizes: number[] } | null>(null)\n\n // Extract panel props from children\n const panels = React.Children.toArray(children).filter(\n (child): child is React.ReactElement<SplitterPanelProps> =>\n React.isValidElement(child)\n )\n\n const panelCount = panels.length\n\n // Track collapsed state for each panel\n const [collapsedStates, setCollapsedStates] = useState<boolean[]>(() =>\n panels.map((panel) => panel.props.defaultCollapsed ?? panel.props.collapsed ?? false)\n )\n\n // Store sizes before collapse for restoration\n const sizesBeforeCollapseRef = useRef<number[]>([])\n\n // Initialize sizes from panel props or defaults\n const getInitialSizes = useCallback(() => {\n // First check if any panels have defaultSize\n const panelDefaultSizes = panels.map((panel) => panel.props.defaultSize)\n const hasAnyPanelSize = panelDefaultSizes.some((s) => s !== undefined)\n\n if (defaultSizes && defaultSizes.length === panelCount) {\n return defaultSizes\n }\n\n if (hasAnyPanelSize) {\n // Calculate sizes from panel props\n const definedTotal = panelDefaultSizes.reduce<number>((sum, s) => sum + (s ?? 0), 0)\n const undefinedCount = panelDefaultSizes.filter((s) => s === undefined).length\n const remainingSize = Math.max(0, 100 - definedTotal)\n const sizePerUndefined = undefinedCount > 0 ? remainingSize / undefinedCount : 0\n\n return panelDefaultSizes.map((s) => s ?? sizePerUndefined)\n }\n\n // Equal distribution\n const equalSize = 100 / panelCount\n return Array(panelCount).fill(equalSize)\n }, [defaultSizes, panelCount, panels])\n\n const [internalSizes, setInternalSizes] = useState<number[]>(getInitialSizes)\n\n // Handle controlled sizes from panel props\n const getControlledSizes = useCallback(() => {\n const panelSizes = panels.map((panel) => panel.props.size)\n const hasControlledPanel = panelSizes.some((s) => s !== undefined)\n\n if (!hasControlledPanel) return null\n\n // Mix controlled and uncontrolled\n const definedTotal = panelSizes.reduce<number>((sum, s) => sum + (s ?? 0), 0)\n const undefinedCount = panelSizes.filter((s) => s === undefined).length\n const remainingSize = Math.max(0, 100 - definedTotal)\n const sizePerUndefined = undefinedCount > 0 ? remainingSize / undefinedCount : 0\n\n return panelSizes.map((s, i) => s ?? internalSizes[i] ?? sizePerUndefined)\n }, [panels, internalSizes])\n\n const currentSizes = sizes || getControlledSizes() || internalSizes\n\n // Update internal sizes when panel count changes\n useEffect(() => {\n if (!sizes && internalSizes.length !== panelCount) {\n setInternalSizes(getInitialSizes())\n }\n }, [panelCount, sizes, internalSizes.length, getInitialSizes])\n\n // Sync controlled collapsed states from props\n useEffect(() => {\n const newCollapsedStates = panels.map((panel, i) =>\n panel.props.collapsed ?? collapsedStates[i] ?? false\n )\n const hasChange = newCollapsedStates.some((s, i) => s !== collapsedStates[i])\n if (hasChange) {\n setCollapsedStates(newCollapsedStates)\n }\n }, [panels.map(p => p.props.collapsed).join(',')])\n\n const updateSizes = useCallback(\n (newSizes: number[]) => {\n if (!sizes) {\n setInternalSizes(newSizes)\n }\n onSizesChange?.(newSizes)\n },\n [sizes, onSizesChange]\n )\n\n const toggleCollapse = useCallback(\n (panelIndex: number) => {\n const panel = panels[panelIndex]\n if (!panel?.props.collapsible) return\n\n const isCurrentlyCollapsed = collapsedStates[panelIndex]\n const newCollapsed = !isCurrentlyCollapsed\n\n // Update collapsed state\n const newCollapsedStates = [...collapsedStates]\n newCollapsedStates[panelIndex] = newCollapsed\n setCollapsedStates(newCollapsedStates)\n\n // Call panel's onCollapse callback\n panel.props.onCollapse?.(newCollapsed)\n\n // Adjust sizes\n if (newCollapsed) {\n // Store current sizes before collapse\n sizesBeforeCollapseRef.current = [...currentSizes]\n\n // Collapse: set to minimum (we'll use 0 for collapsed)\n const collapsedSize = 0\n const sizeToRedistribute = currentSizes[panelIndex] - collapsedSize\n\n // Find panels that can receive the size\n const otherPanels = currentSizes\n .map((s, i) => ({ size: s, index: i }))\n .filter((_, i) => i !== panelIndex && !newCollapsedStates[i])\n\n if (otherPanels.length > 0) {\n const sizePerPanel = sizeToRedistribute / otherPanels.length\n const newSizes = currentSizes.map((s, i) => {\n if (i === panelIndex) return collapsedSize\n if (!newCollapsedStates[i]) return s + sizePerPanel\n return s\n })\n updateSizes(newSizes)\n }\n } else {\n // Expand: restore previous size\n const previousSize = sizesBeforeCollapseRef.current[panelIndex] || (100 / panelCount)\n\n // Take size from other panels proportionally\n const otherPanels = currentSizes\n .map((s, i) => ({ size: s, index: i }))\n .filter((_, i) => i !== panelIndex && !newCollapsedStates[i])\n\n const totalOtherSize = otherPanels.reduce((sum, p) => sum + p.size, 0)\n\n if (totalOtherSize > 0) {\n const newSizes = currentSizes.map((s, i) => {\n if (i === panelIndex) return previousSize\n if (!newCollapsedStates[i]) {\n const proportion = s / totalOtherSize\n return s - previousSize * proportion\n }\n return s\n })\n updateSizes(newSizes)\n }\n }\n },\n [panels, collapsedStates, currentSizes, panelCount, updateSizes]\n )\n\n const handleMouseDown = useCallback(\n (index: number, e: React.MouseEvent) => {\n // Check if either panel is non-resizable\n const panel1Props = panels[index]?.props || {}\n const panel2Props = panels[index + 1]?.props || {}\n\n if (panel1Props.resizable === false || panel2Props.resizable === false) {\n return // Don't allow dragging\n }\n\n // Don't allow dragging if either panel is collapsed\n if (collapsedStates[index] || collapsedStates[index + 1]) {\n return\n }\n\n e.preventDefault()\n const startPos = direction === 'horizontal' ? e.clientX : e.clientY\n draggingRef.current = {\n index,\n startPos,\n startSizes: [...currentSizes],\n }\n\n const handleMouseMove = (moveEvent: MouseEvent) => {\n if (!draggingRef.current || !containerRef.current) return\n\n const { index: dragIndex, startPos: dragStartPos, startSizes } = draggingRef.current\n const containerRect = containerRef.current.getBoundingClientRect()\n const containerSize = direction === 'horizontal' ? containerRect.width : containerRect.height\n const currentPos = direction === 'horizontal' ? moveEvent.clientX : moveEvent.clientY\n\n // Calculate delta as percentage\n const gutterCount = panelCount - 1\n const totalGutterSize = gutterCount * gutterSize\n const availableSize = containerSize - totalGutterSize\n const deltaPixels = currentPos - dragStartPos\n const deltaPercent = (deltaPixels / availableSize) * 100\n\n // Get min sizes for panels\n const panel1Props = panels[dragIndex]?.props || {}\n const panel2Props = panels[dragIndex + 1]?.props || {}\n const minSize1 = panel1Props.minSize ?? minSize\n const minSize2 = panel2Props.minSize ?? minSize\n const minPercent1 = (minSize1 / availableSize) * 100\n const minPercent2 = (minSize2 / availableSize) * 100\n\n // Calculate new sizes\n let newSize1 = startSizes[dragIndex] + deltaPercent\n let newSize2 = startSizes[dragIndex + 1] - deltaPercent\n\n // Apply min constraints\n if (newSize1 < minPercent1) {\n newSize1 = minPercent1\n newSize2 = startSizes[dragIndex] + startSizes[dragIndex + 1] - minPercent1\n }\n if (newSize2 < minPercent2) {\n newSize2 = minPercent2\n newSize1 = startSizes[dragIndex] + startSizes[dragIndex + 1] - minPercent2\n }\n\n // Apply max constraints\n const maxSize1 = panel1Props.maxSize\n const maxSize2 = panel2Props.maxSize\n if (maxSize1) {\n const maxPercent1 = (maxSize1 / availableSize) * 100\n if (newSize1 > maxPercent1) {\n newSize1 = maxPercent1\n newSize2 = startSizes[dragIndex] + startSizes[dragIndex + 1] - maxPercent1\n }\n }\n if (maxSize2) {\n const maxPercent2 = (maxSize2 / availableSize) * 100\n if (newSize2 > maxPercent2) {\n newSize2 = maxPercent2\n newSize1 = startSizes[dragIndex] + startSizes[dragIndex + 1] - maxPercent2\n }\n }\n\n const newSizes = [...startSizes]\n newSizes[dragIndex] = newSize1\n newSizes[dragIndex + 1] = newSize2\n updateSizes(newSizes)\n }\n\n const handleMouseUp = () => {\n draggingRef.current = null\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = direction === 'horizontal' ? 'col-resize' : 'row-resize'\n document.body.style.userSelect = 'none'\n },\n [direction, currentSizes, panelCount, gutterSize, panels, minSize, updateSizes, collapsedStates]\n )\n\n const handleKeyDown = useCallback(\n (index: number, e: React.KeyboardEvent) => {\n // Don't allow keyboard resize if either panel is collapsed\n if (collapsedStates[index] || collapsedStates[index + 1]) {\n return\n }\n\n const step = e.shiftKey ? 10 : 1\n let delta = 0\n\n if (direction === 'horizontal') {\n if (e.key === 'ArrowLeft') delta = -step\n else if (e.key === 'ArrowRight') delta = step\n } else {\n if (e.key === 'ArrowUp') delta = -step\n else if (e.key === 'ArrowDown') delta = step\n }\n\n if (delta !== 0) {\n e.preventDefault()\n const newSizes = [...currentSizes]\n const minPercent = 5 // Minimum 5% when using keyboard\n\n let newSize1 = newSizes[index] + delta\n let newSize2 = newSizes[index + 1] - delta\n\n if (newSize1 >= minPercent && newSize2 >= minPercent) {\n newSizes[index] = newSize1\n newSizes[index + 1] = newSize2\n updateSizes(newSizes)\n }\n }\n },\n [direction, currentSizes, updateSizes, collapsedStates]\n )\n\n const isHorizontal = direction === 'horizontal'\n\n // Determine if gutter should show collapse buttons\n const getCollapseConfig = (index: number) => {\n const panel1 = panels[index]\n const panel2 = panels[index + 1]\n const panel1Collapsible = panel1?.props.collapsible\n const panel2Collapsible = panel2?.props.collapsible\n const panel1Collapsed = collapsedStates[index]\n const panel2Collapsed = collapsedStates[index + 1]\n\n return {\n showStart: panel1Collapsible && !panel2Collapsed,\n showEnd: panel2Collapsible && !panel1Collapsed,\n panel1Collapsed,\n panel2Collapsed,\n }\n }\n\n return (\n <div\n ref={containerRef}\n className={`flex ${isHorizontal ? 'flex-row' : 'flex-col'} h-full w-full ${className}`}\n >\n {panels.map((panel, index) => {\n const panelProps = panel.props\n const isLast = index === panels.length - 1\n const isCollapsed = collapsedStates[index]\n const canResize = panelProps.resizable !== false && !isCollapsed\n\n return (\n <React.Fragment key={index}>\n <div\n ref={(el) => {\n panelsRef.current[index] = el\n }}\n className={`overflow-auto ${panelProps.className || ''}`}\n style={{\n [isHorizontal ? 'width' : 'height']: isCollapsed\n ? '0px'\n : `calc(${currentSizes[index]}% - ${((panelCount - 1) * gutterSize) / panelCount}px)`,\n flexShrink: 0,\n overflow: isCollapsed ? 'hidden' : 'auto',\n }}\n data-collapsed={isCollapsed}\n >\n {panelProps.children}\n </div>\n {!isLast && (\n <div\n role=\"separator\"\n aria-orientation={isHorizontal ? 'vertical' : 'horizontal'}\n aria-valuenow={Math.round(currentSizes[index])}\n tabIndex={canResize ? 0 : -1}\n className={`\n flex-shrink-0 bg-base-300 transition-colors duration-150 relative group\n ${canResize ? 'hover:bg-primary/30 active:bg-primary/50' : ''}\n ${canResize ? (isHorizontal ? 'cursor-col-resize' : 'cursor-row-resize') : 'cursor-default'}\n `}\n style={{\n [isHorizontal ? 'width' : 'height']: `${gutterSize}px`,\n }}\n onMouseDown={(e) => handleMouseDown(index, e)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n >\n {/* Collapse buttons */}\n {(() => {\n const { showStart, showEnd, panel1Collapsed, panel2Collapsed } = getCollapseConfig(index)\n\n if (!showStart && !showEnd) {\n // Just show grip indicator\n return (\n <div\n className={`\n absolute inset-0 flex items-center justify-center\n ${isHorizontal ? 'flex-col gap-0.5' : 'flex-row gap-0.5'}\n `}\n >\n <div className=\"w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60\" />\n <div className=\"w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60\" />\n <div className=\"w-1 h-1 rounded-full bg-base-content/30 group-hover:bg-primary/60\" />\n </div>\n )\n }\n\n return (\n <div\n className={`\n absolute inset-0 flex items-center justify-center\n ${isHorizontal ? 'flex-col' : 'flex-row'}\n `}\n >\n {showStart && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n toggleCollapse(index)\n }}\n className={`\n p-0.5 rounded hover:bg-base-content/20 transition-colors\n ${isHorizontal ? '' : ''}\n `}\n aria-label={panel1Collapsed ? 'Expand panel' : 'Collapse panel'}\n >\n <svg\n className={`w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${\n panel1Collapsed\n ? isHorizontal ? 'rotate-180' : '-rotate-90'\n : isHorizontal ? 'rotate-0' : 'rotate-90'\n }`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )}\n {showEnd && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n toggleCollapse(index + 1)\n }}\n className={`\n p-0.5 rounded hover:bg-base-content/20 transition-colors\n `}\n aria-label={panel2Collapsed ? 'Expand panel' : 'Collapse panel'}\n >\n <svg\n className={`w-3 h-3 text-base-content/50 hover:text-base-content transition-transform ${\n panel2Collapsed\n ? isHorizontal ? 'rotate-0' : 'rotate-90'\n : isHorizontal ? 'rotate-180' : '-rotate-90'\n }`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n )}\n </div>\n )\n })()}\n </div>\n )}\n </React.Fragment>\n )\n })}\n </div>\n )\n}\n\nSplitter.Panel = Panel\n"],"names":["Panel","children","Splitter","direction","sizes","defaultSizes","onSizesChange","gutterSize","minSize","className","containerRef","useRef","panelsRef","draggingRef","panels","React","child","panelCount","collapsedStates","setCollapsedStates","useState","panel","sizesBeforeCollapseRef","getInitialSizes","useCallback","panelDefaultSizes","hasAnyPanelSize","definedTotal","sum","s","undefinedCount","remainingSize","sizePerUndefined","equalSize","internalSizes","setInternalSizes","getControlledSizes","panelSizes","i","currentSizes","useEffect","newCollapsedStates","p","updateSizes","newSizes","toggleCollapse","panelIndex","newCollapsed","collapsedSize","sizeToRedistribute","otherPanels","_","sizePerPanel","previousSize","totalOtherSize","proportion","handleMouseDown","index","e","panel1Props","panel2Props","startPos","handleMouseMove","moveEvent","dragIndex","dragStartPos","startSizes","containerRect","containerSize","currentPos","totalGutterSize","availableSize","deltaPercent","minSize1","minSize2","minPercent1","minPercent2","newSize1","newSize2","maxSize1","maxSize2","maxPercent1","maxPercent2","handleMouseUp","handleKeyDown","step","delta","minPercent","isHorizontal","getCollapseConfig","panel1","panel2","panel1Collapsible","panel2Collapsible","panel1Collapsed","panel2Collapsed","jsx","panelProps","isLast","isCollapsed","canResize","jsxs","el","showStart","showEnd"],"mappings":";;AA2BA,MAAMA,KAAsC,CAAC,EAAE,UAAAC,gCACnC,UAAAA,GAAS,GAGRC,KAA8D,CAAC;AAAA,EAC1E,UAAAD;AAAA,EACA,WAAA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AAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,kBAAA,CAAkB;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACzF;AAAA,sBAAA;AAAA,sBAGHQ,KACC,gBAAAR;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,MAAK;AAAA,0BACL,SAAS,CAACtC,MAAM;AACd,4BAAAA,EAAE,gBAAA,GACFb,EAAeY,IAAQ,CAAC;AAAA,0BAC1B;AAAA,0BACA,WAAW;AAAA;AAAA;AAAA,0BAGX,cAAYsC,IAAkB,iBAAiB;AAAA,0BAE/C,UAAA,gBAAAC;AAAA,4BAAC;AAAA,4BAAA;AAAA,8BACC,WAAW,6EACTD,IACIP,IAAe,aAAa,cAC5BA,IAAe,eAAe,YACpC;AAAA,8BACA,MAAK;AAAA,8BACL,SAAQ;AAAA,8BACR,QAAO;AAAA,8BAEP,UAAA,gBAAAQ,EAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,kBAAA,CAAkB;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACzF;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAIR,GAAA;AAAA,YAAG;AAAA,UAAA;AAAA,QACL,EAAA,GArHiBvC,CAuHrB;AAAA,MAEJ,CAAC;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAvD,GAAS,QAAQF;"}
|
|
1
|
+
{"version":3,"file":"index77.js","sources":["../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, ...rest }: StatsProps) {\n const classes = [\n 'stats',\n vertical ? 'stats-vertical' : 'stats-horizontal',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', ...rest }: StatProps) {\n return (\n <div className={`stat ${className}`} {...rest}>\n {figure && <div className=\"stat-figure\">{figure}</div>}\n {title && <div className=\"stat-title\">{title}</div>}\n {value && <div className=\"stat-value\">{value}</div>}\n {desc && <div className=\"stat-desc\">{desc}</div>}\n {actions && <div className=\"stat-actions\">{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["StatsRoot","children","className","vertical","rest","classes","StatItem","title","value","desc","figure","actions","jsx","Stats"],"mappings":";AAeA,SAASA,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,UAAAC,IAAW,IAAO,GAAGC,KAAoB;AACtF,QAAMC,IAAU;AAAA,IACd;AAAA,IACAF,IAAW,mBAAmB;AAAA,IAC9BD;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,OAAA,EAAI,WAAWG,GAAU,GAAGD,GAAO,UAAAH,GAAS;AACtD;AAEA,SAASK,EAAS,EAAE,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,SAAAC,GAAS,WAAAT,IAAY,IAAI,GAAGE,KAAmB;AAC7F,2BACG,OAAA,EAAI,WAAW,QAAQF,CAAS,IAAK,GAAGE,GACtC,UAAA;AAAA,IAAAM,KAAU,gBAAAE,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAF,GAAO;AAAA,IAC/CH,KAAS,gBAAAK,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAL,GAAM;AAAA,IAC5CC,KAAS,gBAAAI,EAAC,OAAA,EAAI,WAAU,cAAc,UAAAJ,GAAM;AAAA,IAC5CC,KAAQ,gBAAAG,EAAC,OAAA,EAAI,WAAU,aAAa,UAAAH,GAAK;AAAA,IACzCE,KAAW,gBAAAC,EAAC,OAAA,EAAI,WAAU,gBAAgB,UAAAD,EAAA,CAAQ;AAAA,EAAA,GACrD;AAEJ;AAEO,MAAME,IAAQ,OAAO,OAAOb,GAAW;AAAA,EAC5C,MAAMM;AACR,CAAC;"}
|
package/dist/index78.js
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
const l = {
|
|
3
|
+
neutral: "status-neutral",
|
|
4
|
+
primary: "status-primary",
|
|
5
|
+
secondary: "status-secondary",
|
|
6
|
+
accent: "status-accent",
|
|
7
|
+
info: "status-info",
|
|
8
|
+
success: "status-success",
|
|
9
|
+
warning: "status-warning",
|
|
10
|
+
error: "status-error"
|
|
11
|
+
}, m = {
|
|
12
|
+
xs: "status-xs",
|
|
13
|
+
sm: "status-sm",
|
|
14
|
+
md: "status-md",
|
|
15
|
+
lg: "status-lg",
|
|
16
|
+
xl: "status-xl"
|
|
17
|
+
}, d = ({
|
|
18
|
+
type: e = "neutral",
|
|
19
|
+
size: r = "md",
|
|
20
|
+
ping: n = !1,
|
|
21
|
+
bounce: i = !1,
|
|
22
|
+
label: t,
|
|
23
|
+
className: u = ""
|
|
24
|
+
}) => {
|
|
25
|
+
const s = `status ${l[e]} ${m[r]} ${i ? "animate-bounce" : ""} ${u}`.trim();
|
|
26
|
+
return n ? /* @__PURE__ */ c("div", { className: "inline-grid *:[grid-area:1/1]", "aria-label": t, children: [
|
|
27
|
+
/* @__PURE__ */ a("div", { className: `${s} animate-ping` }),
|
|
28
|
+
/* @__PURE__ */ a("div", { className: s })
|
|
29
|
+
] }) : /* @__PURE__ */ a("div", { className: s, "aria-label": t });
|
|
30
|
+
};
|
|
22
31
|
export {
|
|
23
|
-
|
|
32
|
+
d as Status
|
|
24
33
|
};
|
|
25
34
|
//# sourceMappingURL=index78.js.map
|
package/dist/index78.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index78.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index78.js","sources":["../src/components/Status.tsx"],"sourcesContent":["import React from 'react'\n\nexport type StatusType = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\nexport type StatusSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface StatusProps {\n /** Status color type */\n type?: StatusType\n /** Status size */\n size?: StatusSize\n /** Ping animation effect */\n ping?: boolean\n /** Bounce animation effect */\n bounce?: boolean\n /** Accessibility label */\n label?: string\n /** Additional CSS classes */\n className?: string\n}\n\nconst typeClasses: Record<StatusType, string> = {\n neutral: 'status-neutral',\n primary: 'status-primary',\n secondary: 'status-secondary',\n accent: 'status-accent',\n info: 'status-info',\n success: 'status-success',\n warning: 'status-warning',\n error: 'status-error',\n}\n\nconst sizeClasses: Record<StatusSize, string> = {\n xs: 'status-xs',\n sm: 'status-sm',\n md: 'status-md',\n lg: 'status-lg',\n xl: 'status-xl',\n}\n\nexport const Status: React.FC<StatusProps> = ({\n type = 'neutral',\n size = 'md',\n ping = false,\n bounce = false,\n label,\n className = '',\n}) => {\n const baseClasses = `status ${typeClasses[type]} ${sizeClasses[size]} ${bounce ? 'animate-bounce' : ''} ${className}`.trim()\n\n if (ping) {\n return (\n <div className=\"inline-grid *:[grid-area:1/1]\" aria-label={label}>\n <div className={`${baseClasses} animate-ping`} />\n <div className={baseClasses} />\n </div>\n )\n }\n\n return <div className={baseClasses} aria-label={label} />\n}\n"],"names":["typeClasses","sizeClasses","Status","type","size","ping","bounce","label","className","baseClasses","jsxs","jsx"],"mappings":";AAoBA,MAAMA,IAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAgC,CAAC;AAAA,EAC5C,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAc,UAAUT,EAAYG,CAAI,CAAC,IAAIF,EAAYG,CAAI,CAAC,IAAIE,IAAS,mBAAmB,EAAE,IAAIE,CAAS,GAAG,KAAA;AAEtH,SAAIH,IAEA,gBAAAK,EAAC,OAAA,EAAI,WAAU,iCAAgC,cAAYH,GACzD,UAAA;AAAA,IAAA,gBAAAI,EAAC,OAAA,EAAI,WAAW,GAAGF,CAAW,iBAAiB;AAAA,IAC/C,gBAAAE,EAAC,OAAA,EAAI,WAAWF,EAAA,CAAa;AAAA,EAAA,GAC/B,IAIG,gBAAAE,EAAC,OAAA,EAAI,WAAWF,GAAa,cAAYF,GAAO;AACzD;"}
|
package/dist/index79.js
CHANGED
|
@@ -1,34 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
xs: "status-xs",
|
|
13
|
-
sm: "status-sm",
|
|
14
|
-
md: "status-md",
|
|
15
|
-
lg: "status-lg",
|
|
16
|
-
xl: "status-xl"
|
|
17
|
-
}, d = ({
|
|
18
|
-
type: e = "neutral",
|
|
19
|
-
size: r = "md",
|
|
20
|
-
ping: n = !1,
|
|
21
|
-
bounce: i = !1,
|
|
22
|
-
label: t,
|
|
23
|
-
className: u = ""
|
|
24
|
-
}) => {
|
|
25
|
-
const s = `status ${l[e]} ${m[r]} ${i ? "animate-bounce" : ""} ${u}`.trim();
|
|
26
|
-
return n ? /* @__PURE__ */ c("div", { className: "inline-grid *:[grid-area:1/1]", "aria-label": t, children: [
|
|
27
|
-
/* @__PURE__ */ a("div", { className: `${s} animate-ping` }),
|
|
28
|
-
/* @__PURE__ */ a("div", { className: s })
|
|
29
|
-
] }) : /* @__PURE__ */ a("div", { className: s, "aria-label": t });
|
|
1
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
const j = {
|
|
4
|
+
neutral: "step-neutral",
|
|
5
|
+
primary: "step-primary",
|
|
6
|
+
secondary: "step-secondary",
|
|
7
|
+
accent: "step-accent",
|
|
8
|
+
info: "step-info",
|
|
9
|
+
success: "step-success",
|
|
10
|
+
warning: "step-warning",
|
|
11
|
+
error: "step-error"
|
|
30
12
|
};
|
|
13
|
+
function N({
|
|
14
|
+
children: a,
|
|
15
|
+
items: l,
|
|
16
|
+
current: e,
|
|
17
|
+
direction: p,
|
|
18
|
+
vertical: d = !1,
|
|
19
|
+
onChange: t,
|
|
20
|
+
className: c = "",
|
|
21
|
+
...f
|
|
22
|
+
}) {
|
|
23
|
+
const n = ["steps", (p === "vertical" || d) && "steps-vertical", c].filter(Boolean).join(" ");
|
|
24
|
+
if (l && l.length > 0)
|
|
25
|
+
return /* @__PURE__ */ i("ul", { className: n, ...f, children: l.map((s, o) => {
|
|
26
|
+
const C = e !== void 0 && o < e, r = e !== void 0 && o === e, v = s.color || (C || r ? "primary" : void 0);
|
|
27
|
+
return /* @__PURE__ */ i(
|
|
28
|
+
k,
|
|
29
|
+
{
|
|
30
|
+
color: v,
|
|
31
|
+
icon: s.icon,
|
|
32
|
+
title: s.title,
|
|
33
|
+
description: s.description,
|
|
34
|
+
disabled: s.disabled,
|
|
35
|
+
_index: o,
|
|
36
|
+
_clickable: !!t && !s.disabled,
|
|
37
|
+
_onClick: t,
|
|
38
|
+
"aria-current": r ? "step" : void 0
|
|
39
|
+
},
|
|
40
|
+
s.key ?? o
|
|
41
|
+
);
|
|
42
|
+
}) });
|
|
43
|
+
const u = e !== void 0 ? y.Children.map(a, (s, o) => {
|
|
44
|
+
if (y.isValidElement(s)) {
|
|
45
|
+
const C = o < e, r = o === e, v = s.props.color || (C || r ? "primary" : void 0);
|
|
46
|
+
return y.cloneElement(s, {
|
|
47
|
+
color: v,
|
|
48
|
+
_index: o,
|
|
49
|
+
_clickable: !!t && !s.props.disabled,
|
|
50
|
+
_onClick: t,
|
|
51
|
+
"aria-current": r ? "step" : void 0
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return s;
|
|
55
|
+
}) : a;
|
|
56
|
+
return /* @__PURE__ */ i("ul", { className: n, ...f, children: u });
|
|
57
|
+
}
|
|
58
|
+
function k({
|
|
59
|
+
children: a,
|
|
60
|
+
title: l,
|
|
61
|
+
description: e,
|
|
62
|
+
icon: p,
|
|
63
|
+
color: d,
|
|
64
|
+
dataContent: t,
|
|
65
|
+
disabled: c = !1,
|
|
66
|
+
className: f = "",
|
|
67
|
+
_index: m,
|
|
68
|
+
_clickable: n,
|
|
69
|
+
_onClick: u,
|
|
70
|
+
...s
|
|
71
|
+
}) {
|
|
72
|
+
const o = ["step", d && j[d], c && "step-disabled", f].filter(Boolean).join(" ");
|
|
73
|
+
return /* @__PURE__ */ b(
|
|
74
|
+
"li",
|
|
75
|
+
{
|
|
76
|
+
className: o,
|
|
77
|
+
"data-content": t,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
n && u && m !== void 0 && !c && u(m);
|
|
80
|
+
},
|
|
81
|
+
style: n && !c ? { cursor: "pointer" } : void 0,
|
|
82
|
+
...s,
|
|
83
|
+
children: [
|
|
84
|
+
p && /* @__PURE__ */ i("span", { className: "step-icon", children: p }),
|
|
85
|
+
l ?? a,
|
|
86
|
+
e && /* @__PURE__ */ i("span", { className: "text-xs opacity-70 block", children: e })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const V = Object.assign(N, {
|
|
92
|
+
Step: k
|
|
93
|
+
});
|
|
31
94
|
export {
|
|
32
|
-
|
|
95
|
+
V as Steps
|
|
33
96
|
};
|
|
34
97
|
//# sourceMappingURL=index79.js.map
|
package/dist/index79.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index79.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index79.js","sources":["../src/components/Steps.tsx"],"sourcesContent":["import React from 'react'\n\nexport type StepsDirection = 'horizontal' | 'vertical'\n\nexport interface StepItem {\n key?: string\n title: React.ReactNode\n description?: React.ReactNode\n icon?: React.ReactNode\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n disabled?: boolean\n}\n\nexport interface StepsProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {\n /** Step items (compound pattern) */\n children?: React.ReactNode\n /** Step items (data-driven pattern) */\n items?: StepItem[]\n /** Current step index (0-based) */\n current?: number\n /** Layout direction */\n direction?: StepsDirection\n /** @deprecated Use direction=\"vertical\" instead */\n vertical?: boolean\n /** Callback when step is clicked */\n onChange?: (current: number) => void\n}\n\nexport interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color' | 'title'> {\n /** Step title/label */\n children?: React.ReactNode\n /** Step title (alternative to children) */\n title?: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Step icon */\n icon?: React.ReactNode\n /** Step color */\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n /** Custom content for step indicator */\n dataContent?: string\n /** Whether step is disabled */\n disabled?: boolean\n /** Internal: step index */\n _index?: number\n /** Internal: whether step is clickable */\n _clickable?: boolean\n /** Internal: click handler */\n _onClick?: (index: number) => void\n}\n\nconst colorClasses: Record<string, string> = {\n neutral: 'step-neutral',\n primary: 'step-primary',\n secondary: 'step-secondary',\n accent: 'step-accent',\n info: 'step-info',\n success: 'step-success',\n warning: 'step-warning',\n error: 'step-error',\n}\n\nfunction StepsRoot({\n children,\n items,\n current,\n direction,\n vertical = false,\n onChange,\n className = '',\n ...rest\n}: StepsProps) {\n const isVertical = direction === 'vertical' || vertical\n\n const classes = ['steps', isVertical && 'steps-vertical', className]\n .filter(Boolean)\n .join(' ')\n\n // Render data-driven items if provided\n if (items && items.length > 0) {\n return (\n <ul className={classes} {...rest}>\n {items.map((item, index) => {\n const isCompleted = current !== undefined && index < current\n const isCurrent = current !== undefined && index === current\n const stepColor = item.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return (\n <Step\n key={item.key ?? index}\n color={stepColor}\n icon={item.icon}\n title={item.title}\n description={item.description}\n disabled={item.disabled}\n _index={index}\n _clickable={!!onChange && !item.disabled}\n _onClick={onChange}\n aria-current={isCurrent ? 'step' : undefined}\n />\n )\n })}\n </ul>\n )\n }\n\n // For compound pattern, inject props into children if current is provided\n const processedChildren =\n current !== undefined\n ? React.Children.map(children, (child, index) => {\n if (React.isValidElement<StepProps>(child)) {\n const isCompleted = index < current\n const isCurrent = index === current\n const childColor = child.props.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return React.cloneElement(child, {\n color: childColor,\n _index: index,\n _clickable: !!onChange && !child.props.disabled,\n _onClick: onChange,\n 'aria-current': isCurrent ? 'step' : undefined,\n } as Partial<StepProps>)\n }\n return child\n })\n : children\n\n return (\n <ul className={classes} {...rest}>\n {processedChildren}\n </ul>\n )\n}\n\nfunction Step({\n children,\n title,\n description,\n icon,\n color,\n dataContent,\n disabled = false,\n className = '',\n _index,\n _clickable,\n _onClick,\n ...rest\n}: StepProps) {\n const classes = ['step', color && colorClasses[color], disabled && 'step-disabled', className]\n .filter(Boolean)\n .join(' ')\n\n const handleClick = () => {\n if (_clickable && _onClick && _index !== undefined && !disabled) {\n _onClick(_index)\n }\n }\n\n const displayContent = title ?? children\n\n return (\n <li\n className={classes}\n data-content={dataContent}\n onClick={handleClick}\n style={_clickable && !disabled ? { cursor: 'pointer' } : undefined}\n {...rest}\n >\n {icon && <span className=\"step-icon\">{icon}</span>}\n {displayContent}\n {description && <span className=\"text-xs opacity-70 block\">{description}</span>}\n </li>\n )\n}\n\nexport const Steps = Object.assign(StepsRoot, {\n Step,\n})\n"],"names":["colorClasses","StepsRoot","children","items","current","direction","vertical","onChange","className","rest","classes","jsx","item","index","isCompleted","isCurrent","stepColor","Step","processedChildren","React","child","childColor","title","description","icon","color","dataContent","disabled","_index","_clickable","_onClick","jsxs","Steps"],"mappings":";;AAmDA,MAAMA,IAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAEA,SAASC,EAAU;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAe;AAGb,QAAMC,IAAU,CAAC,UAFEL,MAAc,cAAcC,MAEP,kBAAkBE,CAAS,EAChE,OAAO,OAAO,EACd,KAAK,GAAG;AAGX,MAAIL,KAASA,EAAM,SAAS;AAC1B,WACE,gBAAAQ,EAAC,MAAA,EAAG,WAAWD,GAAU,GAAGD,GACzB,UAAAN,EAAM,IAAI,CAACS,GAAMC,MAAU;AAC1B,YAAMC,IAAcV,MAAY,UAAaS,IAAQT,GAC/CW,IAAYX,MAAY,UAAaS,MAAUT,GAC/CY,IAAYJ,EAAK,UAAWE,KAAeC,IAAa,YAAY;AAE1E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