vlite3 1.4.21 → 1.4.23

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 (37) hide show
  1. package/components/Cart/Cart.vue.js +53 -49
  2. package/components/Cart/CartCouponInput.vue.d.ts +1 -0
  3. package/components/Cart/CartCouponInput.vue.js +36 -33
  4. package/components/Cart/CartLineItem.vue.d.ts +1 -0
  5. package/components/Cart/CartLineItem.vue.js +121 -113
  6. package/components/Cart/CartSummary.vue.d.ts +1 -0
  7. package/components/Cart/CartSummary.vue.js +59 -51
  8. package/components/Cart/CartVariant1.vue.js +66 -63
  9. package/components/Cart/CartVariant2.vue.js +50 -47
  10. package/components/Cart/CartVariant3.vue.js +61 -58
  11. package/components/Cart/CartVariant4.vue.js +72 -68
  12. package/components/CategoryManager/CategoryManager.vue2.js +2 -2
  13. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  14. package/components/Form/AccordionView.vue.js +80 -77
  15. package/components/Form/Form.vue.js +2 -2
  16. package/components/Form/Form.vue2.js +164 -162
  17. package/components/Form/FormField.vue.js +26 -28
  18. package/components/Form/FormFields.vue.js +2 -2
  19. package/components/Form/FormFields.vue2.js +21 -18
  20. package/components/Form/composables/useForm.js +150 -150
  21. package/components/Form/index.vue.js +1 -1
  22. package/components/Form/index.vue2.js +43 -39
  23. package/components/Input.vue.js +3 -3
  24. package/components/Price/Price.vue.js +2 -2
  25. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  26. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  27. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  28. package/components/Screen/ScreenFilter.vue.js +2 -2
  29. package/components/Textarea.vue.js +14 -14
  30. package/index.js +389 -388
  31. package/package.json +1 -1
  32. package/style.css +1 -1
  33. package/utils/i18n.d.ts +10 -4
  34. package/utils/i18n.js +14 -3
  35. /package/components/Dropdown/{DropdownMenu.vue3.js → DropdownMenu.vue2.js} +0 -0
  36. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  37. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { defineComponent as S, computed as o, openBlock as n, createElementBlock as r, normalizeClass as a, createElementVNode as l, toDisplayString as c, createVNode as u, unref as d, createCommentVNode as m, createTextVNode as g, createBlock as T } from "vue";
2
- import b from "../Icon.vue.js";
1
+ import { defineComponent as S, computed as c, openBlock as n, createElementBlock as u, normalizeClass as a, createElementVNode as r, toDisplayString as i, createVNode as l, unref as d, createCommentVNode as m, createTextVNode as g, createBlock as T } from "vue";
2
+ import y from "../Icon.vue.js";
3
3
  import f from "../Price/Price.vue.js";
4
4
  const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-success font-medium inline-flex items-center gap-1.5 min-w-0" }, j = { class: "truncate" }, B = { class: "text-muted-foreground font-medium" }, E = { class: "text-foreground font-semibold tabular-nums" }, N = {
5
5
  key: 0,
@@ -12,18 +12,19 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
12
12
  labels: {},
13
13
  compact: { type: Boolean, default: !1 },
14
14
  variant: { default: "Variant1" },
15
- coupon: {}
15
+ coupon: {},
16
+ currency: {}
16
17
  },
