vlite3 1.4.4 → 1.4.6

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 (102) hide show
  1. package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +4 -17
  2. package/components/AppShell/AppShellLayoutStorefront.vue.js +116 -152
  3. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.js +1 -1
  5. package/components/Cart/Cart.vue.js +242 -0
  6. package/components/Cart/Cart.vue2.js +4 -0
  7. package/components/Cart/CartCouponInput.vue.js +176 -0
  8. package/components/Cart/CartCouponInput.vue2.js +4 -0
  9. package/components/Cart/CartEmptyState.vue.js +48 -0
  10. package/components/Cart/CartEmptyState.vue2.js +4 -0
  11. package/components/Cart/CartLineItem.vue.js +341 -0
  12. package/components/Cart/CartLineItem.vue2.js +4 -0
  13. package/components/Cart/CartSummary.vue.js +157 -0
  14. package/components/Cart/CartSummary.vue2.js +4 -0
  15. package/components/Cart/CartVariant1.vue.js +156 -0
  16. package/components/Cart/CartVariant1.vue2.js +4 -0
  17. package/components/Cart/CartVariant2.vue.js +154 -0
  18. package/components/Cart/CartVariant2.vue2.js +4 -0
  19. package/components/Cart/CartVariant3.vue.js +192 -0
  20. package/components/Cart/CartVariant3.vue2.js +4 -0
  21. package/components/Cart/CartVariant4.vue.js +145 -0
  22. package/components/Cart/CartVariant4.vue2.js +4 -0
  23. package/components/Cart/composables/useCart.d.ts +46 -0
  24. package/components/Cart/composables/useCart.js +110 -0
  25. package/components/Cart/composables/useCartCalculation.js +145 -0
  26. package/components/Cart/index.d.ts +2 -0
  27. package/components/CategoryManager/CategoryManager.vue.js +3 -3
  28. package/components/CategoryManager/CategoryManager.vue2.js +225 -249
  29. package/components/CategoryManager/utils.d.ts +3 -0
  30. package/components/CategoryManager/utils.js +31 -0
  31. package/components/CategoryMenu/CategoryMenu.vue.d.ts +2 -0
  32. package/components/CategoryMenu/CategoryMenu.vue.js +46 -40
  33. package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +5 -1
  34. package/components/CategoryMenu/CategoryMenuVariant1.vue.js +5 -144
  35. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +220 -2
  36. package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +5 -1
  37. package/components/CategoryMenu/CategoryMenuVariant2.vue.js +5 -160
  38. package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +235 -2
  39. package/components/CategoryMenu/types.d.ts +5 -2
  40. package/components/Chat/ChatInterface.vue.js +1 -1
  41. package/components/Comment/CommentEditor.vue.js +1 -1
  42. package/components/Dropdown/Dropdown.vue.d.ts +1 -0
  43. package/components/Dropdown/Dropdown.vue.js +31 -29
  44. package/components/FilePicker/FilePickerDropzone.vue.d.ts +27 -0
  45. package/components/FilePicker/FilePickerDropzone.vue.js +117 -0
  46. package/components/FilePicker/FilePickerDropzone.vue2.js +4 -0
  47. package/components/FilePicker/FilePickerInput.vue.d.ts +22 -0
  48. package/components/FilePicker/FilePickerInput.vue.js +147 -0
  49. package/components/FilePicker/FilePickerInput.vue2.js +4 -0
  50. package/components/FilePicker/FilePreview.vue.d.ts +21 -0
  51. package/components/FilePicker/FilePreview.vue.js +95 -0
  52. package/components/FilePicker/FilePreview.vue2.js +4 -0
  53. package/components/FilePicker/composables/useFileProcessing.d.ts +65 -0
  54. package/components/FilePicker/composables/useFileProcessing.js +141 -0
  55. package/components/FilePicker/index.d.ts +2 -2
  56. package/components/FilePicker/{FilePicker.vue.d.ts → index.vue.d.ts} +11 -18
  57. package/components/FilePicker/index.vue.js +131 -0
  58. package/components/FilePicker/index.vue2.js +4 -0
  59. package/components/FilePicker/types.d.ts +17 -0
  60. package/components/FilePicker/utils.d.ts +23 -0
  61. package/components/FilePicker/utils.js +37 -0
  62. package/components/Form/AccordionView.vue.d.ts +26 -0
  63. package/components/Form/AccordionView.vue.js +219 -0
  64. package/components/Form/AccordionView.vue2.js +4 -0
  65. package/components/Form/FormField.vue.js +3 -3
  66. package/components/Form/FormFields.vue.js +2 -2
  67. package/components/Form/TableRow.vue.d.ts +18 -0
  68. package/components/Form/TableRow.vue.js +88 -0
  69. package/components/Form/TableRow.vue2.js +4 -0
  70. package/components/Form/TableView.vue.d.ts +23 -0
  71. package/components/Form/TableView.vue.js +88 -0
  72. package/components/Form/TableView.vue2.js +4 -0
  73. package/components/Form/composables/useCustomFieldRows.d.ts +52 -0
  74. package/components/Form/composables/useCustomFieldRows.js +77 -0
  75. package/components/Form/index.d.ts +1 -1
  76. package/components/Form/{CustomFields.vue.d.ts → index.vue.d.ts} +8 -5
  77. package/components/Form/index.vue.js +7 -0
  78. package/components/Form/index.vue2.js +141 -0
  79. package/components/Form/rowHelpers.d.ts +45 -0
  80. package/components/Form/rowHelpers.js +40 -0
  81. package/components/Form/types.d.ts +3 -0
  82. package/components/IconPicker.vue.d.ts +2 -2
  83. package/components/Modal.vue.d.ts +2 -0
  84. package/components/Modal.vue.js +1 -1
  85. package/components/Modal.vue2.js +30 -28
  86. package/components/Screen/ScreenFilter.vue.js +4 -3
  87. package/components/SidePanel.vue.d.ts +2 -0
  88. package/components/SidePanel.vue.js +1 -1
  89. package/components/SidePanel.vue2.js +25 -23
  90. package/components/SidebarMenu/SidebarMenu.vue.js +145 -128
  91. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
  92. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
  93. package/components/index.d.ts +2 -1
  94. package/core/config.d.ts +6 -6
  95. package/index.d.ts +1 -0
  96. package/index.js +328 -307
  97. package/package.json +1 -1
  98. package/style.css +1 -1
  99. package/components/FilePicker/FilePicker.vue.js +0 -361
  100. package/components/FilePicker/FilePicker.vue2.js +0 -4
  101. package/components/Form/CustomFields.vue.js +0 -7
  102. package/components/Form/CustomFields.vue2.js +0 -261
