vlite3 0.6.8 → 0.6.9

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 (39) hide show
  1. package/_virtual/_commonjsHelpers.js +6 -0
  2. package/_virtual/dayjs.min.js +7 -0
  3. package/_virtual/dayjs.min2.js +4 -0
  4. package/components/Barcode/Barcode.vue.d.ts +1 -1
  5. package/components/Breadcrumb/BreadcrumbItem.vue.js +2 -2
  6. package/components/ConfirmationModal.vue.js +30 -25
  7. package/components/DataTable/DataTableRow.vue.js +70 -64
  8. package/components/Date/Date.vue.d.ts +8 -0
  9. package/components/Date/Date.vue.js +21 -0
  10. package/components/Date/Date.vue2.js +4 -0
  11. package/components/Date/index.d.ts +1 -0
  12. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  13. package/components/Form/Form.vue.js +1 -1
  14. package/components/Form/Form.vue2.js +39 -36
  15. package/components/List/ListFieldRow.vue.js +150 -107
  16. package/components/Modal.vue.js +2 -2
  17. package/components/Modal.vue2.js +43 -42
  18. package/components/Navbar/Navbar.vue.d.ts +33 -19
  19. package/components/Navbar/Navbar.vue.js +295 -185
  20. package/components/Navbar/NavbarTabs.vue.js +1 -1
  21. package/components/Price/Price.vue.d.ts +8 -0
  22. package/components/Price/Price.vue.js +26 -0
  23. package/components/Price/Price.vue2.js +4 -0
  24. package/components/Price/index.d.ts +1 -0
  25. package/components/Screen/Screen.vue.js +19 -19
  26. package/components/SidebarMenu/SidebarMenu.vue.js +95 -93
  27. package/components/SidebarMenu/SidebarMenuItem.vue.js +42 -42
  28. package/components/Tabes/Tabes.vue.d.ts +6 -0
  29. package/components/Tabes/Tabes.vue.js +63 -56
  30. package/core/config.d.ts +14 -1
  31. package/core/config.js +15 -9
  32. package/core/index.d.ts +0 -22
  33. package/core/index.js +17 -9
  34. package/index.d.ts +2 -0
  35. package/index.js +18 -14
  36. package/package.json +2 -1
  37. package/style.css +1 -1
  38. package/types/config.type.d.ts +6 -0
  39. package/types/navbar.type.d.ts +7 -17
@@ -1,4 +1,4 @@
1
- import { defineComponent as X, inject as Y, computed as c, resolveComponent as Z, openBlock as r, createElementBlock as f, normalizeClass as u, createBlock as h, unref as n, withCtx as b, createElementVNode as p, normalizeStyle as M, createCommentVNode as d, toDisplayString as g, createVNode as S, resolveDynamicComponent as B, mergeProps as D, createTextVNode as ee, Fragment as V, withKeys as te, withModifiers as ae, Transition as ne, renderList as ie } from "vue";
1
+ import { defineComponent as X, inject as Y, computed as s, resolveComponent as Z, openBlock as r, createElementBlock as f, normalizeClass as u, createBlock as h, unref as n, withCtx as b, createElementVNode as v, normalizeStyle as M, createCommentVNode as d, toDisplayString as g, createVNode as S, resolveDynamicComponent as B, mergeProps as D, createTextVNode as ee, Fragment as V, withKeys as te, withModifiers as ae, Transition as ne, renderList as ie } from "vue";
2
2
  import { useRouter as oe } from "vue-router";
3
3
  import w from "../Icon.vue.js";
4
4
  import K from "../Tooltip.vue.js";