17
18
  setup(t) {
18
- const e = t, s = o(() => e.labels || {}), h = o(() => s.value.estimatedTax ? s.value.estimatedTax : e.totals.taxRate !== void 0 ? `Estimated Tax (${e.totals.taxRate}%)` : "Estimated Tax");
19
- o(() => {
20
- const i = e.totals.itemCount ?? 0;
21
- return i === 0 ? s.value.itemCount || "Items" : `${s.value.itemCount || "Items"} (${i})`;
19
+ const e = t, s = c(() => e.labels || {}), h = c(() => s.value.estimatedTax ? s.value.estimatedTax : e.totals.taxRate !== void 0 ? `Estimated Tax (${e.totals.taxRate}%)` : "Estimated Tax");
20
+ c(() => {
21
+ const o = e.totals.itemCount ?? 0;
22
+ return o === 0 ? s.value.itemCount || "Items" : `${s.value.itemCount || "Items"} (${o})`;
22
23
  });
23
- const p = o(() => {
24
- const i = e.coupon?.definition;
25
- return i && i.type === "percentage" ? `−${i.value}%` : null;
26
- }), y = o(() => e.coupon?.code ? `${s.value.discount || "Discount"} · ${e.coupon.code}` : s.value.discount || "Discount"), k = o(() => {
24
+ const b = c(() => {
25
+ const o = e.coupon?.definition;
26
+ return o && o.type === "percentage" ? `−${o.value}%` : null;
27
+ }), p = c(() => e.coupon?.code ? `${s.value.discount || "Discount"} · ${e.coupon.code}` : s.value.discount || "Discount"), k = c(() => {
27
28
  switch (e.variant) {
28
29
  case "Variant2":
29
30
  return e.compact ? "space-y-1.5 text-xs" : "space-y-2 text-sm";
@@ -34,7 +35,7 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
34
35
  default:
35
36
  return e.compact ? "space-y-1.5" : "space-y-2.5";
36
37
  }
37
- }), x = o(() => (e.variant === "Variant2", e.compact ? "text-xs" : "text-sm")), w = o(() => {
38
+ }), x = c(() => (e.variant === "Variant2", e.compact ? "text-xs" : "text-sm")), w = c(() => {
38
39
  switch (e.variant) {
39
40
  case "Variant2":
40
41
  return ["border-t border-dashed border-border pt-2 mt-1.5", e.compact ? "text-sm" : "text-base", "font-extrabold text-foreground"];
@@ -49,105 +50,112 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
49
50
  "font-black text-foreground"
50
51
  ];
51
52
  }
52
- }), V = o(
53
+ }), V = c(
53
54
  () => e.features.shipping && e.totals.freeShippingProgress && e.totals.freeShippingProgress.remaining > 0
54
55
  );
55
- return (i, v) => (n(), r("div", {
56
+ return (o, v) => (n(), u("div", {
56
57
  class: a(["v-cart-summary", k.value])
57
58
  }, [
58
- t.features.subtotal ? (n(), r("div", {
59
+ t.features.subtotal ? (n(), u("div", {
59
60
  key: 0,
60
61
  class: a(["flex items-center justify-between gap-3", x.value])
61
62
  }, [
62
- l("span", C, c(s.value.subtotal || "Subtotal"), 1),
63
- u(d(f), {
63
+ r("span", C, i(s.value.subtotal || "Subtotal"), 1),
64
+ l(d(f), {
64
65
  value: t.totals.subtotal,
66
+ currency: t.currency || t.totals.currency,
65
67
  class: "text-foreground font-semibold tabular-nums"
66
- }, null, 8, ["value"])
68
+ }, null, 8, ["value", "currency"])
67
69
  ], 2)) : m("", !0),
68
- t.features.discount && t.totals.discount && t.totals.discount > 0 ? (n(), r("div", {
70
+ t.features.discount && t.totals.discount && t.totals.discount > 0 ? (n(), u("div", {
69
71
  key: 1,
70
72
  class: a(["flex items-center justify-between gap-3", x.value])
71
73
  }, [
72
- l("span", $, [
73
- u(b, {
74
+ r("span", $, [
75
+ l(y, {
74
76
  icon: "lucide:tag",
75
77
  class: "w-3.5 h-3.5 shrink-0"
76
78
  }),
77
- l("span", j, c(y.value), 1),
78
- p.value ? (n(), r("span", {
79
+ r("span", j, i(p.value), 1),
80
+ b.value ? (n(), u("span", {
79
81
  key: 0,
80
82
  class: a(["inline-flex items-center px-1.5 py-0.5 rounded bg-success/10 text-success font-bold tabular-nums shrink-0", t.compact ? "text-[9px]" : "text-[10px]"])
81
- }, c(p.value), 3)) : m("", !0)
83
+ }, i(b.value), 3)) : m("", !0)
82
84
  ]),
83
- u(d(f), {
85
+ l(d(f), {
84
86
  value: -t.totals.discount,
87
+ currency: t.currency || t.totals.currency,
85
88
  class: "text-success font-semibold tabular-nums"
86
- }, null, 8, ["value"])
89
+ }, null, 8, ["value", "currency"])
87
90
  ], 2)) : m("", !0),
88
- V.value ? (n(), r("div", {
91
+ V.value ? (n(), u("div", {
89
92
  key: 2,
90
93
  class: a(["flex items-center gap-1.5 text-muted-foreground", t.compact ? "text-[10px]" : "text-xs"])
91
94
  }, [
92
- u(b, {
95
+ l(y, {
93
96
  icon: "lucide:truck",
94
97
  class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
95
98
  }, null, 8, ["class"]),
96
- l("span", null, [
99
+ r("span", null, [
97
100
  v[0] || (v[0] = g(" Add ", -1)),
98
- u(d(f), {
101
+ l(d(f), {
99
102
  value: t.totals.freeShippingProgress.remaining,
103
+ currency: t.currency || t.totals.currency,
100
104
  class: "font-semibold text-foreground"
101
- }, null, 8, ["value"]),
105
+ }, null, 8, ["value", "currency"]),
102
106
  v[1] || (v[1] = g(" more for free shipping ", -1))
103
107
  ])
104
108
  ], 2)) : m("", !0),
105
- t.features.shipping && t.totals.shipping !== void 0 ? (n(), r("div", {
109
+ t.features.shipping && t.totals.shipping !== void 0 ? (n(), u("div", {
106
110
  key: 3,
107
111
  class: a(["flex items-center justify-between gap-3", x.value])
108
112
  }, [
109
- l("span", B, c(s.value.shipping || "Shipping"), 1),
110
- l("span", E, [
111
- t.totals.shipping === 0 ? (n(), r("span", N, "Free")) : (n(), T(d(f), {
113
+ r("span", B, i(s.value.shipping || "Shipping"), 1),
114
+ r("span", E, [
115
+ t.totals.shipping === 0 ? (n(), u("span", N, "Free")) : (n(), T(d(f), {
112
116
  key: 1,
113
- value: t.totals.shipping
114
- }, null, 8, ["value"]))
117
+ value: t.totals.shipping,
118
+ currency: t.currency || t.totals.currency
119
+ }, null, 8, ["value", "currency"]))
115
120
  ])
116
121
  ], 2)) : m("", !0),
117
- t.features.estimatedTax && t.totals.estimatedTax !== void 0 ? (n(), r("div", {
122
+ t.features.estimatedTax && t.totals.estimatedTax !== void 0 ? (n(), u("div", {
118
123
  key: 4,
119
124
  class: a(["flex items-center justify-between gap-3", x.value])
120
125
  }, [
121
- l("span", D, c(h.value), 1),
122
- u(d(f), {
126
+ r("span", D, i(h.value), 1),
127
+ l(d(f), {
123
128
  value: t.totals.estimatedTax,
129
+ currency: t.currency || t.totals.currency,
124
130
  class: "text-foreground font-semibold tabular-nums"
125
- }, null, 8, ["value"])
131
+ }, null, 8, ["value", "currency"])
126
132
  ], 2)) : m("", !0),
127
- l("div", {
133
+ r("div", {
128
134
  class: a(["flex items-center justify-between gap-3", w.value])
129
135
  }, [
130
- l("span", P, c(s.value.grandTotal || "Grand Total"), 1),
131
- u(d(f), {
136
+ r("span", P, i(s.value.grandTotal || "Grand Total"), 1),
137
+ l(d(f), {
132
138
  value: t.totals.grandTotal,
139
+ currency: t.currency || t.totals.currency,
133
140
  class: a(["font-black text-foreground tabular-nums", e.compact ? "text-base" : "text-lg"])
134
- }, null, 8, ["value", "class"])
141
+ }, null, 8, ["value", "currency", "class"])
135
142
  ], 2),
136
- t.features.totalSavings && t.totals.totalSavings && t.totals.totalSavings > 0 ? (n(), r("div", {
143
+ t.features.totalSavings && t.totals.totalSavings && t.totals.totalSavings > 0 ? (n(), u("div", {
137
144
  key: 5,
138
145
  class: a(["flex items-center justify-between gap-3 pt-1", t.compact ? "text-[10px]" : "text-xs"])
139
146
  }, [
140
- l("span", F, [
141
- u(b, {
147
+ r("span", F, [
148
+ l(y, {
142
149
  icon: "lucide:circle-dollar-sign",
143
150
  class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
144
151
  }, null, 8, ["class"]),
145
- g(" " + c(s.value.totalSavings || "Total Savings"), 1)
152
+ g(" " + i(s.value.totalSavings || "Total Savings"), 1)
146
153
  ]),
147
- u(d(f), {
154
+ l(d(f), {
148
155
  value: t.totals.totalSavings,
156
+ currency: t.currency || t.totals.currency,
149
157
  class: "text-success font-bold tabular-nums"
150
- }, null, 8, ["value"])
158
+ }, null, 8, ["value", "currency"])
151
159
  ], 2)) : m("", !0)
152
160
  ], 2));
153
161
  }
@@ -1,20 +1,20 @@
1
- import { defineComponent as q, computed as s, openBlock as a, createElementBlock as u, normalizeStyle as B, normalizeClass as d, createElementVNode as y, createVNode as h, toDisplayString as v, createCommentVNode as c, createBlock as f, Fragment as D, renderList as L, withCtx as C, createTextVNode as w } from "vue";
2
- import N from "../Icon.vue.js";
3
- import x from "../Button.vue.js";
4
- import E from "./CartLineItem.vue.js";
5
- import I from "./CartSummary.vue.js";
6
- import j from "./CartCouponInput.vue.js";
7
- import R from "./CartEmptyState.vue.js";
8
- const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" }, T = {
1
+ import { defineComponent as B, computed as r, openBlock as a, createElementBlock as c, normalizeStyle as D, normalizeClass as d, createElementVNode as b, createVNode as x, toDisplayString as v, createCommentVNode as i, createBlock as f, Fragment as L, renderList as N, withCtx as w, createTextVNode as S } from "vue";
2
+ import E from "../Icon.vue.js";
3
+ import C from "../Button.vue.js";
4
+ import I from "./CartLineItem.vue.js";
5
+ import j from "./CartSummary.vue.js";
6
+ import R from "./CartCouponInput.vue.js";
7
+ import A from "./CartEmptyState.vue.js";
8
+ const F = { class: "min-w-0 flex-1" }, T = { class: "flex items-center gap-2" }, U = {
9
9
  key: 0,
10
10
  class: "inline-flex items-center justify-center px-1.5 h-5 rounded-full bg-muted text-muted-foreground text-[10px] font-bold tabular-nums"
11
- }, U = {
11
+ }, Y = {
12
12
  key: 0,
13
13
  class: "text-muted-foreground text-xs mt-0.5 truncate"
14
- }, Y = { class: "flex-1 min-h-0 overflow-y-auto" }, G = {
14
+ }, G = { class: "flex-1 min-h-0 overflow-y-auto" }, H = {
15
15
  key: 1,
16
16
  class: "space-y-2 pt-1"
17
- }, W = /* @__PURE__ */ q({
17
+ }, X = /* @__PURE__ */ B({
18
18
  __name: "CartVariant1",
19
19
  props: {
20
20
  data: {},
@@ -26,112 +26,115 @@ const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" },
26
26
  containerClass: {}
27
27
  },
28
28
  emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
29
- setup(e, { emit: S }) {
30
- const p = e, i = S, l = s(() => p.data), m = s(() => p.labels || {}), n = s(() => p.actions || {}), b = s(() => p.features || {}), r = s(() => l.value.empty || !l.value.items || l.value.items.length === 0), $ = s(
31
- () => l.value.totals.itemCount ?? l.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
32
- ), z = s(
33
- () => n.value.showContinue && b.value.continue && !n.value.continueDisabled && !r.value
29
+ setup(e, { emit: $ }) {
30
+ const p = e, u = $, o = r(() => p.data), m = r(() => p.labels || {}), n = r(() => p.actions || {}), y = r(() => p.features || {}), s = r(() => o.value.empty || !o.value.items || o.value.items.length === 0), z = r(
31
+ () => o.value.totals.itemCount ?? o.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
32
+ ), g = r(() => o.value.currency || o.value.totals.currency), V = r(
33
+ () => n.value.showContinue && y.value.continue && !n.value.continueDisabled && !s.value
34
34
  );
35
- return (k, t) => (a(), u("div", {
35
+ return (k, t) => (a(), c("div", {
36
36
  class: d(["v-cart v-cart-v1 flex flex-col bg-background text-foreground border border-border rounded-lg overflow-hidden h-full", [e.containerClass]]),
37
- style: B({
37
+ style: D({
38
38
  "--cart-cell-px": e.compact ? "0.875rem" : "1.25rem",
39
39
  "--cart-cell-py": e.compact ? "0.75rem" : "1rem"
40
40
  })
41
41
  }, [
42
- l.value.title || l.value.subtitle ? (a(), u("div", {
42
+ o.value.title || o.value.subtitle ? (a(), c("div", {
43
43
  key: 0,
44
44
  class: d(["flex items-center justify-between gap-3 border-b border-border shrink-0", e.compact ? "px-4 py-2.5" : "px-5 py-3.5"])
45
45
  }, [
46
- y("div", A, [
47
- y("div", F, [
48
- h(N, {
46
+ b("div", F, [
47
+ b("div", T, [
48
+ x(E, {
49
49
  icon: "lucide:shopping-bag",
50
50
  class: d(e.compact ? "w-4 h-4" : "w-5 h-5")
51
51
  }, null, 8, ["class"]),
52
- y("h2", {
52
+ b("h2", {
53
53
  class: d(["font-bold text-foreground leading-tight truncate", e.compact ? "text-sm" : "text-base"])
54
- }, v(l.value.title || m.value.cart || "Your Cart"), 3),
55
- r.value ? c("", !0) : (a(), u("span", T, v($.value), 1))
54
+ }, v(o.value.title || m.value.cart || "Your Cart"), 3),
55
+ s.value ? i("", !0) : (a(), c("span", U, v(z.value), 1))
56
56
  ]),
57
- l.value.subtitle && !e.compact ? (a(), u("p", U, v(l.value.subtitle), 1)) : c("", !0)
57
+ o.value.subtitle && !e.compact ? (a(), c("p", Y, v(o.value.subtitle), 1)) : i("", !0)
58
58
  ]),
59
- e.features.clearable && !r.value && !e.data.readonly ? (a(), f(x, {
59
+ e.features.clearable && !s.value && !e.data.readonly ? (a(), f(C, {
60
60
  key: 0,
61
61
  variant: "ghost",
62
62
  size: e.compact ? "xs" : "sm",
63
63
  icon: "lucide:trash-2",
64
64
  text: m.value.clearCart,
65
65
  "as-icon": !m.value.clearCart,
66
- onClick: t[0] || (t[0] = (o) => i("clear"))
67
- }, null, 8, ["size", "text", "as-icon"])) : c("", !0)
68
- ], 2)) : c("", !0),
69
- y("div", Y, [
70
- r.value ? (a(), f(R, {
66
+ onClick: t[0] || (t[0] = (l) => u("clear"))
67
+ }, null, 8, ["size", "text", "as-icon"])) : i("", !0)
68
+ ], 2)) : i("", !0),
69
+ b("div", G, [
70
+ s.value ? (a(), f(A, {
71
71
  key: 0,
72
72
  labels: e.labels,
73
73
  compact: e.compact,
74
- onContinueShopping: t[1] || (t[1] = (o) => i("continue-shopping"))
75
- }, null, 8, ["labels", "compact"])) : (a(), u("ul", {
74
+ onContinueShopping: t[1] || (t[1] = (l) => u("continue-shopping"))
75
+ }, null, 8, ["labels", "compact"])) : (a(), c("ul", {
76
76
  key: 1,
77
77
  class: d(["divide-y divide-border", e.compact ? "px-4" : "px-5"])
78
78
  }, [
79
- (a(!0), u(D, null, L(e.data.items, (o) => (a(), u("li", {
80
- key: o.id
79
+ (a(!0), c(L, null, N(e.data.items, (l) => (a(), c("li", {
80
+ key: l.id
81
81
  }, [
82
- h(E, {
83
- item: o,
82
+ x(I, {
83
+ item: l,
84
84
  features: e.features,
85
85
  labels: e.labels,
86
86
  compact: e.compact,
87
87
  readonly: e.data.readonly,
88
+ currency: g.value,
88
89
  layout: "drawer",
89
- "onUpdate:quantity": t[2] || (t[2] = (g, V) => i("update:quantity", g, V)),
90
- onRemove: t[3] || (t[3] = (g) => i("remove", g))
91
- }, null, 8, ["item", "features", "labels", "compact", "readonly"])
90
+ "onUpdate:quantity": t[2] || (t[2] = (h, q) => u("update:quantity", h, q)),
91
+ onRemove: t[3] || (t[3] = (h) => u("remove", h))
92
+ }, null, 8, ["item", "features", "labels", "compact", "readonly", "currency"])
92
93
  ]))), 128))
93
94
  ], 2))
94
95
  ]),
95
- r.value ? c("", !0) : (a(), u("div", {
96
+ s.value ? i("", !0) : (a(), c("div", {
96
97
  key: 1,
97
98
  class: d(["border-t border-border bg-card-light/40 shrink-0 space-y-3", e.compact ? "p-4" : "p-5"])
98
99
  }, [
99
- e.features.coupon ? (a(), f(j, {
100
+ e.features.coupon ? (a(), f(R, {
100
101
  key: 0,
101
102
  coupon: e.data.coupon,
102
103
  labels: e.labels,
103
104
  compact: e.compact,
104
105
  readonly: e.data.readonly,
105
- onApply: t[4] || (t[4] = (o) => i("apply-coupon", o)),
106
- onRemove: t[5] || (t[5] = (o) => i("remove-coupon")),
107
- onChange: t[6] || (t[6] = (o) => i("coupon-change", o))
108
- }, null, 8, ["coupon", "labels", "compact", "readonly"])) : c("", !0),
109
- h(I, {
106
+ currency: g.value,
107
+ onApply: t[4] || (t[4] = (l) => u("apply-coupon", l)),
108
+ onRemove: t[5] || (t[5] = (l) => u("remove-coupon")),
109
+ onChange: t[6] || (t[6] = (l) => u("coupon-change", l))
110
+ }, null, 8, ["coupon", "labels", "compact", "readonly", "currency"])) : i("", !0),
111
+ x(j, {
110
112
  totals: e.data.totals,
111
113
  features: e.features,
112
114
  labels: e.labels,
113
115
  compact: e.compact,
114
116
  coupon: e.data.coupon,
117
+ currency: g.value,
115
118
  variant: "Variant1"
116
- }, null, 8, ["totals", "features", "labels", "compact", "coupon"]),
117
- z.value && n.value.continueLabel || n.value.showContinueShopping && b.value.continueShopping ? (a(), u("div", G, [
118
- n.value.showContinue && b.value.continue ? (a(), f(x, {
119
+ }, null, 8, ["totals", "features", "labels", "compact", "coupon", "currency"]),
120
+ V.value && n.value.continueLabel || n.value.showContinueShopping && y.value.continueShopping ? (a(), c("div", H, [
121
+ n.value.showContinue && y.value.continue ? (a(), f(C, {
119
122
  key: 0,
120
123
  variant: "primary",
121
124
  size: e.compact ? "md" : "lg",
122
125
  block: !0,
123
126
  icon: n.value.continueIcon || "lucide:arrow-right",
124
127
  "icon-right": (n.value.continueIcon, void 0),
125
- disabled: n.value.continueDisabled || r.value,
128
+ disabled: n.value.continueDisabled || s.value,
126
129
  class: "w-full",
127
- onClick: t[7] || (t[7] = (o) => i("continue"))
130
+ onClick: t[7] || (t[7] = (l) => u("continue"))
128
131
  }, {
129
- default: C(() => [
130
- w(v(n.value.continueLabel || m.value.continue || "Continue to checkout"), 1)
132
+ default: w(() => [
133
+ S(v(n.value.continueLabel || m.value.continue || "Continue to checkout"), 1)
131
134
  ]),
132
135
  _: 1
133
- }, 8, ["size", "icon", "icon-right", "disabled"])) : c("", !0),
134
- n.value.showContinueShopping && b.value.continueShopping ? (a(), f(x, {
136
+ }, 8, ["size", "icon", "icon-right", "disabled"])) : i("", !0),
137
+ n.value.showContinueShopping && y.value.continueShopping ? (a(), f(C, {
135
138
  key: 1,
136
139
  variant: "ghost",
137
140
  size: e.compact ? "sm" : "md",
@@ -139,18 +142,18 @@ const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" },
139
142
  icon: n.value.continueShoppingIcon || "lucide:arrow-left",
140
143
  disabled: n.value.continueShoppingDisabled,
141
144
  class: "w-full",
142
- onClick: t[8] || (t[8] = (o) => i("continue-shopping"))
145
+ onClick: t[8] || (t[8] = (l) => u("continue-shopping"))
143
146
  }, {
144
- default: C(() => [
145
- w(v(n.value.continueShoppingLabel || m.value.continueShopping || "Continue shopping"), 1)
147
+ default: w(() => [
148
+ S(v(n.value.continueShoppingLabel || m.value.continueShopping || "Continue shopping"), 1)
146
149
  ]),
147
150
  _: 1
148
- }, 8, ["size", "icon", "disabled"])) : c("", !0)
149
- ])) : c("", !0)
151
+ }, 8, ["size", "icon", "disabled"])) : i("", !0)
152
+ ])) : i("", !0)
150
153
  ], 2))
151
154
  ], 6));
152
155
  }
153
156
  });
154
157
  export {
155
- W as default
158
+ X as default
156
159
  };
@@ -1,17 +1,17 @@
1
- import { defineComponent as z, computed as r, openBlock as a, createElementBlock as s, normalizeClass as o, createElementVNode as n, createBlock as p, createCommentVNode as d, toDisplayString as v, Fragment as L, renderList as N, createVNode as k, withCtx as C, createTextVNode as w } from "vue";
2
- import q from "../Icon.vue.js";
3
- import S from "../Button.vue.js";
4
- import B from "./CartLineItem.vue.js";
5
- import A from "./CartSummary.vue.js";
6
- import D from "./CartCouponInput.vue.js";
7
- import E from "./CartEmptyState.vue.js";
8
- const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "flex-1 min-h-0 overflow-y-auto" }, j = { class: "divide-y divide-dashed divide-border" }, F = {
1
+ import { defineComponent as L, computed as r, openBlock as a, createElementBlock as s, normalizeClass as o, createElementVNode as n, createBlock as v, createCommentVNode as d, toDisplayString as p, Fragment as N, renderList as q, createVNode as C, withCtx as w, createTextVNode as S } from "vue";
2
+ import B from "../Icon.vue.js";
3
+ import $ from "../Button.vue.js";
4
+ import A from "./CartLineItem.vue.js";
5
+ import D from "./CartSummary.vue.js";
6
+ import E from "./CartCouponInput.vue.js";
7
+ import I from "./CartEmptyState.vue.js";
8
+ const R = { class: "flex items-center justify-center gap-1.5" }, j = { class: "flex-1 min-h-0 overflow-y-auto" }, F = { class: "divide-y divide-dashed divide-border" }, T = {
9
9
  key: 0,
10
10
  class: "shrink-0"
11
- }, T = {
11
+ }, U = {
12
12
  key: 1,
13
13
  class: "grid grid-cols-2 gap-2"
14
- }, P = /* @__PURE__ */ z({
14
+ }, Q = /* @__PURE__ */ L({
15
15
  __name: "CartVariant2",
16
16
  props: {
17
17
  data: {},
@@ -23,33 +23,33 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
23
23
  containerClass: {}
24
24
  },
25
25
  emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
26
- setup(e, { emit: $ }) {
27
- const b = e, u = $, c = r(() => b.data), y = r(() => b.labels || {}), l = r(() => b.actions || {}), m = r(() => b.features || {}), f = r(() => c.value.empty || !c.value.items || c.value.items.length === 0), x = r(
28
- () => c.value.totals.itemCount ?? c.value.items?.reduce((h, t) => h + (t.quantity || 0), 0) ?? 0
29
- );
30
- return (h, t) => (a(), s("div", {
26
+ setup(e, { emit: V }) {
27
+ const b = e, u = V, l = r(() => b.data), f = r(() => b.labels || {}), c = r(() => b.actions || {}), m = r(() => b.features || {}), y = r(() => l.value.empty || !l.value.items || l.value.items.length === 0), h = r(
28
+ () => l.value.totals.itemCount ?? l.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
29
+ ), g = r(() => l.value.currency || l.value.totals.currency);
30
+ return (k, t) => (a(), s("div", {
31
31
  class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
32
32
  }, [
33
33
  n("div", {
34
34
  class: o(["text-center border-b border-dashed border-border shrink-0", e.compact ? "p-3" : "p-4"])
35
35
  }, [
36
- n("div", I, [
37
- c.value.brandLogo ? (a(), p(q, {
36
+ n("div", R, [
37
+ l.value.brandLogo ? (a(), v(B, {
38
38
  key: 0,
39
- icon: c.value.brandLogo,
39
+ icon: l.value.brandLogo,
40
40
  class: o(e.compact ? "w-5 h-5" : "w-6 h-6")
41
41
  }, null, 8, ["icon", "class"])) : d("", !0),
42
42
  n("p", {
43
43
  class: o(["font-bold text-foreground tracking-wide", e.compact ? "text-sm" : "text-base"])
44
- }, v(c.value.brandName || c.value.title || y.value.cart || "Cart"), 3)
44
+ }, p(l.value.brandName || l.value.title || f.value.cart || "Cart"), 3)
45
45
  ]),
46
- f.value ? d("", !0) : (a(), s("p", {
46
+ y.value ? d("", !0) : (a(), s("p", {
47
47
  key: 0,
48
48
  class: o(["text-muted-foreground tabular-nums font-semibold uppercase tracking-wider", e.compact ? "text-[10px] mt-0.5" : "text-xs mt-1"])
49
- }, v(x.value) + " " + v(x.value === 1 ? "item" : "items"), 3))
49
+ }, p(h.value) + " " + p(h.value === 1 ? "item" : "items"), 3))
50
50
  ], 2),
51
- n("div", R, [
52
- f.value ? (a(), p(E, {
51
+ n("div", j, [
52
+ y.value ? (a(), v(I, {
53
53
  key: 0,
54
54
  labels: e.labels,
55
55
  compact: e.compact,
@@ -64,39 +64,41 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
64
64
  n("span", { class: "flex-1" }, "Item", -1),
65
65
  n("span", { class: "w-20 text-right" }, "Amount", -1)
66
66
  ])], 2),
67
- n("ul", j, [
68
- (a(!0), s(L, null, N(e.data.items, (i) => (a(), s("li", {
67
+ n("ul", F, [
68
+ (a(!0), s(N, null, q(e.data.items, (i) => (a(), s("li", {
69
69
  key: i.id
70
70
  }, [
71
- k(B, {
71
+ C(A, {
72
72
  item: i,
73
73
  features: e.features,
74
74
  labels: e.labels,
75
75
  compact: e.compact,
76
76
  readonly: e.data.readonly,
77
+ currency: g.value,
77
78
  layout: "compact",
78
- "onUpdate:quantity": t[1] || (t[1] = (g, V) => u("update:quantity", g, V)),
79
- onRemove: t[2] || (t[2] = (g) => u("remove", g))
80
- }, null, 8, ["item", "features", "labels", "compact", "readonly"])
79
+ "onUpdate:quantity": t[1] || (t[1] = (x, z) => u("update:quantity", x, z)),
80
+ onRemove: t[2] || (t[2] = (x) => u("remove", x))
81
+ }, null, 8, ["item", "features", "labels", "compact", "readonly", "currency"])
81
82
  ]))), 128))
82
83
  ])
83
84
  ], 2))
84
85
  ]),
85
- f.value ? d("", !0) : (a(), s("div", F, [
86
+ y.value ? d("", !0) : (a(), s("div", T, [
86
87
  n("div", {
87
88
  class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
88
89
  }, null, 2),
89
90
  n("div", {
90
91
  class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
91
92
  }, [
92
- k(A, {
93
+ C(D, {
93
94
  totals: e.data.totals,
94
95
  features: e.features,
95
96
  labels: e.labels,
96
97
  compact: e.compact,
97
98
  coupon: e.data.coupon,
99
+ currency: g.value,
98
100
  variant: "Variant2"
99
- }, null, 8, ["totals", "features", "labels", "compact", "coupon"])
101
+ }, null, 8, ["totals", "features", "labels", "compact", "coupon", "currency"])
100
102
  ], 2),
101
103
  n("div", {
102
104
  class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
@@ -104,42 +106,43 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
104
106
  n("div", {
105
107
  class: o(e.compact ? "px-3 py-2.5 space-y-2.5" : "px-4 py-3 space-y-3")
106
108
  }, [
107
- e.features.coupon ? (a(), p(D, {
109
+ e.features.coupon ? (a(), v(E, {
108
110
  key: 0,
109
111
  coupon: e.data.coupon,
110
112
  labels: e.labels,
111
113
  compact: e.compact,
112
114
  readonly: e.data.readonly,
115
+ currency: g.value,
113
116
  onApply: t[3] || (t[3] = (i) => u("apply-coupon", i)),
114
117
  onRemove: t[4] || (t[4] = (i) => u("remove-coupon")),
115
118
  onChange: t[5] || (t[5] = (i) => u("coupon-change", i))
116
- }, null, 8, ["coupon", "labels", "compact", "readonly"])) : d("", !0),
117
- l.value.showContinue && m.value.continue || l.value.showContinueShopping && m.value.continueShopping ? (a(), s("div", T, [
118
- l.value.showContinueShopping && m.value.continueShopping ? (a(), p(S, {
119
+ }, null, 8, ["coupon", "labels", "compact", "readonly", "currency"])) : d("", !0),
120
+ c.value.showContinue && m.value.continue || c.value.showContinueShopping && m.value.continueShopping ? (a(), s("div", U, [
121
+ c.value.showContinueShopping && m.value.continueShopping ? (a(), v($, {
119
122
  key: 0,
120
123
  variant: "outline",
121
124
  size: e.compact ? "sm" : "md",
122
- icon: l.value.continueShoppingIcon || "lucide:plus",
123
- disabled: l.value.continueShoppingDisabled,
125
+ icon: c.value.continueShoppingIcon || "lucide:plus",
126
+ disabled: c.value.continueShoppingDisabled,
124
127
  onClick: t[6] || (t[6] = (i) => u("continue-shopping"))
125
128
  }, {
126
- default: C(() => [
127
- w(v(l.value.continueShoppingLabel || y.value.continueShopping || "Add more"), 1)
129
+ default: w(() => [
130
+ S(p(c.value.continueShoppingLabel || f.value.continueShopping || "Add more"), 1)
128
131
  ]),
129
132
  _: 1
130
133
  }, 8, ["size", "icon", "disabled"])) : d("", !0),
131
- l.value.showContinue && m.value.continue ? (a(), p(S, {
134
+ c.value.showContinue && m.value.continue ? (a(), v($, {
132
135
  key: 1,
133
136
  variant: "primary",
134
137
  size: e.compact ? "sm" : "md",
135
- icon: l.value.continueIcon || "lucide:credit-card",
138
+ icon: c.value.continueIcon || "lucide:credit-card",
136
139
  "icon-right": void 0,
137
- disabled: l.value.continueDisabled || f.value,
138
- class: o(l.value.showContinueShopping && m.value.continueShopping ? "" : "col-span-2"),
140
+ disabled: c.value.continueDisabled || y.value,
141
+ class: o(c.value.showContinueShopping && m.value.continueShopping ? "" : "col-span-2"),
139
142
  onClick: t[7] || (t[7] = (i) => u("continue"))
140
143
  }, {
141
- default: C(() => [
142
- w(v(l.value.continueLabel || y.value.continue || "Checkout"), 1)
144
+ default: w(() => [
145
+ S(p(c.value.continueLabel || f.value.continue || "Checkout"), 1)
143
146
  ]),
144
147
  _: 1
145
148
  }, 8, ["size", "icon", "disabled", "class"])) : d("", !0)
@@ -150,5 +153,5 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
150
153
  }
151
154
  });
152
155
  export {
153
- P as default
156
+ Q as default
154
157
  };