vlite3 1.1.2 → 1.1.4

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 (87) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  2. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  3. package/components/Avatar.vue.js +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  5. package/components/Button.vue.js +30 -28
  6. package/components/Carousel/Carousel.vue.d.ts +2 -2
  7. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  8. package/components/CategoryManager/CategoryManager.vue.js +137 -118
  9. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  10. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  11. package/components/Chat/ChatBubble.vue.js +22 -22
  12. package/components/CheckBox.vue.js +29 -28
  13. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  14. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  15. package/components/ConfirmationModal.vue.js +30 -28
  16. package/components/CopyButton.vue.d.ts +50 -0
  17. package/components/CopyButton.vue.js +69 -0
  18. package/components/CopyButton.vue2.js +4 -0
  19. package/components/DataTable/DataTable.vue.js +44 -44
  20. package/components/DatePicker.vue.js +41 -35
  21. package/components/DateRangePicker.vue.js +18 -17
  22. package/components/Dropdown/Dropdown.vue.d.ts +3 -0
  23. package/components/Dropdown/Dropdown.vue.js +117 -115
  24. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  25. package/components/Dropdown/DropdownItem.vue.js +21 -20
  26. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  27. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  28. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  29. package/components/Dropdown/DropdownTrigger.vue.js +10 -6
  30. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  31. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  32. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  33. package/components/FilePicker/FilePicker.vue.js +93 -90
  34. package/components/Form/CustomFields.vue.js +2 -2
  35. package/components/Form/Form.vue.js +2 -2
  36. package/components/Form/Form.vue2.js +68 -64
  37. package/components/Form/FormField.vue.js +204 -148
  38. package/components/Form/FormFields.vue.js +2 -2
  39. package/components/Form/FormFields.vue2.js +28 -27
  40. package/components/Form/types.d.ts +2 -2
  41. package/components/Form/utils/form.utils.d.ts +3 -3
  42. package/components/Form/utils/form.utils.js +37 -37
  43. package/components/Input.vue.js +64 -62
  44. package/components/Invoice/Invoice.vue.js +9 -7
  45. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  46. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  47. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  48. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  49. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  50. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  51. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  52. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  53. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  54. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  55. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  56. package/components/Invoice/index.d.ts +1 -0
  57. package/components/Invoice/types.d.ts +22 -0
  58. package/components/Masonry/Masonry.vue.d.ts +1 -1
  59. package/components/Modal.vue.js +1 -1
  60. package/components/Modal.vue2.js +60 -54
  61. package/components/MultiSelect/MultiSelect.vue.js +47 -46
  62. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  63. package/components/NavbarCommandPalette.vue.js +1 -1
  64. package/components/NumberInput.vue.js +2 -2
  65. package/components/NumberInput.vue2.js +121 -116
  66. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  67. package/components/SidePanel.vue.js +2 -2
  68. package/components/SidePanel.vue2.js +58 -52
  69. package/components/Stats/StatItem.vue.js +96 -91
  70. package/components/Stats/types.d.ts +1 -0
  71. package/components/Switch.vue.d.ts +6 -1
  72. package/components/Switch.vue.js +61 -24
  73. package/components/TagInput/TagInput.vue.d.ts +187 -0
  74. package/components/TagInput/TagInput.vue.js +113 -0
  75. package/components/TagInput/TagInput.vue2.js +4 -0
  76. package/components/TagInput/index.d.ts +1 -0
  77. package/components/Textarea.vue.js +19 -18
  78. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  79. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  80. package/core/config.d.ts +36 -0
  81. package/index.d.ts +2 -0
  82. package/index.js +130 -124
  83. package/package.json +1 -1
  84. package/style.css +616 -1
  85. package/types/button.d.ts +1 -1
  86. package/types/styles.d.ts +1 -0
  87. package/utils/functions.js +9 -9