@@ -8,7 +8,7 @@ import { $t as O } from "../../utils/i18n.js";
8
8
  const re = {
9
9
  key: 0,
10
10
  class: "px-3 py-1.5 text-sm flex items-center gap-2 font-medium border-b bg-muted-light rounded-t-md text-center truncate"
11
- }, se = { class: "w-full" }, ce = { class: "flex items-center w-full gap-2 text-sm" }, ue = { class: "truncate flex-1 font-medium" }, de = ["onKeydown"], me = {
11
+ }, ce = { class: "w-full" }, se = { class: "flex items-center w-full gap-2 text-sm" }, ue = { class: "truncate flex-1 font-medium" }, de = ["onKeydown"], me = {
12
12
  key: 0,
13
13
  class: "overflow-hidden transition-all duration-300 ease-in-out relative"
14
14
  }, fe = { class: "mt-0.5 space-y-0.5" }, we = /* @__PURE__ */ X({
@@ -19,13 +19,13 @@ const re = {
19
19
  menuOffset: {},
20
20
  itemClass: {}
21
21
  },
22
- setup(s) {
23
- const t = s, e = Y("sidebar-menu-ctx"), k = oe();
22
+ setup(c) {
23
+ const t = c, e = Y("sidebar-menu-ctx"), k = oe();
24
24
  if (!e)
25
25
  throw new Error("SidebarMenuItem must be used within a SidebarMenu");
26
- const i = c(
26
+ const i = s(
27
27
  () => e.currentOrientation === "horizontal" && t.depth === 0
28
- ), v = c(() => !!t.item.children?.length), R = c(() => i.value && v.value || e.compact && v.value ? "popover" : t.item.renderMode || e.renderMode || "tree"), I = c(() => e.renderNestedTabs && t.depth === 0 ? !1 : R.value === "popover" && v.value), y = c(() => t.item.id ? t.item.id : t.item.to && typeof t.item.to == "string" ? t.item.to : t.item.label), E = c(() => I.value || e.renderNestedTabs && t.depth === 0 ? !1 : e.expandedItems.includes(y.value)), j = c(() => !(!v.value || e.renderNestedTabs && t.depth === 0)), z = c(() => e.activeItem === y.value), L = (o) => {
28
+ ), p = s(() => !!t.item.children?.length), R = s(() => i.value && p.value || e.compact && p.value ? "popover" : t.item.renderMode || e.renderMode || "tree"), I = s(() => e.renderNestedTabs && t.depth === 0 ? !1 : R.value === "popover" && p.value), y = s(() => t.item.id ? t.item.id : t.item.to && typeof t.item.to == "string" ? t.item.to : t.item.label), E = s(() => I.value || e.renderNestedTabs && t.depth === 0 ? !1 : e.expandedItems.includes(y.value)), j = s(() => !(!p.value || e.renderNestedTabs && t.depth === 0)), z = s(() => e.activeItem === y.value), L = (o) => {
29
29
  if (!t.item.disabled) {
30
30
  if (e.renderNestedTabs && t.depth === 0) {
31
31
  if (t.item.action && t.item.action(t.item), t.item.to)
@@ -33,7 +33,7 @@ const re = {
33
33
  });
34
34
  else if (t.item.href)
35
35
  window.open(t.item.href, "_blank");
36
- else if (v.value) {
36
+ else if (p.value) {
37
37
  const a = t.item.children?.[0];
38
38
  a && (a.to ? k.push(a.to).catch(() => {
39
39
  }) : a.href && window.open(a.href, "_blank"));
@@ -41,7 +41,7 @@ const re = {
41
41
  e.setActive(y.value);
42
42
  return;
43
43
  }
44
- v.value && !t.item.to && !t.item.href && (I.value || e.toggleExpand(y.value)), t.item.action && t.item.action(t.item), (!v.value || t.item.to) && e.setActive(y.value);
44
+ p.value && !t.item.to && !t.item.href && (I.value || e.toggleExpand(y.value)), t.item.action && t.item.action(t.item), (!p.value || t.item.to) && e.setActive(y.value);
45
45
  }
46
46
  }, N = (o) => {
47
47
  if (o.stopPropagation(), e.renderNestedTabs && t.depth === 0) {
@@ -50,7 +50,7 @@ const re = {
50
50
  });
51
51
  else if (t.item.href)
52
52
  window.open(t.item.href, "_blank");
53
- else if (v.value) {
53
+ else if (p.value) {
54
54
  const a = t.item.children?.[0];
55
55
  a && (a.to ? k.push(a.to).catch(() => {
56
56
  }) : a.href && window.open(a.href, "_blank"));
@@ -59,14 +59,14 @@ const re = {
59
59
  return;
60
60
  }
61
61
  I.value || e.toggleExpand(y.value);
62
- }, $ = c(() => e.indentSize || 12), T = c(() => i.value ? {} : e.compact ? { width: "100%" } : {
62
+ }, $ = s(() => e.indentSize || 12), T = s(() => i.value ? {} : e.compact ? { width: "100%" } : {
63
63
  marginLeft: `${t.depth * $.value}px`,
64
64
  width: `calc(100% - ${t.depth * $.value}px)`
65
- }), _ = c(() => {
66
- const a = `group flex items-center justify-between font-medium rounded-md transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 relative border border-transparent select-none cursor-pointer ${i.value ? "w-auto" : "w-full"} ${t?.itemClass || ""} ${e.labelClass}`, x = e.compact ? `justify-center ${e.compactItemPadding}` : `justify-between ${e.itemPadding}`;
65
+ }), _ = s(() => {
66
+ const a = `group flex items-center justify-between font-medium rounded-md focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 relative border border-transparent select-none cursor-pointer ${i.value ? "w-auto" : "w-full"} ${t?.itemClass || ""} ${e.labelClass}`, x = e.compact ? `justify-center ${e.compactItemPadding}` : `justify-between ${e.itemPadding}`;
67
67
  let l = "";
68
68
  return z.value ? l = "bg-primary-light text-primary-fg-light" : l = "text-muted hover:bg-accent/80 hover:text-foreground", t.item.disabled && (l = "opacity-50 cursor-not-allowed pointer-events-none"), `${a} ${x} ${l} ${t.item.class || ""}`;
69
- }), m = c(() => e.compact && e.showCompactLabels), C = c(
69
+ }), m = s(() => e.compact && e.showCompactLabels), C = s(
70
70
  () => t.item.labelI18n ? O(t.item.labelI18n) : t.item.label
71
71
  ), A = (o) => ({
72
72
  label: o.labelI18n ? O(o.labelI18n) : o.label,
@@ -75,7 +75,7 @@ const re = {
75
75
  disabled: o.disabled,
76
76
  children: o.children ? o.children.map(A) : void 0,
77
77
  data: o
78
- }), F = c(() => t.item.children ? t.item.children.map(A) : []), W = (o) => {
78
+ }), F = s(() => t.item.children ? t.item.children.map(A) : []), W = (o) => {
79
79
  const a = o.data;
80
80
  if (a) {
81
81
  a.action && a.action(a);
@@ -98,7 +98,7 @@ const re = {
98
98
  }, U = (o) => {
99
99
  const a = o;
100
100
  a.style.height = "0", a.style.opacity = "0";
101
- }, H = c(() => t.item.to ? "router-link" : t.item.href ? "a" : "button"), P = c(() => t.item.to ? { to: t.item.to } : t.item.href ? {
101
+ }, H = s(() => t.item.to ? "router-link" : t.item.href ? "a" : "button"), P = s(() => t.item.to ? { to: t.item.to } : t.item.href ? {
102
102
  href: t.item.href,
103
103
  target: "_blank",
104
104
  rel: "noopener noreferrer"
@@ -111,7 +111,7 @@ const re = {
111
111
  I.value ? (r(), h(n(le), {
112
112
  key: 0,
113
113
  position: i.value ? "bottom-start" : "right-start",
114
- offset: s.menuOffset,
114
+ offset: c.menuOffset,
115
115
  class: "w-full block",
116
116
  searchable: !1,
117
117
  width: n(e).nestedMenuWidth,
@@ -121,9 +121,9 @@ const re = {
121
121
  }, {
122
122
  header: b(() => [
123
123
  n(e).compact && !i.value ? (r(), f("div", re, [
124
- s.item.icon ? (r(), h(w, {
124
+ c.item.icon ? (r(), h(w, {
125
125
  key: 0,
126
- icon: s.item.icon,
126
+ icon: c.item.icon,
127
127
  class: "shrink-0 transition-colors opacity-80 group-hover:opacity-100"
128
128
  }, null, 8, ["icon"])) : d("", !0),
129
129
  ee(" " + g(C.value), 1)
@@ -138,7 +138,7 @@ const re = {
138
138
  class: "w-full block"
139
139
  }, {
140
140
  default: b(() => [
141
- p("div", se, [
141
+ v("div", ce, [
142
142
  (r(), h(B(H.value), D(P.value, {
143
143
  class: [_.value, l ? "bg-muted text-foreground" : ""],
144
144
  style: T.value,
@@ -147,36 +147,36 @@ const re = {
147
147
  onClick: L
148
148
  }), {
149
149
  default: b(() => [
150
- p("div", {
150
+ v("div", {
151
151
  class: u(["min-w-0 flex-1 flex", [
152
152
  m.value && !i.value ? "flex-col items-center justify-center gap-1" : n(e).compact && !i.value ? "justify-center" : "items-center gap-2.5"
153
153
  ]])
154
154
  }, [
155
- s.item.icon ? (r(), h(w, {
155
+ c.item.icon ? (r(), h(w, {
156
156
  key: 0,
157
- icon: s.item.icon,
157
+ icon: c.item.icon,
158
158
  class: u(["shrink-0 transition-colors opacity-80 group-hover:opacity-100", [z.value || l ? "opacity-100" : ""]]),
159
159
  style: M({
160
160
  width: n(e).compact && !i.value ? n(e).compactIconSize : n(e).iconSize,
161
161
  height: n(e).compact && !i.value ? n(e).compactIconSize : n(e).iconSize
162
162
  })
163
163
  }, null, 8, ["icon", "class", "style"])) : d("", !0),
164
- p("span", {
165
- class: u(["truncate leading-none pt-0.5", {
164
+ v("span", {
165
+ class: u(["truncate leading-none pt-0.5 text-wrap", {
166
166
  [n(e).compactLabelClass]: m.value && !i.value,
167
167
  hidden: n(e).compact && !m.value && !i.value,
168
168
  "md:hidden": n(e).compact && !m.value && !i.value
169
169
  }])
170
170
  }, g(C.value), 3),
171
- s.item.badge && (!n(e).compact || !m.value || i.value) ? (r(), f("span", {
171
+ c.item.badge && (!n(e).compact || !m.value || i.value) ? (r(), f("span", {
172
172
  key: 1,
173
173
  class: u(["ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium", [
174
- s.item.badgeClass || "bg-muted text-muted-foreground",
174
+ c.item.badgeClass || "bg-muted text-muted-foreground",
175
175
  { "md:hidden": n(e).compact && !i.value }
176
176
  ]])
177
- }, g(s.item.badge), 3)) : d("", !0)
177
+ }, g(c.item.badge), 3)) : d("", !0)
178
178
  ], 2),
179
- p("div", {
179
+ v("div", {
180
180
  class: u(["ml-1.5 flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground", { "md:hidden": n(e).compact && !i.value }])
181
181
  }, [
182
182
  S(w, {
@@ -193,14 +193,14 @@ const re = {
193
193
  }, 1032, ["content", "placement", "disabled"])
194
194
  ]),
195
195
  item: b(({ option: l }) => [
196
- p("div", ce, [
196
+ v("div", se, [
197
197
  l.icon ? (r(), h(w, {
198
198
  key: 0,
199
199
  icon: l.icon,
200
200
  class: "shrink-0 opacity-80",
201
201
  style: M({ width: n(e).iconSize, height: n(e).iconSize })
202
202
  }, null, 8, ["icon", "style"])) : d("", !0),
203
- p("span", ue, g(l.label), 1),
203
+ v("span", ue, g(l.label), 1),
204
204
  l.data?.badge ? (r(), f("span", {
205
205
  key: 1,
206
206
  class: u(["ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium", l.data?.badgeClass || "bg-muted text-muted-foreground"])
@@ -224,34 +224,34 @@ const re = {
224
224
  onClick: L
225
225
  }), {
226
226
  default: b(() => [
227
- p("div", {
227
+ v("div", {
228
228
  class: u(["min-w-0 flex-1 flex py-0.5", [
229
229
  m.value && !i.value ? "flex-col items-center justify-center gap-1" : n(e).compact && !i.value ? "justify-center" : "items-center gap-2.5"
230
230
  ]])
231
231
  }, [
232
- s.item.icon ? (r(), h(w, {
232
+ c.item.icon ? (r(), h(w, {
233
233
  key: 0,
234
- icon: s.item.icon,
234
+ icon: c.item.icon,
235
235
  class: u(["shrink-0 transition-colors opacity-80 group-hover:opacity-100", [z.value ? "opacity-100" : ""]]),
236
236
  style: M({
237
237
  width: n(e).compact && !i.value ? n(e).compactIconSize : n(e).iconSize,
238
238
  height: n(e).compact && !i.value ? n(e).compactIconSize : n(e).iconSize
239
239
  })
240
240
  }, null, 8, ["icon", "class", "style"])) : d("", !0),
241
- p("span", {
241
+ v("span", {
242
242
  class: u(["truncate leading-none pt-0.5 wrap-break-word flex-wrap text-wrap", {
243
243
  [n(e).compactLabelClass]: m.value && !i.value,
244
244
  hidden: n(e).compact && !m.value && !i.value,
245
245
  "md:hidden": n(e).compact && !m.value && !i.value
246
246
  }])
247
247
  }, g(C.value), 3),
248
- s.item.badge && (!n(e).compact || !m.value || i.value) ? (r(), f("span", {
248
+ c.item.badge && (!n(e).compact || !m.value || i.value) ? (r(), f("span", {
249
249
  key: 1,
250
250
  class: u(["ml-auto inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium", [
251
- s.item.badgeClass || "bg-muted text-muted-foreground",
251
+ c.item.badgeClass || "bg-muted text-muted-foreground",
252
252
  { "md:hidden": n(e).compact && !i.value }
253
253
  ]])
254
- }, g(s.item.badge), 3)) : d("", !0)
254
+ }, g(c.item.badge), 3)) : d("", !0)
255
255
  ], 2),
256
256
  j.value ? (r(), f("div", {
257
257
  key: 0,
@@ -281,19 +281,19 @@ const re = {
281
281
  onLeave: U
282
282
  }, {
283
283
  default: b(() => [
284
- v.value && E.value && !i.value ? (r(), f("div", me, [
284
+ p.value && E.value && !i.value ? (r(), f("div", me, [
285
285
  n(e).variant === "default" ? (r(), f("div", {
286
286
  key: 0,
287
287
  class: "absolute top-0 bottom-2 w-px bg-border",
288
288
  style: M({
289
- left: `${(s.depth + 1) * $.value - $.value / 2}px`
289
+ left: `${(c.depth + 1) * $.value - $.value / 2}px`
290
290
  })
291
291
  }, null, 4)) : d("", !0),
292
- p("div", fe, [
293
- (r(!0), f(V, null, ie(s.item.children, (l) => (r(), h(x, {
292
+ v("div", fe, [
293
+ (r(!0), f(V, null, ie(c.item.children, (l) => (r(), h(x, {
294
294
  key: l.id || l.label,
295
295
  item: l,
296
- depth: s.depth + 1
296
+ depth: c.depth + 1
297
297
  }, null, 8, ["item", "depth"]))), 128))
298
298
  ])
299
299
  ])) : d("", !0)
@@ -6,6 +6,11 @@ interface Props {
6
6
  variant?: TabesVariant;
7
7
  block?: boolean;
8
8
  textClass?: string;
9
+ /**
10
+ * When true, tabs wrap to multiple rows on small screens instead of scrolling.
11
+ * Default: false (horizontal scroll behavior)
12
+ */
13
+ wrap?: boolean;
9
14
  }
10
15
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
11
16
  change: (value: string | number) => any;
@@ -17,6 +22,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
17
22
  variant: TabesVariant;
18
23
  size: TabesSize;
19
24
  block: boolean;
25
+ wrap: boolean;
20
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
21
27
  containerRef: HTMLDivElement;
22
28
  }, HTMLDivElement>;
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, ref as b, watch as l, onMounted as _, computed as g, openBlock as i, createElementBlock as p, normalizeClass as c, normalizeStyle as D, createCommentVNode as y, Fragment as N, renderList as O, createBlock as x, resolveDynamicComponent as P, mergeProps as T, withCtx as F, createElementVNode as q, toDisplayString as G, nextTick as H } from "vue";
1
+ import { defineComponent as E, ref as b, watch as l, onMounted as D, computed as g, openBlock as i, createElementBlock as p, normalizeClass as u, normalizeStyle as N, createCommentVNode as y, Fragment as O, renderList as P, createBlock as x, resolveDynamicComponent as T, mergeProps as F, withCtx as _, createElementVNode as q, toDisplayString as G, nextTick as H } from "vue";
2
2
  import { useResizeObserver as J } from "@vueuse/core";
3
3
  import K from "../Icon.vue.js";
4
4
  import { $t as Q } from "../../utils/i18n.js";
@@ -10,84 +10,91 @@ const Z = /* @__PURE__ */ E({
10
10
  size: { default: "md" },
11
11
  variant: { default: "surface" },
12
12
  block: { type: Boolean, default: !1 },
13
- textClass: {}
13
+ textClass: {},
14
+ wrap: { type: Boolean, default: !1 }
14
15
  },
15
16
  emits: ["update:modelValue", "change"],
16
17
  setup(s, { emit: h }) {
17
- const n = s, v = h, u = b(null), d = b(/* @__PURE__ */ new Map()), k = (e, a) => {
18
- e ? d.value.set(a, e) : d.value.delete(a);
19
- }, f = b({
18
+ const n = s, v = h, d = b(null), f = b(/* @__PURE__ */ new Map()), k = (e, a) => {
19
+ e ? f.value.set(a, e) : f.value.delete(a);
20
+ }, m = b({
20
21
  width: "0px",
21
22
  height: "0px",
22
23
  transform: "translate(0px, 0px)",
23
24
  opacity: 0
24
25
  }), o = async () => {
25
26
  await H();
26
- const e = u.value, a = d.value.get(n.modelValue);
27
+ const e = d.value, a = f.value.get(n.modelValue);
27
28
  if (!e || !a) {
28
- f.value.opacity = 0;
29
+ m.value.opacity = 0;
29
30
  return;
30
31
  }
31
- const r = e.getBoundingClientRect(), t = a.getBoundingClientRect(), m = t.left - r.left, M = t.top - r.top, j = t.width, A = t.height;
32
- f.value = {
32
+ const t = e.getBoundingClientRect(), r = a.getBoundingClientRect(), c = r.left - t.left, M = r.top - t.top, j = r.width, A = r.height;
33
+ m.value = {
33
34
  width: `${j}px`,
34
35
  height: `${A}px`,
35
- transform: `translate(${m}px, ${M}px)`,
36
+ transform: `translate(${c}px, ${M}px)`,
36
37
  opacity: 1
37
38
  };
38
39
  };
39
- J(u, o), l(() => n.modelValue, o), l(() => n.options, o, { deep: !0 }), l(() => n.size, o), l(() => n.block, o), _(o);
40
+ J(d, o), l(() => n.modelValue, o), l(() => n.options, o, { deep: !0 }), l(() => n.size, o), l(() => n.block, o), l(() => n.wrap, o), D(o);
40
41
  const C = (e) => {
41
42
  e.disabled || (v("update:modelValue", e.value), v("change", e.value));
42
- }, w = g(() => ["inline-flex rounded-lg relative isolate", {
43
- surface: "bg-secondary/80 p-1",
44
- primary: "bg-secondary p-1",
45
- secondary: "bg-secondary p-1",
46
- danger: "bg-danger/10 p-1",
47
- success: "bg-success/10 p-1",
48
- outline: "bg-transparent border border-border p-1",
49
- line: "bg-transparent gap-6 rounded-none p-0 border-b border-border w-full"
50
- }[n.variant], n.block ? "flex w-full" : ""]), z = {
43
+ }, w = g(() => {
44
+ const e = n.variant === "line", a = {
45
+ surface: "bg-secondary/80 p-1",
46
+ primary: "bg-secondary p-1",
47
+ secondary: "bg-secondary p-1",
48
+ danger: "bg-danger/10 p-1",
49
+ success: "bg-success/10 p-1",
50
+ outline: "bg-transparent border border-border p-1",
51
+ line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
52
+ }, t = n.wrap && !e ? "flex-wrap" : "";
53
+ return [`${n.block || e ? "flex w-full" : "inline-flex"} rounded-lg relative isolate ${t}`, a[n.variant]];
54
+ }), z = {
51
55
  sm: "text-xs px-2.5 py-1",
52
56
  md: "-text-fs-2 px-3 py-1",
53
57
  lg: "-text-fs-1 px-4 py-1"
54
- }, V = g(() => [n.variant === "line" ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-2 border-b-2 border-transparent hover:text-foreground" : "relative z-10 flex-1 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50"]), $ = (e) => {
55
- const a = e.value === n.modelValue, r = n.variant === "line";
56
- let t = "";
58
+ }, $ = g(() => {
59
+ const e = n.variant === "line", a = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-2 border-b-2 border-transparent hover:text-foreground" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t = (n.block || n.wrap) && !e ? "flex-1" : "";
60
+ return [a, t];
61
+ }), V = (e) => {
62
+ const a = e.value === n.modelValue, t = n.variant === "line";
63
+ let r = "";
57
64
  if (a)
58
- if (r)
59
- t = "text-primary";
65
+ if (t)
66
+ r = "text-primary";
60
67
  else
61
68
  switch (n.variant) {
62
69
  case "surface":
63
- t = "text-foreground";
70
+ r = "text-foreground";
64
71
  break;
65
72
  case "primary":
66
- t = "text-primary-foreground";
73
+ r = "text-primary-foreground";
67
74
  break;
68
75
  case "secondary":
69
- t = "text-secondary";
76
+ r = "text-secondary";
70
77
  break;
71
78
  case "danger":
72
- t = "text-danger-fg";
79
+ r = "text-danger-fg";
73
80
  break;
74
81
  case "success":
75
- t = "text-success-fg";
82
+ r = "text-success-fg";
76
83
  break;
77
84
  case "outline":
78
- t = "text-accent-foreground";
85
+ r = "text-accent-foreground";
79
86
  break;
80
87
  default:
81
- t = "text-foreground";
88
+ r = "text-foreground";
82
89
  }
83
90
  else
84
- t = r ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
85
- const m = e.disabled ? "opacity-50 cursor-not-allowed" : "";
86
- return [V.value, t, m].join(" ");
91
+ r = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
92
+ const c = e.disabled ? "opacity-50 cursor-not-allowed" : "";
93
+ return [$.value, r, c].join(" ");
87
94
  }, R = g(() => {
88
95
  const e = "absolute left-0 top-0 transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)] z-0 pointer-events-none";
89
96
  return n.variant === "line" ? `${e} !h-[2px] !top-auto bottom-0` : `${e} rounded-md shadow-sm`;
90
- }), S = () => ({
97
+ }), B = () => ({
91
98
  surface: "bg-background",
92
99
  primary: "bg-primary",
93
100
  secondary: "bg-secondary-foreground",
@@ -95,38 +102,38 @@ const Z = /* @__PURE__ */ E({
95
102
  success: "bg-success",
96
103
  outline: "bg-accent/50 ring-1 ring-border",
97
104
  line: "bg-primary"
98
- })[n.variant], B = (e) => e.labelI18n ? Q(e.labelI18n) : e.label, I = (e) => e.to ? "router-link" : e.href ? "a" : "button", L = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
105
+ })[n.variant], S = (e) => e.labelI18n ? Q(e.labelI18n) : e.label, I = (e) => e.to ? "router-link" : e.href ? "a" : "button", L = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
99
106
  return (e, a) => (i(), p("div", {
100
107
  ref_key: "containerRef",
101
- ref: u,
102
- class: c(w.value),
108
+ ref: d,
109
+ class: u(w.value),
103
110
  role: "tablist"
104
111
  }, [
105
- s.modelValue !== void 0 ? (i(), p("div", {
112
+ s.modelValue !== void 0 && !s.wrap ? (i(), p("div", {
106
113
  key: 0,
107
- class: c([R.value, S()]),
108
- style: D(f.value)
114
+ class: u([R.value, B()]),
115
+ style: N(m.value)
109
116
  }, null, 6)) : y("", !0),
110
- (i(!0), p(N, null, O(s.options, (r) => (i(), x(P(I(r)), T({
111
- key: r.value,
117
+ (i(!0), p(O, null, P(s.options, (t) => (i(), x(T(I(t)), F({
118
+ key: t.value,
112
119
  ref_for: !0,
113
- ref: (t) => k(t?.$el || t, r.value),
120
+ ref: (r) => k(r?.$el || r, t.value),
114
121
  role: "tab",
115
- "aria-selected": s.modelValue === r.value,
116
- disabled: r.disabled,
117
- class: [$(r), z[n.size]]
118
- }, { ref_for: !0 }, L(r), {
119
- onClick: (t) => C(r)
122
+ "aria-selected": s.modelValue === t.value,
123
+ disabled: t.disabled,
124
+ class: [V(t), z[n.size]]
125
+ }, { ref_for: !0 }, L(t), {
126
+ onClick: (r) => C(t)
120
127
  }), {
121
- default: F(() => [
122
- r.icon ? (i(), x(K, {
128
+ default: _(() => [
129
+ t.icon ? (i(), x(K, {
123
130
  key: 0,
124
- icon: r.icon,
125
- class: c(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
131
+ icon: t.icon,
132
+ class: u(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
126
133
  }, null, 8, ["icon", "class"])) : y("", !0),
127
134
  q("span", {
128
- class: c(["whitespace-nowrap z-20 relative", s.textClass])
129
- }, G(B(r)), 3)
135
+ class: u(["whitespace-nowrap z-20 relative", s.textClass])
136
+ }, G(S(t)), 3)
130
137
  ]),
131
138
  _: 2
132
139
  }, 1040, ["aria-selected", "disabled", "class", "onClick"]))), 128))
package/core/config.d.ts CHANGED
@@ -30,10 +30,17 @@ export declare const configState: {
30
30
  rounded?: import('..').InputRounded;
31
31
  showRequiredAsterisk?: boolean;
32
32
  };
33
+ price?: {
34
+ currency?: string;
35
+ };
36
+ date?: {
37
+ format?: string;
38
+ };
33
39
  };
34
40
  };
35
41
  /**
36
- * Helper to update the global configuration.
42
+ * Helper to update the global configuration safely.
43
+ * Uses deep merge to preserve existing nested objects.
37
44
  */
38
45
  export declare function updateConfig(updates: Partial<VLiteConfig>): void;
39
46
  /**
@@ -61,5 +68,11 @@ export declare function useVLiteConfig(): {
61
68
  rounded?: import('..').InputRounded;
62
69
  showRequiredAsterisk?: boolean;
63
70
  };
71
+ price?: {
72
+ currency?: string;
73
+ };
74
+ date?: {
75
+ format?: string;
76
+ };
64
77
  };
65
78
  };
package/core/config.js CHANGED
@@ -1,15 +1,21 @@
1
- import { reactive as o, inject as t } from "vue";
2
- const e = /* @__PURE__ */ Symbol("vlite-config"), n = {
1
+ import { reactive as t, inject as e } from "vue";
2
+ const o = /* @__PURE__ */ Symbol("vlite-config"), n = {
3
3
  services: {},
4
4
  components: {
5
- form: {}
5
+ form: {},
6
+ price: {
7
+ currency: "USD"
8
+ },
9
+ date: {
10
+ format: "MM/DD/YYYY"
11
+ }
6
12
  }
7
- }, i = o({ ...n });
8
- function f() {
9
- return t(e, i);
13
+ }, c = t({ ...n });
14
+ function r() {
15
+ return e(o, c);
10
16
  }
11
17
  export {
12
- e as VLITE_CONFIG_KEY,
13
- i as configState,
14
- f as useVLiteConfig
18
+ o as VLITE_CONFIG_KEY,
19
+ c as configState,
20
+ r as useVLiteConfig
15
21
  };
package/core/index.d.ts CHANGED
@@ -2,28 +2,6 @@ import { App } from 'vue';
2
2
  import { VLiteConfig } from '../types/config.type';
3
3
  /**
4
4
  * Creates the VLite plugin instance.
5
- *
6
- * @example
7
- * // main.ts
8
- * import { createApp } from 'vue'
9
- * import { createVLite } from 'vlite3'
10
- *
11
- * const app = createApp(App)
12
- *
13
- * const vlite = createVLite({
14
- * services: {
15
- * upload: async (file) => {
16
- * // Custom API call here
17
- * const formData = new FormData()
18
- * formData.append('file', file)
19
- * const res = await axios.post('/api/upload', formData)
20
- * return res.data.url
21
- * }
22
- * }
23
- * })
24
- *
25
- * app.use(vlite)
26
- * app.mount('#app')
27
5
  */
28
6
  export declare function createVLite(options?: VLiteConfig): {
29
7
  install(app: App): void;
package/core/index.js CHANGED
@@ -1,22 +1,30 @@
1
1
  import { configState as e, VLITE_CONFIG_KEY as a } from "./config.js";
2
- import { useVLiteConfig as f } from "./config.js";
3
- function m(r = {}) {
2
+ import { useVLiteConfig as n } from "./config.js";
3
+ function o(t = {}) {
4
4
  return {
5
- install(t) {
6
- r && (r.services && (e.services = { ...e.services, ...r.services }), r.importData && (e.importData = { ...e.importData, ...r.importData }), r.exportData && (e.exportData = { ...e.exportData, ...r.exportData }), r.components && (e.components = {
5
+ install(r) {
6
+ t && (t.services && (e.services = { ...e.services, ...t.services }), t.importData && (e.importData = { ...e.importData, ...t.importData }), t.exportData && (e.exportData = { ...e.exportData, ...t.exportData }), t.components && (e.components = {
7
7
  ...e.components,
8
- ...r.components,
8
+ ...t.components,
9
9
  form: {
10
10
  ...e.components?.form || {},
11
- ...r.components.form || {}
11
+ ...t.components.form || {}
12
+ },
13
+ price: {
14
+ ...e.components?.price || {},
15
+ ...t.components.price || {}
16
+ },
17
+ date: {
18
+ ...e.components?.date || {},
19
+ ...t.components.date || {}
12
20
  }
13
- })), t.provide(a, e), t.config.globalProperties.$vlite = e;
21
+ })), r.provide(a, e), r.config.globalProperties.$vlite = e;
14
22
  }
15
23
  };
16
24
  }
17
25
  export {
18
26
  a as VLITE_CONFIG_KEY,
19
27
  e as configState,
20
- m as createVLite,
21
- f as useVLiteConfig
28
+ o as createVLite,
29
+ n as useVLiteConfig
22
30
  };
package/index.d.ts CHANGED
@@ -72,3 +72,5 @@ export { $t } from './utils/i18n';
72
72
  export { createVLite, useVLiteConfig } from './core';
73
73
  export { GoogleSignInPlugin };
74
74
  export * from './components/StatusChip';
75
+ export * from './components/Price';
76
+ export * from './components/Date';