vlite3 0.4.6 → 0.4.7

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 (108) hide show
  1. package/components/Accordion/AccordionItem.vue.js +33 -32
  2. package/components/Accordion/types.d.ts +2 -0
  3. package/components/Alert.vue.d.ts +2 -0
  4. package/components/Alert.vue.js +38 -36
  5. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  6. package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
  7. package/components/Button.vue.d.ts +1 -1
  8. package/components/Button.vue.js +37 -35
  9. package/components/CheckBox.vue.d.ts +1 -0
  10. package/components/CheckBox.vue.js +40 -40
  11. package/components/Chip/Chip.vue.js +55 -55
  12. package/components/Chip/types.d.ts +1 -0
  13. package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
  14. package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
  15. package/components/ColorPicker/ColorPicker.vue.js +3 -2
  16. package/components/ConfirmationModal.vue.d.ts +4 -2
  17. package/components/ConfirmationModal.vue.js +48 -33
  18. package/components/DataList/DataList.vue.d.ts +0 -2
  19. package/components/DataList/DataList.vue.js +39 -35
  20. package/components/DataList/types.d.ts +2 -0
  21. package/components/DataTable/DataTable.vue.d.ts +0 -5
  22. package/components/DataTable/DataTable.vue.js +177 -158
  23. package/components/DataTable/DataTableHeader.vue.js +15 -14
  24. package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
  25. package/components/DataTable/DataTableToolbar.vue.js +30 -23
  26. package/components/DataTable/types.d.ts +4 -0
  27. package/components/DatePicker.vue.d.ts +1 -0
  28. package/components/DatePicker.vue.js +32 -25
  29. package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
  30. package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
  31. package/components/Dropdown/DropdownItem.vue.js +24 -23
  32. package/components/Dropdown/DropdownMenu.vue.js +100 -91
  33. package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
  34. package/components/Dropdown/composables/useDropdownSelection.js +19 -17
  35. package/components/Empty/Empty.vue.d.ts +2 -2
  36. package/components/Empty/Empty.vue.js +32 -18
  37. package/components/FilePicker/FilePicker.vue.d.ts +3 -1
  38. package/components/FilePicker/FilePicker.vue.js +140 -127
  39. package/components/FileTree/FileTree.vue.js +68 -58
  40. package/components/FileTree/FileTreeNode.vue.js +35 -34
  41. package/components/FileTree/types.d.ts +3 -0
  42. package/components/Form/CustomFields.vue.d.ts +3 -1
  43. package/components/Form/CustomFields.vue.js +2 -2
  44. package/components/Form/CustomFields.vue2.js +92 -80
  45. package/components/Form/Form.vue.d.ts +1 -1
  46. package/components/Form/FormField.vue.d.ts +1 -1
  47. package/components/Form/FormField.vue.js +60 -59
  48. package/components/Form/FormFields.vue.js +2 -2
  49. package/components/Form/FormFields.vue2.js +58 -57
  50. package/components/Form/composables/useForm.js +84 -79
  51. package/components/Form/types.d.ts +4 -0
  52. package/components/GoogleLogin.vue.d.ts +1 -1
  53. package/components/GoogleLogin.vue.js +39 -32
  54. package/components/Heatmap/Heatmap.vue2.js +3 -2
  55. package/components/IconPicker.vue.d.ts +2 -0
  56. package/components/IconPicker.vue.js +37 -29
  57. package/components/Input.vue.d.ts +1 -1
  58. package/components/Input.vue.js +96 -98
  59. package/components/Kanban/KanbanBoard.vue.js +1 -1
  60. package/components/Kanban/KanbanBoard.vue2.js +55 -54
  61. package/components/Kanban/types.d.ts +1 -0
  62. package/components/Masonry/Masonry.vue2.js +3 -2
  63. package/components/Modal.vue.d.ts +2 -0
  64. package/components/Modal.vue.js +62 -57
  65. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  66. package/components/MultiSelect/MultiSelect.vue.js +61 -54
  67. package/components/Navbar/Navbar.vue.js +46 -46
  68. package/components/Pagination/Pagination.vue.js +116 -97
  69. package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
  70. package/components/PricingPlan/types.d.ts +5 -0
  71. package/components/Screen/Screen.vue.d.ts +0 -4
  72. package/components/Screen/Screen.vue.js +231 -189
  73. package/components/Screen/ScreenFilter.vue.js +73 -63
  74. package/components/Screen/types.d.ts +5 -0
  75. package/components/SidePanel.vue.d.ts +2 -0
  76. package/components/SidePanel.vue.js +140 -5
  77. package/components/SidePanel.vue2.js +2 -135
  78. package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
  79. package/components/SidebarMenu/types.d.ts +1 -0
  80. package/components/Slider.vue.d.ts +1 -0
  81. package/components/Slider.vue.js +71 -69
  82. package/components/Switch.vue.d.ts +1 -0
  83. package/components/Switch.vue.js +23 -18
  84. package/components/Tabes/Tabes.vue.js +20 -19
  85. package/components/Tabes/types.d.ts +1 -0
  86. package/components/Textarea.vue.d.ts +1 -0
  87. package/components/Textarea.vue.js +18 -16
  88. package/components/ThemeToggle.vue.js +24 -14
  89. package/components/Timeline.vue.js +68 -82
  90. package/components/ToastNotification.vue.js +2 -2
  91. package/components/Tooltip.vue.d.ts +4 -3
  92. package/components/Tooltip.vue.js +17 -15
  93. package/components/Workbook/Sheet.vue.js +80 -71
  94. package/components/Workbook/WorkbookAddButton.vue.js +14 -10
  95. package/components/Workbook/types.d.ts +1 -0
  96. package/core/config.d.ts +2 -0
  97. package/index.d.ts +1 -0
  98. package/index.js +28 -26
  99. package/package.json +1 -1
  100. package/style.css +1 -2
  101. package/types/button.d.ts +1 -0
  102. package/types/config.type.d.ts +10 -0
  103. package/types/form.type.d.ts +2 -0
  104. package/types/styles.d.ts +3 -0
  105. package/types/timeline.type.d.ts +2 -0
  106. package/utils/i18n.d.ts +8 -0
  107. package/utils/i18n.js +5 -0
  108. package/utils/index.d.ts +1 -0
