vlite3 1.2.2 → 1.2.5

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.
Files changed (57) hide show
  1. package/README.md +18 -7
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +1 -1
  3. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +1 -1
  4. package/components/AsyncSelect/createAsyncSelect.d.ts +88 -0
  5. package/components/AsyncSelect/createAsyncSelect.js +156 -0
  6. package/components/AsyncSelect/index.d.ts +1 -0
  7. package/components/AvatarGroup/AvatarGroup.vue.js +10 -9
  8. package/components/Beacon.vue.d.ts +13 -0
  9. package/components/CategoryManager/CategoryManager.vue.js +1 -1
  10. package/components/ChoiceBox/ChoiceBox.vue.js +4 -2
  11. package/components/{CopyButton.vue.d.ts → Clipboard.vue.d.ts} +4 -3
  12. package/components/{CopyButton.vue.js → Clipboard.vue.js} +19 -19
  13. package/components/Clipboard.vue2.js +4 -0
  14. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  15. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  16. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  17. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  18. package/components/DataTable/types.d.ts +1 -1
  19. package/components/Form/Form.vue.js +1 -1
  20. package/components/Form/Form.vue2.js +1 -1
  21. package/components/List/ListFieldRow.vue.js +221 -144
  22. package/components/Modal.vue.js +1 -1
  23. package/components/Modal.vue2.js +92 -86
  24. package/components/NavbarCommandPalette.vue.js +1 -1
  25. package/components/Persona.vue.d.ts +25 -0
  26. package/components/Price/Price.vue.d.ts +1 -1
  27. package/components/Price/Price.vue.js +35 -13
  28. package/components/Rating/Rating.vue.d.ts +43 -0
  29. package/components/Rating/Rating.vue.js +7 -0
  30. package/components/Rating/Rating.vue2.js +92 -0
  31. package/components/Rating/ReviewSummary.vue.d.ts +5 -0
  32. package/components/Rating/ReviewSummary.vue.js +67 -0
  33. package/components/Rating/ReviewSummary.vue2.js +4 -0
  34. package/components/Rating/index.d.ts +3 -0
  35. package/components/Rating/types.d.ts +28 -0
  36. package/components/Screen/Screen.vue.d.ts +2 -2
  37. package/components/Screen/Screen.vue.js +3 -1
  38. package/components/Screen/ScreenFilter.vue.js +1 -1
  39. package/components/SidePanel.vue.js +3 -3
  40. package/components/SidePanel.vue2.js +44 -56
  41. package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
  42. package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +3 -1
  43. package/components/SidebarMenu/SidebarMenuItem.vue.js +197 -178
  44. package/components/Stats/StatItem.vue.js +222 -164
  45. package/components/Stats/components/StatIconBox.vue.js +42 -42
  46. package/components/Stats/components/StatTrend.vue.js +20 -20
  47. package/components/ThemeToggle.vue.js +10 -10
  48. package/components/Timeline/Timeline.vue.js +21 -11
  49. package/components/Timeline/TimelineItem.vue.js +1 -1
  50. package/components/index.d.ts +2 -0
  51. package/index.d.ts +3 -1
  52. package/index.js +113 -107
  53. package/package.json +2 -1
  54. package/style.css +47 -32
  55. package/utils/status.js +16 -16
  56. package/components/CopyButton.vue2.js +0 -4
  57. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,30 +1,32 @@
