@munet/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.
@@ -4,13 +4,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
4
4
  onContextmenu: PropType<() => any>;
5
5
  disabled: BooleanConstructor;
6
6
  ing: BooleanConstructor;
7
+ variant: PropType<"primary" | "secondary" | "ghost">;
8
+ danger: BooleanConstructor;
9
+ size: PropType<"small" | "medium">;
7
10
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
8
11
  onClick: PropType<() => any>;
9
12
  onContextmenu: PropType<() => any>;
10
13
  disabled: BooleanConstructor;
11
14
  ing: BooleanConstructor;
15
+ variant: PropType<"primary" | "secondary" | "ghost">;
16
+ danger: BooleanConstructor;
17
+ size: PropType<"small" | "medium">;
12
18
  }>> & Readonly<{}>, {
13
19
  disabled: boolean;
14
20
  ing: boolean;
21
+ danger: boolean;
15
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
23
  export default _default;
@@ -1,29 +1,46 @@
1
- import { defineComponent as o, createVNode as n } from "vue";
2
- import { theme as i } from "../../themes/index.js";
1
+ import { defineComponent as a, createVNode as t } from "vue";
2
+ import { theme as r } from "../../themes/index.js";
3
3
  import l from "./LoadingBackground/index.js";
4
- const m = /* @__PURE__ */ o({
4
+ const c = /* @__PURE__ */ a({
5
5
  props: {
6
6
  onClick: Function,
7
7
  onContextmenu: Function,
8
8
  disabled: Boolean,
9
- ing: Boolean
9
+ ing: Boolean,
10
+ variant: String,
11
+ danger: Boolean,
12
+ size: String
10
13
  },
11
14
  setup(e, {
12
- emit: a,
13
- slots: t
15
+ emit: u,
16
+ slots: n
14
17
  }) {
15
- return () => n("button", {
16
- class: "relative of-hidden",
18
+ const i = () => {
19
+ if (e.danger)
20
+ return "text-red-4 hover:bg-red-4/10!";
21
+ switch (e.variant) {
22
+ // case 'primary':
23
+ // return 'bg-[var(--link-color)]! border-[var(--link-color)]! text-white!';
24
+ // case 'secondary':
25
+ // return 'bg-transparent! border-[var(--link-color)]! text-[var(--link-color)]!';
26
+ // case 'ghost':
27
+ // return 'bg-transparent! border-transparent! text-[var(--link-color)]! hover:bg-[var(--link-color)]/12! active:bg-[var(--link-color)]/18!';
28
+ default:
29
+ return "";
30
+ }
31
+ }, o = () => e.size === "small" ? "h-8 text-sm px-2" : e.size === "medium" ? "h-10 text-base px-4" : "";
32
+ return () => t("button", {
33
+ class: ["relative of-hidden", i(), o()],
17
34
  disabled: e.disabled || e.ing,
18
35
  onClick: e.onClick,
19
36
  onContextmenu: e.onContextmenu
20
- }, [n("div", {
37
+ }, [t("div", {
21
38
  class: "z-2 inline-flex items-center justify-center"
22
- }, [t.default?.()]), e.ing && n(l, {
23
- class: ["absolute bottom-0 left-0 right-0 top-25% z-1", i.value.loadingBackground]
39
+ }, [n.default?.()]), e.ing && t(l, {
40
+ class: ["absolute bottom-0 left-0 right-0 top-25% z-1", r.value.loadingBackground]
24
41
  }, null)]);
25
42
  }
26
43
  });
27
44
  export {
28
- m as default
45
+ c as default
29
46
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  value: {
3
- type: (DateConstructor | StringConstructor | NumberConstructor)[];
3
+ type: (StringConstructor | DateConstructor | NumberConstructor)[];
4
4
  required: true;
5
5
  };
6
6
  format: {
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9
9
  };
10
10
  }>, () => string, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
11
  value: {
12
- type: (DateConstructor | StringConstructor | NumberConstructor)[];
12
+ type: (StringConstructor | DateConstructor | NumberConstructor)[];
13
13
  required: true;
14
14
  };
15
15
  format: {
@@ -19,6 +19,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
19
19
  type: NumberConstructor;
20
20
  default: number;
21
21
  };
22
+ align: {
23
+ type: PropType<"center" | "left" | "right">;
24
+ default: string;
25
+ };
22
26
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
27
  innerClass: (StringConstructor | ArrayConstructor)[];
24
28
  innerStyle: PropType<CSSProperties>;
@@ -39,11 +43,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
39
43
  type: NumberConstructor;
40
44
  default: number;
41
45
  };
46
+ align: {
47
+ type: PropType<"center" | "left" | "right">;
48
+ default: string;
49
+ };
42
50
  }>> & Readonly<{}>, {
43
51
  gap: number;
52
+ maxHeight: number;
44
53
  buttonIng: boolean;
45
54
  buttonText: string;
46
55
  autoPosition: boolean;
47
- maxHeight: number;
56
+ align: "right" | "left" | "center";
48
57
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
49
58
  export default _default;
@@ -1,8 +1,8 @@
1
- import { defineComponent as p, ref as s, computed as b, createVNode as a } from "vue";
2
- import { onClickOutside as v } from "@vueuse/core";
3
- import y from "../TransitionVertical.vue.js";
4
- import w from "../Button/index.js";
5
- const H = /* @__PURE__ */ p({
1
+ import { defineComponent as b, ref as l, onBeforeUnmount as x, createVNode as o, Fragment as y, Teleport as h } from "vue";
2
+ import { onClickOutside as S } from "@vueuse/core";
3
+ import B from "../TransitionVertical.vue.js";
4
+ import C from "../Button/index.js";
5
+ const z = /* @__PURE__ */ b({
6
6
  props: {
7
7
  innerClass: [String, Array],
8
8
  innerStyle: [Object, String],
@@ -22,56 +22,64 @@ const H = /* @__PURE__ */ p({
22
22
  maxHeight: {
23
23
  type: Number,
24
24
  default: 200
25
+ },
26
+ align: {
27
+ type: String,
28
+ default: "center"
25
29
  }
26
30
  },
27
- setup(o, {
28
- emit: x,
29
- slots: l,
30
- expose: f
31
+ setup(t, {
32
+ emit: $,
33
+ slots: s,
34
+ expose: p
31
35
  }) {
32
- const n = s(!1), i = s(null), r = s("bottom");
33
- v(i, (t) => n.value = !1);
34
- const m = () => {
35
- if (!o.autoPosition || !i.value) return;
36
- const t = i.value.getBoundingClientRect(), c = window.innerHeight - t.bottom, d = t.top;
37
- c < o.maxHeight && d > c ? r.value = "top" : r.value = "bottom";
38
- }, u = (t) => {
39
- const e = typeof t == "boolean" ? t : !n.value;
40
- e && m(), n.value = e;
41
- };
42
- f({
43
- setShow: (t) => {
44
- u(t);
45
- }
36
+ const i = l(!1), a = l(null), d = l(null), g = l("bottom"), c = l({});
37
+ S(a, (e) => i.value = !1, {
38
+ ignore: [d]
46
39
  });
47
- const g = b(() => {
48
- const t = o.innerStyle || {};
49
- if (!o.autoPosition) return t;
50
- const e = {
51
- position: "absolute",
40
+ const m = () => {
41
+ if (!t.autoPosition || !a.value) return;
42
+ const e = a.value.getBoundingClientRect(), r = window.innerHeight, v = r - e.bottom, w = e.top, n = {
43
+ position: "fixed",
52
44
  zIndex: 100
53
45
  };
54
- return r.value === "bottom" ? (e.top = `calc(100% + ${o.gap}px)`, e.transformOrigin = "top center") : (e.bottom = `calc(100% + ${o.gap}px)`, e.top = "auto", e.transformOrigin = "bottom center"), {
55
- ...t,
56
- ...e
46
+ t.align === "right" ? n.right = `${window.innerWidth - e.right}px` : t.align === "left" ? n.left = `${e.left}px` : (n.left = `${e.left + e.width / 2}px`, n.transform = "translateX(-50%)"), v < t.maxHeight && w > v ? (g.value = "top", n.bottom = `${r - e.top + t.gap}px`, n.transformOrigin = "bottom center") : (g.value = "bottom", n.top = `${e.bottom + t.gap}px`, n.transformOrigin = "top center"), c.value = {
47
+ ...t.innerStyle || {},
48
+ ...n
57
49
  };
58
- });
59
- return () => a("div", {
50
+ }, f = (e) => {
51
+ const r = typeof e == "boolean" ? e : !i.value;
52
+ r && m(), i.value = r;
53
+ }, u = () => {
54
+ i.value && m();
55
+ };
56
+ return window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), x(() => {
57
+ window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0);
58
+ }), p({
59
+ setShow: (e) => {
60
+ f(e);
61
+ }
62
+ }), () => o(y, null, [o("div", {
60
63
  class: "relative",
61
- ref: i
62
- }, [l.trigger ? l.trigger(u) : a(w, {
63
- ing: o.buttonIng,
64
- onClick: () => u()
64
+ ref: a
65
+ }, [s.trigger ? s.trigger(f) : o(C, {
66
+ ing: t.buttonIng,
67
+ onClick: () => f()
68
+ }, {
69
+ default: () => [t.buttonText]
70
+ })]), o(h, {
71
+ to: "body"
65
72
  }, {
66
- default: () => [o.buttonText]
67
- }), a(y, null, {
68
- default: () => [n.value && a("div", {
69
- class: o.innerClass,
70
- style: g.value
71
- }, [l.default?.()])]
73
+ default: () => [o(B, null, {
74
+ default: () => [i.value && o("div", {
75
+ ref: d,
76
+ class: t.innerClass,
77
+ style: c.value
78
+ }, [s.default?.()])]
79
+ })]
72
80
  })]);
73
81
  }
74
82
  });
75
83
  export {
76
- H as default
84
+ z as default
77
85
  };
@@ -12,6 +12,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
12
12
  options: {
13
13
  type: PropType<{
14
14
  label: string;
15
+ desc?: string;
16
+ icon?: string;
17
+ disabled?: boolean;
15
18
  action: () => any;
16
19
  }[]>;
17
20
  default: () => never[];
@@ -20,6 +23,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
20
23
  type: PropType<string>;
21
24
  default: string;
22
25
  };
26
+ align: {
27
+ type: PropType<"center" | "left" | "right">;
28
+ default: string;
29
+ };
23
30
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
31
  buttonText: {
25
32
  type: PropType<string>;
@@ -33,6 +40,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
33
40
  options: {
34
41
  type: PropType<{
35
42
  label: string;
43
+ desc?: string;
44
+ icon?: string;
45
+ disabled?: boolean;
36
46
  action: () => any;
37
47
  }[]>;
38
48
  default: () => never[];
@@ -41,14 +51,22 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
41
51
  type: PropType<string>;
42
52
  default: string;
43
53
  };
54
+ align: {
55
+ type: PropType<"center" | "left" | "right">;
56
+ default: string;
57
+ };
44
58
  }>> & Readonly<{}>, {
45
59
  width: string;
46
60
  innerClass: string;
47
61
  options: {
48
62
  label: string;
63
+ desc?: string;
64
+ icon?: string;
65
+ disabled?: boolean;
49
66
  action: () => any;
50
67
  }[];
51
- buttonText: string;
52
68
  row: boolean;
69
+ buttonText: string;
70
+ align: "right" | "left" | "center";
53
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
72
  export default _default;
@@ -1,6 +1,6 @@
1
- import { defineComponent as a, ref as i, createVNode as r } from "vue";
2
- import u from "./DropDown.js";
3
- const s = /* @__PURE__ */ a({
1
+ import { defineComponent as s, ref as d, createVNode as l } from "vue";
2
+ import i from "./DropDown.js";
3
+ const c = /* @__PURE__ */ s({
4
4
  props: {
5
5
  buttonText: {
6
6
  type: String,
@@ -18,31 +18,42 @@ const s = /* @__PURE__ */ a({
18
18
  innerClass: {
19
19
  type: String,
20
20
  default: ""
21
+ },
22
+ align: {
23
+ type: String,
24
+ default: "center"
21
25
  }
22
26
  },
23
27
  setup(t, {
24
- slots: o
28
+ slots: a
25
29
  }) {
26
- const e = i();
27
- return () => r(u, {
30
+ const n = d();
31
+ return () => l(i, {
28
32
  buttonText: t.buttonText,
29
33
  innerStyle: {
30
34
  width: t.width
31
35
  },
32
- ref: e,
33
- innerClass: ["absolute top-full left-50% bg-dropMenu rounded-lg p-2 z-10 flex gap-2 translate-x--50% backdrop-blur-8", !t.row && "flex-col", t.innerClass]
36
+ ref: n,
37
+ align: t.align,
38
+ innerClass: ["bg-dropMenu rounded-lg p-2 flex gap-2 backdrop-blur-8", !t.row && "flex-col", t.innerClass]
34
39
  }, {
35
- default: () => t.options.map((n, l) => r("div", {
36
- key: l,
37
- class: "w-full min-w-max flex items-center justify-center px-4 py-2 rounded-lg bg-avatarMenuButton transition-colors",
40
+ default: () => t.options.map((e, r) => l("div", {
41
+ key: r,
42
+ class: ["w-full min-w-max flex items-center px-4 py-2 rounded-lg bg-avatarMenuButton transition-colors gap-2", e.disabled && "op-50 cursor-not-allowed"],
38
43
  onClick: () => {
39
- e.value?.setShow(!1), n.action();
44
+ e.disabled || (n.value?.setShow(!1), e.action());
40
45
  }
41
- }, [n.label])),
42
- trigger: o.trigger
46
+ }, [e.icon && l("span", {
47
+ class: [e.icon, "text-lg shrink-0"]
48
+ }, null), l("div", {
49
+ class: "flex flex-col"
50
+ }, [l("span", null, [e.label]), e.desc && l("span", {
51
+ class: "text-xs op-60"
52
+ }, [e.desc])])])),
53
+ trigger: a.trigger
43
54
  });
44
55
  }
45
56
  });
46
57
  export {
47
- s as default
58
+ c as default
48
59
  };
@@ -1,3 +1,4 @@
1
+ import { PropType } from 'vue';
1
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  min: {
3
4
  type: NumberConstructor;
@@ -19,6 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
19
20
  type: NumberConstructor;
20
21
  default: number;
21
22
  };
23
+ onFocus: PropType<() => void>;
22
24
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
25
  min: {
24
26
  type: NumberConstructor;
@@ -40,6 +42,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
40
42
  type: NumberConstructor;
41
43
  default: number;
42
44
  };
45
+ onFocus: PropType<() => void>;
43
46
  }>> & Readonly<{}>, {
44
47
  value: number;
45
48
  step: number;
@@ -1,8 +1,8 @@
1
- import { defineComponent as o, ref as f, computed as d, shallowRef as i, watch as s, createVNode as p } from "vue";
2
- import { useVModel as c } from "@vueuse/core";
1
+ import { defineComponent as m, ref as f, computed as s, shallowRef as i, watch as c, createVNode as d } from "vue";
2
+ import { useVModel as p } from "@vueuse/core";
3
3
  import v from "./TextInput/index.js";
4
4
  import * as y from "lodash-es";
5
- const h = /* @__PURE__ */ o({
5
+ const F = /* @__PURE__ */ m({
6
6
  props: {
7
7
  min: {
8
8
  type: Number,
@@ -23,38 +23,40 @@ const h = /* @__PURE__ */ o({
23
23
  value: {
24
24
  type: Number,
25
25
  default: 0
26
- }
26
+ },
27
+ onFocus: Function
27
28
  },
28
29
  setup(e, {
29
- emit: m
30
+ emit: r
30
31
  }) {
31
- const l = c(e, "value", m), u = f(""), r = d({
32
+ const n = p(e, "value", r), u = f(""), o = s({
32
33
  get: () => u.value,
33
34
  set: (t) => {
34
- u.value = t, l.value = y.clamp(Number(t), e.min, e.max);
35
+ u.value = t, n.value = y.clamp(Number(t), e.min, e.max);
35
36
  }
36
37
  }), a = () => {
37
- u.value = l.value.toFixed(e.decimal);
38
- }, n = i();
39
- return s(() => e.value, () => {
40
- if (n?.value?.focused) {
38
+ u.value = n.value.toFixed(e.decimal);
39
+ }, l = i();
40
+ return c(() => e.value, () => {
41
+ if (l?.value?.focused) {
41
42
  console.log("focused, not refresh");
42
43
  return;
43
44
  }
44
45
  a();
45
46
  }, {
46
47
  immediate: !0
47
- }), () => p(v, {
48
- ref: n,
49
- value: r.value,
50
- "onUpdate:value": (t) => r.value = t,
48
+ }), () => d(v, {
49
+ ref: l,
50
+ value: o.value,
51
+ "onUpdate:value": (t) => o.value = t,
51
52
  type: "number",
52
53
  step: e.step,
53
54
  onBlur: a,
54
- onEnterPressed: a
55
+ onEnterPressed: a,
56
+ onFocus: e.onFocus
55
57
  }, null);
56
58
  }
57
59
  });
58
60
  export {
59
- h as default
61
+ F as default
60
62
  };
@@ -0,0 +1,25 @@
1
+ import { PropType } from 'vue';
2
+ type TriggerType = 'hover' | 'click';
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ trigger: {
5
+ type: PropType<TriggerType>;
6
+ default: string;
7
+ };
8
+ offset: {
9
+ type: NumberConstructor;
10
+ default: number;
11
+ };
12
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ trigger: {
14
+ type: PropType<TriggerType>;
15
+ default: string;
16
+ };
17
+ offset: {
18
+ type: NumberConstructor;
19
+ default: number;
20
+ };
21
+ }>> & Readonly<{}>, {
22
+ trigger: TriggerType;
23
+ offset: number;
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
+ export default _default;
@@ -0,0 +1,76 @@
1
+ import { defineComponent as R, ref as o, computed as y, onBeforeUnmount as B, createVNode as r, Fragment as H, Teleport as z, nextTick as W } from "vue";
2
+ import N from "../TransitionOpacity.js";
3
+ const $ = /* @__PURE__ */ R({
4
+ props: {
5
+ trigger: {
6
+ type: String,
7
+ default: "hover"
8
+ },
9
+ offset: {
10
+ type: Number,
11
+ default: 8
12
+ }
13
+ },
14
+ setup(i, {
15
+ slots: g
16
+ }) {
17
+ const t = o(!1), m = o("bottom"), d = o(0), p = o(0), a = o(null), u = o(null), s = o(null), c = y(() => i.trigger === "hover"), l = () => {
18
+ s.value !== null && (window.clearTimeout(s.value), s.value = null);
19
+ }, f = () => {
20
+ if (!a.value || !u.value) return;
21
+ const n = a.value.getBoundingClientRect(), e = u.value.getBoundingClientRect(), b = window.innerHeight, L = window.innerWidth, k = b - n.bottom, C = n.top;
22
+ k < e.height + i.offset && C > k ? (m.value = "top", d.value = Math.max(8, n.top - e.height - i.offset)) : (m.value = "bottom", d.value = Math.min(b - e.height - 8, n.bottom + i.offset));
23
+ const E = n.left + (n.width - e.width) / 2;
24
+ p.value = Math.min(Math.max(8, E), Math.max(8, L - e.width - 8));
25
+ }, w = () => {
26
+ if (l(), t.value) {
27
+ f();
28
+ return;
29
+ }
30
+ t.value = !0, W(() => {
31
+ f();
32
+ });
33
+ }, h = () => {
34
+ l(), t.value = !1;
35
+ }, x = () => {
36
+ l(), s.value = window.setTimeout(() => {
37
+ t.value = !1;
38
+ }, 120);
39
+ }, T = () => {
40
+ t.value ? h() : w();
41
+ }, v = () => {
42
+ t.value && f();
43
+ }, M = (n) => {
44
+ if (i.trigger !== "click" || !t.value) return;
45
+ const e = n.target;
46
+ e && (a.value?.contains(e) || u.value?.contains(e) || h());
47
+ };
48
+ return window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), document.addEventListener("click", M, !0), B(() => {
49
+ l(), window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0), document.removeEventListener("click", M, !0);
50
+ }), () => r(H, null, [r("div", {
51
+ ref: a,
52
+ class: "inline-flex",
53
+ onMouseenter: () => c.value && w(),
54
+ onMouseleave: () => c.value && x(),
55
+ onClick: () => i.trigger === "click" && T()
56
+ }, [g.trigger?.()]), r(z, {
57
+ to: "#app"
58
+ }, {
59
+ default: () => [r(N, null, {
60
+ default: () => [t.value && r("div", {
61
+ ref: u,
62
+ class: "fixed z-80 max-w-90vw rd-2 bg-dropMenu p-2 text-sm backdrop-blur-8",
63
+ style: {
64
+ top: `${d.value}px`,
65
+ left: `${p.value}px`
66
+ },
67
+ onMouseenter: () => c.value && l(),
68
+ onMouseleave: () => c.value && x()
69
+ }, [g.default?.()])]
70
+ })]
71
+ })]);
72
+ }
73
+ });
74
+ export {
75
+ $ as default
76
+ };
@@ -0,0 +1,33 @@
1
+ import { PropType } from 'vue';
2
+ declare const Progress: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ percentage: {
4
+ type: NumberConstructor;
5
+ default: number;
6
+ };
7
+ status: {
8
+ type: PropType<"default" | "success" | "error">;
9
+ default: string;
10
+ };
11
+ showIndicator: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ percentage: {
17
+ type: NumberConstructor;
18
+ default: number;
19
+ };
20
+ status: {
21
+ type: PropType<"default" | "success" | "error">;
22
+ default: string;
23
+ };
24
+ showIndicator: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ }>> & Readonly<{}>, {
29
+ status: "success" | "error" | "default";
30
+ percentage: number;
31
+ showIndicator: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
+ export default Progress;
@@ -0,0 +1,35 @@
1
+ import { defineComponent as s, computed as r, createVNode as t, createTextVNode as u } from "vue";
2
+ const d = /* @__PURE__ */ s({
3
+ props: {
4
+ percentage: {
5
+ type: Number,
6
+ default: 0
7
+ },
8
+ status: {
9
+ type: String,
10
+ default: "default"
11
+ },
12
+ showIndicator: {
13
+ type: Boolean,
14
+ default: !1
15
+ }
16
+ },
17
+ setup(e) {
18
+ const l = r(() => e.status === "success" ? "bg-green-500" : e.status === "error" ? "bg-red-500" : "bg-blue-500"), a = r(() => Math.min(100, Math.max(0, e.percentage)));
19
+ return () => t("div", {
20
+ class: "flex items-center gap-2 w-full"
21
+ }, [t("div", {
22
+ class: "flex-1 h-2 bg-gray-200 rounded-full overflow-hidden"
23
+ }, [t("div", {
24
+ class: [l.value, "h-full rounded-full"],
25
+ style: {
26
+ width: `${a.value}%`
27
+ }
28
+ }, null)]), e.showIndicator && t("span", {
29
+ class: "text-sm text-gray-600 min-w-10 text-right"
30
+ }, [a.value, u("%")])]);
31
+ }
32
+ });
33
+ export {
34
+ d as default
35
+ };