@@ -0,0 +1,157 @@
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";
3
+ import f from "../Price/Price.vue.js";
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
+ key: 0,
6
+ class: "text-success font-semibold"
7
+ }, D = { class: "text-muted-foreground font-medium" }, P = { class: "uppercase tracking-widest text-xs font-bold text-muted-foreground" }, F = { class: "text-success font-semibold inline-flex items-center gap-1.5" }, z = /* @__PURE__ */ S({
8
+ __name: "CartSummary",
9
+ props: {
10
+ totals: {},
11
+ features: {},
12
+ labels: {},
13
+ compact: { type: Boolean, default: !1 },
14
+ variant: { default: "Variant1" },
15
+ coupon: {}
16
+ },
17
+ 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})`;
22
+ });
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(() => {
27
+ switch (e.variant) {
28
+ case "Variant2":
29
+ return e.compact ? "space-y-1.5 text-xs" : "space-y-2 text-sm";
30
+ case "Variant3":
31
+ return "space-y-2 text-sm";
32
+ case "Variant4":
33
+ return "space-y-1.5 text-sm";
34
+ default:
35
+ return e.compact ? "space-y-1.5" : "space-y-2.5";
36
+ }
37
+ }), x = o(() => (e.variant === "Variant2", e.compact ? "text-xs" : "text-sm")), w = o(() => {
38
+ switch (e.variant) {
39
+ case "Variant2":
40
+ return ["border-t border-dashed border-border pt-2 mt-1.5", e.compact ? "text-sm" : "text-base", "font-extrabold text-foreground"];
41
+ case "Variant3":
42
+ return ["border-t border-border pt-3 mt-1 text-base font-extrabold text-foreground"];
43
+ case "Variant4":
44
+ return ["border-t border-border pt-2 mt-1 text-base font-extrabold text-foreground"];
45
+ default:
46
+ return [
47
+ "border-t border-border pt-3 mt-1",
48
+ e.compact ? "text-base" : "text-lg",
49
+ "font-black text-foreground"
50
+ ];
51
+ }
52
+ }), V = o(
53
+ () => e.features.shipping && e.totals.freeShippingProgress && e.totals.freeShippingProgress.remaining > 0
54
+ );
55
+ return (i, v) => (n(), r("div", {
56
+ class: a(["v-cart-summary", k.value])
57
+ }, [
58
+ t.features.subtotal ? (n(), r("div", {
59
+ key: 0,
60
+ class: a(["flex items-center justify-between gap-3", x.value])
61
+ }, [
62
+ l("span", C, c(s.value.subtotal || "Subtotal"), 1),
63
+ u(d(f), {
64
+ value: t.totals.subtotal,
65
+ class: "text-foreground font-semibold tabular-nums"
66
+ }, null, 8, ["value"])
67
+ ], 2)) : m("", !0),
68
+ t.features.discount && t.totals.discount && t.totals.discount > 0 ? (n(), r("div", {
69
+ key: 1,
70
+ class: a(["flex items-center justify-between gap-3", x.value])
71
+ }, [
72
+ l("span", $, [
73
+ u(b, {
74
+ icon: "lucide:tag",
75
+ class: "w-3.5 h-3.5 shrink-0"
76
+ }),
77
+ l("span", j, c(y.value), 1),
78
+ p.value ? (n(), r("span", {
79
+ key: 0,
80
+ 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)
82
+ ]),
83
+ u(d(f), {
84
+ value: -t.totals.discount,
85
+ class: "text-success font-semibold tabular-nums"
86
+ }, null, 8, ["value"])
87
+ ], 2)) : m("", !0),
88
+ V.value ? (n(), r("div", {
89
+ key: 2,
90
+ class: a(["flex items-center gap-1.5 text-muted-foreground", t.compact ? "text-[10px]" : "text-xs"])
91
+ }, [
92
+ u(b, {
93
+ icon: "lucide:truck",
94
+ class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
95
+ }, null, 8, ["class"]),
96
+ l("span", null, [
97
+ v[0] || (v[0] = g(" Add ", -1)),
98
+ u(d(f), {
99
+ value: t.totals.freeShippingProgress.remaining,
100
+ class: "font-semibold text-foreground"
101
+ }, null, 8, ["value"]),
102
+ v[1] || (v[1] = g(" more for free shipping ", -1))
103
+ ])
104
+ ], 2)) : m("", !0),
105
+ t.features.shipping && t.totals.shipping !== void 0 ? (n(), r("div", {
106
+ key: 3,
107
+ class: a(["flex items-center justify-between gap-3", x.value])
108
+ }, [
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), {
112
+ key: 1,
113
+ value: t.totals.shipping
114
+ }, null, 8, ["value"]))
115
+ ])
116
+ ], 2)) : m("", !0),
117
+ t.features.estimatedTax && t.totals.estimatedTax !== void 0 ? (n(), r("div", {
118
+ key: 4,
119
+ class: a(["flex items-center justify-between gap-3", x.value])
120
+ }, [
121
+ l("span", D, c(h.value), 1),
122
+ u(d(f), {
123
+ value: t.totals.estimatedTax,
124
+ class: "text-foreground font-semibold tabular-nums"
125
+ }, null, 8, ["value"])
126
+ ], 2)) : m("", !0),
127
+ l("div", {
128
+ class: a(["flex items-center justify-between gap-3", w.value])
129
+ }, [
130
+ l("span", P, c(s.value.grandTotal || "Grand Total"), 1),
131
+ u(d(f), {
132
+ value: t.totals.grandTotal,
133
+ class: a(["font-black text-foreground tabular-nums", e.compact ? "text-base" : "text-lg"])
134
+ }, null, 8, ["value", "class"])
135
+ ], 2),
136
+ t.features.totalSavings && t.totals.totalSavings && t.totals.totalSavings > 0 ? (n(), r("div", {
137
+ key: 5,
138
+ class: a(["flex items-center justify-between gap-3 pt-1", t.compact ? "text-[10px]" : "text-xs"])
139
+ }, [
140
+ l("span", F, [
141
+ u(b, {
142
+ icon: "lucide:circle-dollar-sign",
143
+ class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
144
+ }, null, 8, ["class"]),
145
+ g(" " + c(s.value.totalSavings || "Total Savings"), 1)
146
+ ]),
147
+ u(d(f), {
148
+ value: t.totals.totalSavings,
149
+ class: "text-success font-bold tabular-nums"
150
+ }, null, 8, ["value"])
151
+ ], 2)) : m("", !0)
152
+ ], 2));
153
+ }
154
+ });
155
+ export {
156
+ z as default
157
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CartSummary.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,156 @@
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 = {
9
+ key: 0,
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 = {
12
+ key: 0,
13
+ class: "text-muted-foreground text-xs mt-0.5 truncate"
14
+ }, Y = { class: "flex-1 min-h-0 overflow-y-auto" }, G = {
15
+ key: 1,
16
+ class: "space-y-2 pt-1"
17
+ }, W = /* @__PURE__ */ q({
18
+ __name: "CartVariant1",
19
+ props: {
20
+ data: {},
21
+ actions: {},
22
+ features: {},
23
+ labels: {},
24
+ compact: { type: Boolean, default: !1 },
25
+ variant: { default: "Variant1" },
26
+ containerClass: {}
27
+ },
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
34
+ );
35
+ return (k, t) => (a(), u("div", {
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({
38
+ "--cart-cell-px": e.compact ? "0.875rem" : "1.25rem",
39
+ "--cart-cell-py": e.compact ? "0.75rem" : "1rem"
40
+ })
41
+ }, [
42
+ l.value.title || l.value.subtitle ? (a(), u("div", {
43
+ key: 0,
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
+ }, [
46
+ y("div", A, [
47
+ y("div", F, [
48
+ h(N, {
49
+ icon: "lucide:shopping-bag",
50
+ class: d(e.compact ? "w-4 h-4" : "w-5 h-5")
51
+ }, null, 8, ["class"]),
52
+ y("h2", {
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))
56
+ ]),
57
+ l.value.subtitle && !e.compact ? (a(), u("p", U, v(l.value.subtitle), 1)) : c("", !0)
58
+ ]),
59
+ e.features.clearable && !r.value && !e.data.readonly ? (a(), f(x, {
60
+ key: 0,
61
+ variant: "ghost",
62
+ size: e.compact ? "xs" : "sm",
63
+ icon: "lucide:trash-2",
64
+ text: m.value.clearCart,
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, {
71
+ key: 0,
72
+ labels: e.labels,
73
+ compact: e.compact,
74
+ onContinueShopping: t[1] || (t[1] = (o) => i("continue-shopping"))
75
+ }, null, 8, ["labels", "compact"])) : (a(), u("ul", {
76
+ key: 1,
77
+ class: d(["divide-y divide-border", e.compact ? "px-4" : "px-5"])
78
+ }, [
79
+ (a(!0), u(D, null, L(e.data.items, (o) => (a(), u("li", {
80
+ key: o.id
81
+ }, [
82
+ h(E, {
83
+ item: o,
84
+ features: e.features,
85
+ labels: e.labels,
86
+ compact: e.compact,
87
+ readonly: e.data.readonly,
88
+ 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"])
92
+ ]))), 128))
93
+ ], 2))
94
+ ]),
95
+ r.value ? c("", !0) : (a(), u("div", {
96
+ key: 1,
97
+ class: d(["border-t border-border bg-card-light/40 shrink-0 space-y-3", e.compact ? "p-4" : "p-5"])
98
+ }, [
99
+ e.features.coupon ? (a(), f(j, {
100
+ key: 0,
101
+ coupon: e.data.coupon,
102
+ labels: e.labels,
103
+ compact: e.compact,
104
+ 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, {
110
+ totals: e.data.totals,
111
+ features: e.features,
112
+ labels: e.labels,
113
+ compact: e.compact,
114
+ coupon: e.data.coupon,
115
+ 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
+ key: 0,
120
+ variant: "primary",
121
+ size: e.compact ? "md" : "lg",
122
+ block: !0,
123
+ icon: n.value.continueIcon || "lucide:arrow-right",
124
+ "icon-right": (n.value.continueIcon, void 0),
125
+ disabled: n.value.continueDisabled || r.value,
126
+ class: "w-full",
127
+ onClick: t[7] || (t[7] = (o) => i("continue"))
128
+ }, {
129
+ default: C(() => [
130
+ w(v(n.value.continueLabel || m.value.continue || "Continue to checkout"), 1)
131
+ ]),
132
+ _: 1
133
+ }, 8, ["size", "icon", "icon-right", "disabled"])) : c("", !0),
134
+ n.value.showContinueShopping && b.value.continueShopping ? (a(), f(x, {
135
+ key: 1,
136
+ variant: "ghost",
137
+ size: e.compact ? "sm" : "md",
138
+ block: !0,
139
+ icon: n.value.continueShoppingIcon || "lucide:arrow-left",
140
+ disabled: n.value.continueShoppingDisabled,
141
+ class: "w-full",
142
+ onClick: t[8] || (t[8] = (o) => i("continue-shopping"))
143
+ }, {
144
+ default: C(() => [
145
+ w(v(n.value.continueShoppingLabel || m.value.continueShopping || "Continue shopping"), 1)
146
+ ]),
147
+ _: 1
148
+ }, 8, ["size", "icon", "disabled"])) : c("", !0)
149
+ ])) : c("", !0)
150
+ ], 2))
151
+ ], 6));
152
+ }
153
+ });
154
+ export {
155
+ W as default
156
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CartVariant1.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,154 @@
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 = {
9
+ key: 0,
10
+ class: "shrink-0"
11
+ }, T = {
12
+ key: 1,
13
+ class: "grid grid-cols-2 gap-2"
14
+ }, P = /* @__PURE__ */ z({
15
+ __name: "CartVariant2",
16
+ props: {
17
+ data: {},
18
+ actions: {},
19
+ features: {},
20
+ labels: {},
21
+ compact: { type: Boolean, default: !1 },
22
+ variant: { default: "Variant2" },
23
+ containerClass: {}
24
+ },
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", {
31
+ class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border max-w-md mx-auto overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
32
+ }, [
33
+ n("div", {
34
+ class: o(["text-center border-b border-dashed border-border shrink-0", e.compact ? "p-3" : "p-4"])
35
+ }, [
36
+ n("div", I, [
37
+ c.value.brandLogo ? (a(), p(q, {
38
+ key: 0,
39
+ icon: c.value.brandLogo,
40
+ class: o(e.compact ? "w-5 h-5" : "w-6 h-6")
41
+ }, null, 8, ["icon", "class"])) : d("", !0),
42
+ n("p", {
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)
45
+ ]),
46
+ f.value ? d("", !0) : (a(), s("p", {
47
+ key: 0,
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))
50
+ ], 2),
51
+ n("div", R, [
52
+ f.value ? (a(), p(E, {
53
+ key: 0,
54
+ labels: e.labels,
55
+ compact: e.compact,
56
+ onContinueShopping: t[0] || (t[0] = (i) => u("continue-shopping"))
57
+ }, null, 8, ["labels", "compact"])) : (a(), s("div", {
58
+ key: 1,
59
+ class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
60
+ }, [
61
+ n("div", {
62
+ class: o(["flex items-center text-muted-foreground font-semibold uppercase tracking-wider pb-1 border-b border-dashed border-border", e.compact ? "text-[9px] gap-1" : "text-[10px] gap-2"])
63
+ }, [...t[8] || (t[8] = [
64
+ n("span", { class: "flex-1" }, "Item", -1),
65
+ n("span", { class: "w-20 text-right" }, "Amount", -1)
66
+ ])], 2),
67
+ n("ul", j, [
68
+ (a(!0), s(L, null, N(e.data.items, (i) => (a(), s("li", {
69
+ key: i.id
70
+ }, [
71
+ k(B, {
72
+ item: i,
73
+ features: e.features,
74
+ labels: e.labels,
75
+ compact: e.compact,
76
+ readonly: e.data.readonly,
77
+ 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"])
81
+ ]))), 128))
82
+ ])
83
+ ], 2))
84
+ ]),
85
+ f.value ? d("", !0) : (a(), s("div", F, [
86
+ n("div", {
87
+ class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
88
+ }, null, 2),
89
+ n("div", {
90
+ class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
91
+ }, [
92
+ k(A, {
93
+ totals: e.data.totals,
94
+ features: e.features,
95
+ labels: e.labels,
96
+ compact: e.compact,
97
+ coupon: e.data.coupon,
98
+ variant: "Variant2"
99
+ }, null, 8, ["totals", "features", "labels", "compact", "coupon"])
100
+ ], 2),
101
+ n("div", {
102
+ class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
103
+ }, null, 2),
104
+ n("div", {
105
+ class: o(e.compact ? "px-3 py-2.5 space-y-2.5" : "px-4 py-3 space-y-3")
106
+ }, [
107
+ e.features.coupon ? (a(), p(D, {
108
+ key: 0,
109
+ coupon: e.data.coupon,
110
+ labels: e.labels,
111
+ compact: e.compact,
112
+ readonly: e.data.readonly,
113
+ onApply: t[3] || (t[3] = (i) => u("apply-coupon", i)),
114
+ onRemove: t[4] || (t[4] = (i) => u("remove-coupon")),
115
+ 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
+ key: 0,
120
+ variant: "outline",
121
+ size: e.compact ? "sm" : "md",
122
+ icon: l.value.continueShoppingIcon || "lucide:plus",
123
+ disabled: l.value.continueShoppingDisabled,
124
+ onClick: t[6] || (t[6] = (i) => u("continue-shopping"))
125
+ }, {
126
+ default: C(() => [
127
+ w(v(l.value.continueShoppingLabel || y.value.continueShopping || "Add more"), 1)
128
+ ]),
129
+ _: 1
130
+ }, 8, ["size", "icon", "disabled"])) : d("", !0),
131
+ l.value.showContinue && m.value.continue ? (a(), p(S, {
132
+ key: 1,
133
+ variant: "primary",
134
+ size: e.compact ? "sm" : "md",
135
+ icon: l.value.continueIcon || "lucide:credit-card",
136
+ "icon-right": void 0,
137
+ disabled: l.value.continueDisabled || f.value,
138
+ class: o(l.value.showContinueShopping && m.value.continueShopping ? "" : "col-span-2"),
139
+ onClick: t[7] || (t[7] = (i) => u("continue"))
140
+ }, {
141
+ default: C(() => [
142
+ w(v(l.value.continueLabel || y.value.continue || "Checkout"), 1)
143
+ ]),
144
+ _: 1
145
+ }, 8, ["size", "icon", "disabled", "class"])) : d("", !0)
146
+ ])) : d("", !0)
147
+ ], 2)
148
+ ]))
149
+ ], 2));
150
+ }
151
+ });
152
+ export {
153
+ P as default
154
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CartVariant2.vue.js";
2
+ export {
3
+ f as default
4
+ };