1
- import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as l, Fragment as x, createElementVNode as d, toDisplayString as o, unref as s, createBlock as c, createCommentVNode as r } from "vue";
2
- import { $t as f } from "../../utils/i18n.js";
3
- import { formatCurrency as C, formatNumber as j } from "../../utils/functions.js";
4
- import b from "./components/StatTrend.vue.js";
5
- import g from "./components/StatIconBox.vue.js";
6
- const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
1
+ import { defineComponent as T, computed as w, openBlock as t, createElementBlock as o, normalizeStyle as $, normalizeClass as r, Fragment as k, createElementVNode as l, toDisplayString as c, unref as b, createBlock as n, withCtx as g, createCommentVNode as d } from "vue";
2
+ import { $t as x } from "../../utils/i18n.js";
3
+ import { formatCurrency as C, formatNumber as I } from "../../utils/functions.js";
4
+ import h from "./components/StatTrend.vue.js";
5
+ import S from "./components/StatIconBox.vue.js";
6
+ import v from "../Tooltip.vue.js";
7
+ import { configState as P } from "../../core/config.js";
8
+ const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
7
9
  key: 0,
8
10
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
9
- }, N = {
11
+ }, E = {
10
12
  key: 0,
11
13
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
12
- }, T = {
14
+ }, D = {
13
15
  key: 1,
14
16
  class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
15
- }, V = {
17
+ }, L = {
16
18
  key: 3,
17
19
  class: "flex-1 flex flex-col justify-center min-w-0"
18
- }, E = {
20
+ }, q = {
19
21
  key: 0,
20
22
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
21
- }, M = {
23
+ }, A = {
22
24
  key: 1,
23
25
  class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
24
- }, D = { class: "flex-1 flex flex-col justify-center min-w-0" }, L = { class: "flex items-baseline gap-2 mt-1" }, P = {
26
+ }, G = { class: "flex-1 flex flex-col justify-center min-w-0" }, H = { class: "flex items-baseline gap-2 mt-1" }, J = {
25
27
  key: 0,
26
28
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
27
- }, K = /* @__PURE__ */ B({
29
+ }, Y = /* @__PURE__ */ T({
28
30
  __name: "StatItem",
29
31
  props: {
30
32
  item: {},
@@ -38,14 +40,22 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
38
40
  iconBoxShape: { default: "rounded" },
39
41
  iconBoxStyle: { default: "filled" }
40
42
  },
41
- setup(t) {
42
- const n = t;
43
- function y(a) {
44
- const m = Number(a.value);
45
- return a.isPrice ? C(m, { numberFormat: a.numberFormat || "compact", compactThreshold: a.compactThreshold }) : a.numberFormat ? j(m, { numberFormat: a.numberFormat, compactThreshold: a.compactThreshold }) : a.value;
43
+ setup(e) {
44
+ const i = e;
45
+ function s(a) {
46
+ const u = Number(a.value);
47
+ return a.isPrice ? C(u, { numberFormat: a.numberFormat || "compact", compactThreshold: a.compactThreshold }) : a.numberFormat ? I(u, { numberFormat: a.numberFormat, compactThreshold: a.compactThreshold }) : a.value;
46
48
  }
47
- const S = k(() => {
48
- const a = n.layout === "inline-label-value" ? "flex px-3.5 py-3" : n.layout === "centered-value-title" ? "flex px-1 py-1" : "flex p-3", m = {
49
+ const y = w(() => {
50
+ const a = Number(i.item.value) || 0;
51
+ if (!i.item.isPrice && !i.item.numberFormat || (i.item.numberFormat || (i.item.isPrice ? "compact" : "standard")) !== "compact") return !1;
52
+ const z = i.item.compactThreshold ?? P?.components?.price?.compactThreshold ?? 1e3;
53
+ return Math.abs(a) >= z;
54
+ }), f = w(() => {
55
+ const a = Number(i.item.value) || 0;
56
+ return i.item.isPrice ? C(a, { numberFormat: "standard" }) : i.item.numberFormat ? I(a, { numberFormat: "standard" }) : String(i.item.value);
57
+ }), F = w(() => {
58
+ const a = i.layout === "inline-label-value" ? "flex px-3.5 py-3" : i.layout === "centered-value-title" ? "flex px-1 py-1" : "flex p-3", u = {
49
59
  "icon-left": "flex-row items-center gap-3 text-left",
50
60
  "icon-right": "flex-row items-center justify-between gap-3 text-left",
51
61
  "icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
@@ -54,45 +64,45 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
54
64
  "floating-icon": "flex-col items-start gap-1 text-left relative",
55
65
  "split-bar": "flex-row items-center gap-3 text-left border-l-4",
56
66
  "inline-label-value": "flex-row items-center gap-2.5 text-left"
57
- }, h = m[n.layout] || m["icon-left"];
58
- let u = "";
59
- if (n.attached)
60
- n.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : n.variant === "outline" ? u = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : u = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
67
+ }, z = u[i.layout] || u["icon-left"];
68
+ let m = "";
69
+ if (i.attached)
70
+ i.variant === "transparent" ? m = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : i.variant === "outline" ? m = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : m = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
61
71
  else {
62
- switch (n.variant) {
72
+ switch (i.variant) {
63
73
  case "solid": {
64
- const w = n.item.color || "primary", v = {
65
- primary: "bg-primary-light",
66
- secondary: "bg-secondary",
67
- success: "bg-success-light",
68
- warning: "bg-warning-light",
69
- danger: "bg-danger-light",
70
- info: "bg-info-light"
74
+ const N = i.item.color || "primary", B = {
75
+ primary: "bg-primary-light dark:ring-1 dark:ring-inset dark:ring-primary/20",
76
+ secondary: "bg-secondary dark:ring-1 dark:ring-inset dark:ring-secondary-foreground/20",
77
+ success: "bg-success-light dark:ring-1 dark:ring-inset dark:ring-success/20",
78
+ warning: "bg-warning-light dark:ring-1 dark:ring-inset dark:ring-warning/20",
79
+ danger: "bg-danger-light dark:ring-1 dark:ring-inset dark:ring-danger/20",
80
+ info: "bg-info-light dark:ring-1 dark:ring-inset dark:ring-info/20"
71
81
  };
72
- u = `${v[w] || v.primary}`;
82
+ m = `${B[N] || B.primary}`;
73
83
  break;
74
84
  }
75
85
  case "outline":
76
- u = "border border-border";
86
+ m = "border border-border";
77
87
  break;
78
88
  case "shadow":
79
- u = "bg-card shadow-md border border-border/50";
89
+ m = "bg-card shadow-md border border-border/50";
80
90
  break;
81
91
  case "transparent":
82
- u = "bg-transparent";
92
+ m = "bg-transparent";
83
93
  break;
84
94
  }
85
- u += " rounded-lg";
95
+ m += " rounded-lg";
86
96
  }
87
- return [a, h, u].join(" ");
88
- }), z = k(() => {
89
- if (n.variant === "solid" && !n.attached) {
90
- const a = n.item.color;
97
+ return [a, z, m].join(" ");
98
+ }), j = w(() => {
99
+ if (i.variant === "solid" && !i.attached) {
100
+ const a = i.item.color;
91
101
  if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
92
102
  return { backgroundColor: `${a}15` };
93
103
  }
94
- if (n.layout === "split-bar") {
95
- const a = n.item.color, m = {
104
+ if (i.layout === "split-bar") {
105
+ const a = i.item.color, u = {
96
106
  primary: "var(--color-primary)",
97
107
  secondary: "var(--color-secondary)",
98
108
  success: "var(--color-success)",
@@ -101,157 +111,205 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
101
111
  info: "var(--color-info)"
102
112
  };
103
113
  if (a)
104
- return { borderLeftColor: m[a] || a };
114
+ return { borderLeftColor: u[a] || a };
105
115
  }
106
116
  return {};
107
117
  });
108
- return (a, m) => (e(), i("div", {
109
- class: l(S.value),
110
- style: I(z.value)
118
+ return (a, u) => (t(), o("div", {
119
+ class: r(F.value),
120
+ style: $(j.value)
111
121
  }, [
112
- t.layout === "title-top-icon-bottom-right" ? (e(), i(x, { key: 0 }, [
113
- d("h3", {
114
- class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
115
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
116
- d("div", F, [
117
- d("div", null, [
118
- t.loading ? (e(), i("div", $)) : (e(), i("p", {
122
+ e.layout === "title-top-icon-bottom-right" ? (t(), o(k, { key: 0 }, [
123
+ l("h3", {
124
+ class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
125
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
126
+ l("div", V, [
127
+ l("div", null, [
128
+ e.loading ? (t(), o("div", M)) : (t(), n(v, {
119
129
  key: 1,
120
- class: l(t.valueSize || "text-2xl font-bold text-foreground truncate")
121
- }, o(y(t.item)), 3)),
122
- t.item.trend && !t.loading ? (e(), c(b, {
130
+ content: f.value,
131
+ disabled: !y.value
132
+ }, {
133
+ default: g(() => [
134
+ l("p", {
135
+ class: r(e.valueSize || "text-2xl font-bold text-foreground truncate")
136
+ }, c(s(e.item)), 3)
137
+ ]),
138
+ _: 1
139
+ }, 8, ["content", "disabled"])),
140
+ e.item.trend && !e.loading ? (t(), n(h, {
123
141
  key: 2,
124
- trend: t.item.trend,
125
- layout: t.layout
126
- }, null, 8, ["trend", "layout"])) : r("", !0)
142
+ trend: e.item.trend,
143
+ layout: e.layout
144
+ }, null, 8, ["trend", "layout"])) : d("", !0)
127
145
  ]),
128
- t.item.icon ? (e(), c(g, {
146
+ e.item.icon ? (t(), n(S, {
129
147
  key: 0,
130
- item: t.item,
131
- variant: t.variant,
132
- layout: t.layout,
133
- attached: t.attached,
134
- "icon-box-shape": t.iconBoxShape,
135
- "icon-box-style": t.iconBoxStyle,
136
- "icon-size": t.iconSize
137
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0)
148
+ item: e.item,
149
+ variant: e.variant,
150
+ layout: e.layout,
151
+ attached: e.attached,
152
+ "icon-box-shape": e.iconBoxShape,
153
+ "icon-box-style": e.iconBoxStyle,
154
+ "icon-size": e.iconSize
155
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
138
156
  ])
139
- ], 64)) : t.layout === "centered-value-title" ? (e(), i(x, { key: 1 }, [
140
- t.loading ? (e(), i("div", N)) : (e(), i("p", {
157
+ ], 64)) : e.layout === "centered-value-title" ? (t(), o(k, { key: 1 }, [
158
+ e.loading ? (t(), o("div", E)) : (t(), n(v, {
141
159
  key: 1,
142
- class: l(t.valueSize || "text-3xl font-bold text-foreground")
143
- }, o(y(t.item)), 3)),
144
- d("h3", {
145
- class: l(t.titleSize || "text-sm font-medium text-muted-foreground")
146
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
147
- t.item.trend && !t.loading ? (e(), c(b, {
160
+ content: f.value,
161
+ disabled: !y.value
162
+ }, {
163
+ default: g(() => [
164
+ l("p", {
165
+ class: r(e.valueSize || "text-3xl font-bold text-foreground")
166
+ }, c(s(e.item)), 3)
167
+ ]),
168
+ _: 1
169
+ }, 8, ["content", "disabled"])),
170
+ l("h3", {
171
+ class: r(e.titleSize || "text-sm font-medium text-muted-foreground")
172
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
173
+ e.item.trend && !e.loading ? (t(), n(h, {
148
174
  key: 2,
149
- trend: t.item.trend,
150
- layout: t.layout
151
- }, null, 8, ["trend", "layout"])) : r("", !0)
152
- ], 64)) : t.layout === "floating-icon" ? (e(), i(x, { key: 2 }, [
153
- t.item.icon ? (e(), c(g, {
175
+ trend: e.item.trend,
176
+ layout: e.layout
177
+ }, null, 8, ["trend", "layout"])) : d("", !0)
178
+ ], 64)) : e.layout === "floating-icon" ? (t(), o(k, { key: 2 }, [
179
+ e.item.icon ? (t(), n(S, {
154
180
  key: 0,
155
- item: t.item,
156
- variant: t.variant,
157
- layout: t.layout,
158
- attached: t.attached,
159
- "icon-box-shape": t.iconBoxShape,
160
- "icon-box-style": t.iconBoxStyle,
161
- "icon-size": t.iconSize,
181
+ item: e.item,
182
+ variant: e.variant,
183
+ layout: e.layout,
184
+ attached: e.attached,
185
+ "icon-box-shape": e.iconBoxShape,
186
+ "icon-box-style": e.iconBoxStyle,
187
+ "icon-size": e.iconSize,
162
188
  class: "absolute top-4 right-4"
163
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
164
- d("h3", {
165
- class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
166
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
167
- t.loading ? (e(), i("div", T)) : (e(), i("p", {
189
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
190
+ l("h3", {
191
+ class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
192
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
193
+ e.loading ? (t(), o("div", D)) : (t(), n(v, {
168
194
  key: 2,
169
- class: l(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
170
- }, o(y(t.item)), 3)),
171
- t.item.trend && !t.loading ? (e(), c(b, {
195
+ content: f.value,
196
+ disabled: !y.value
197
+ }, {
198
+ default: g(() => [
199
+ l("p", {
200
+ class: r(e.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
201
+ }, c(s(e.item)), 3)
202
+ ]),
203
+ _: 1
204
+ }, 8, ["content", "disabled"])),
205
+ e.item.trend && !e.loading ? (t(), n(h, {
172
206
  key: 3,
173
- trend: t.item.trend,
174
- layout: t.layout
175
- }, null, 8, ["trend", "layout"])) : r("", !0)
176
- ], 64)) : t.layout === "split-bar" ? (e(), i("div", V, [
177
- d("h3", {
178
- class: l(
179
- t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
207
+ trend: e.item.trend,
208
+ layout: e.layout
209
+ }, null, 8, ["trend", "layout"])) : d("", !0)
210
+ ], 64)) : e.layout === "split-bar" ? (t(), o("div", L, [
211
+ l("h3", {
212
+ class: r(
213
+ e.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
180
214
  )
181
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
182
- t.loading ? (e(), i("div", E)) : (e(), i("p", {
215
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
216
+ e.loading ? (t(), o("div", q)) : (t(), n(v, {
183
217
  key: 1,
184
- class: l(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
185
- }, o(y(t.item)), 3)),
186
- t.item.trend && !t.loading ? (e(), c(b, {
218
+ content: f.value,
219
+ disabled: !y.value
220
+ }, {
221
+ default: g(() => [
222
+ l("p", {
223
+ class: r(e.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
224
+ }, c(s(e.item)), 3)
225
+ ]),
226
+ _: 1
227
+ }, 8, ["content", "disabled"])),
228
+ e.item.trend && !e.loading ? (t(), n(h, {
187
229
  key: 2,
188
- trend: t.item.trend,
189
- layout: t.layout
190
- }, null, 8, ["trend", "layout"])) : r("", !0)
191
- ])) : t.layout === "inline-label-value" ? (e(), i(x, { key: 4 }, [
192
- t.item.icon ? (e(), c(g, {
230
+ trend: e.item.trend,
231
+ layout: e.layout
232
+ }, null, 8, ["trend", "layout"])) : d("", !0)
233
+ ])) : e.layout === "inline-label-value" ? (t(), o(k, { key: 4 }, [
234
+ e.item.icon ? (t(), n(S, {
193
235
  key: 0,
194
- item: t.item,
195
- variant: t.variant,
196
- layout: t.layout,
197
- attached: t.attached,
198
- "icon-box-shape": t.iconBoxShape,
199
- "icon-box-style": t.iconBoxStyle,
200
- "icon-size": t.iconSize
201
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
202
- d("span", {
203
- class: l([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
204
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
205
- t.loading ? (e(), i("div", M)) : (e(), i("span", {
236
+ item: e.item,
237
+ variant: e.variant,
238
+ layout: e.layout,
239
+ attached: e.attached,
240
+ "icon-box-shape": e.iconBoxShape,
241
+ "icon-box-style": e.iconBoxStyle,
242
+ "icon-size": e.iconSize
243
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
244
+ l("span", {
245
+ class: r([e.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
246
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
247
+ e.loading ? (t(), o("div", A)) : (t(), n(v, {
206
248
  key: 2,
207
- class: l(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
208
- }, o(y(t.item)), 3)),
209
- t.item.trend && !t.loading ? (e(), c(b, {
249
+ content: f.value,
250
+ disabled: !y.value
251
+ }, {
252
+ default: g(() => [
253
+ l("span", {
254
+ class: r(e.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
255
+ }, c(s(e.item)), 3)
256
+ ]),
257
+ _: 1
258
+ }, 8, ["content", "disabled"])),
259
+ e.item.trend && !e.loading ? (t(), n(h, {
210
260
  key: 3,
211
- trend: t.item.trend,
212
- layout: t.layout
213
- }, null, 8, ["trend", "layout"])) : r("", !0)
214
- ], 64)) : (e(), i(x, { key: 5 }, [
215
- t.item.icon && t.layout !== "icon-right" ? (e(), c(g, {
261
+ trend: e.item.trend,
262
+ layout: e.layout
263
+ }, null, 8, ["trend", "layout"])) : d("", !0)
264
+ ], 64)) : (t(), o(k, { key: 5 }, [
265
+ e.item.icon && e.layout !== "icon-right" ? (t(), n(S, {
216
266
  key: 0,
217
- item: t.item,
218
- variant: t.variant,
219
- layout: t.layout,
220
- attached: t.attached,
221
- "icon-box-shape": t.iconBoxShape,
222
- "icon-box-style": t.iconBoxStyle,
223
- "icon-size": t.iconSize
224
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
225
- d("div", D, [
226
- d("h3", {
227
- class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
228
- }, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
229
- d("div", L, [
230
- t.loading ? (e(), i("div", P)) : (e(), i("p", {
267
+ item: e.item,
268
+ variant: e.variant,
269
+ layout: e.layout,
270
+ attached: e.attached,
271
+ "icon-box-shape": e.iconBoxShape,
272
+ "icon-box-style": e.iconBoxStyle,
273
+ "icon-size": e.iconSize
274
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
275
+ l("div", G, [
276
+ l("h3", {
277
+ class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate")
278
+ }, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
279
+ l("div", H, [
280
+ e.loading ? (t(), o("div", J)) : (t(), n(v, {
231
281
  key: 1,
232
- class: l(t.valueSize || "text-2xl font-bold text-foreground truncate")
233
- }, o(y(t.item)), 3))
282
+ content: f.value,
283
+ disabled: !y.value
284
+ }, {
285
+ default: g(() => [
286
+ l("p", {
287
+ class: r(e.valueSize || "text-2xl font-bold text-foreground truncate")
288
+ }, c(s(e.item)), 3)
289
+ ]),
290
+ _: 1
291
+ }, 8, ["content", "disabled"]))
234
292
  ]),
235
- t.item.trend && !t.loading ? (e(), c(b, {
293
+ e.item.trend && !e.loading ? (t(), n(h, {
236
294
  key: 0,
237
- trend: t.item.trend,
238
- layout: t.layout
239
- }, null, 8, ["trend", "layout"])) : r("", !0)
295
+ trend: e.item.trend,
296
+ layout: e.layout
297
+ }, null, 8, ["trend", "layout"])) : d("", !0)
240
298
  ]),
241
- t.item.icon && t.layout === "icon-right" ? (e(), c(g, {
299
+ e.item.icon && e.layout === "icon-right" ? (t(), n(S, {
242
300
  key: 1,
243
- item: t.item,
244
- variant: t.variant,
245
- layout: t.layout,
246
- attached: t.attached,
247
- "icon-box-shape": t.iconBoxShape,
248
- "icon-box-style": t.iconBoxStyle,
249
- "icon-size": t.iconSize
250
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0)
301
+ item: e.item,
302
+ variant: e.variant,
303
+ layout: e.layout,
304
+ attached: e.attached,
305
+ "icon-box-shape": e.iconBoxShape,
306
+ "icon-box-style": e.iconBoxStyle,
307
+ "icon-size": e.iconSize
308
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
251
309
  ], 64))
252
310
  ], 6));
253
311
  }
254
312
  });
255
313
  export {
256
- K as default
314
+ Y as default
257
315
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as y, computed as c, openBlock as d, createElementBlock as m, normalizeStyle as u, normalizeClass as i, createVNode as x, createBlock as p, createCommentVNode as k } from "vue";
2
- import g from "../../Icon.vue.js";
3
- const w = /* @__PURE__ */ y({
1
+ import { defineComponent as y, computed as s, openBlock as u, createElementBlock as m, normalizeStyle as g, normalizeClass as c, createVNode as x, createBlock as b, createCommentVNode as p } from "vue";
2
+ import f from "../../Icon.vue.js";
3
+ const S = /* @__PURE__ */ y({
4
4
  __name: "StatIconBox",
5
5
  props: {
6
6
  item: {},
@@ -12,31 +12,31 @@ const w = /* @__PURE__ */ y({
12
12
  iconSize: {},
13
13
  class: {}
14
14
  },
15
- setup(t) {
16
- const e = t, a = c(() => e.layout === "inline-label-value"), f = c(() => e.iconBoxShape === "full-rounded" ? "rounded-full" : e.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), s = c(() => {
17
- if (a.value) {
18
- const n = e.item.color || "primary";
15
+ setup(r) {
16
+ const e = r, o = s(() => e.layout === "inline-label-value"), d = s(() => e.iconBoxShape === "full-rounded" ? "rounded-full" : e.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), i = s(() => {
17
+ if (o.value) {
18
+ const t = e.item.color || "primary";
19
19
  return `shrink-0 ${{
20
20
  primary: "text-primary",
21
21
  secondary: "text-secondary-foreground",
22
- success: "text-success-dark",
23
- warning: "text-warning-dark",
24
- danger: "text-danger-dark",
25
- info: "text-info-dark"
26
- }[n] || "text-primary"} ${e.class || ""}`;
22
+ success: "text-success-subtle-fg",
23
+ warning: "text-warning-subtle-fg",
24
+ danger: "text-danger-subtle-fg",
25
+ info: "text-info-subtle-fg"
26
+ }[t] || "text-primary"} ${e.class || ""}`;
27
27
  }
28
- const r = `flex items-center justify-center shrink-0 ${f.value} p-3 ${e.class || ""}`, o = e.item.color || "primary";
28
+ const n = `flex items-center justify-center shrink-0 ${d.value} p-3 ${e.class || ""}`, a = e.item.color || "primary";
29
29
  if (e.iconBoxStyle === "transparent")
30
- return `${r} bg-transparent ${{
30
+ return `${n} bg-transparent ${{
31
31
  primary: "text-primary",
32
32
  secondary: "text-secondary-foreground",
33
- success: "text-success-dark",
34
- warning: "text-warning-dark",
35
- danger: "text-danger-dark",
36
- info: "text-info-dark"
37
- }[o] || "text-primary"}`;
33
+ success: "text-success-subtle-fg",
34
+ warning: "text-warning-subtle-fg",
35
+ danger: "text-danger-subtle-fg",
36
+ info: "text-info-subtle-fg"
37
+ }[a] || "text-primary"}`;
38
38
  if (e.variant === "solid" && !e.attached) {
39
- const n = {
39
+ const t = {
40
40
  primary: "bg-primary text-primary-fg",
41
41
  secondary: "bg-foreground text-background",
42
42
  success: "bg-success text-success-fg",
@@ -44,39 +44,39 @@ const w = /* @__PURE__ */ y({
44
44
  danger: "bg-danger text-danger-fg",
45
45
  info: "bg-info text-info-fg"
46
46
  };
47
- return `${r} ${n[o] || n.primary}`;
47
+ return `${n} ${t[a] || t.primary}`;
48
48
  } else {
49
- const n = {
49
+ const t = {
50
50
  primary: "bg-primary-light text-primary",
51
51
  secondary: "bg-secondary text-secondary-foreground",
52
- success: "bg-success-light text-success-dark",
53
- warning: "bg-warning-light text-warning-dark",
54
- danger: "bg-danger-light text-danger-dark",
55
- info: "bg-info-light text-info-dark"
52
+ success: "bg-success-subtle text-success-subtle-fg",
53
+ warning: "bg-warning-subtle text-warning-subtle-fg",
54
+ danger: "bg-danger-subtle text-danger-subtle-fg",
55
+ info: "bg-info-subtle text-info-subtle-fg"
56
56
  };
57
- return `${r} ${n[o] || n.primary}`;
57
+ return `${n} ${t[a] || t.primary}`;
58
58
  }
59
- }), l = c(() => {
60
- const r = e.item.color;
61
- return a.value ? r && !["primary", "secondary", "success", "warning", "danger", "info"].includes(r) ? { color: r } : {} : r && !["primary", "secondary", "success", "warning", "danger", "info"].includes(r) ? e.iconBoxStyle === "transparent" ? { color: r } : e.variant === "solid" && !e.attached ? { backgroundColor: r, color: "#fff" } : { color: r, backgroundColor: `${r}20` } : {};
59
+ }), l = s(() => {
60
+ const n = e.item.color;
61
+ return o.value ? n && !["primary", "secondary", "success", "warning", "danger", "info"].includes(n) ? { color: n } : {} : n && !["primary", "secondary", "success", "warning", "danger", "info"].includes(n) ? e.iconBoxStyle === "transparent" ? { color: n } : e.variant === "solid" && !e.attached ? { backgroundColor: n, color: "#fff" } : { color: n, backgroundColor: `${n}20` } : {};
62
62
  });
63
- return (r, o) => !a.value && t.item.icon ? (d(), m("div", {
63
+ return (n, a) => !o.value && r.item.icon ? (u(), m("div", {
64
64
  key: 0,
65
- class: i(s.value),
66
- style: u(l.value)
65
+ class: c(i.value),
66
+ style: g(l.value)
67
67
  }, [
68
- x(g, {
69
- icon: t.item.icon,
70
- class: i(t.iconSize || "w-6 h-6")
68
+ x(f, {
69
+ icon: r.item.icon,
70
+ class: c(r.iconSize || "w-6 h-6")
71
71
  }, null, 8, ["icon", "class"])
72
- ], 6)) : a.value && t.item.icon ? (d(), p(g, {
72
+ ], 6)) : o.value && r.item.icon ? (u(), b(f, {
73
73
  key: 1,
74
- icon: t.item.icon,
75
- class: i([s.value, t.iconSize || "w-4.5 h-4.5"]),
76
- style: u(l.value)
77
- }, null, 8, ["icon", "class", "style"])) : k("", !0);
74
+ icon: r.item.icon,
75
+ class: c([i.value, r.iconSize || "w-4.5 h-4.5"]),
76
+ style: g(l.value)
77
+ }, null, 8, ["icon", "class", "style"])) : p("", !0);
78
78
  }
79
79
  });
80
80
  export {
81
- w as default
81
+ S as default
82
82
  };