minm-ui 1.0.0 → 1.0.1
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/README.md +29 -0
- package/dist/components/UiAreaChart.vue.d.ts +14 -0
- package/dist/components/UiBadge.vue.d.ts +19 -0
- package/dist/components/UiBarChart.vue.d.ts +14 -0
- package/dist/components/UiButton.vue.d.ts +27 -0
- package/dist/components/UiCard.vue.d.ts +24 -0
- package/dist/components/UiDonutChart.vue.d.ts +18 -0
- package/dist/components/UiDrawer.vue.d.ts +25 -0
- package/dist/components/UiEmptyState.vue.d.ts +18 -0
- package/dist/components/UiIcon.vue.d.ts +9 -0
- package/dist/components/UiInput.vue.d.ts +18 -0
- package/dist/components/UiModal.vue.d.ts +24 -0
- package/dist/components/UiPagination.vue.d.ts +14 -0
- package/dist/components/UiSelect.vue.d.ts +21 -0
- package/dist/components/UiSkeleton.vue.d.ts +10 -0
- package/dist/components/UiSpinner.vue.d.ts +9 -0
- package/dist/components/UiStatTile.vue.d.ts +12 -0
- package/dist/components/UiTable.vue.d.ts +38 -0
- package/dist/components/UiTextarea.vue.d.ts +16 -0
- package/dist/components/UiToaster.vue.d.ts +3 -0
- package/dist/composables/useToast.d.ts +27 -0
- package/{src/index.ts → dist/index.d.ts} +0 -2
- package/dist/minm-ui.css +2 -0
- package/dist/minm-ui.js +1041 -0
- package/dist/types.d.ts +9 -0
- package/package.json +29 -3
- package/src/components/UiAreaChart.vue +0 -117
- package/src/components/UiBadge.vue +0 -34
- package/src/components/UiBarChart.vue +0 -50
- package/src/components/UiButton.vue +0 -54
- package/src/components/UiCard.vue +0 -28
- package/src/components/UiDonutChart.vue +0 -73
- package/src/components/UiDrawer.vue +0 -65
- package/src/components/UiEmptyState.vue +0 -17
- package/src/components/UiIcon.vue +0 -76
- package/src/components/UiInput.vue +0 -50
- package/src/components/UiModal.vue +0 -63
- package/src/components/UiPagination.vue +0 -70
- package/src/components/UiSelect.vue +0 -53
- package/src/components/UiSkeleton.vue +0 -17
- package/src/components/UiSpinner.vue +0 -11
- package/src/components/UiStatTile.vue +0 -49
- package/src/components/UiTable.vue +0 -139
- package/src/components/UiTextarea.vue +0 -35
- package/src/components/UiToaster.vue +0 -47
- package/src/composables/useToast.ts +0 -43
- package/src/styles/tokens.css +0 -199
- package/src/types.ts +0 -9
package/dist/minm-ui.js
ADDED
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, onUnmounted as m, openBlock as h, reactive as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, watch as S, withCtx as C, withKeys as w, withModifiers as T } from "vue";
|
|
2
|
+
//#region src/components/UiIcon.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var ee = [
|
|
4
|
+
"width",
|
|
5
|
+
"height",
|
|
6
|
+
"innerHTML"
|
|
7
|
+
], E = /* @__PURE__ */ d({
|
|
8
|
+
__name: "UiIcon",
|
|
9
|
+
props: {
|
|
10
|
+
name: {},
|
|
11
|
+
size: { default: 20 }
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
let t = e, n = {
|
|
15
|
+
menu: "<path d=\"M3 6h18M3 12h18M3 18h18\"/>",
|
|
16
|
+
dashboard: "<rect x=\"3\" y=\"3\" width=\"7\" height=\"9\" rx=\"1\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"5\" rx=\"1\"/><rect x=\"14\" y=\"12\" width=\"7\" height=\"9\" rx=\"1\"/><rect x=\"3\" y=\"16\" width=\"7\" height=\"5\" rx=\"1\"/>",
|
|
17
|
+
pin: "<path d=\"M12 21s-7-6.2-7-11a7 7 0 0 1 14 0c0 4.8-7 11-7 11z\"/><circle cx=\"12\" cy=\"10\" r=\"2.5\"/>",
|
|
18
|
+
cabin: "<path d=\"M3 11.5 12 4l9 7.5\"/><path d=\"M5 10v10h14V10\"/><path d=\"M9 20v-5h6v5\"/>",
|
|
19
|
+
package: "<path d=\"M21 8 12 3 3 8v8l9 5 9-5V8z\"/><path d=\"m3 8 9 5 9-5\"/><path d=\"M12 13v8\"/>",
|
|
20
|
+
calendar: "<rect x=\"3\" y=\"4.5\" width=\"18\" height=\"17\" rx=\"2\"/><path d=\"M3 9h18M8 2.5v4M16 2.5v4\"/>",
|
|
21
|
+
users: "<path d=\"M17 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\"/><circle cx=\"9.5\" cy=\"7\" r=\"4\"/><path d=\"M22 21v-2a4 4 0 0 0-3-3.87\"/><path d=\"M16 3.13A4 4 0 0 1 16 11\"/>",
|
|
22
|
+
user: "<circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1\"/>",
|
|
23
|
+
shield: "<path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/>",
|
|
24
|
+
card: "<rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\"/><path d=\"M2 10h20\"/>",
|
|
25
|
+
bell: "<path d=\"M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9\"/><path d=\"M13.7 21a2 2 0 0 1-3.4 0\"/>",
|
|
26
|
+
settings: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\"/>",
|
|
27
|
+
search: "<circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m21 21-4.3-4.3\"/>",
|
|
28
|
+
plus: "<path d=\"M12 5v14M5 12h14\"/>",
|
|
29
|
+
edit: "<path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z\"/>",
|
|
30
|
+
trash: "<path d=\"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V6\"/><path d=\"M10 11v6M14 11v6\"/>",
|
|
31
|
+
x: "<path d=\"M18 6 6 18M6 6l12 12\"/>",
|
|
32
|
+
check: "<path d=\"M20 6 9 17l-5-5\"/>",
|
|
33
|
+
"chevron-down": "<path d=\"m6 9 6 6 6-6\"/>",
|
|
34
|
+
"chevron-up": "<path d=\"m18 15-6-6-6 6\"/>",
|
|
35
|
+
"chevron-left": "<path d=\"m15 18-6-6 6-6\"/>",
|
|
36
|
+
"chevron-right": "<path d=\"m9 18 6-6-6-6\"/>",
|
|
37
|
+
sun: "<circle cx=\"12\" cy=\"12\" r=\"4.5\"/><path d=\"M12 1.5v2M12 20.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1.5 12h2M20.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\"/>",
|
|
38
|
+
moon: "<path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\"/>",
|
|
39
|
+
logout: "<path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\"/><path d=\"m16 17 5-5-5-5\"/><path d=\"M21 12H9\"/>",
|
|
40
|
+
filter: "<path d=\"M3 4h18l-7 8v6l-4 2v-8z\"/>",
|
|
41
|
+
download: "<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><path d=\"m7 10 5 5 5-5\"/><path d=\"M12 15V3\"/>",
|
|
42
|
+
database: "<ellipse cx=\"12\" cy=\"6\" rx=\"8\" ry=\"3\"/><path d=\"M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6\"/><path d=\"M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6\"/>",
|
|
43
|
+
broom: "<path d=\"M3 21h18\"/><path d=\"M7 21c0-3 1-5 3-7l7-7\"/><path d=\"M13 5l6 6\"/><path d=\"M16 2l6 6\"/>",
|
|
44
|
+
alert: "<path d=\"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z\"/><path d=\"M12 9v4M12 17h.01\"/>",
|
|
45
|
+
"arrow-up": "<path d=\"M12 19V5M5 12l7-7 7 7\"/>",
|
|
46
|
+
"arrow-down": "<path d=\"M12 5v14M19 12l-7 7-7-7\"/>",
|
|
47
|
+
"trend-up": "<path d=\"M23 6l-9.5 9.5-5-5L1 18\"/><path d=\"M17 6h6v6\"/>",
|
|
48
|
+
"trend-down": "<path d=\"M23 18l-9.5-9.5-5 5L1 6\"/><path d=\"M17 18h6v-6\"/>",
|
|
49
|
+
eye: "<path d=\"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>",
|
|
50
|
+
refresh: "<path d=\"M23 4v6h-6M1 20v-6h6\"/><path d=\"M3.5 9a9 9 0 0 1 14.9-3.4L23 10M1 14l4.6 4.4A9 9 0 0 0 20.5 15\"/>",
|
|
51
|
+
globe: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z\"/>",
|
|
52
|
+
tag: "<path d=\"M20.6 13.4 12 22l-9-9V4h9l8.6 8.6a2 2 0 0 1 0 2.8z\"/><circle cx=\"7.5\" cy=\"7.5\" r=\"1.2\"/>",
|
|
53
|
+
check_circle: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"m9 12 2 2 4-4\"/>",
|
|
54
|
+
clock: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v5l3 2\"/>",
|
|
55
|
+
logo: "<path d=\"M3 11.5 12 4l9 7.5\"/><path d=\"M5 10v10h14V10\"/><path d=\"M10 20v-4h4v4\"/>",
|
|
56
|
+
dollar: "<path d=\"M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\"/>",
|
|
57
|
+
activity: "<path d=\"M22 12h-4l-3 9L9 3l-3 9H2\"/>"
|
|
58
|
+
}, r = i(() => n[t.name] ?? n.x), a = i(() => typeof t.size == "number" ? `${t.size}px` : t.size);
|
|
59
|
+
return (e, t) => (h(), s("svg", {
|
|
60
|
+
width: a.value,
|
|
61
|
+
height: a.value,
|
|
62
|
+
viewBox: "0 0 24 24",
|
|
63
|
+
fill: "none",
|
|
64
|
+
stroke: "currentColor",
|
|
65
|
+
"stroke-width": "1.75",
|
|
66
|
+
"stroke-linecap": "round",
|
|
67
|
+
"stroke-linejoin": "round",
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
innerHTML: r.value
|
|
70
|
+
}, null, 8, ee));
|
|
71
|
+
}
|
|
72
|
+
}), te = ["type", "disabled"], ne = /* @__PURE__ */ d({
|
|
73
|
+
__name: "UiButton",
|
|
74
|
+
props: {
|
|
75
|
+
variant: { default: "primary" },
|
|
76
|
+
size: { default: "md" },
|
|
77
|
+
icon: {},
|
|
78
|
+
iconRight: {},
|
|
79
|
+
loading: { type: Boolean },
|
|
80
|
+
disabled: { type: Boolean },
|
|
81
|
+
block: { type: Boolean },
|
|
82
|
+
type: { default: "button" }
|
|
83
|
+
},
|
|
84
|
+
setup(e) {
|
|
85
|
+
let t = e, n = {
|
|
86
|
+
primary: "bg-accent text-accent-fg hover:bg-accent-hover shadow-sm",
|
|
87
|
+
secondary: "bg-surface text-content border border-border hover:bg-surface-hover",
|
|
88
|
+
ghost: "text-muted hover:text-content hover:bg-surface-hover",
|
|
89
|
+
subtle: "bg-accent-soft text-accent-soft-fg hover:brightness-95",
|
|
90
|
+
danger: "bg-danger text-white hover:brightness-110 shadow-sm"
|
|
91
|
+
}, r = {
|
|
92
|
+
sm: "h-8 px-3 text-[13px] gap-1.5 rounded-md",
|
|
93
|
+
md: "h-10 px-4 text-sm gap-2 rounded-md",
|
|
94
|
+
lg: "h-11 px-5 text-[15px] gap-2 rounded-lg"
|
|
95
|
+
}, c = i(() => t.size === "sm" ? 15 : t.size === "lg" ? 19 : 17);
|
|
96
|
+
return (t, i) => (h(), s("button", {
|
|
97
|
+
type: e.type,
|
|
98
|
+
disabled: e.disabled || e.loading,
|
|
99
|
+
class: f([
|
|
100
|
+
"inline-flex items-center justify-center font-medium transition-all duration-150 select-none",
|
|
101
|
+
"disabled:opacity-55 disabled:pointer-events-none whitespace-nowrap",
|
|
102
|
+
n[e.variant],
|
|
103
|
+
r[e.size],
|
|
104
|
+
e.block ? "w-full" : ""
|
|
105
|
+
])
|
|
106
|
+
}, [
|
|
107
|
+
e.loading ? (h(), a(E, {
|
|
108
|
+
key: 0,
|
|
109
|
+
name: "refresh",
|
|
110
|
+
size: c.value,
|
|
111
|
+
class: "animate-spin"
|
|
112
|
+
}, null, 8, ["size"])) : e.icon ? (h(), a(E, {
|
|
113
|
+
key: 1,
|
|
114
|
+
name: e.icon,
|
|
115
|
+
size: c.value
|
|
116
|
+
}, null, 8, ["name", "size"])) : o("", !0),
|
|
117
|
+
y(t.$slots, "default"),
|
|
118
|
+
e.iconRight && !e.loading ? (h(), a(E, {
|
|
119
|
+
key: 2,
|
|
120
|
+
name: e.iconRight,
|
|
121
|
+
size: c.value
|
|
122
|
+
}, null, 8, ["name", "size"])) : o("", !0)
|
|
123
|
+
], 10, te));
|
|
124
|
+
}
|
|
125
|
+
}), re = { class: "block" }, ie = {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: "mb-1.5 block text-[13px] font-medium text-content"
|
|
128
|
+
}, ae = {
|
|
129
|
+
key: 0,
|
|
130
|
+
class: "text-danger"
|
|
131
|
+
}, oe = { class: "relative" }, se = [
|
|
132
|
+
"value",
|
|
133
|
+
"type",
|
|
134
|
+
"placeholder",
|
|
135
|
+
"disabled"
|
|
136
|
+
], ce = {
|
|
137
|
+
key: 1,
|
|
138
|
+
class: "mt-1 text-xs text-danger"
|
|
139
|
+
}, le = {
|
|
140
|
+
key: 2,
|
|
141
|
+
class: "mt-1 text-xs text-muted"
|
|
142
|
+
}, ue = /* @__PURE__ */ d({
|
|
143
|
+
__name: "UiInput",
|
|
144
|
+
props: {
|
|
145
|
+
modelValue: {},
|
|
146
|
+
label: {},
|
|
147
|
+
type: {},
|
|
148
|
+
placeholder: {},
|
|
149
|
+
icon: {},
|
|
150
|
+
error: {},
|
|
151
|
+
hint: {},
|
|
152
|
+
disabled: { type: Boolean },
|
|
153
|
+
required: { type: Boolean }
|
|
154
|
+
},
|
|
155
|
+
emits: ["update:modelValue"],
|
|
156
|
+
setup(e) {
|
|
157
|
+
return (t, n) => (h(), s("label", re, [
|
|
158
|
+
e.label ? (h(), s("span", ie, [l(b(e.label) + " ", 1), e.required ? (h(), s("span", ae, "*")) : o("", !0)])) : o("", !0),
|
|
159
|
+
c("div", oe, [e.icon ? (h(), a(E, {
|
|
160
|
+
key: 0,
|
|
161
|
+
name: e.icon,
|
|
162
|
+
size: 17,
|
|
163
|
+
class: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-subtle"
|
|
164
|
+
}, null, 8, ["name"])) : o("", !0), c("input", {
|
|
165
|
+
value: e.modelValue,
|
|
166
|
+
type: e.type || "text",
|
|
167
|
+
placeholder: e.placeholder,
|
|
168
|
+
disabled: e.disabled,
|
|
169
|
+
class: f([
|
|
170
|
+
"h-10 w-full rounded-md border bg-surface text-sm text-content transition-colors",
|
|
171
|
+
"placeholder:text-subtle focus:outline-none focus:ring-2 focus:ring-[var(--ring)]",
|
|
172
|
+
"disabled:opacity-60",
|
|
173
|
+
e.icon ? "pl-9 pr-3" : "px-3",
|
|
174
|
+
e.error ? "border-danger" : "border-border focus:border-accent"
|
|
175
|
+
]),
|
|
176
|
+
onInput: n[0] ||= (e) => t.$emit("update:modelValue", e.target.value)
|
|
177
|
+
}, null, 42, se)]),
|
|
178
|
+
e.error ? (h(), s("p", ce, b(e.error), 1)) : e.hint ? (h(), s("p", le, b(e.hint), 1)) : o("", !0)
|
|
179
|
+
]));
|
|
180
|
+
}
|
|
181
|
+
}), de = { class: "block" }, D = {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: "mb-1.5 block text-[13px] font-medium text-content"
|
|
184
|
+
}, O = {
|
|
185
|
+
key: 0,
|
|
186
|
+
class: "text-danger"
|
|
187
|
+
}, k = { class: "relative" }, A = ["value", "disabled"], j = ["selected"], M = ["value"], N = {
|
|
188
|
+
key: 1,
|
|
189
|
+
class: "mt-1 text-xs text-danger"
|
|
190
|
+
}, P = {
|
|
191
|
+
key: 2,
|
|
192
|
+
class: "mt-1 text-xs text-muted"
|
|
193
|
+
}, F = /* @__PURE__ */ d({
|
|
194
|
+
__name: "UiSelect",
|
|
195
|
+
props: {
|
|
196
|
+
modelValue: { type: [
|
|
197
|
+
String,
|
|
198
|
+
Number,
|
|
199
|
+
Boolean,
|
|
200
|
+
null
|
|
201
|
+
] },
|
|
202
|
+
label: {},
|
|
203
|
+
options: {},
|
|
204
|
+
placeholder: {},
|
|
205
|
+
error: {},
|
|
206
|
+
hint: {},
|
|
207
|
+
disabled: { type: Boolean },
|
|
208
|
+
required: { type: Boolean }
|
|
209
|
+
},
|
|
210
|
+
emits: ["update:modelValue"],
|
|
211
|
+
setup(t) {
|
|
212
|
+
return (n, r) => (h(), s("label", de, [
|
|
213
|
+
t.label ? (h(), s("span", D, [l(b(t.label) + " ", 1), t.required ? (h(), s("span", O, "*")) : o("", !0)])) : o("", !0),
|
|
214
|
+
c("div", k, [c("select", {
|
|
215
|
+
value: t.modelValue,
|
|
216
|
+
disabled: t.disabled,
|
|
217
|
+
class: f([
|
|
218
|
+
"h-10 w-full appearance-none rounded-md border bg-surface pl-3 pr-9 text-sm text-content transition-colors",
|
|
219
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--ring)] disabled:opacity-60",
|
|
220
|
+
t.error ? "border-danger" : "border-border focus:border-accent"
|
|
221
|
+
]),
|
|
222
|
+
onChange: r[0] ||= (e) => n.$emit("update:modelValue", e.target.value)
|
|
223
|
+
}, [t.placeholder ? (h(), s("option", {
|
|
224
|
+
key: 0,
|
|
225
|
+
value: "",
|
|
226
|
+
disabled: "",
|
|
227
|
+
selected: t.modelValue === "" || t.modelValue == null
|
|
228
|
+
}, b(t.placeholder), 9, j)) : o("", !0), (h(!0), s(e, null, v(t.options, (e) => (h(), s("option", {
|
|
229
|
+
key: String(e.value),
|
|
230
|
+
value: e.value
|
|
231
|
+
}, b(e.label), 9, M))), 128))], 42, A), u(E, {
|
|
232
|
+
name: "chevron-down",
|
|
233
|
+
size: 17,
|
|
234
|
+
class: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-subtle"
|
|
235
|
+
})]),
|
|
236
|
+
t.error ? (h(), s("p", N, b(t.error), 1)) : t.hint ? (h(), s("p", P, b(t.hint), 1)) : o("", !0)
|
|
237
|
+
]));
|
|
238
|
+
}
|
|
239
|
+
}), I = { class: "block" }, L = {
|
|
240
|
+
key: 0,
|
|
241
|
+
class: "mb-1.5 block text-[13px] font-medium text-content"
|
|
242
|
+
}, R = {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "text-danger"
|
|
245
|
+
}, z = [
|
|
246
|
+
"value",
|
|
247
|
+
"rows",
|
|
248
|
+
"placeholder"
|
|
249
|
+
], B = {
|
|
250
|
+
key: 1,
|
|
251
|
+
class: "mt-1 text-xs text-danger"
|
|
252
|
+
}, V = {
|
|
253
|
+
key: 2,
|
|
254
|
+
class: "mt-1 text-xs text-muted"
|
|
255
|
+
}, H = /* @__PURE__ */ d({
|
|
256
|
+
__name: "UiTextarea",
|
|
257
|
+
props: {
|
|
258
|
+
modelValue: {},
|
|
259
|
+
label: {},
|
|
260
|
+
placeholder: {},
|
|
261
|
+
rows: {},
|
|
262
|
+
error: {},
|
|
263
|
+
hint: {},
|
|
264
|
+
required: { type: Boolean }
|
|
265
|
+
},
|
|
266
|
+
emits: ["update:modelValue"],
|
|
267
|
+
setup(e) {
|
|
268
|
+
return (t, n) => (h(), s("label", I, [
|
|
269
|
+
e.label ? (h(), s("span", L, [l(b(e.label) + " ", 1), e.required ? (h(), s("span", R, "*")) : o("", !0)])) : o("", !0),
|
|
270
|
+
c("textarea", {
|
|
271
|
+
value: e.modelValue,
|
|
272
|
+
rows: e.rows || 3,
|
|
273
|
+
placeholder: e.placeholder,
|
|
274
|
+
class: f([
|
|
275
|
+
"w-full rounded-md border bg-surface px-3 py-2 text-sm text-content transition-colors resize-y",
|
|
276
|
+
"placeholder:text-subtle focus:outline-none focus:ring-2 focus:ring-[var(--ring)]",
|
|
277
|
+
e.error ? "border-danger" : "border-border focus:border-accent"
|
|
278
|
+
]),
|
|
279
|
+
onInput: n[0] ||= (e) => t.$emit("update:modelValue", e.target.value)
|
|
280
|
+
}, null, 42, z),
|
|
281
|
+
e.error ? (h(), s("p", B, b(e.error), 1)) : e.hint ? (h(), s("p", V, b(e.hint), 1)) : o("", !0)
|
|
282
|
+
]));
|
|
283
|
+
}
|
|
284
|
+
}), fe = /* @__PURE__ */ d({
|
|
285
|
+
__name: "UiBadge",
|
|
286
|
+
props: {
|
|
287
|
+
variant: { default: "neutral" },
|
|
288
|
+
dot: { type: Boolean }
|
|
289
|
+
},
|
|
290
|
+
setup(e) {
|
|
291
|
+
let t = e, n = {
|
|
292
|
+
neutral: "bg-surface-2 text-muted border-border",
|
|
293
|
+
success: "bg-success-bg text-success border-transparent",
|
|
294
|
+
warning: "bg-warning-bg text-warning border-transparent",
|
|
295
|
+
danger: "bg-danger-bg text-danger border-transparent",
|
|
296
|
+
info: "bg-info-bg text-info border-transparent",
|
|
297
|
+
accent: "bg-accent-soft text-accent-soft-fg border-transparent"
|
|
298
|
+
}, r = i(() => ({
|
|
299
|
+
neutral: "bg-subtle",
|
|
300
|
+
success: "bg-success",
|
|
301
|
+
warning: "bg-warning",
|
|
302
|
+
danger: "bg-danger",
|
|
303
|
+
info: "bg-info",
|
|
304
|
+
accent: "bg-accent"
|
|
305
|
+
})[t.variant]);
|
|
306
|
+
return (t, i) => (h(), s("span", { class: f(["inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium whitespace-nowrap", n[e.variant]]) }, [e.dot ? (h(), s("span", {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: f(["h-1.5 w-1.5 rounded-full", r.value])
|
|
309
|
+
}, null, 2)) : o("", !0), y(t.$slots, "default")], 2));
|
|
310
|
+
}
|
|
311
|
+
}), pe = { class: "rounded-lg border border-border bg-surface shadow-sm" }, me = {
|
|
312
|
+
key: 0,
|
|
313
|
+
class: "flex items-center justify-between gap-4 border-b border-border px-5 py-4"
|
|
314
|
+
}, he = {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: "min-w-0"
|
|
317
|
+
}, ge = { class: "truncate text-[15px] font-semibold text-content" }, _e = {
|
|
318
|
+
key: 0,
|
|
319
|
+
class: "mt-0.5 truncate text-[13px] text-muted"
|
|
320
|
+
}, ve = {
|
|
321
|
+
key: 1,
|
|
322
|
+
class: "flex shrink-0 items-center gap-2"
|
|
323
|
+
}, ye = /* @__PURE__ */ d({
|
|
324
|
+
__name: "UiCard",
|
|
325
|
+
props: {
|
|
326
|
+
title: {},
|
|
327
|
+
subtitle: {},
|
|
328
|
+
padded: {
|
|
329
|
+
type: Boolean,
|
|
330
|
+
default: !0
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
setup(e) {
|
|
334
|
+
return (t, n) => (h(), s("section", pe, [e.title || t.$slots.header || t.$slots.actions ? (h(), s("header", me, [
|
|
335
|
+
e.title || e.subtitle ? (h(), s("div", he, [c("h3", ge, b(e.title), 1), e.subtitle ? (h(), s("p", _e, b(e.subtitle), 1)) : o("", !0)])) : o("", !0),
|
|
336
|
+
y(t.$slots, "header"),
|
|
337
|
+
t.$slots.actions ? (h(), s("div", ve, [y(t.$slots, "actions")])) : o("", !0)
|
|
338
|
+
])) : o("", !0), c("div", { class: f(e.padded ? "p-5" : "") }, [y(t.$slots, "default")], 2)]));
|
|
339
|
+
}
|
|
340
|
+
}), be = { class: "rounded-lg border border-border bg-surface p-5 shadow-sm transition-shadow hover:shadow-md" }, xe = { class: "flex items-start justify-between gap-3" }, Se = { class: "text-[13px] font-medium text-muted" }, Ce = { class: "tabular mt-3 text-[28px] font-semibold leading-none text-content" }, we = { class: "mt-2 flex items-center gap-2 text-xs" }, Te = {
|
|
341
|
+
key: 1,
|
|
342
|
+
class: "text-subtle"
|
|
343
|
+
}, Ee = /* @__PURE__ */ d({
|
|
344
|
+
__name: "UiStatTile",
|
|
345
|
+
props: {
|
|
346
|
+
label: {},
|
|
347
|
+
value: {},
|
|
348
|
+
icon: {},
|
|
349
|
+
tone: {},
|
|
350
|
+
delta: {},
|
|
351
|
+
deltaLabel: {},
|
|
352
|
+
hint: {}
|
|
353
|
+
},
|
|
354
|
+
setup(e) {
|
|
355
|
+
let t = e, n = {
|
|
356
|
+
accent: "bg-accent-soft text-accent-soft-fg",
|
|
357
|
+
success: "bg-success-bg text-success",
|
|
358
|
+
warning: "bg-warning-bg text-warning",
|
|
359
|
+
danger: "bg-danger-bg text-danger",
|
|
360
|
+
info: "bg-info-bg text-info"
|
|
361
|
+
}, r = i(() => (t.delta ?? 0) >= 0);
|
|
362
|
+
return (t, i) => (h(), s("div", be, [
|
|
363
|
+
c("div", xe, [c("p", Se, b(e.label), 1), e.icon ? (h(), s("span", {
|
|
364
|
+
key: 0,
|
|
365
|
+
class: f(["flex h-9 w-9 shrink-0 items-center justify-center rounded-lg", n[e.tone || "accent"]])
|
|
366
|
+
}, [u(E, {
|
|
367
|
+
name: e.icon,
|
|
368
|
+
size: 18
|
|
369
|
+
}, null, 8, ["name"])], 2)) : o("", !0)]),
|
|
370
|
+
c("p", Ce, b(e.value), 1),
|
|
371
|
+
c("div", we, [e.delta !== null && e.delta !== void 0 ? (h(), s("span", {
|
|
372
|
+
key: 0,
|
|
373
|
+
class: f(["inline-flex items-center gap-0.5 font-medium", r.value ? "text-success" : "text-danger"])
|
|
374
|
+
}, [u(E, {
|
|
375
|
+
name: r.value ? "trend-up" : "trend-down",
|
|
376
|
+
size: 14
|
|
377
|
+
}, null, 8, ["name"]), l(" " + b(Math.abs(e.delta)) + "% ", 1)], 2)) : o("", !0), e.deltaLabel || e.hint ? (h(), s("span", Te, b(e.deltaLabel || e.hint), 1)) : o("", !0)])
|
|
378
|
+
]));
|
|
379
|
+
}
|
|
380
|
+
}), De = { class: "flex items-center justify-center gap-2 text-muted" }, Oe = {
|
|
381
|
+
key: 0,
|
|
382
|
+
class: "text-sm"
|
|
383
|
+
}, ke = /* @__PURE__ */ d({
|
|
384
|
+
__name: "UiSpinner",
|
|
385
|
+
props: {
|
|
386
|
+
size: { default: 22 },
|
|
387
|
+
label: {}
|
|
388
|
+
},
|
|
389
|
+
setup(e) {
|
|
390
|
+
return (t, n) => (h(), s("div", De, [u(E, {
|
|
391
|
+
name: "refresh",
|
|
392
|
+
size: e.size,
|
|
393
|
+
class: "animate-spin"
|
|
394
|
+
}, null, 8, ["size"]), e.label ? (h(), s("span", Oe, b(e.label), 1)) : o("", !0)]));
|
|
395
|
+
}
|
|
396
|
+
}), U = /* @__PURE__ */ d({
|
|
397
|
+
__name: "UiSkeleton",
|
|
398
|
+
props: {
|
|
399
|
+
width: {},
|
|
400
|
+
height: { default: "1rem" },
|
|
401
|
+
rounded: {}
|
|
402
|
+
},
|
|
403
|
+
setup(e) {
|
|
404
|
+
return (t, n) => (h(), s("span", {
|
|
405
|
+
class: "relative block overflow-hidden bg-surface-2",
|
|
406
|
+
style: p({
|
|
407
|
+
width: e.width || "100%",
|
|
408
|
+
height: e.height,
|
|
409
|
+
borderRadius: e.rounded || "var(--radius-sm)"
|
|
410
|
+
})
|
|
411
|
+
}, [...n[0] ||= [c("span", {
|
|
412
|
+
class: "absolute inset-0 -translate-x-full",
|
|
413
|
+
style: {
|
|
414
|
+
background: "linear-gradient(90deg, transparent, color-mix(in srgb, var(--border-strong) 40%, transparent), transparent)",
|
|
415
|
+
animation: "shimmer 1.5s infinite"
|
|
416
|
+
}
|
|
417
|
+
}, null, -1)]], 4));
|
|
418
|
+
}
|
|
419
|
+
}), Ae = { class: "flex flex-col items-center justify-center px-6 py-14 text-center" }, je = { class: "mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-surface-2 text-subtle" }, Me = { class: "text-[15px] font-semibold text-content" }, Ne = {
|
|
420
|
+
key: 0,
|
|
421
|
+
class: "mt-1 max-w-sm text-sm text-muted"
|
|
422
|
+
}, Pe = {
|
|
423
|
+
key: 1,
|
|
424
|
+
class: "mt-5"
|
|
425
|
+
}, Fe = /* @__PURE__ */ d({
|
|
426
|
+
__name: "UiEmptyState",
|
|
427
|
+
props: {
|
|
428
|
+
icon: {},
|
|
429
|
+
title: {},
|
|
430
|
+
description: {}
|
|
431
|
+
},
|
|
432
|
+
setup(e) {
|
|
433
|
+
return (t, n) => (h(), s("div", Ae, [
|
|
434
|
+
c("span", je, [u(E, {
|
|
435
|
+
name: e.icon || "search",
|
|
436
|
+
size: 26
|
|
437
|
+
}, null, 8, ["name"])]),
|
|
438
|
+
c("h4", Me, b(e.title), 1),
|
|
439
|
+
e.description ? (h(), s("p", Ne, b(e.description), 1)) : o("", !0),
|
|
440
|
+
t.$slots.default ? (h(), s("div", Pe, [y(t.$slots, "default")])) : o("", !0)
|
|
441
|
+
]));
|
|
442
|
+
}
|
|
443
|
+
}), Ie = {
|
|
444
|
+
key: 0,
|
|
445
|
+
class: "flex items-center justify-between gap-4 border-b border-border px-5 py-4"
|
|
446
|
+
}, Le = { class: "text-base font-semibold text-content" }, Re = { class: "px-5 py-4" }, ze = {
|
|
447
|
+
key: 1,
|
|
448
|
+
class: "flex items-center justify-end gap-2 border-t border-border px-5 py-4"
|
|
449
|
+
}, Be = /*@__PURE__*/ d({
|
|
450
|
+
__name: "UiModal",
|
|
451
|
+
props: {
|
|
452
|
+
modelValue: { type: Boolean },
|
|
453
|
+
title: {},
|
|
454
|
+
size: {}
|
|
455
|
+
},
|
|
456
|
+
emits: ["update:modelValue"],
|
|
457
|
+
setup(e, { emit: r }) {
|
|
458
|
+
let i = e, l = r, d = {
|
|
459
|
+
sm: "max-w-sm",
|
|
460
|
+
md: "max-w-lg",
|
|
461
|
+
lg: "max-w-2xl"
|
|
462
|
+
};
|
|
463
|
+
function p() {
|
|
464
|
+
l("update:modelValue", !1);
|
|
465
|
+
}
|
|
466
|
+
function g(e) {
|
|
467
|
+
e.key === "Escape" && p();
|
|
468
|
+
}
|
|
469
|
+
return S(() => i.modelValue, (e) => {
|
|
470
|
+
document.body.style.overflow = e ? "hidden" : "", e ? document.addEventListener("keydown", g) : document.removeEventListener("keydown", g);
|
|
471
|
+
}), m(() => {
|
|
472
|
+
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
473
|
+
}), (r, i) => (h(), a(t, { to: "body" }, [u(n, { name: "overlay" }, {
|
|
474
|
+
default: C(() => [e.modelValue ? (h(), s("div", {
|
|
475
|
+
key: 0,
|
|
476
|
+
class: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/40 p-4 pt-[8vh] backdrop-blur-sm",
|
|
477
|
+
onClick: T(p, ["self"]),
|
|
478
|
+
onKeydown: w(p, ["esc"])
|
|
479
|
+
}, [c("div", {
|
|
480
|
+
class: f(["w-full animate-slide-up rounded-lg border border-border bg-surface shadow-lg", d[e.size || "md"]]),
|
|
481
|
+
role: "dialog",
|
|
482
|
+
"aria-modal": "true"
|
|
483
|
+
}, [
|
|
484
|
+
e.title || r.$slots.header ? (h(), s("header", Ie, [c("h3", Le, b(e.title), 1), c("button", {
|
|
485
|
+
class: "rounded-md p-1 text-subtle transition-colors hover:bg-surface-hover hover:text-content",
|
|
486
|
+
onClick: p
|
|
487
|
+
}, [u(E, {
|
|
488
|
+
name: "x",
|
|
489
|
+
size: 18
|
|
490
|
+
})])])) : o("", !0),
|
|
491
|
+
c("div", Re, [y(r.$slots, "default", {}, void 0, !0)]),
|
|
492
|
+
r.$slots.footer ? (h(), s("footer", ze, [y(r.$slots, "footer", {}, void 0, !0)])) : o("", !0)
|
|
493
|
+
], 2)], 32)) : o("", !0)]),
|
|
494
|
+
_: 3
|
|
495
|
+
})]));
|
|
496
|
+
}
|
|
497
|
+
}), W = (e, t) => {
|
|
498
|
+
let n = e.__vccOpts || e;
|
|
499
|
+
for (let [e, r] of t) n[e] = r;
|
|
500
|
+
return n;
|
|
501
|
+
}, Ve = /*#__PURE__*/ W(Be, [["__scopeId", "data-v-0a48c32b"]]), He = { class: "flex items-start justify-between gap-4 border-b border-border px-6 py-4" }, Ue = { class: "min-w-0" }, We = { class: "truncate text-base font-semibold text-content" }, Ge = {
|
|
502
|
+
key: 0,
|
|
503
|
+
class: "mt-0.5 truncate text-[13px] text-muted"
|
|
504
|
+
}, Ke = { class: "flex-1 overflow-y-auto px-6 py-5" }, qe = {
|
|
505
|
+
key: 0,
|
|
506
|
+
class: "flex items-center justify-end gap-2 border-t border-border px-6 py-4"
|
|
507
|
+
}, Je = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
508
|
+
__name: "UiDrawer",
|
|
509
|
+
props: {
|
|
510
|
+
modelValue: { type: Boolean },
|
|
511
|
+
title: {},
|
|
512
|
+
subtitle: {},
|
|
513
|
+
width: {}
|
|
514
|
+
},
|
|
515
|
+
emits: ["update:modelValue"],
|
|
516
|
+
setup(e, { emit: r }) {
|
|
517
|
+
let i = e, l = r;
|
|
518
|
+
function d() {
|
|
519
|
+
l("update:modelValue", !1);
|
|
520
|
+
}
|
|
521
|
+
function f(e) {
|
|
522
|
+
e.key === "Escape" && d();
|
|
523
|
+
}
|
|
524
|
+
return S(() => i.modelValue, (e) => {
|
|
525
|
+
document.body.style.overflow = e ? "hidden" : "", e ? document.addEventListener("keydown", f) : document.removeEventListener("keydown", f);
|
|
526
|
+
}), m(() => {
|
|
527
|
+
document.removeEventListener("keydown", f), document.body.style.overflow = "";
|
|
528
|
+
}), (r, i) => (h(), a(t, { to: "body" }, [u(n, { name: "overlay" }, {
|
|
529
|
+
default: C(() => [e.modelValue ? (h(), s("div", {
|
|
530
|
+
key: 0,
|
|
531
|
+
class: "fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",
|
|
532
|
+
onClick: T(d, ["self"]),
|
|
533
|
+
onKeydown: w(d, ["esc"])
|
|
534
|
+
}, [c("aside", {
|
|
535
|
+
class: "absolute right-0 top-0 flex h-full w-full flex-col border-l border-border bg-surface shadow-lg animate-slide-in-right",
|
|
536
|
+
style: p({ maxWidth: e.width || "30rem" }),
|
|
537
|
+
role: "dialog",
|
|
538
|
+
"aria-modal": "true"
|
|
539
|
+
}, [
|
|
540
|
+
c("header", He, [c("div", Ue, [c("h3", We, b(e.title), 1), e.subtitle ? (h(), s("p", Ge, b(e.subtitle), 1)) : o("", !0)]), c("button", {
|
|
541
|
+
class: "rounded-md p-1 text-subtle transition-colors hover:bg-surface-hover hover:text-content",
|
|
542
|
+
onClick: d
|
|
543
|
+
}, [u(E, {
|
|
544
|
+
name: "x",
|
|
545
|
+
size: 18
|
|
546
|
+
})])]),
|
|
547
|
+
c("div", Ke, [y(r.$slots, "default", {}, void 0, !0)]),
|
|
548
|
+
r.$slots.footer ? (h(), s("footer", qe, [y(r.$slots, "footer", {}, void 0, !0)])) : o("", !0)
|
|
549
|
+
], 4)], 32)) : o("", !0)]),
|
|
550
|
+
_: 3
|
|
551
|
+
})]));
|
|
552
|
+
}
|
|
553
|
+
}), [["__scopeId", "data-v-ed2c5461"]]), Ye = { class: "overflow-x-auto" }, Xe = { class: "w-full border-collapse text-sm" }, Ze = { class: "border-b border-border" }, Qe = {
|
|
554
|
+
key: 0,
|
|
555
|
+
class: "w-10 px-4 py-3"
|
|
556
|
+
}, $e = ["checked"], et = ["onClick"], tt = {
|
|
557
|
+
key: 0,
|
|
558
|
+
class: "px-4 py-3.5"
|
|
559
|
+
}, nt = ["onClick"], rt = ["checked", "onChange"], it = { key: 0 }, at = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
560
|
+
__name: "UiTable",
|
|
561
|
+
props: {
|
|
562
|
+
columns: {},
|
|
563
|
+
rows: {},
|
|
564
|
+
loading: { type: Boolean },
|
|
565
|
+
sort: {},
|
|
566
|
+
order: {},
|
|
567
|
+
rowKey: {},
|
|
568
|
+
clickable: { type: Boolean },
|
|
569
|
+
selectable: { type: Boolean },
|
|
570
|
+
selected: {}
|
|
571
|
+
},
|
|
572
|
+
emits: [
|
|
573
|
+
"sort",
|
|
574
|
+
"row-click",
|
|
575
|
+
"update:selected"
|
|
576
|
+
],
|
|
577
|
+
setup(t, { emit: n }) {
|
|
578
|
+
let r = t, d = n;
|
|
579
|
+
function m(e) {
|
|
580
|
+
return e === "right" ? "text-right" : e === "center" ? "text-center" : "text-left";
|
|
581
|
+
}
|
|
582
|
+
function g(e) {
|
|
583
|
+
e.sortable && d("sort", e.key);
|
|
584
|
+
}
|
|
585
|
+
let _ = (e) => e[r.rowKey || "id"], x = i(() => new Set(r.selected ?? [])), S = i(() => r.rows.length > 0 && r.rows.every((e) => x.value.has(_(e))));
|
|
586
|
+
function C(e) {
|
|
587
|
+
let t = _(e), n = new Set(r.selected ?? []);
|
|
588
|
+
n.has(t) ? n.delete(t) : n.add(t), d("update:selected", [...n]);
|
|
589
|
+
}
|
|
590
|
+
function w() {
|
|
591
|
+
d("update:selected", S.value ? [] : r.rows.map(_));
|
|
592
|
+
}
|
|
593
|
+
return (n, r) => (h(), s("div", Ye, [c("table", Xe, [c("thead", null, [c("tr", Ze, [t.selectable ? (h(), s("th", Qe, [c("input", {
|
|
594
|
+
type: "checkbox",
|
|
595
|
+
class: "ui-checkbox",
|
|
596
|
+
checked: S.value,
|
|
597
|
+
onChange: w
|
|
598
|
+
}, null, 40, $e)])) : o("", !0), (h(!0), s(e, null, v(t.columns, (e) => (h(), s("th", {
|
|
599
|
+
key: e.key,
|
|
600
|
+
style: p(e.width ? { width: e.width } : void 0),
|
|
601
|
+
class: f([
|
|
602
|
+
"whitespace-nowrap px-4 py-3 text-[12px] font-semibold uppercase tracking-wide text-subtle",
|
|
603
|
+
m(e.align),
|
|
604
|
+
e.sortable ? "cursor-pointer select-none hover:text-content" : ""
|
|
605
|
+
]),
|
|
606
|
+
onClick: (t) => g(e)
|
|
607
|
+
}, [c("span", { class: f(["inline-flex items-center gap-1", e.align === "right" ? "flex-row-reverse" : ""]) }, [l(b(e.label) + " ", 1), e.sortable && t.sort === e.key ? (h(), a(E, {
|
|
608
|
+
key: 0,
|
|
609
|
+
name: t.order === "asc" ? "chevron-up" : "chevron-down",
|
|
610
|
+
size: 14,
|
|
611
|
+
class: "text-accent"
|
|
612
|
+
}, null, 8, ["name"])) : o("", !0)], 2)], 14, et))), 128))])]), c("tbody", null, [t.loading ? (h(), s(e, { key: 0 }, v(6, (n) => c("tr", {
|
|
613
|
+
key: `sk-${n}`,
|
|
614
|
+
class: "border-b border-border"
|
|
615
|
+
}, [t.selectable ? (h(), s("td", tt, [u(U, {
|
|
616
|
+
width: "1rem",
|
|
617
|
+
height: "1rem"
|
|
618
|
+
})])) : o("", !0), (h(!0), s(e, null, v(t.columns, (e) => (h(), s("td", {
|
|
619
|
+
key: e.key,
|
|
620
|
+
class: "px-4 py-3.5"
|
|
621
|
+
}, [u(U, {
|
|
622
|
+
width: e.key === t.columns[0].key ? "60%" : "80%",
|
|
623
|
+
height: "0.9rem"
|
|
624
|
+
}, null, 8, ["width"])]))), 128))])), 64)) : (h(!0), s(e, { key: 1 }, v(t.rows, (i, a) => (h(), s("tr", {
|
|
625
|
+
key: t.rowKey ? i[t.rowKey] : a,
|
|
626
|
+
class: f([
|
|
627
|
+
"border-b border-border transition-colors",
|
|
628
|
+
x.value.has(_(i)) ? "bg-accent-soft/40" : "",
|
|
629
|
+
t.clickable ? "cursor-pointer hover:bg-surface-hover" : "hover:bg-surface-2"
|
|
630
|
+
]),
|
|
631
|
+
onClick: (e) => t.clickable && d("row-click", i)
|
|
632
|
+
}, [t.selectable ? (h(), s("td", {
|
|
633
|
+
key: 0,
|
|
634
|
+
class: "px-4 py-3",
|
|
635
|
+
onClick: r[0] ||= T(() => {}, ["stop"])
|
|
636
|
+
}, [c("input", {
|
|
637
|
+
type: "checkbox",
|
|
638
|
+
class: "ui-checkbox",
|
|
639
|
+
checked: x.value.has(_(i)),
|
|
640
|
+
onChange: (e) => C(i)
|
|
641
|
+
}, null, 40, rt)])) : o("", !0), (h(!0), s(e, null, v(t.columns, (e) => (h(), s("td", {
|
|
642
|
+
key: e.key,
|
|
643
|
+
class: f([
|
|
644
|
+
"px-4 py-3 align-middle text-content",
|
|
645
|
+
m(e.align),
|
|
646
|
+
e.class
|
|
647
|
+
])
|
|
648
|
+
}, [y(n.$slots, `cell-${e.key}`, {
|
|
649
|
+
row: i,
|
|
650
|
+
value: i[e.key]
|
|
651
|
+
}, () => [l(b(i[e.key] ?? "—"), 1)], !0)], 2))), 128))], 10, nt))), 128))])]), !t.loading && t.rows.length === 0 ? (h(), s("div", it, [y(n.$slots, "empty", {}, () => [r[1] ||= c("div", { class: "px-4 py-12 text-center text-sm text-muted" }, "No records found.", -1)], !0)])) : o("", !0)]));
|
|
652
|
+
}
|
|
653
|
+
}), [["__scopeId", "data-v-1e40b378"]]), ot = { class: "flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm" }, st = { class: "text-muted" }, ct = {
|
|
654
|
+
key: 0,
|
|
655
|
+
class: "tabular"
|
|
656
|
+
}, lt = { class: "font-medium text-content" }, ut = { class: "font-medium text-content" }, dt = { class: "font-medium text-content" }, ft = {
|
|
657
|
+
key: 0,
|
|
658
|
+
class: "flex items-center gap-1"
|
|
659
|
+
}, pt = ["disabled"], mt = ["disabled", "onClick"], ht = ["disabled"], gt = /* @__PURE__ */ d({
|
|
660
|
+
__name: "UiPagination",
|
|
661
|
+
props: {
|
|
662
|
+
currentPage: {},
|
|
663
|
+
lastPage: {},
|
|
664
|
+
total: {},
|
|
665
|
+
from: {},
|
|
666
|
+
to: {}
|
|
667
|
+
},
|
|
668
|
+
emits: ["change"],
|
|
669
|
+
setup(t, { emit: n }) {
|
|
670
|
+
let r = t, a = n, d = i(() => {
|
|
671
|
+
let { currentPage: e, lastPage: t } = r, n = [], i = (e) => n.push(e);
|
|
672
|
+
for (let r = 1; r <= t; r++) r === 1 || r === t || r >= e - 1 && r <= e + 1 ? i(r) : n[n.length - 1] !== "…" && i("…");
|
|
673
|
+
return n;
|
|
674
|
+
});
|
|
675
|
+
function p(e) {
|
|
676
|
+
e >= 1 && e <= r.lastPage && e !== r.currentPage && a("change", e);
|
|
677
|
+
}
|
|
678
|
+
return (n, r) => (h(), s("div", ot, [c("p", st, [t.total == null ? o("", !0) : (h(), s("span", ct, [
|
|
679
|
+
r[2] ||= l(" Showing ", -1),
|
|
680
|
+
c("span", lt, b(t.from ?? 0), 1),
|
|
681
|
+
r[3] ||= l("–", -1),
|
|
682
|
+
c("span", ut, b(t.to ?? 0), 1),
|
|
683
|
+
r[4] ||= l(" of ", -1),
|
|
684
|
+
c("span", dt, b(t.total), 1)
|
|
685
|
+
]))]), t.lastPage > 1 ? (h(), s("div", ft, [
|
|
686
|
+
c("button", {
|
|
687
|
+
class: "flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted transition-colors hover:bg-surface-hover disabled:opacity-40",
|
|
688
|
+
disabled: t.currentPage <= 1,
|
|
689
|
+
onClick: r[0] ||= (e) => p(t.currentPage - 1)
|
|
690
|
+
}, [u(E, {
|
|
691
|
+
name: "chevron-left",
|
|
692
|
+
size: 16
|
|
693
|
+
})], 8, pt),
|
|
694
|
+
(h(!0), s(e, null, v(d.value, (e, n) => (h(), s("button", {
|
|
695
|
+
key: n,
|
|
696
|
+
disabled: e === "…",
|
|
697
|
+
class: f(["tabular flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-[13px] font-medium transition-colors", e === t.currentPage ? "bg-accent text-accent-fg" : e === "…" ? "text-subtle" : "border border-border text-muted hover:bg-surface-hover"]),
|
|
698
|
+
onClick: (t) => typeof e == "number" && p(e)
|
|
699
|
+
}, b(e), 11, mt))), 128)),
|
|
700
|
+
c("button", {
|
|
701
|
+
class: "flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted transition-colors hover:bg-surface-hover disabled:opacity-40",
|
|
702
|
+
disabled: t.currentPage >= t.lastPage,
|
|
703
|
+
onClick: r[1] ||= (e) => p(t.currentPage + 1)
|
|
704
|
+
}, [u(E, {
|
|
705
|
+
name: "chevron-right",
|
|
706
|
+
size: 16
|
|
707
|
+
})], 8, ht)
|
|
708
|
+
])) : o("", !0)]));
|
|
709
|
+
}
|
|
710
|
+
}), G = g({ items: [] }), _t = 0;
|
|
711
|
+
function K(e, t, n, r = 4e3) {
|
|
712
|
+
let i = ++_t;
|
|
713
|
+
return G.items.push({
|
|
714
|
+
id: i,
|
|
715
|
+
type: e,
|
|
716
|
+
title: t,
|
|
717
|
+
message: n
|
|
718
|
+
}), r > 0 && setTimeout(() => q(i), r), i;
|
|
719
|
+
}
|
|
720
|
+
function q(e) {
|
|
721
|
+
let t = G.items.findIndex((t) => t.id === e);
|
|
722
|
+
t !== -1 && G.items.splice(t, 1);
|
|
723
|
+
}
|
|
724
|
+
function J() {
|
|
725
|
+
return {
|
|
726
|
+
items: G.items,
|
|
727
|
+
dismiss: q,
|
|
728
|
+
success: (e, t) => K("success", e, t),
|
|
729
|
+
error: (e, t) => K("error", e, t, 6e3),
|
|
730
|
+
info: (e, t) => K("info", e, t),
|
|
731
|
+
warning: (e, t) => K("warning", e, t)
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
//#endregion
|
|
735
|
+
//#region src/components/UiToaster.vue?vue&type=script&setup=true&lang.ts
|
|
736
|
+
var vt = { class: "pointer-events-none fixed bottom-4 right-4 z-[100] flex w-full max-w-sm flex-col gap-2.5" }, yt = { class: "min-w-0" }, bt = { class: "text-sm font-semibold text-content" }, xt = {
|
|
737
|
+
key: 0,
|
|
738
|
+
class: "mt-0.5 text-[13px] text-muted"
|
|
739
|
+
}, St = ["onClick"], Ct = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
740
|
+
__name: "UiToaster",
|
|
741
|
+
setup(n) {
|
|
742
|
+
let i = J(), l = {
|
|
743
|
+
success: {
|
|
744
|
+
icon: "check_circle",
|
|
745
|
+
class: "text-success",
|
|
746
|
+
bar: "bg-success"
|
|
747
|
+
},
|
|
748
|
+
error: {
|
|
749
|
+
icon: "alert",
|
|
750
|
+
class: "text-danger",
|
|
751
|
+
bar: "bg-danger"
|
|
752
|
+
},
|
|
753
|
+
warning: {
|
|
754
|
+
icon: "alert",
|
|
755
|
+
class: "text-warning",
|
|
756
|
+
bar: "bg-warning"
|
|
757
|
+
},
|
|
758
|
+
info: {
|
|
759
|
+
icon: "bell",
|
|
760
|
+
class: "text-info",
|
|
761
|
+
bar: "bg-info"
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
return (n, d) => (h(), a(t, { to: "body" }, [c("div", vt, [u(r, { name: "toast" }, {
|
|
765
|
+
default: C(() => [(h(!0), s(e, null, v(x(i).items, (e) => (h(), s("div", {
|
|
766
|
+
key: e.id,
|
|
767
|
+
class: "pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4 pr-10 shadow-lg"
|
|
768
|
+
}, [
|
|
769
|
+
c("span", { class: f(["absolute inset-y-0 left-0 w-1", l[e.type].bar]) }, null, 2),
|
|
770
|
+
u(E, {
|
|
771
|
+
name: l[e.type].icon,
|
|
772
|
+
size: 19,
|
|
773
|
+
class: f(["mt-0.5 shrink-0", l[e.type].class])
|
|
774
|
+
}, null, 8, ["name", "class"]),
|
|
775
|
+
c("div", yt, [c("p", bt, b(e.title), 1), e.message ? (h(), s("p", xt, b(e.message), 1)) : o("", !0)]),
|
|
776
|
+
c("button", {
|
|
777
|
+
class: "absolute right-2 top-2 rounded-md p-1 text-subtle transition-colors hover:bg-surface-hover hover:text-content",
|
|
778
|
+
onClick: (t) => x(i).dismiss(e.id)
|
|
779
|
+
}, [u(E, {
|
|
780
|
+
name: "x",
|
|
781
|
+
size: 15
|
|
782
|
+
})], 8, St)
|
|
783
|
+
]))), 128))]),
|
|
784
|
+
_: 1
|
|
785
|
+
})])]));
|
|
786
|
+
}
|
|
787
|
+
}), [["__scopeId", "data-v-2b500649"]]), wt = { class: "relative w-full" }, Tt = ["viewBox", "height"], Et = ["id"], Dt = [
|
|
788
|
+
"x2",
|
|
789
|
+
"y1",
|
|
790
|
+
"y2",
|
|
791
|
+
"stroke-dasharray"
|
|
792
|
+
], Ot = ["d", "fill"], kt = ["d"], At = ["cx", "cy"], jt = ["cx", "cy"], Mt = [
|
|
793
|
+
"x",
|
|
794
|
+
"width",
|
|
795
|
+
"height",
|
|
796
|
+
"onMouseenter"
|
|
797
|
+
], Nt = { class: "mt-1 flex justify-between px-1" }, Pt = { class: "font-semibold text-content tabular" }, Ft = { class: "text-subtle" }, Y = 1e3, X = 12, Z = 26, Q = 8, It = /* @__PURE__ */ d({
|
|
798
|
+
__name: "UiAreaChart",
|
|
799
|
+
props: {
|
|
800
|
+
data: {},
|
|
801
|
+
height: { default: 220 },
|
|
802
|
+
format: {}
|
|
803
|
+
},
|
|
804
|
+
setup(t) {
|
|
805
|
+
let n = t, r = i(() => n.height), a = i(() => Math.max(1, ...n.data.map((e) => e.value))), l = i(() => {
|
|
806
|
+
let e = n.data.length, t = Y - Q * 2, i = r.value - X - Z;
|
|
807
|
+
return n.data.map((n, r) => ({
|
|
808
|
+
x: e <= 1 ? Y / 2 : Q + r / (e - 1) * t,
|
|
809
|
+
y: X + i - n.value / a.value * i,
|
|
810
|
+
...n
|
|
811
|
+
}));
|
|
812
|
+
}), u = i(() => l.value.map((e, t) => `${t === 0 ? "M" : "L"} ${e.x.toFixed(1)} ${e.y.toFixed(1)}`).join(" ")), d = i(() => {
|
|
813
|
+
if (!l.value.length) return "";
|
|
814
|
+
let e = r.value - Z, t = l.value[0], n = l.value[l.value.length - 1];
|
|
815
|
+
return `M ${t.x} ${e} ${l.value.map((e) => `L ${e.x.toFixed(1)} ${e.y.toFixed(1)}`).join(" ")} L ${n.x} ${e} Z`;
|
|
816
|
+
}), f = i(() => {
|
|
817
|
+
let e = r.value - X - Z;
|
|
818
|
+
return [
|
|
819
|
+
0,
|
|
820
|
+
.25,
|
|
821
|
+
.5,
|
|
822
|
+
.75,
|
|
823
|
+
1
|
|
824
|
+
].map((t) => X + e * t);
|
|
825
|
+
}), m = Math.random().toString(36).slice(2, 8), g = _(null), y = (e) => n.format ? n.format(e) : String(e), S = i(() => Math.ceil(n.data.length / 6));
|
|
826
|
+
return (n, i) => (h(), s("div", wt, [
|
|
827
|
+
(h(), s("svg", {
|
|
828
|
+
viewBox: `0 0 ${Y} ${r.value}`,
|
|
829
|
+
height: r.value,
|
|
830
|
+
width: "100%",
|
|
831
|
+
preserveAspectRatio: "none",
|
|
832
|
+
class: "overflow-visible"
|
|
833
|
+
}, [
|
|
834
|
+
c("defs", null, [c("linearGradient", {
|
|
835
|
+
id: `area-${x(m)}`,
|
|
836
|
+
x1: "0",
|
|
837
|
+
y1: "0",
|
|
838
|
+
x2: "0",
|
|
839
|
+
y2: "1"
|
|
840
|
+
}, [...i[1] ||= [c("stop", {
|
|
841
|
+
offset: "0%",
|
|
842
|
+
"stop-color": "var(--accent)",
|
|
843
|
+
"stop-opacity": "0.22"
|
|
844
|
+
}, null, -1), c("stop", {
|
|
845
|
+
offset: "100%",
|
|
846
|
+
"stop-color": "var(--accent)",
|
|
847
|
+
"stop-opacity": "0"
|
|
848
|
+
}, null, -1)]], 8, Et)]),
|
|
849
|
+
(h(!0), s(e, null, v(f.value, (e, t) => (h(), s("line", {
|
|
850
|
+
key: t,
|
|
851
|
+
x1: Q,
|
|
852
|
+
x2: Y - Q,
|
|
853
|
+
y1: e,
|
|
854
|
+
y2: e,
|
|
855
|
+
stroke: "var(--border)",
|
|
856
|
+
"stroke-width": "1",
|
|
857
|
+
"vector-effect": "non-scaling-stroke",
|
|
858
|
+
"stroke-dasharray": t === f.value.length - 1 ? "0" : "3 4"
|
|
859
|
+
}, null, 8, Dt))), 128)),
|
|
860
|
+
c("path", {
|
|
861
|
+
d: d.value,
|
|
862
|
+
fill: `url(#area-${x(m)})`
|
|
863
|
+
}, null, 8, Ot),
|
|
864
|
+
c("path", {
|
|
865
|
+
d: u.value,
|
|
866
|
+
fill: "none",
|
|
867
|
+
stroke: "var(--accent)",
|
|
868
|
+
"stroke-width": "2.5",
|
|
869
|
+
"vector-effect": "non-scaling-stroke",
|
|
870
|
+
"stroke-linejoin": "round",
|
|
871
|
+
"stroke-linecap": "round"
|
|
872
|
+
}, null, 8, kt),
|
|
873
|
+
l.value.length ? (h(), s("circle", {
|
|
874
|
+
key: 0,
|
|
875
|
+
cx: l.value[l.value.length - 1].x,
|
|
876
|
+
cy: l.value[l.value.length - 1].y,
|
|
877
|
+
r: "4",
|
|
878
|
+
fill: "var(--accent)",
|
|
879
|
+
stroke: "var(--surface)",
|
|
880
|
+
"stroke-width": "2",
|
|
881
|
+
"vector-effect": "non-scaling-stroke"
|
|
882
|
+
}, null, 8, At)) : o("", !0),
|
|
883
|
+
(h(!0), s(e, null, v(l.value, (e, t) => (h(), s("g", { key: `h-${t}` }, [g.value === t ? (h(), s("circle", {
|
|
884
|
+
key: 0,
|
|
885
|
+
cx: e.x,
|
|
886
|
+
cy: e.y,
|
|
887
|
+
r: "4",
|
|
888
|
+
fill: "var(--surface)",
|
|
889
|
+
stroke: "var(--accent)",
|
|
890
|
+
"stroke-width": "2",
|
|
891
|
+
"vector-effect": "non-scaling-stroke"
|
|
892
|
+
}, null, 8, jt)) : o("", !0), c("rect", {
|
|
893
|
+
x: e.x - Y / l.value.length / 2,
|
|
894
|
+
y: 0,
|
|
895
|
+
width: Y / l.value.length,
|
|
896
|
+
height: r.value,
|
|
897
|
+
fill: "transparent",
|
|
898
|
+
onMouseenter: (e) => g.value = t,
|
|
899
|
+
onMouseleave: i[0] ||= (e) => g.value = null
|
|
900
|
+
}, null, 40, Mt)]))), 128))
|
|
901
|
+
], 8, Tt)),
|
|
902
|
+
c("div", Nt, [(h(!0), s(e, null, v(t.data, (e, n) => (h(), s("span", {
|
|
903
|
+
key: n,
|
|
904
|
+
class: "text-[11px] text-subtle",
|
|
905
|
+
style: p({ visibility: n % S.value === 0 || n === t.data.length - 1 ? "visible" : "hidden" })
|
|
906
|
+
}, b(e.label), 5))), 128))]),
|
|
907
|
+
g.value === null ? o("", !0) : (h(), s("div", {
|
|
908
|
+
key: 0,
|
|
909
|
+
class: "pointer-events-none absolute -translate-x-1/2 -translate-y-full rounded-md border border-border bg-surface px-2.5 py-1.5 text-xs shadow-md",
|
|
910
|
+
style: p({
|
|
911
|
+
left: `${l.value[g.value].x / Y * 100}%`,
|
|
912
|
+
top: `${l.value[g.value].y / r.value * 100}%`
|
|
913
|
+
})
|
|
914
|
+
}, [c("p", Pt, b(y(l.value[g.value].value)), 1), c("p", Ft, b(l.value[g.value].label), 1)], 4))
|
|
915
|
+
]));
|
|
916
|
+
}
|
|
917
|
+
}), Lt = { class: "w-full" }, Rt = ["onMouseenter"], zt = {
|
|
918
|
+
key: 0,
|
|
919
|
+
class: "pointer-events-none absolute bottom-full left-1/2 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded-md border border-border bg-surface px-2 py-1 text-xs shadow-md"
|
|
920
|
+
}, Bt = { class: "font-semibold text-content tabular" }, Vt = { class: "ml-1 text-subtle" }, Ht = { class: "mt-1.5 flex gap-1.5" }, Ut = /* @__PURE__ */ d({
|
|
921
|
+
__name: "UiBarChart",
|
|
922
|
+
props: {
|
|
923
|
+
data: {},
|
|
924
|
+
height: { default: 220 },
|
|
925
|
+
format: {}
|
|
926
|
+
},
|
|
927
|
+
setup(t) {
|
|
928
|
+
let n = t, r = i(() => Math.max(1, ...n.data.map((e) => e.value))), a = _(null), l = (e) => n.format ? n.format(e) : String(e), u = i(() => Math.ceil(n.data.length / 8));
|
|
929
|
+
return (n, i) => (h(), s("div", Lt, [c("div", {
|
|
930
|
+
class: "flex items-end gap-1.5",
|
|
931
|
+
style: p({ height: `${t.height}px` })
|
|
932
|
+
}, [(h(!0), s(e, null, v(t.data, (e, t) => (h(), s("div", {
|
|
933
|
+
key: t,
|
|
934
|
+
class: "group relative flex flex-1 flex-col justify-end",
|
|
935
|
+
onMouseenter: (e) => a.value = t,
|
|
936
|
+
onMouseleave: i[0] ||= (e) => a.value = null
|
|
937
|
+
}, [c("div", {
|
|
938
|
+
class: f(["w-full rounded-t transition-all duration-200", a.value === t ? "bg-accent" : "bg-accent/55"]),
|
|
939
|
+
style: p({ height: `${Math.max(2, e.value / r.value * 100)}%` })
|
|
940
|
+
}, null, 6), a.value === t ? (h(), s("div", zt, [c("span", Bt, b(l(e.value)), 1), c("span", Vt, b(e.label), 1)])) : o("", !0)], 40, Rt))), 128))], 4), c("div", Ht, [(h(!0), s(e, null, v(t.data, (e, n) => (h(), s("span", {
|
|
941
|
+
key: n,
|
|
942
|
+
class: "flex-1 truncate text-center text-[11px] text-subtle",
|
|
943
|
+
style: p({ visibility: n % u.value === 0 || n === t.data.length - 1 ? "visible" : "hidden" })
|
|
944
|
+
}, b(e.label), 5))), 128))])]));
|
|
945
|
+
}
|
|
946
|
+
}), Wt = { class: "flex flex-wrap items-center gap-6" }, Gt = [
|
|
947
|
+
"width",
|
|
948
|
+
"height",
|
|
949
|
+
"viewBox"
|
|
950
|
+
], Kt = [
|
|
951
|
+
"cx",
|
|
952
|
+
"cy",
|
|
953
|
+
"r",
|
|
954
|
+
"stroke-width"
|
|
955
|
+
], $ = [
|
|
956
|
+
"cx",
|
|
957
|
+
"cy",
|
|
958
|
+
"r",
|
|
959
|
+
"stroke",
|
|
960
|
+
"stroke-width",
|
|
961
|
+
"stroke-dasharray",
|
|
962
|
+
"stroke-dashoffset"
|
|
963
|
+
], qt = { class: "absolute inset-0 flex flex-col items-center justify-center" }, Jt = { class: "tabular text-2xl font-semibold text-content" }, Yt = {
|
|
964
|
+
key: 0,
|
|
965
|
+
class: "text-[11px] uppercase tracking-wide text-subtle"
|
|
966
|
+
}, Xt = { class: "flex min-w-0 flex-1 flex-col gap-2" }, Zt = { class: "truncate capitalize text-muted" }, Qt = { class: "tabular ml-auto font-medium text-content" }, $t = { class: "tabular w-9 text-right text-xs text-subtle" }, en = /* @__PURE__ */ d({
|
|
967
|
+
__name: "UiDonutChart",
|
|
968
|
+
props: {
|
|
969
|
+
data: {},
|
|
970
|
+
size: { default: 180 },
|
|
971
|
+
thickness: { default: 20 },
|
|
972
|
+
centerLabel: {},
|
|
973
|
+
centerValue: {}
|
|
974
|
+
},
|
|
975
|
+
setup(t) {
|
|
976
|
+
let n = t, r = [
|
|
977
|
+
"var(--brand-500)",
|
|
978
|
+
"var(--info)",
|
|
979
|
+
"var(--warning)",
|
|
980
|
+
"var(--brand-300)",
|
|
981
|
+
"var(--danger)",
|
|
982
|
+
"var(--success)"
|
|
983
|
+
], a = i(() => n.data.reduce((e, t) => e + t.value, 0) || 1), l = i(() => (n.size - n.thickness) / 2), u = i(() => 2 * Math.PI * l.value), d = i(() => {
|
|
984
|
+
let e = 0;
|
|
985
|
+
return n.data.map((t, n) => {
|
|
986
|
+
let i = t.value / a.value, o = {
|
|
987
|
+
...t,
|
|
988
|
+
color: t.color || r[n % r.length],
|
|
989
|
+
dash: i * u.value,
|
|
990
|
+
gap: u.value - i * u.value,
|
|
991
|
+
offset: -e * u.value,
|
|
992
|
+
pct: Math.round(i * 100)
|
|
993
|
+
};
|
|
994
|
+
return e += i, o;
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
return (n, r) => (h(), s("div", Wt, [c("div", {
|
|
998
|
+
class: "relative shrink-0",
|
|
999
|
+
style: p({
|
|
1000
|
+
width: `${t.size}px`,
|
|
1001
|
+
height: `${t.size}px`
|
|
1002
|
+
})
|
|
1003
|
+
}, [(h(), s("svg", {
|
|
1004
|
+
width: t.size,
|
|
1005
|
+
height: t.size,
|
|
1006
|
+
viewBox: `0 0 ${t.size} ${t.size}`,
|
|
1007
|
+
class: "-rotate-90"
|
|
1008
|
+
}, [c("circle", {
|
|
1009
|
+
cx: t.size / 2,
|
|
1010
|
+
cy: t.size / 2,
|
|
1011
|
+
r: l.value,
|
|
1012
|
+
fill: "none",
|
|
1013
|
+
stroke: "var(--surface-2)",
|
|
1014
|
+
"stroke-width": t.thickness
|
|
1015
|
+
}, null, 8, Kt), (h(!0), s(e, null, v(d.value, (e, n) => (h(), s("circle", {
|
|
1016
|
+
key: n,
|
|
1017
|
+
cx: t.size / 2,
|
|
1018
|
+
cy: t.size / 2,
|
|
1019
|
+
r: l.value,
|
|
1020
|
+
fill: "none",
|
|
1021
|
+
stroke: e.color,
|
|
1022
|
+
"stroke-width": t.thickness,
|
|
1023
|
+
"stroke-dasharray": `${e.dash} ${e.gap}`,
|
|
1024
|
+
"stroke-dashoffset": e.offset,
|
|
1025
|
+
"stroke-linecap": "butt"
|
|
1026
|
+
}, null, 8, $))), 128))], 8, Gt)), c("div", qt, [c("span", Jt, b(t.centerValue ?? a.value), 1), t.centerLabel ? (h(), s("span", Yt, b(t.centerLabel), 1)) : o("", !0)])], 4), c("ul", Xt, [(h(!0), s(e, null, v(d.value, (e, t) => (h(), s("li", {
|
|
1027
|
+
key: t,
|
|
1028
|
+
class: "flex items-center gap-2.5 text-sm"
|
|
1029
|
+
}, [
|
|
1030
|
+
c("span", {
|
|
1031
|
+
class: "h-2.5 w-2.5 shrink-0 rounded-full",
|
|
1032
|
+
style: p({ background: e.color })
|
|
1033
|
+
}, null, 4),
|
|
1034
|
+
c("span", Zt, b(e.label), 1),
|
|
1035
|
+
c("span", Qt, b(e.value), 1),
|
|
1036
|
+
c("span", $t, b(e.pct) + "%", 1)
|
|
1037
|
+
]))), 128))])]));
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
//#endregion
|
|
1041
|
+
export { It as UiAreaChart, fe as UiBadge, Ut as UiBarChart, ne as UiButton, ye as UiCard, en as UiDonutChart, Je as UiDrawer, Fe as UiEmptyState, E as UiIcon, ue as UiInput, Ve as UiModal, gt as UiPagination, F as UiSelect, U as UiSkeleton, ke as UiSpinner, Ee as UiStatTile, at as UiTable, H as UiTextarea, Ct as UiToaster, J as useToast };
|