@alfadocs/ui-kit 1.106.0 → 1.107.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/_chunks/stat-group-CC4-O-Fj.js +97 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/stat-group/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/stat-group-DSNnzkbW.js +0 -107
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S, Children as j } from "react";
|
|
3
|
+
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
|
+
const d = 6;
|
|
5
|
+
function N(a, t) {
|
|
6
|
+
const p = Math.max(1, Math.min(t, d));
|
|
7
|
+
if (a <= p) return Math.max(1, a);
|
|
8
|
+
const m = Math.ceil(a / p), l = Math.ceil(a / m);
|
|
9
|
+
for (let r = l; r >= 2; r -= 1)
|
|
10
|
+
if (a % r !== 1) return r;
|
|
11
|
+
return l;
|
|
12
|
+
}
|
|
13
|
+
function _(a, t) {
|
|
14
|
+
return t > 1 && a > t && a % t === 1;
|
|
15
|
+
}
|
|
16
|
+
const b = {
|
|
17
|
+
2: "ds:@[400px]:grid-cols-[repeat(var(--sg-t2),minmax(0,1fr))]",
|
|
18
|
+
3: "ds:@[608px]:grid-cols-[repeat(var(--sg-t3),minmax(0,1fr))]",
|
|
19
|
+
4: "ds:@[816px]:grid-cols-[repeat(var(--sg-t4),minmax(0,1fr))]",
|
|
20
|
+
5: "ds:@[1024px]:grid-cols-[repeat(var(--sg-t5),minmax(0,1fr))]",
|
|
21
|
+
6: "ds:@[1232px]:grid-cols-[repeat(var(--sg-t6),minmax(0,1fr))]"
|
|
22
|
+
}, G = {
|
|
23
|
+
2: {
|
|
24
|
+
normal: "ds:@[400px]:col-span-[var(--sg-s2)]",
|
|
25
|
+
last: "ds:@[400px]:col-span-[var(--sg-l2)]"
|
|
26
|
+
},
|
|
27
|
+
3: {
|
|
28
|
+
normal: "ds:@[608px]:col-span-[var(--sg-s3)]",
|
|
29
|
+
last: "ds:@[608px]:col-span-[var(--sg-l3)]"
|
|
30
|
+
},
|
|
31
|
+
4: {
|
|
32
|
+
normal: "ds:@[816px]:col-span-[var(--sg-s4)]",
|
|
33
|
+
last: "ds:@[816px]:col-span-[var(--sg-l4)]"
|
|
34
|
+
},
|
|
35
|
+
5: {
|
|
36
|
+
normal: "ds:@[1024px]:col-span-[var(--sg-s5)]",
|
|
37
|
+
last: "ds:@[1024px]:col-span-[var(--sg-l5)]"
|
|
38
|
+
},
|
|
39
|
+
6: {
|
|
40
|
+
normal: "ds:@[1232px]:col-span-[var(--sg-s6)]",
|
|
41
|
+
last: "ds:@[1232px]:col-span-[var(--sg-l6)]"
|
|
42
|
+
}
|
|
43
|
+
}, A = x("ds:@container ds:block ds:w-full ds:min-w-0"), C = x(
|
|
44
|
+
[
|
|
45
|
+
"ds:grid ds:list-none ds:m-0 ds:p-0 ds:grid-cols-1",
|
|
46
|
+
"ds:gap-[var(--spacing-md)] ds:items-stretch"
|
|
47
|
+
].join(" ")
|
|
48
|
+
), O = x("ds:flex ds:min-w-0 ds:[&>*]:w-full ds:[&>*]:min-w-0"), V = S(
|
|
49
|
+
function({ children: t, maxColumns: p = d, className: m, ...l }, r) {
|
|
50
|
+
const f = j.toArray(t), i = f.length, w = Math.min(p, d), u = [], e = {}, v = {};
|
|
51
|
+
for (let s = 2; s <= d; s += 1) {
|
|
52
|
+
const n = N(i, Math.min(s, w)), o = i > 0 ? i % n : 0, c = o === 0 ? 1 : o;
|
|
53
|
+
u.push(b[s]), e[`--sg-t${s}`] = n * c, e[`--sg-s${s}`] = c, e[`--sg-l${s}`] = o === 0 ? c : n, v[s] = o;
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ g(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref: r,
|
|
59
|
+
"data-component": "stat-group",
|
|
60
|
+
"data-count": i,
|
|
61
|
+
role: l["aria-label"] ? "group" : void 0,
|
|
62
|
+
className: [A(), m].filter(Boolean).join(" "),
|
|
63
|
+
...l,
|
|
64
|
+
children: /* @__PURE__ */ g(
|
|
65
|
+
"ul",
|
|
66
|
+
{
|
|
67
|
+
className: [C(), ...u].join(" "),
|
|
68
|
+
style: e,
|
|
69
|
+
children: f.map((s, n) => {
|
|
70
|
+
const o = Object.entries(G).map(([c, h]) => {
|
|
71
|
+
const M = v[Number(c)];
|
|
72
|
+
return M > 0 && n >= i - M ? h.last : h.normal;
|
|
73
|
+
}).join(" ");
|
|
74
|
+
return /* @__PURE__ */ g(
|
|
75
|
+
"li",
|
|
76
|
+
{
|
|
77
|
+
"data-stat-group-item": "",
|
|
78
|
+
className: [O(), o].join(" "),
|
|
79
|
+
children: s
|
|
80
|
+
},
|
|
81
|
+
n
|
|
82
|
+
);
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
V.displayName = "StatGroup";
|
|
91
|
+
export {
|
|
92
|
+
d as S,
|
|
93
|
+
V as a,
|
|
94
|
+
_ as b,
|
|
95
|
+
N as s
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=stat-group-CC4-O-Fj.js.map
|
package/dist/agent-catalog.json
CHANGED