dishui 0.0.72 → 0.0.73
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/Button/index.d.ts +4 -4
- package/dist/components/Button/index.js +18 -17
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/Metric.d.ts +17 -0
- package/dist/components/Card/Metric2.js +50 -0
- package/dist/components/Card/Metric2.js.map +1 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/index.js +118 -117
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Group/index.d.ts +2 -0
- package/dist/components/GroupButton/index.d.ts +16 -0
- package/dist/components/GroupButton/index.js +41 -0
- package/dist/components/GroupButton/index.js.map +1 -0
- package/dist/components/GroupedTable/index.d.ts +38 -0
- package/dist/components/GroupedTable/index.js +92 -0
- package/dist/components/GroupedTable/index.js.map +1 -0
- package/dist/components/Layout/index.d.ts +4 -2
- package/dist/components/Layout/index.js +1 -1
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/NavigationList/index.d.ts +17 -0
- package/dist/components/NavigationList/index.js +48 -0
- package/dist/components/NavigationList/index.js.map +1 -0
- package/dist/components/Section/index.d.ts +28 -0
- package/dist/components/Section/index.js +58 -0
- package/dist/components/Section/index.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +83 -82
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.d.ts +16 -1
- package/dist/components/SidebarToggleButton/index.js +90 -30
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts +7 -0
- package/dist/components/Skeleton/index.js +21 -0
- package/dist/components/Skeleton/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +5 -2
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/RichTextEditor/AIRewrite.js +114 -72
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +315 -196
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.d.ts +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +69 -33
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.d.ts +2 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +100 -81
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.d.ts +2 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +92 -68
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +24 -22
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SearchReplace.d.ts +7 -0
- package/dist/components/pro/RichTextEditor/SlashMenu.js +136 -73
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.d.ts +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +346 -313
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +114 -146
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +2 -2
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +178 -163
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +8 -5
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.d.ts +6 -0
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +85 -74
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/searchUtils.d.ts +23 -0
- package/dist/contexts/AppContext.js +47 -45
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/index-nostyled.d.ts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +119 -114
- package/dist/layouts/MainLayout.js +9 -10
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Sidebar.d.ts +9 -0
- package/dist/layouts/Sidebar.js +99 -80
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.d.ts +1 -1
- package/dist/layouts/headbar/Headbar.js +2 -2
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/lite.d.ts +19 -1
- package/dist/lite.js +17 -8
- package/dist/styles/themeStyles.js +6 -6
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/i18n.d.ts +3 -0
- package/dist/utils/i18n.js +78 -0
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +23 -6
- package/dist/utils/menu.js.map +1 -1
- package/package.json +8 -2
|
@@ -1,100 +1,101 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { CardMetric as t } from "./Metric2.js";
|
|
2
3
|
import "react";
|
|
3
|
-
import { jsx as
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/Card/index.tsx
|
|
5
|
-
var
|
|
6
|
+
var i = ({ children: t, variant: r, bordered: i = !1, dash: a = !1, side: o = !1, imageFull: s = !1, compact: c = !1, hover: l = !0, glass: u = !0, size: d = "sm", className: f = "" }) => {
|
|
6
7
|
let p = u && !r ? "glass shadow-lg" : "", m = r ? `bg-${r} text-${r}-content shadow-md` : "", h = i ? "card-bordered" : "", g = a ? "card-dash" : "", _ = o ? "card-side" : "", v = s ? "image-full" : "", y = c ? "card-compact" : "", b = l ? "hover:shadow-xl transition-shadow duration-300" : "", x = d ? `card-${d}` : "";
|
|
7
8
|
f.includes("w-") || f.match(/max-w-|min-w-/);
|
|
8
9
|
let S = e("card", "", p, m, h, g, _, v, y, b, x, f);
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ n("div", {
|
|
10
11
|
className: S,
|
|
11
|
-
children:
|
|
12
|
+
children: t
|
|
12
13
|
});
|
|
13
|
-
},
|
|
14
|
+
}, a = ({ children: t, className: r = "" }) => {
|
|
14
15
|
let i = e("card-title", r);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ n("h2", {
|
|
16
17
|
className: i,
|
|
17
|
-
children:
|
|
18
|
+
children: t
|
|
18
19
|
});
|
|
19
|
-
},
|
|
20
|
+
}, o = ({ children: t, className: r = "" }) => {
|
|
20
21
|
let i = e("card-body", r);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ n("div", {
|
|
22
23
|
className: i,
|
|
23
|
-
children:
|
|
24
|
+
children: t
|
|
24
25
|
});
|
|
25
|
-
},
|
|
26
|
+
}, s = ({ children: t, className: r = "", justify: i = "end" }) => {
|
|
26
27
|
let a = e("card-actions", i && `justify-${i}`, r);
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ n("div", {
|
|
28
29
|
className: a,
|
|
29
|
-
children:
|
|
30
|
+
children: t
|
|
30
31
|
});
|
|
31
|
-
},
|
|
32
|
+
}, c = {
|
|
32
33
|
cover: "[&>img]:object-cover",
|
|
33
34
|
contain: "[&>img]:object-contain",
|
|
34
35
|
fill: "[&>img]:object-fill"
|
|
35
|
-
},
|
|
36
|
-
let
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
className:
|
|
39
|
-
style: o === void 0 ? void 0 : { height:
|
|
40
|
-
children:
|
|
36
|
+
}, l = (e) => typeof e == "number" ? `${e}px` : e, u = ({ children: t, className: r = "", fit: i = "cover", fill: a = !1, height: o }) => {
|
|
37
|
+
let s = e("figure", c[i], a && "w-full h-full [&>img]:h-full [&>img]:w-full", o !== void 0 && "w-full [&>img]:h-full [&>img]:w-full", r);
|
|
38
|
+
return /* @__PURE__ */ n("figure", {
|
|
39
|
+
className: s,
|
|
40
|
+
style: o === void 0 ? void 0 : { height: l(o) },
|
|
41
|
+
children: t
|
|
41
42
|
});
|
|
42
|
-
},
|
|
43
|
+
}, d = ({ variant: t, bordered: n = !1, glass: r = !0, className: i = "" }) => {
|
|
43
44
|
let a = r && !t ? "glass shadow-lg" : "", o = t ? `bg-${t} text-${t}-content shadow-md` : "";
|
|
44
45
|
return e("card", a, o, n && "card-bordered", i);
|
|
45
|
-
},
|
|
46
|
+
}, f = ({ className: t }) => /* @__PURE__ */ r("svg", {
|
|
46
47
|
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
-
className: e("h-4 w-4",
|
|
48
|
+
className: e("h-4 w-4", t),
|
|
48
49
|
fill: "none",
|
|
49
50
|
viewBox: "0 0 24 24",
|
|
50
51
|
stroke: "currentColor",
|
|
51
52
|
strokeWidth: 2,
|
|
52
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ n("circle", {
|
|
53
54
|
cx: "12",
|
|
54
55
|
cy: "12",
|
|
55
56
|
r: "9"
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ n("path", {
|
|
57
58
|
strokeLinecap: "round",
|
|
58
59
|
d: "M12 7v5l3 2"
|
|
59
60
|
})]
|
|
60
|
-
}),
|
|
61
|
-
let h =
|
|
61
|
+
}), p = ({ icon: t, title: i, description: a, layout: o = "vertical", iconShape: s, children: c, variant: l, bordered: u, glass: f = !0, className: p = "", onClick: m }) => {
|
|
62
|
+
let h = t && /* @__PURE__ */ n("span", {
|
|
62
63
|
className: e("flex shrink-0 items-center justify-center bg-primary/10 text-primary", o === "vertical" ? "size-16" : "size-12", (s ?? (o === "vertical" ? "circle" : "square")) === "circle" ? "rounded-full" : "rounded-xl"),
|
|
63
|
-
children:
|
|
64
|
+
children: t
|
|
64
65
|
});
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
className:
|
|
66
|
+
return /* @__PURE__ */ n("div", {
|
|
67
|
+
className: d({
|
|
67
68
|
variant: l,
|
|
68
|
-
bordered:
|
|
69
|
+
bordered: u,
|
|
69
70
|
glass: f,
|
|
70
71
|
className: p
|
|
71
72
|
}),
|
|
72
73
|
onClick: m,
|
|
73
|
-
children: o === "horizontal" ? /* @__PURE__ */
|
|
74
|
+
children: o === "horizontal" ? /* @__PURE__ */ r("div", {
|
|
74
75
|
className: "card-body flex-row items-center gap-4",
|
|
75
|
-
children: [h, /* @__PURE__ */
|
|
76
|
+
children: [h, /* @__PURE__ */ r("div", {
|
|
76
77
|
className: "min-w-0 flex-1",
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ n("h3", {
|
|
79
80
|
className: "font-semibold text-base-content",
|
|
80
81
|
children: i
|
|
81
82
|
}),
|
|
82
|
-
a && /* @__PURE__ */
|
|
83
|
+
a && /* @__PURE__ */ n("p", {
|
|
83
84
|
className: "mt-0.5 text-sm text-base-content/70",
|
|
84
85
|
children: a
|
|
85
86
|
}),
|
|
86
87
|
c
|
|
87
88
|
]
|
|
88
89
|
})]
|
|
89
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ r("div", {
|
|
90
91
|
className: "card-body items-center gap-3 text-center",
|
|
91
92
|
children: [
|
|
92
93
|
h,
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ n("h3", {
|
|
94
95
|
className: "text-lg font-bold text-base-content",
|
|
95
96
|
children: i
|
|
96
97
|
}),
|
|
97
|
-
a && /* @__PURE__ */
|
|
98
|
+
a && /* @__PURE__ */ n("p", {
|
|
98
99
|
className: "text-sm leading-relaxed text-base-content/70",
|
|
99
100
|
children: a
|
|
100
101
|
}),
|
|
@@ -102,78 +103,78 @@ var r = ({ children: n, variant: r, bordered: i = !1, dash: a = !1, side: o = !1
|
|
|
102
103
|
]
|
|
103
104
|
})
|
|
104
105
|
});
|
|
105
|
-
},
|
|
106
|
-
className: e(
|
|
106
|
+
}, m = ({ children: t, author: i, avatar: a, date: o, quoteMark: s = !0, divider: c = !0, variant: l, bordered: u, glass: p = !0, className: m = "", onClick: h }) => /* @__PURE__ */ r("div", {
|
|
107
|
+
className: e(d({
|
|
107
108
|
variant: l,
|
|
108
|
-
bordered:
|
|
109
|
+
bordered: u,
|
|
109
110
|
glass: p,
|
|
110
111
|
className: m
|
|
111
112
|
}), "relative overflow-hidden"),
|
|
112
113
|
onClick: h,
|
|
113
|
-
children: [s && /* @__PURE__ */
|
|
114
|
+
children: [s && /* @__PURE__ */ n("span", {
|
|
114
115
|
"aria-hidden": "true",
|
|
115
116
|
className: "pointer-events-none absolute right-5 top-2 select-none font-serif text-6xl leading-none text-primary/25",
|
|
116
117
|
children: "”"
|
|
117
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ r("div", {
|
|
118
119
|
className: "card-body gap-0 p-6",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ n("div", {
|
|
120
121
|
className: "relative z-10 text-lg text-base-content",
|
|
121
|
-
children:
|
|
122
|
-
}), /* @__PURE__ */
|
|
122
|
+
children: t
|
|
123
|
+
}), /* @__PURE__ */ r("div", {
|
|
123
124
|
className: e("mt-4 flex items-center justify-between gap-3", c && "border-t border-base-300 pt-3.5"),
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ r("div", {
|
|
125
126
|
className: "flex min-w-0 items-center gap-2.5",
|
|
126
|
-
children: [a && /* @__PURE__ */
|
|
127
|
+
children: [a && /* @__PURE__ */ n("span", {
|
|
127
128
|
className: "size-8 shrink-0 overflow-hidden rounded-full",
|
|
128
129
|
children: a
|
|
129
|
-
}), i && /* @__PURE__ */
|
|
130
|
+
}), i && /* @__PURE__ */ n("span", {
|
|
130
131
|
className: "truncate text-sm font-medium text-primary",
|
|
131
132
|
children: i
|
|
132
133
|
})]
|
|
133
|
-
}), o && /* @__PURE__ */
|
|
134
|
+
}), o && /* @__PURE__ */ r("span", {
|
|
134
135
|
className: "flex shrink-0 items-center gap-1.5 text-sm text-base-content/55",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ n(f, {}), o]
|
|
136
137
|
})]
|
|
137
138
|
})]
|
|
138
139
|
})]
|
|
139
|
-
}),
|
|
140
|
-
className:
|
|
140
|
+
}), h = ({ title: e, badge: t, children: i, footerLeft: a, footerRight: o, variant: s, bordered: c, glass: l = !0, className: u = "", onClick: f }) => /* @__PURE__ */ n("div", {
|
|
141
|
+
className: d({
|
|
141
142
|
variant: s,
|
|
142
143
|
bordered: c,
|
|
143
144
|
glass: l,
|
|
144
|
-
className:
|
|
145
|
+
className: u
|
|
145
146
|
}),
|
|
146
147
|
onClick: f,
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ r("div", {
|
|
148
149
|
className: "card-body gap-2.5 p-6",
|
|
149
150
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ r("div", {
|
|
151
152
|
className: "flex items-center justify-between gap-3",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ n("h3", {
|
|
153
154
|
className: "min-w-0 flex-1 truncate text-lg font-bold text-base-content",
|
|
154
155
|
children: e
|
|
155
|
-
}),
|
|
156
|
+
}), t && /* @__PURE__ */ n("span", {
|
|
156
157
|
className: "shrink-0",
|
|
157
|
-
children:
|
|
158
|
+
children: t
|
|
158
159
|
})]
|
|
159
160
|
}),
|
|
160
|
-
i && /* @__PURE__ */
|
|
161
|
+
i && /* @__PURE__ */ n("div", {
|
|
161
162
|
className: "text-sm text-base-content/75",
|
|
162
163
|
children: i
|
|
163
164
|
}),
|
|
164
|
-
(a || o) && /* @__PURE__ */
|
|
165
|
+
(a || o) && /* @__PURE__ */ r("div", {
|
|
165
166
|
className: "mt-1.5 flex items-center justify-between gap-3 text-sm text-base-content/55",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ n("span", {
|
|
167
168
|
className: "min-w-0 truncate",
|
|
168
169
|
children: a
|
|
169
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ n("span", {
|
|
170
171
|
className: "shrink-0",
|
|
171
172
|
children: o
|
|
172
173
|
})]
|
|
173
174
|
})
|
|
174
175
|
]
|
|
175
176
|
})
|
|
176
|
-
}),
|
|
177
|
+
}), g = {
|
|
177
178
|
primary: {
|
|
178
179
|
text: "text-primary",
|
|
179
180
|
bg: "bg-primary/10"
|
|
@@ -198,126 +199,126 @@ var r = ({ children: n, variant: r, bordered: i = !1, dash: a = !1, side: o = !1
|
|
|
198
199
|
text: "text-base-content/70",
|
|
199
200
|
bg: "bg-base-content/5"
|
|
200
201
|
}
|
|
201
|
-
},
|
|
202
|
-
let y =
|
|
202
|
+
}, _ = ({ label: t, value: i, icon: a, iconPosition: o = "top", iconShape: s = "square", iconBoxed: c = !0, tone: l = "primary", hint: u, loading: f = !1, variant: p, bordered: m = !0, glass: h = !1, className: _ = "", onClick: v }) => {
|
|
203
|
+
let y = g[l], b = d({
|
|
203
204
|
variant: p,
|
|
204
205
|
bordered: m,
|
|
205
|
-
glass:
|
|
206
|
+
glass: h,
|
|
206
207
|
className: e("bg-base-200 p-4", _)
|
|
207
|
-
}), x = a && /* @__PURE__ */
|
|
208
|
+
}), x = a && /* @__PURE__ */ n("span", {
|
|
208
209
|
className: e(o === "left" ? "flex shrink-0 items-center justify-center p-2.5 [&>svg]:h-5 [&>svg]:w-5" : "p-1.5 [&>svg]:h-4 [&>svg]:w-4", s === "circle" ? "rounded-full" : o === "left" ? "rounded-lg" : "rounded-md", y.bg, y.text),
|
|
209
210
|
children: a
|
|
210
|
-
}), S = a && /* @__PURE__ */
|
|
211
|
+
}), S = a && /* @__PURE__ */ n("span", {
|
|
211
212
|
className: e(o === "left" ? "flex shrink-0" : "inline-flex", "[&>svg]:h-6 [&>svg]:w-6", y.text),
|
|
212
213
|
children: a
|
|
213
214
|
});
|
|
214
|
-
return o === "left" ? /* @__PURE__ */
|
|
215
|
+
return o === "left" ? /* @__PURE__ */ n("div", {
|
|
215
216
|
className: e(b, "transition-shadow duration-300 hover:shadow-xl"),
|
|
216
217
|
onClick: v,
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ r("div", {
|
|
218
219
|
className: "flex items-center gap-3",
|
|
219
|
-
children: [c ? x : S, /* @__PURE__ */
|
|
220
|
+
children: [c ? x : S, /* @__PURE__ */ r("div", {
|
|
220
221
|
className: "min-w-0 flex-1",
|
|
221
222
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ n("span", {
|
|
223
224
|
className: "block truncate text-xs font-medium text-base-content/60",
|
|
224
|
-
children:
|
|
225
|
+
children: t
|
|
225
226
|
}),
|
|
226
|
-
f ? /* @__PURE__ */
|
|
227
|
+
f ? /* @__PURE__ */ n("div", { className: "mt-1 h-6 w-14 animate-pulse rounded bg-base-content/10" }) : /* @__PURE__ */ n("p", {
|
|
227
228
|
className: "truncate text-xl font-bold leading-tight text-base-content",
|
|
228
229
|
children: i
|
|
229
230
|
}),
|
|
230
|
-
|
|
231
|
+
u && /* @__PURE__ */ n("p", {
|
|
231
232
|
className: "mt-0.5 truncate text-[11px] text-base-content/50",
|
|
232
|
-
children:
|
|
233
|
+
children: u
|
|
233
234
|
})
|
|
234
235
|
]
|
|
235
236
|
})]
|
|
236
237
|
})
|
|
237
|
-
}) : /* @__PURE__ */
|
|
238
|
+
}) : /* @__PURE__ */ r("div", {
|
|
238
239
|
className: e(b, "transition-shadow duration-300 hover:shadow-xl"),
|
|
239
240
|
onClick: v,
|
|
240
241
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ r("div", {
|
|
242
243
|
className: "mb-2 flex items-center justify-between gap-2",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ n("span", {
|
|
244
245
|
className: "truncate text-xs font-medium text-base-content/60",
|
|
245
|
-
children:
|
|
246
|
+
children: t
|
|
246
247
|
}), c ? x : S]
|
|
247
248
|
}),
|
|
248
|
-
f ? /* @__PURE__ */
|
|
249
|
+
f ? /* @__PURE__ */ n("div", { className: "h-7 w-14 animate-pulse rounded bg-base-content/10" }) : /* @__PURE__ */ n("p", {
|
|
249
250
|
className: "text-2xl font-bold leading-none text-base-content",
|
|
250
251
|
children: i
|
|
251
252
|
}),
|
|
252
|
-
|
|
253
|
+
u && /* @__PURE__ */ n("p", {
|
|
253
254
|
className: "mt-1.5 text-[11px] text-base-content/50",
|
|
254
|
-
children:
|
|
255
|
+
children: u
|
|
255
256
|
})
|
|
256
257
|
]
|
|
257
258
|
});
|
|
258
|
-
},
|
|
259
|
+
}, v = {
|
|
259
260
|
primary: "text-primary",
|
|
260
261
|
success: "text-success",
|
|
261
262
|
warning: "text-warning",
|
|
262
263
|
info: "text-info",
|
|
263
264
|
error: "text-error",
|
|
264
265
|
neutral: "text-base-content/70"
|
|
265
|
-
},
|
|
266
|
+
}, y = {
|
|
266
267
|
primary: "bg-primary text-primary-content",
|
|
267
268
|
success: "bg-success text-success-content",
|
|
268
269
|
warning: "bg-warning text-warning-content",
|
|
269
270
|
info: "bg-info text-info-content",
|
|
270
271
|
error: "bg-error text-error-content",
|
|
271
272
|
neutral: "bg-neutral text-neutral-content"
|
|
272
|
-
},
|
|
273
|
+
}, b = {
|
|
273
274
|
md: "text-2xl",
|
|
274
275
|
lg: "text-4xl",
|
|
275
276
|
xl: "text-5xl",
|
|
276
277
|
"2xl": "text-6xl"
|
|
277
|
-
},
|
|
278
|
+
}, x = (e) => e === "neutral" ? "var(--color-base-content)" : `var(--color-${e})`, S = ({ data: e, type: t, height: i }) => {
|
|
278
279
|
if (!e || e.length < 2) return null;
|
|
279
280
|
let a = Math.min(...e), o = Math.max(...e) - a || 1, s = (t) => t / (e.length - 1) * 100, c = (e) => i - 3 - (e - a) / o * (i - 6), l = e.map((e, t) => `${s(t).toFixed(2)},${c(e).toFixed(2)}`);
|
|
280
|
-
if (
|
|
281
|
-
let
|
|
282
|
-
return /* @__PURE__ */
|
|
281
|
+
if (t === "bar") {
|
|
282
|
+
let t = 100 / e.length;
|
|
283
|
+
return /* @__PURE__ */ n("svg", {
|
|
283
284
|
viewBox: `0 0 100 ${i}`,
|
|
284
285
|
preserveAspectRatio: "none",
|
|
285
286
|
className: "block w-full",
|
|
286
287
|
style: { height: i },
|
|
287
288
|
"aria-hidden": "true",
|
|
288
|
-
children: e.map((e, r) => /* @__PURE__ */
|
|
289
|
-
x: s(r) -
|
|
289
|
+
children: e.map((e, r) => /* @__PURE__ */ n("rect", {
|
|
290
|
+
x: s(r) - t / 2,
|
|
290
291
|
y: c(e),
|
|
291
|
-
width:
|
|
292
|
+
width: t * .8,
|
|
292
293
|
height: Math.max(1, i - 3 - c(e)),
|
|
293
294
|
fill: "currentColor"
|
|
294
295
|
}, r))
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
|
-
return
|
|
298
|
+
return t === "area" ? /* @__PURE__ */ r("svg", {
|
|
298
299
|
viewBox: `0 0 100 ${i}`,
|
|
299
300
|
preserveAspectRatio: "none",
|
|
300
301
|
className: "block w-full",
|
|
301
302
|
style: { height: i },
|
|
302
303
|
"aria-hidden": "true",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ n("path", {
|
|
304
305
|
d: `M0,${i} L${l.join(" L")} L100,${i} Z`,
|
|
305
306
|
fill: "currentColor",
|
|
306
307
|
opacity: .18
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ n("polyline", {
|
|
308
309
|
points: l.join(" "),
|
|
309
310
|
fill: "none",
|
|
310
311
|
stroke: "currentColor",
|
|
311
312
|
strokeWidth: 1.5,
|
|
312
313
|
vectorEffect: "non-scaling-stroke"
|
|
313
314
|
})]
|
|
314
|
-
}) : /* @__PURE__ */
|
|
315
|
+
}) : /* @__PURE__ */ n("svg", {
|
|
315
316
|
viewBox: `0 0 100 ${i}`,
|
|
316
317
|
preserveAspectRatio: "none",
|
|
317
318
|
className: "block w-full",
|
|
318
319
|
style: { height: i },
|
|
319
320
|
"aria-hidden": "true",
|
|
320
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ n("polyline", {
|
|
321
322
|
points: l.join(" "),
|
|
322
323
|
fill: "none",
|
|
323
324
|
stroke: "currentColor",
|
|
@@ -325,47 +326,47 @@ var r = ({ children: n, variant: r, bordered: i = !1, dash: a = !1, side: o = !1
|
|
|
325
326
|
vectorEffect: "non-scaling-stroke"
|
|
326
327
|
})
|
|
327
328
|
});
|
|
328
|
-
},
|
|
329
|
-
let
|
|
329
|
+
}, C = ({ label: e, value: t, tone: i = "primary", loading: a = !1, className: o = "", unit: s, valueSize: c = "xl", align: l = "left", sparkline: u, sparklineData: d, sparklineType: f = "line", sparklineHeight: p = 36, indicator: m = !1, filled: h = !1, onClick: g }) => {
|
|
330
|
+
let _ = u ?? (d && d.length >= 2 ? /* @__PURE__ */ n(S, {
|
|
330
331
|
data: d,
|
|
331
332
|
type: f,
|
|
332
333
|
height: p
|
|
333
|
-
}) : null), C = h ? "" :
|
|
334
|
-
return /* @__PURE__ */
|
|
334
|
+
}) : null), C = h ? "" : v[i], w = h ? "opacity-80" : "text-base-content/60";
|
|
335
|
+
return /* @__PURE__ */ r("div", {
|
|
335
336
|
onClick: g,
|
|
336
|
-
className: `relative flex flex-col overflow-hidden rounded-lg p-3 ${h ?
|
|
337
|
+
className: `relative flex flex-col overflow-hidden rounded-lg p-3 ${h ? y[i] : "border border-base-300/60 bg-base-200"} ${g ? "cursor-pointer transition-colors hover:border-primary/40" : ""} ${o}`.trim(),
|
|
337
338
|
children: [
|
|
338
|
-
m && !h && /* @__PURE__ */
|
|
339
|
+
m && !h && /* @__PURE__ */ n("span", {
|
|
339
340
|
"aria-hidden": "true",
|
|
340
341
|
className: "absolute right-0 top-0 h-0 w-0",
|
|
341
342
|
style: {
|
|
342
|
-
borderTop: "14px solid " +
|
|
343
|
+
borderTop: "14px solid " + x(i),
|
|
343
344
|
borderLeft: "14px solid transparent"
|
|
344
345
|
}
|
|
345
346
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ n("div", {
|
|
347
348
|
className: `truncate text-xs font-medium ${w} ${l === "center" ? "text-center" : ""}`.trim(),
|
|
348
349
|
children: e
|
|
349
350
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ n("div", {
|
|
351
352
|
className: `flex min-h-[3rem] flex-1 items-center py-1 ${l === "center" ? "justify-center" : "justify-start"}`,
|
|
352
|
-
children: a ? /* @__PURE__ */
|
|
353
|
-
className: `leading-none tracking-tight ${
|
|
354
|
-
children: [
|
|
353
|
+
children: a ? /* @__PURE__ */ n("span", { className: `inline-block h-8 w-16 animate-pulse rounded ${h ? "bg-white/25" : "bg-base-content/10"}` }) : /* @__PURE__ */ r("span", {
|
|
354
|
+
className: `leading-none tracking-tight ${b[c]} font-semibold ${h ? "" : C}`.trim(),
|
|
355
|
+
children: [t, s != null && s !== "" && /* @__PURE__ */ n("span", {
|
|
355
356
|
className: "ml-0.5 text-[0.45em] font-semibold",
|
|
356
357
|
children: s
|
|
357
358
|
})]
|
|
358
359
|
})
|
|
359
360
|
}),
|
|
360
|
-
|
|
361
|
-
className: `-mx-3 -mb-3 mt-1 ${h ? "text-white" :
|
|
362
|
-
children:
|
|
361
|
+
_ && /* @__PURE__ */ n("div", {
|
|
362
|
+
className: `-mx-3 -mb-3 mt-1 ${h ? "text-white" : v[i]}`,
|
|
363
|
+
children: _
|
|
363
364
|
})
|
|
364
365
|
]
|
|
365
366
|
});
|
|
366
|
-
},
|
|
367
|
-
|
|
367
|
+
}, w = i;
|
|
368
|
+
w.Title = a, w.Body = o, w.Actions = s, w.Figure = u, w.Feature = p, w.Quote = m, w.Meta = h, w.Info = _, w.Stat = C, w.Metric = t;
|
|
368
369
|
//#endregion
|
|
369
|
-
export {
|
|
370
|
+
export { w as default };
|
|
370
371
|
|
|
371
372
|
//# sourceMappingURL=index.js.map
|