@@ -1,10 +1,11 @@
1
- import { defineComponent as I, computed as c, openBlock as l, createElementBlock as m, normalizeClass as u, renderSlot as b, createVNode as f, withCtx as x, createElementVNode as k, toDisplayString as h, createCommentVNode as v, withDirectives as z, createBlock as B, resolveDynamicComponent as V, vShow as O } from "vue";
2
- import A from "./AccordionTrigger.vue.js";
3
- import P from "./AccordionContent.vue.js";
4
- const T = { class: "font-medium" }, D = {
1
+ import { defineComponent as B, computed as r, openBlock as c, createElementBlock as m, normalizeClass as u, renderSlot as f, createVNode as p, withCtx as v, createElementVNode as V, toDisplayString as x, createCommentVNode as $, withDirectives as O, createBlock as T, resolveDynamicComponent as A, vShow as D } from "vue";
2
+ import P from "./AccordionTrigger.vue.js";
3
+ import N from "./AccordionContent.vue.js";
4
+ import { $t as h } from "../../utils/i18n.js";
5
+ const S = { class: "font-medium" }, E = {
5
6
  key: 0,
6
7
  class: "ml-2 text-sm text-muted-foreground font-normal"
7
- }, N = ["innerHTML"], M = /* @__PURE__ */ I({
8
+ }, H = ["innerHTML"], G = /* @__PURE__ */ B({
8
9
  __name: "AccordionItem",
9
10
  props: {
10
11
  item: {},
@@ -25,13 +26,13 @@ const T = { class: "font-medium" }, D = {
25
26
  class: { default: "" }
26
27
  },
27
28
  emits: ["toggle"],
28
- setup(e, { emit: $ }) {
29
- const n = e, p = $, r = () => {
30
- n.item.disabled || n.disabled || p("toggle", n.item.id);
31
- }, C = c(() => {
29
+ setup(e, { emit: C }) {
30
+ const n = e, y = C, l = () => {
31
+ n.item.disabled || n.disabled || y("toggle", n.item.id);
32
+ }, I = r(() => {
32
33
  const { variant: t, attached: a } = n;
33
34
  return a ? "transition-all first:rounded-t-lg last:rounded-b-lg border-b last:border-0" : t === "solid" ? "mb-2 border rounded-lg overflow-hidden transition-all duration-200" : t === "outline" ? "border mb-2 rounded-lg overflow-hidden" : t === "separated" ? "border mb-4 rounded-lg overflow-hidden" : t === "ghost" ? "border-none bg-transparent mb-1 rounded-lg overflow-hidden" : "border-b";
34
- }), g = c(() => {
35
+ }), g = r(() => {
35
36
  const { variant: t, size: a, isOpen: d } = n, i = n.triggerClass || "", o = "transition-all duration-200 ease-in-out", s = {
36
37
  sm: "px-3.5 py-2.5 text-sm",
37
38
  md: "px-4 py-3 text-base",
@@ -42,7 +43,7 @@ const T = { class: "font-medium" }, D = {
42
43
  md: "py-3 text-base",
43
44
  lg: "py-4 text-lg"
44
45
  }[a]} px-0 hover:no-underline ${o}` : `${i} ${s} hover:bg-muted/5 ${o}`;
45
- }), y = c(() => {
46
+ }), w = r(() => {
46
47
  const { variant: t, size: a, attached: d } = n, i = n.contentClass || "", o = {
47
48
  sm: "px-3.5 pb-3.5 pt-2.5 text-sm",
48
49
  md: "px-4 pb-4 pt-4 text-sm",
@@ -53,17 +54,17 @@ const T = { class: "font-medium" }, D = {
53
54
  md: "pb-4 pt-4 text-sm",
54
55
  lg: "pb-5 pt-5 text-base"
55
56
  }[a]} px-0`;
56
- });
57
- return (t, a) => (l(), m("div", {
58
- class: u([C.value, n.class, n.itemClass])
57
+ }), k = r(() => n.item.titleI18n ? h(n.item.titleI18n) : n.item.title), b = r(() => n.item.descriptionI18n ? h(n.item.descriptionI18n) : n.item.description);
58
+ return (t, a) => (c(), m("div", {
59
+ class: u([I.value, n.class, n.itemClass])
59
60
  }, [
60
- b(t.$slots, "trigger", {
61
+ f(t.$slots, "trigger", {
61
62
  item: e.item,
62
63
  open: e.isOpen,
63
- toggle: r,
64
+ toggle: l,
64
65
  triggerClass: g.value
65
66
  }, () => [
66
- f(A, {
67
+ p(P, {
67
68
  open: e.isOpen,
68
69
  size: e.size,
69
70
  disabled: e.item.disabled || e.disabled,
@@ -75,41 +76,41 @@ const T = { class: "font-medium" }, D = {
75
76
  "icon-variant": e.iconVariant,
76
77
  "active-icon-variant": e.activeIconVariant,
77
78
  class: u(g.value),
78
- onClick: r
79
+ onClick: l
79
80
  }, {
80
- default: x(() => [
81
- k("span", T, h(e.item.title), 1),
82
- e.item.description ? (l(), m("span", D, h(e.item.description), 1)) : v("", !0)
81
+ default: v(() => [
82
+ V("span", S, x(k.value), 1),
83
+ b.value ? (c(), m("span", E, x(b.value), 1)) : $("", !0)
83
84
  ]),
84
85
  _: 1
85
86
  }, 8, ["open", "size", "disabled", "icon", "index", "show-index", "open-icon", "close-icon", "icon-variant", "active-icon-variant", "class"])
86
87
  ]),
87
- z(f(P, {
88
- class: u(y.value)
88
+ O(p(N, {
89
+ class: u(w.value)
89
90
  }, {
90
- default: x(() => [
91
- b(t.$slots, "content", {
91
+ default: v(() => [
92
+ f(t.$slots, "content", {
92
93
  item: e.item,
93
- close: r
94
+ close: l
94
95
  }, () => [
95
- e.item.bodyComponent ? (l(), B(V(e.item.bodyComponent), {
96
+ e.item.bodyComponent ? (c(), T(A(e.item.bodyComponent), {
96
97
  key: 0,
97
98
  item: e.item,
98
- close: r
99
- }, null, 8, ["item"])) : e.item.content ? (l(), m("div", {
99
+ close: l
100
+ }, null, 8, ["item"])) : e.item.content ? (c(), m("div", {
100
101
  key: 1,
101
102
  class: "text-muted-foreground leading-relaxed",
102
103
  innerHTML: e.item.content
103
- }, null, 8, N)) : v("", !0)
104
+ }, null, 8, H)) : $("", !0)
104
105
  ])
105
106
  ]),
106
107
  _: 3
107
108
  }, 8, ["class"]), [
108
- [O, e.isOpen]
109
+ [D, e.isOpen]
109
110
  ])
110
111
  ], 2));
111
112
  }
112
113
  });
113
114
  export {
114
- M as default
115
+ G as default
115
116
  };
@@ -5,7 +5,9 @@ export type IconVariant = 'simple' | 'solid' | 'outline' | 'primary' | 'ghost';
5
5
  export interface AccordionItemSchema {
6
6
  id: string;
7
7
  title: string;
8
+ titleI18n?: string;
8
9
  description?: string;
10
+ descriptionI18n?: string;
9
11
  content?: string;
10
12
  icon?: string;
11
13
  disabled?: boolean;
@@ -1,7 +1,9 @@
1
1
  import { AlertVariant } from '../types';
2
2
  interface Props {
3
3
  title?: string;
4
+ titleI18n?: string;
4
5
  description?: string;
6
+ descriptionI18n?: string;
5
7
  icon?: string;
6
8
  variant?: AlertVariant;
7
9
  closable?: boolean;
@@ -1,13 +1,16 @@
1
- import { defineComponent as C, ref as V, computed as a, useSlots as $, openBlock as n, createElementBlock as i, normalizeClass as r, renderSlot as d, createBlock as B, createCommentVNode as o, createElementVNode as g, toDisplayString as v, createTextVNode as N, createVNode as S } from "vue";
2
- import m from "./Icon.vue.js";
3
- const j = ["role"], E = {
1
+ import { defineComponent as V, ref as B, computed as t, useSlots as N, openBlock as a, createElementBlock as i, normalizeClass as r, renderSlot as p, createBlock as S, createCommentVNode as o, createElementVNode as v, toDisplayString as m, createTextVNode as T, createVNode as j } from "vue";
2
+ import f from "./Icon.vue.js";
3
+ import { $t as y } from "../utils/i18n.js";
4
+ const D = ["role"], E = {
4
5
  key: 1,
5
6
  class: "text-sm opacity-90 [&_p]:leading-relaxed"
6
- }, A = /* @__PURE__ */ C({
7
+ }, R = /* @__PURE__ */ V({
7
8
  __name: "Alert",
8
9
  props: {
9
10
  title: {},
11
+ titleI18n: {},
10
12
  description: {},
13
+ descriptionI18n: {},
11
14
  icon: {},
12
15
  variant: { default: "primary" },
13
16
  closable: { type: Boolean, default: !1 },
@@ -15,70 +18,69 @@ const j = ["role"], E = {
15
18
  class: { default: "" }
16
19
  },
17
20
  emits: ["close"],
18
- setup(e, { emit: f }) {
19
- const t = e, p = f, c = V(!0), y = () => {
20
- c.value = !1, p("close");
21
- }, b = a(() => ({
21
+ setup(s, { emit: b }) {
22
+ const e = s, k = b, u = B(!0), x = () => {
23
+ u.value = !1, k("close");
24
+ }, d = t(() => e.titleI18n ? y(e.titleI18n) : e.title), c = t(() => e.descriptionI18n ? y(e.descriptionI18n) : e.description), h = t(() => ({
22
25
  primary: "bg-primary-light text-primary border-primary/15",
23
26
  success: "bg-success-light text-success-dark border-success/25",
24
27
  warning: "bg-warning-light text-warning-dark border-warning/20",
25
28
  danger: "bg-danger-light text-danger-dark border-danger/15"
26
- })[t.variant]), k = a(() => ({
29
+ })[e.variant]), w = t(() => ({
27
30
  primary: "text-primary!",
28
31
  success: "text-success-dark!",
29
32
  warning: "text-warning-dark!",
30
33
  danger: "text-danger-dark!"
31
- })[t.variant]), l = a(() => !t.description && !$().default), x = a(() => [
34
+ })[e.variant]), l = t(() => !c.value && !N().default), C = t(() => [
32
35
  "relative w-full rounded-lg border px-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:text-foreground",
33
36
  l.value ? "py-3" : "pt-4 pb-2",
34
- // Icon Position: Center vertically if title only, otherwise top-4
35
37
  l.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 top-4 [&>svg+div]:translate-y-[-3px]",
36
- b.value,
37
- t.class
38
- ].join(" ")), h = a(() => [
38
+ h.value,
39
+ e.class
40
+ ].join(" ")), I = t(() => [
39
41
  "font-medium leading-none tracking-tight text-inherit!",
40
42
  l.value ? "" : "mb-1"
41
- ].join(" ")), w = a(() => t.role ? t.role : ["danger", "warning"].includes(t.variant) ? "alert" : "status");
42
- return (s, u) => c.value ? (n(), i("div", {
43
+ ].join(" ")), $ = t(() => e.role ? e.role : ["danger", "warning"].includes(e.variant) ? "alert" : "status");
44
+ return (n, g) => u.value ? (a(), i("div", {
43
45
  key: 0,
44
- class: r(x.value),
45
- role: w.value
46
+ class: r(C.value),
47
+ role: $.value
46
48
  }, [
47
- d(s.$slots, "icon", {}, () => [
48
- e.icon ? (n(), B(m, {
49
+ p(n.$slots, "icon", {}, () => [
50
+ s.icon ? (a(), S(f, {
49
51
  key: 0,
50
- icon: e.icon,
51
- class: r(["h-4 w-4", k.value])
52
+ icon: s.icon,
53
+ class: r(["h-4 w-4", w.value])
52
54
  }, null, 8, ["icon", "class"])) : o("", !0)
53
55
  ]),
54
- g("div", {
55
- class: r({ "pl-7": e.icon || s.$slots.icon, "pr-6": e.closable })
56
+ v("div", {
57
+ class: r({ "pl-7": s.icon || n.$slots.icon, "pr-6": s.closable })
56
58
  }, [
57
- e.title ? (n(), i("h5", {
59
+ d.value ? (a(), i("h5", {
58
60
  key: 0,
59
- class: r(h.value)
60
- }, v(e.title), 3)) : o("", !0),
61
- e.description || s.$slots.default ? (n(), i("div", E, [
62
- d(s.$slots, "default", {}, () => [
63
- N(v(e.description), 1)
61
+ class: r(I.value)
62
+ }, m(d.value), 3)) : o("", !0),
63
+ c.value || n.$slots.default ? (a(), i("div", E, [
64
+ p(n.$slots, "default", {}, () => [
65
+ T(m(c.value), 1)
64
66
  ])
65
67
  ])) : o("", !0)
66
68
  ], 2),
67
- e.closable ? (n(), i("button", {
69
+ s.closable ? (a(), i("button", {
68
70
  key: 0,
69
71
  type: "button",
70
- onClick: y,
72
+ onClick: x,
71
73
  class: r(["absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", [l.value ? "top-1/2 -translate-y-1/2" : "top-4"]])
72
74
  }, [
73
- S(m, {
75
+ j(f, {
74
76
  icon: "lucide:x",
75
77
  class: "h-4 w-4"
76
78
  }),
77
- u[0] || (u[0] = g("span", { class: "sr-only" }, "Close", -1))
79
+ g[0] || (g[0] = v("span", { class: "sr-only" }, "Close", -1))
78
80
  ], 2)) : o("", !0)
79
- ], 10, j)) : o("", !0);
81
+ ], 10, D)) : o("", !0);
80
82
  }
81
83
  });
82
84
  export {
83
- A as default
85
+ R as default
84
86
  };
@@ -25,8 +25,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
25
25
  alt: string;
26
26
  size: AvatarSize;
27
27
  modelValue: any;
28
- loading: boolean;
29
28
  rounded: AvatarRounded;
29
+ loading: boolean;
30
30
  editable: boolean;
31
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
32
32
  export default _default;
@@ -1,7 +1,7 @@
1
- import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as r, createElementVNode as f, normalizeClass as o, createVNode as n, withCtx as C, createCommentVNode as g, withModifiers as A } from "vue";
1
+ import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as r, createElementVNode as b, normalizeClass as o, createVNode as n, withCtx as V, createCommentVNode as g, withModifiers as C } from "vue";
2
2
  import c from "../Icon.vue.js";
3
3
  import U from "../FilePicker/FilePicker.vue.js";
4
- import V from "../Avatar.vue.js";
4
+ import A from "../Avatar.vue.js";
5
5
  const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
6
6
  name: "AvatarUploader",
7
7
  __name: "AvatarUploader",
@@ -19,39 +19,40 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
19
19
  },
20
20
  emits: ["update:modelValue", "change", "error"],
21
21
  setup(e, { emit: v }) {
22
- const l = e, t = v, d = w(null), m = z(() => {
22
+ const a = e, t = v, d = w(null), m = z(() => {
23
23
  if (d.value) return d.value;
24
- if (typeof l.modelValue == "string") return l.modelValue;
25
- if (l.modelValue && l.modelValue.base64) return l.modelValue.base64;
26
- if (l.modelValue && l.modelValue.file instanceof File)
24
+ if (typeof a.modelValue == "string") return a.modelValue;
25
+ if (a.modelValue && a.modelValue.fileUrl) return a.modelValue.fileUrl;
26
+ if (a.modelValue && a.modelValue.base64) return a.modelValue.base64;
27
+ if (a.modelValue && a.modelValue.file instanceof File)
27
28
  try {
28
- return URL.createObjectURL(l.modelValue.file);
29
+ return URL.createObjectURL(a.modelValue.file);
29
30
  } catch {
30
31
  }
31
32
  return null;
32
- }), h = (a) => {
33
- if (!a || Array.isArray(a)) {
34
- Array.isArray(a) && a.length === 0 && b();
33
+ }), h = (l) => {
34
+ if (!l || Array.isArray(l)) {
35
+ Array.isArray(l) && l.length === 0 && f();
35
36
  return;
36
37
  }
37
- if (a.base64)
38
- d.value = a.base64, t("update:modelValue", a.base64);
39
- else if (a.file)
38
+ if (l.base64)
39
+ d.value = l.base64, t("update:modelValue", l.base64);
40
+ else if (l.file)
40
41
  try {
41
- d.value = URL.createObjectURL(a.file), t("update:modelValue", a);
42
+ d.value = URL.createObjectURL(l.file), t("update:modelValue", l);
42
43
  } catch {
43
44
  }
44
- t("change", a);
45
- }, y = (a) => {
46
- t("error", a);
47
- }, b = () => {
45
+ t("change", l);
46
+ }, y = (l) => {
47
+ t("error", l);
48
+ }, f = () => {
48
49
  d.value = null, t("update:modelValue", null), t("change", null);
49
50
  };
50
- return (a, u) => (i(), r("div", R, [
51
- f("div", {
51
+ return (l, u) => (i(), r("div", R, [
52
+ b("div", {
52
53
  class: o(["relative inline-block group", e.rounded === "full" ? "rounded-full" : "rounded-md"])
53
54
  }, [
54
- n(V, {
55
+ n(A, {
55
56
  src: m.value || void 0,
56
57
  fallback: e.fallback,
57
58
  alt: e.alt,
@@ -68,8 +69,8 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
68
69
  onChange: u[0] || (u[0] = (s) => h(s)),
69
70
  onError: y
70
71
  }, {
71
- trigger: C(({ trigger: s, isLoading: k }) => [
72
- f("button", {
72
+ trigger: V(({ trigger: s, isLoading: k }) => [
73
+ b("button", {
73
74
  type: "button",
74
75
  class: o(["absolute inset-0 cursor-pointer", { "cursor-default": !e.editable || e.disabled }]),
75
76
  onClick: (B) => e.editable && !e.disabled ? s() : null
@@ -99,7 +100,7 @@ const R = { class: "inline-block" }, j = ["onClick"], F = /* @__PURE__ */ x({
99
100
  key: 0,
100
101
  type: "button",
101
102
  class: "absolute -top-1 -right-1 z-10 p-1 bg-background border border-border rounded-full text-muted-foreground shadow-sm hover:text-destructive hover:border-destructive transition-all opacity-0 group-hover:opacity-100 scale-75 group-hover:scale-100",
102
- onClick: A(b, ["stop"]),
103
+ onClick: C(f, ["stop"]),
103
104
  title: "Remove image"
104
105
  }, [
105
106
  n(c, {
@@ -15,8 +15,8 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
15
15
  class: any;
16
16
  size: ButtonSize;
17
17
  variant: ButtonVariant;
18
- loading: boolean;
19
18
  rounded: ButtonRounded;
19
+ loading: boolean;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
21
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
22
  export default _default;
@@ -1,7 +1,8 @@
1
- import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as i, createBlock as d, createCommentVNode as h, renderSlot as m, createTextVNode as f, toDisplayString as b, unref as G } from "vue";
2
- import u from "./Icon.vue.js";
1
+ import { defineComponent as B, computed as s, useSlots as R, inject as S, withDirectives as G, openBlock as o, createElementBlock as h, normalizeClass as i, createBlock as d, createCommentVNode as m, renderSlot as f, createTextVNode as x, toDisplayString as b, unref as $ } from "vue";
2
+ import g from "./Icon.vue.js";
3
3
  import { vRipple as j } from "../directives/vRipple.js";
4
- const V = ["type", "disabled"], E = /* @__PURE__ */ B({
4
+ import { $t as V } from "../utils/i18n.js";
5
+ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
5
6
  __name: "Button",
6
7
  props: {
7
8
  variant: { default: "primary" },
@@ -13,6 +14,7 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
13
14
  iconRight: {},
14
15
  type: { default: "button" },
15
16
  text: {},
17
+ textI18n: {},
16
18
  rounded: { default: "md" },
17
19
  textClass: {},
18
20
  iconClass: {},
@@ -20,8 +22,8 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
20
22
  asIcon: { type: Boolean }
21
23
  },
22
24
  setup(e) {
23
- const n = e, x = I(), l = r(() => n?.asIcon || n.icon && !n.text && !x.default), v = R("buttonGroup", null), w = r(() => !!v?.isInGroup), p = r(() => {
24
- const t = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", o = {
25
+ const n = e, l = s(() => n.textI18n ? V(n.textI18n) : n.text), v = R(), a = s(() => n?.asIcon || n.icon && !l.value && !v.default), p = S("buttonGroup", null), w = s(() => !!p?.isInGroup), y = s(() => {
26
+ const t = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", r = {
25
27
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
26
28
  "primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
27
29
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -41,28 +43,28 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
41
43
  "outline-success": "border border-success text-success hover:bg-success/10",
42
44
  ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
43
45
  link: "text-primary underline-offset-4 hover:underline"
44
- }, y = {
46
+ }, z = {
45
47
  xs: "h-6.5 px-2",
46
48
  sm: "h-7.5 px-3",
47
49
  sm2: "h-8 px-3",
48
50
  md: "h-9 px-4 py-2",
49
51
  lg: "h-10 px-6",
50
52
  xl: "h-12 px-10"
51
- }, z = {
53
+ }, C = {
52
54
  xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
53
55
  sm: "h-7 w-7 min-h-7 min-w-7",
54
56
  sm2: "h-7 w-7 min-h-7 min-w-7",
55
57
  md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
56
58
  lg: "h-8 w-8 min-h-8 min-w-8",
57
59
  xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
58
- }, C = {
60
+ }, k = {
59
61
  xs: "px-2",
60
62
  sm: "px-3",
61
63
  sm2: "px-3",
62
64
  md: "px-4",
63
65
  lg: "px-6",
64
66
  xl: "px-10"
65
- }, k = {
67
+ }, I = {
66
68
  none: "rounded-none",
67
69
  sm: "rounded-sm",
68
70
  sm2: "rounded-sm",
@@ -72,15 +74,15 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
72
74
  "2xl": "rounded-2xl",
73
75
  full: "rounded-full"
74
76
  };
75
- let c;
76
- return l.value ? c = w.value ? C[n.size] : z[n.size] : c = y[n.size], [
77
+ let u;
78
+ return a.value ? u = w.value ? k[n.size] : C[n.size] : u = z[n.size], [
77
79
  t,
78
- o[n.variant],
79
- k[n.rounded],
80
- c,
80
+ r[n.variant],
81
+ I[n.rounded],
82
+ u,
81
83
  n.class
82
84
  ].join(" ");
83
- }), a = r(() => {
85
+ }), c = s(() => {
84
86
  const t = {
85
87
  xs: "w-3 h-3",
86
88
  sm: "w-4 h-4",
@@ -88,7 +90,7 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
88
90
  md: "w-4 h-4",
89
91
  lg: "w-4 h-4",
90
92
  xl: "w-4 h-4"
91
- }, o = {
93
+ }, r = {
92
94
  xs: "w-3 h-3",
93
95
  sm: "w-3.5 h-3.5",
94
96
  sm2: "w-3.5 h-3.5",
@@ -96,42 +98,42 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
96
98
  lg: "w-4 h-4",
97
99
  xl: "w-4 h-4"
98
100
  };
99
- return l.value ? o[n.size] : t[n.size];
101
+ return a.value ? r[n.size] : t[n.size];
100
102
  });
101
- return (t, o) => S((s(), g("button", {
103
+ return (t, r) => G((o(), h("button", {
102
104
  type: e.type,
103
- class: i(p.value),
105
+ class: i(y.value),
104
106
  disabled: e.disabled || e.loading
105
107
  }, [
106
- e.loading ? (s(), d(u, {
108
+ e.loading ? (o(), d(g, {
107
109
  key: 0,
108
110
  icon: "lucide:loader-2",
109
- class: i(["animate-spin pointer-events-none", a.value])
110
- }, null, 8, ["class"])) : e.icon ? (s(), d(u, {
111
+ class: i(["animate-spin pointer-events-none", c.value])
112
+ }, null, 8, ["class"])) : e.icon ? (o(), d(g, {
111
113
  key: 1,
112
114
  icon: e.icon,
113
- class: i(["pointer-events-none", [e.iconClass, a.value, l.value ? "mx-auto" : ""]])
114
- }, null, 8, ["icon", "class"])) : h("", !0),
115
- e.textClass ? (s(), g("span", {
115
+ class: i(["pointer-events-none", [e.iconClass, c.value, a.value ? "mx-auto" : ""]])
116
+ }, null, 8, ["icon", "class"])) : m("", !0),
117
+ e.textClass ? (o(), h("span", {
116
118
  key: 2,
117
119
  class: i(e.textClass)
118
120
  }, [
119
- m(t.$slots, "default", {}, () => [
120
- f(b(e.text), 1)
121
+ f(t.$slots, "default", {}, () => [
122
+ x(b(l.value), 1)
121
123
  ])
122
- ], 2)) : m(t.$slots, "default", { key: 3 }, () => [
123
- f(b(e.text), 1)
124
+ ], 2)) : f(t.$slots, "default", { key: 3 }, () => [
125
+ x(b(l.value), 1)
124
126
  ]),
125
- e.iconRight && !e.loading ? (s(), d(u, {
127
+ e.iconRight && !e.loading ? (o(), d(g, {
126
128
  key: 4,
127
129
  icon: e.iconRight,
128
- class: i([[e.iconRightClass, a.value], "h-4 w-4 pointer-events-none"])
129
- }, null, 8, ["icon", "class"])) : h("", !0)
130
- ], 10, V)), [
131
- [G(j)]
130
+ class: i([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
131
+ }, null, 8, ["icon", "class"])) : m("", !0)
132
+ ], 10, D)), [
133
+ [$(j)]
132
134
  ]);
133
135
  }
134
136
  });
135
137
  export {
136
- E as default
138
+ q as default
137
139
  };
@@ -5,6 +5,7 @@ interface Props {
5
5
  disabled?: boolean;
6
6
  indeterminate?: boolean;
7
7
  label?: string;
8
+ labelI18n?: string;
8
9
  id?: string;
9
10
  class?: string;
10
11
  size?: CheckboxSize;