@@ -1,14 +1,15 @@
1
- import { defineComponent as w, computed as v, openBlock as e, createElementBlock as i, normalizeStyle as B, normalizeClass as a, Fragment as x, createElementVNode as r, toDisplayString as l, unref as m, createBlock as o, createCommentVNode as c } from "vue";
2
- import { $t as y } from "../../utils/i18n.js";
3
- import s from "./components/StatTrend.vue.js";
4
- import b from "./components/StatIconBox.vue.js";
5
- const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
1
+ import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as n, Fragment as b, createElementVNode as r, toDisplayString as o, unref as y, createBlock as c, createCommentVNode as d } from "vue";
2
+ import { $t as s } from "../../utils/i18n.js";
3
+ import { formatCurrency as C } from "../../utils/functions.js";
4
+ import f from "./components/StatTrend.vue.js";
5
+ import g from "./components/StatIconBox.vue.js";
6
+ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
6
7
  key: 0,
7
8
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
8
- }, j = {
9
+ }, N = {
9
10
  key: 0,
10
11
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
11
- }, $ = {
12
+ }, V = {
12
13
  key: 1,
13
14
  class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
14
15
  }, E = {
@@ -17,13 +18,13 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
17
18
  }, M = {
18
19
  key: 0,
19
20
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
20
- }, N = {
21
+ }, D = {
21
22
  key: 1,
22
23
  class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
23
- }, V = { class: "flex-1 flex flex-col justify-center min-w-0" }, D = { class: "flex items-baseline gap-2 mt-1" }, F = {
24
+ }, F = { class: "flex-1 flex flex-col justify-center min-w-0" }, L = { class: "flex items-baseline gap-2 mt-1" }, P = {
24
25
  key: 0,
25
26
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
26
- }, H = /* @__PURE__ */ w({
27
+ }, K = /* @__PURE__ */ B({
27
28
  __name: "StatItem",
28
29
  props: {
29
30
  item: {},
@@ -38,8 +39,12 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
38
39
  iconBoxStyle: { default: "filled" }
39
40
  },
40
41
  setup(t) {
41
- const n = t, k = v(() => {
42
- const d = n.layout === "inline-label-value" ? "flex px-3.5 py-3" : "flex p-3", f = {
42
+ const l = t;
43
+ function m(a) {
44
+ return a.isPrice ? C(Number(a.value)) : a.value;
45
+ }
46
+ const S = k(() => {
47
+ const a = l.layout === "inline-label-value" ? "flex px-3.5 py-3" : "flex p-3", x = {
43
48
  "icon-left": "flex-row items-center gap-3 text-left",
44
49
  "icon-right": "flex-row items-center justify-between gap-3 text-left",
45
50
  "icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
@@ -48,14 +53,14 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
48
53
  "floating-icon": "flex-col items-start gap-1 text-left relative",
49
54
  "split-bar": "flex-row items-center gap-3 text-left border-l-4",
50
55
  "inline-label-value": "flex-row items-center gap-2.5 text-left"
51
- }, g = f[n.layout] || f["icon-left"];
56
+ }, h = x[l.layout] || x["icon-left"];
52
57
  let u = "";
53
- if (n.attached)
54
- 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";
58
+ if (l.attached)
59
+ l.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : l.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";
55
60
  else {
56
- switch (n.variant) {
61
+ switch (l.variant) {
57
62
  case "solid": {
58
- const z = n.item.color || "primary", h = {
63
+ const w = l.item.color || "primary", v = {
59
64
  primary: "bg-primary-light",
60
65
  secondary: "bg-secondary",
61
66
  success: "bg-success-light",
@@ -63,7 +68,7 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
63
68
  danger: "bg-danger-light",
64
69
  info: "bg-info-light"
65
70
  };
66
- u = `${h[z] || h.primary}`;
71
+ u = `${v[w] || v.primary}`;
67
72
  break;
68
73
  }
69
74
  case "outline":
@@ -78,15 +83,15 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
78
83
  }
79
84
  u += " rounded-lg";
80
85
  }
81
- return [d, g, u].join(" ");
82
- }), S = v(() => {
83
- if (n.variant === "solid" && !n.attached) {
84
- const d = n.item.color;
85
- if (d && !["primary", "secondary", "success", "warning", "danger", "info"].includes(d))
86
- return { backgroundColor: `${d}15` };
86
+ return [a, h, u].join(" ");
87
+ }), z = k(() => {
88
+ if (l.variant === "solid" && !l.attached) {
89
+ const a = l.item.color;
90
+ if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
91
+ return { backgroundColor: `${a}15` };
87
92
  }
88
- if (n.layout === "split-bar") {
89
- const d = n.item.color, f = {
93
+ if (l.layout === "split-bar") {
94
+ const a = l.item.color, x = {
90
95
  primary: "var(--color-primary)",
91
96
  secondary: "var(--color-secondary)",
92
97
  success: "var(--color-success)",
@@ -94,32 +99,32 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
94
99
  danger: "var(--color-danger)",
95
100
  info: "var(--color-info)"
96
101
  };
97
- if (d)
98
- return { borderLeftColor: f[d] || d };
102
+ if (a)
103
+ return { borderLeftColor: x[a] || a };
99
104
  }
100
105
  return {};
101
106
  });
102
- return (d, f) => (e(), i("div", {
103
- class: a(k.value),
104
- style: B(S.value)
107
+ return (a, x) => (e(), i("div", {
108
+ class: n(S.value),
109
+ style: I(z.value)
105
110
  }, [
106
- t.layout === "title-top-icon-bottom-right" ? (e(), i(x, { key: 0 }, [
111
+ t.layout === "title-top-icon-bottom-right" ? (e(), i(b, { key: 0 }, [
107
112
  r("h3", {
108
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
109
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
110
- r("div", I, [
113
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
114
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
115
+ r("div", j, [
111
116
  r("div", null, [
112
- t.loading ? (e(), i("div", C)) : (e(), i("p", {
117
+ t.loading ? (e(), i("div", $)) : (e(), i("p", {
113
118
  key: 1,
114
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate")
115
- }, l(t.item.value), 3)),
116
- t.item.trend && !t.loading ? (e(), o(s, {
119
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
120
+ }, o(m(t.item)), 3)),
121
+ t.item.trend && !t.loading ? (e(), c(f, {
117
122
  key: 2,
118
123
  trend: t.item.trend,
119
124
  layout: t.layout
120
- }, null, 8, ["trend", "layout"])) : c("", !0)
125
+ }, null, 8, ["trend", "layout"])) : d("", !0)
121
126
  ]),
122
- t.item.icon ? (e(), o(b, {
127
+ t.item.icon ? (e(), c(g, {
123
128
  key: 0,
124
129
  item: t.item,
125
130
  variant: t.variant,
@@ -128,23 +133,23 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
128
133
  "icon-box-shape": t.iconBoxShape,
129
134
  "icon-box-style": t.iconBoxStyle,
130
135
  "icon-size": t.iconSize
131
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0)
136
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
132
137
  ])
133
- ], 64)) : t.layout === "centered-value-title" ? (e(), i(x, { key: 1 }, [
134
- t.loading ? (e(), i("div", j)) : (e(), i("p", {
138
+ ], 64)) : t.layout === "centered-value-title" ? (e(), i(b, { key: 1 }, [
139
+ t.loading ? (e(), i("div", N)) : (e(), i("p", {
135
140
  key: 1,
136
- class: a(t.valueSize || "text-3xl font-bold text-foreground")
137
- }, l(t.item.value), 3)),
141
+ class: n(t.valueSize || "text-3xl font-bold text-foreground")
142
+ }, o(m(t.item)), 3)),
138
143
  r("h3", {
139
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground")
140
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
141
- t.item.trend && !t.loading ? (e(), o(s, {
144
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground")
145
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
146
+ t.item.trend && !t.loading ? (e(), c(f, {
142
147
  key: 2,
143
148
  trend: t.item.trend,
144
149
  layout: t.layout
145
- }, null, 8, ["trend", "layout"])) : c("", !0)
146
- ], 64)) : t.layout === "floating-icon" ? (e(), i(x, { key: 2 }, [
147
- t.item.icon ? (e(), o(b, {
150
+ }, null, 8, ["trend", "layout"])) : d("", !0)
151
+ ], 64)) : t.layout === "floating-icon" ? (e(), i(b, { key: 2 }, [
152
+ t.item.icon ? (e(), c(g, {
148
153
  key: 0,
149
154
  item: t.item,
150
155
  variant: t.variant,
@@ -154,36 +159,36 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
154
159
  "icon-box-style": t.iconBoxStyle,
155
160
  "icon-size": t.iconSize,
156
161
  class: "absolute top-4 right-4"
157
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
162
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
158
163
  r("h3", {
159
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
160
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
161
- t.loading ? (e(), i("div", $)) : (e(), i("p", {
164
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
165
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
166
+ t.loading ? (e(), i("div", V)) : (e(), i("p", {
162
167
  key: 2,
163
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
164
- }, l(t.item.value), 3)),
165
- t.item.trend && !t.loading ? (e(), o(s, {
168
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
169
+ }, o(m(t.item)), 3)),
170
+ t.item.trend && !t.loading ? (e(), c(f, {
166
171
  key: 3,
167
172
  trend: t.item.trend,
168
173
  layout: t.layout
169
- }, null, 8, ["trend", "layout"])) : c("", !0)
174
+ }, null, 8, ["trend", "layout"])) : d("", !0)
170
175
  ], 64)) : t.layout === "split-bar" ? (e(), i("div", E, [
171
176
  r("h3", {
172
- class: a(
177
+ class: n(
173
178
  t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
174
179
  )
175
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
180
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
176
181
  t.loading ? (e(), i("div", M)) : (e(), i("p", {
177
182
  key: 1,
178
- class: a(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
179
- }, l(t.item.value), 3)),
180
- t.item.trend && !t.loading ? (e(), o(s, {
183
+ class: n(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
184
+ }, o(m(t.item)), 3)),
185
+ t.item.trend && !t.loading ? (e(), c(f, {
181
186
  key: 2,
182
187
  trend: t.item.trend,
183
188
  layout: t.layout
184
- }, null, 8, ["trend", "layout"])) : c("", !0)
185
- ])) : t.layout === "inline-label-value" ? (e(), i(x, { key: 4 }, [
186
- t.item.icon ? (e(), o(b, {
189
+ }, null, 8, ["trend", "layout"])) : d("", !0)
190
+ ])) : t.layout === "inline-label-value" ? (e(), i(b, { key: 4 }, [
191
+ t.item.icon ? (e(), c(g, {
187
192
  key: 0,
188
193
  item: t.item,
189
194
  variant: t.variant,
@@ -192,21 +197,21 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
192
197
  "icon-box-shape": t.iconBoxShape,
193
198
  "icon-box-style": t.iconBoxStyle,
194
199
  "icon-size": t.iconSize
195
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
200
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
196
201
  r("span", {
197
- class: a([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
198
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
199
- t.loading ? (e(), i("div", N)) : (e(), i("span", {
202
+ class: n([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
203
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
204
+ t.loading ? (e(), i("div", D)) : (e(), i("span", {
200
205
  key: 2,
201
- class: a(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
202
- }, l(t.item.value), 3)),
203
- t.item.trend && !t.loading ? (e(), o(s, {
206
+ class: n(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
207
+ }, o(m(t.item)), 3)),
208
+ t.item.trend && !t.loading ? (e(), c(f, {
204
209
  key: 3,
205
210
  trend: t.item.trend,
206
211
  layout: t.layout
207
- }, null, 8, ["trend", "layout"])) : c("", !0)
208
- ], 64)) : (e(), i(x, { key: 5 }, [
209
- t.item.icon && t.layout !== "icon-right" ? (e(), o(b, {
212
+ }, null, 8, ["trend", "layout"])) : d("", !0)
213
+ ], 64)) : (e(), i(b, { key: 5 }, [
214
+ t.item.icon && t.layout !== "icon-right" ? (e(), c(g, {
210
215
  key: 0,
211
216
  item: t.item,
212
217
  variant: t.variant,
@@ -215,24 +220,24 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
215
220
  "icon-box-shape": t.iconBoxShape,
216
221
  "icon-box-style": t.iconBoxStyle,
217
222
  "icon-size": t.iconSize
218
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
219
- r("div", V, [
223
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
224
+ r("div", F, [
220
225
  r("h3", {
221
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
222
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
223
- r("div", D, [
224
- t.loading ? (e(), i("div", F)) : (e(), i("p", {
226
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
227
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
228
+ r("div", L, [
229
+ t.loading ? (e(), i("div", P)) : (e(), i("p", {
225
230
  key: 1,
226
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate")
227
- }, l(t.item.value), 3))
231
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
232
+ }, o(m(t.item)), 3))
228
233
  ]),
229
- t.item.trend && !t.loading ? (e(), o(s, {
234
+ t.item.trend && !t.loading ? (e(), c(f, {
230
235
  key: 0,
231
236
  trend: t.item.trend,
232
237
  layout: t.layout
233
- }, null, 8, ["trend", "layout"])) : c("", !0)
238
+ }, null, 8, ["trend", "layout"])) : d("", !0)
234
239
  ]),
235
- t.item.icon && t.layout === "icon-right" ? (e(), o(b, {
240
+ t.item.icon && t.layout === "icon-right" ? (e(), c(g, {
236
241
  key: 1,
237
242
  item: t.item,
238
243
  variant: t.variant,
@@ -241,11 +246,11 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
241
246
  "icon-box-shape": t.iconBoxShape,
242
247
  "icon-box-style": t.iconBoxStyle,
243
248
  "icon-size": t.iconSize
244
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0)
249
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
245
250
  ], 64))
246
251
  ], 6));
247
252
  }
248
253
  });
249
254
  export {
250
- H as default
255
+ K as default
251
256
  };
@@ -12,6 +12,7 @@ export interface StatItemSchema {
12
12
  title: string;
13
13
  titleI18n?: string;
14
14
  value: string | number;
15
+ isPrice?: boolean;
15
16
  icon?: string;
16
17
  color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | string;
17
18
  trend?: StatTrend;
@@ -1,8 +1,12 @@
1
+ type SwitchVariant = 'basic' | 'card';
1
2
  interface Props {
2
3
  modelValue?: boolean;
3
4
  disabled?: boolean;
4
5
  label?: string;
5
6
  labelI18n?: string;
7
+ description?: string;
8
+ descriptionI18n?: string;
9
+ variant?: SwitchVariant;
6
10
  class?: string;
7
11
  id?: string;
8
12
  }
@@ -12,7 +16,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
12
16
  "onUpdate:modelValue"?: (value: boolean) => any;
13
17
  }>, {
14
18
  class: string;
19
+ variant: SwitchVariant;
15
20
  disabled: boolean;
16
21
  modelValue: boolean;
17
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
23
  export default _default;
@@ -1,47 +1,84 @@
1
- import { defineComponent as u, computed as c, openBlock as n, createElementBlock as i, createElementVNode as r, normalizeClass as t, toDisplayString as m, createCommentVNode as b } from "vue";
2
- import { $t as f } from "../utils/i18n.js";
3
- const p = { class: "flex items-center gap-2" }, g = ["id", "aria-checked", "aria-label", "disabled"], v = /* @__PURE__ */ u({
1
+ import { defineComponent as h, computed as b, openBlock as n, createElementBlock as s, normalizeClass as i, createElementVNode as o, toDisplayString as d, createCommentVNode as u, withModifiers as v } from "vue";
2
+ import { $t as m } from "../utils/i18n.js";
3
+ const w = { class: "flex flex-col gap-0.5 min-w-0" }, p = {
4
+ key: 0,
5
+ class: "text-sm font-medium text-foreground leading-snug select-none"
6
+ }, k = {
7
+ key: 1,
8
+ class: "text-xs text-muted-foreground leading-snug select-none"
9
+ }, y = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], x = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], I = /* @__PURE__ */ h({
4
10
  __name: "Switch",
5
11
  props: {
6
12
  modelValue: { type: Boolean, default: !1 },
7
13
  disabled: { type: Boolean, default: !1 },
8
14
  label: {},
9
15
  labelI18n: {},
16
+ description: {},
17
+ descriptionI18n: {},
18
+ variant: { default: "basic" },
10
19
  class: { default: "" },
11
20
  id: {}
12
21
  },
13
22
  emits: ["update:modelValue"],
14
- setup(e, { emit: s }) {
15
- const l = e, d = s, o = () => {
16
- l.disabled || d("update:modelValue", !l.modelValue);
17
- }, a = c(() => l.labelI18n ? f(l.labelI18n) : l.label);
18
- return (h, k) => (n(), i("div", p, [
19
- r("button", {
23
+ setup(e, { emit: f }) {
24
+ const a = e, g = f, r = () => {
25
+ a.disabled || g("update:modelValue", !a.modelValue);
26
+ }, t = b(() => a.labelI18n ? m(a.labelI18n) : a.label), c = b(
27
+ () => a.descriptionI18n ? m(a.descriptionI18n) : a.description
28
+ );
29
+ return (l, $) => e.variant === "card" ? (n(), s("div", {
30
+ key: 0,
31
+ class: i(["flex items-start justify-between gap-4 w-full rounded-md border border-border bg-background px-4 py-3 cursor-pointer", e.disabled ? "opacity-50 pointer-events-none" : ""]),
32
+ onClick: r
33
+ }, [
34
+ o("div", w, [
35
+ t.value ? (n(), s("span", p, d(t.value), 1)) : u("", !0),
36
+ c.value ? (n(), s("span", k, d(c.value), 1)) : u("", !0)
37
+ ]),
38
+ o("button", {
20
39
  id: e.id,
21
40
  type: "button",
22
41
  role: "switch",
23
42
  "aria-checked": e.modelValue,
24
- "aria-label": a.value || "Toggle",
43
+ "aria-label": t.value || "Toggle",
25
44
  disabled: e.disabled,
26
- class: t(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", [e.modelValue ? "bg-primary" : "bg-input", l.class]]),
27
- onClick: o
45
+ class: i(["relative mt-0.5 inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
46
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
47
+ onClick: v(r, ["stop"])
28
48
  }, [
29
- r("span", {
49
+ o("span", {
30
50
  "aria-hidden": "true",
31
- class: t([
32
- "pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out",
33
- e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"
34
- ])
51
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
35
52
  }, null, 2)
36
- ], 10, g),
37
- a.value ? (n(), i("label", {
53
+ ], 10, y)
54
+ ], 2)) : (n(), s("div", {
55
+ key: 1,
56
+ class: i(["inline-flex items-center gap-2", a.class])
57
+ }, [
58
+ o("button", {
59
+ id: e.id,
60
+ type: "button",
61
+ role: "switch",
62
+ "aria-checked": e.modelValue,
63
+ "aria-label": t.value || "Toggle",
64
+ disabled: e.disabled,
65
+ class: i(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
66
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
67
+ onClick: r
68
+ }, [
69
+ o("span", {
70
+ "aria-hidden": "true",
71
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
72
+ }, null, 2)
73
+ ], 10, x),
74
+ t.value ? (n(), s("label", {
38
75
  key: 0,
39
- class: t([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
40
- onClick: o
41
- }, m(a.value), 3)) : b("", !0)
42
- ]));
76
+ class: i([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
77
+ onClick: r
78
+ }, d(t.value), 3)) : u("", !0)
79
+ ], 2));
43
80
  }
44
81
  });
45
82
  export {
46
- v as default
83
+ I as default
47
84
  };