@a4ui/core 0.16.0 → 0.18.0
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.
- package/dist/{Checkbox-B5Gb3h5J.js → Checkbox-BZjX1GMG.js} +153 -146
- package/dist/commerce/ProductCard.d.ts +10 -0
- package/dist/commerce/createCart.d.ts +53 -0
- package/dist/commerce/index.d.ts +1 -0
- package/dist/commerce.js +160 -133
- package/dist/elements.css +244 -0
- package/dist/elements.iife.js +3 -3
- package/dist/elements.js +590 -583
- package/dist/full.css +244 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3090 -2798
- package/dist/layout/ActionBar.d.ts +53 -0
- package/dist/layout/Section.d.ts +31 -0
- package/dist/styles.css +66 -0
- package/dist/ui/Badge.d.ts +6 -0
- package/dist/ui/BeforeAfter.d.ts +34 -0
- package/dist/ui/Carousel.d.ts +6 -0
- package/dist/ui/FloatingActionButton.d.ts +6 -0
- package/dist/ui/Image.d.ts +6 -0
- package/dist/ui/List.d.ts +5 -0
- package/dist/ui/PricingTable.d.ts +60 -0
- package/dist/ui/Skeleton.d.ts +10 -3
- package/package.json +1 -1
- package/src/commerce/ProductCard.tsx +26 -2
- package/src/commerce/createCart.ts +102 -0
- package/src/commerce/index.ts +1 -0
- package/src/index.ts +5 -1
- package/src/layout/ActionBar.tsx +121 -0
- package/src/layout/Section.tsx +69 -0
- package/src/ui/Accordion.tsx +3 -1
- package/src/ui/Badge.tsx +14 -2
- package/src/ui/BeforeAfter.tsx +162 -0
- package/src/ui/Carousel.tsx +48 -3
- package/src/ui/Collapse.tsx +13 -4
- package/src/ui/FloatingActionButton.tsx +16 -1
- package/src/ui/Image.tsx +29 -1
- package/src/ui/List.tsx +10 -2
- package/src/ui/PricingTable.tsx +196 -0
- package/src/ui/Skeleton.tsx +17 -5
- package/src/ui/SpeedDial.tsx +3 -1
package/dist/commerce.js
CHANGED
|
@@ -1,125 +1,131 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { Show as
|
|
3
|
-
import { c as
|
|
4
|
-
import { B as
|
|
5
|
-
import { Minus as
|
|
6
|
-
var j = /* @__PURE__ */
|
|
7
|
-
const
|
|
1
|
+
import { insert as l, createComponent as d, memo as I, effect as b, className as $, template as g, delegateEvents as S, setAttribute as y } from "solid-js/web";
|
|
2
|
+
import { Show as h, For as k, createSignal as N, createMemo as C } from "solid-js";
|
|
3
|
+
import { c as x } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { B as q, C as E, R, a as A, b as F } from "./Checkbox-BZjX1GMG.js";
|
|
5
|
+
import { Minus as M, Plus as P, Trash2 as U } from "lucide-solid";
|
|
6
|
+
var j = /* @__PURE__ */ g('<span class="text-muted-foreground line-through">'), B = /* @__PURE__ */ g("<div><span>");
|
|
7
|
+
const D = {
|
|
8
8
|
sm: "text-sm",
|
|
9
9
|
md: "text-lg",
|
|
10
10
|
lg: "text-2xl"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
13
|
-
const
|
|
12
|
+
function T(e) {
|
|
13
|
+
const n = (a) => new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
14
14
|
style: "currency",
|
|
15
15
|
currency: e.currency ?? "USD"
|
|
16
|
-
}).format(
|
|
16
|
+
}).format(a), r = () => (e.compareAt ?? 0) > e.amount, t = () => Math.round((1 - e.amount / e.compareAt) * 100);
|
|
17
17
|
return (() => {
|
|
18
|
-
var
|
|
19
|
-
return
|
|
18
|
+
var a = B(), o = a.firstChild;
|
|
19
|
+
return l(o, () => n(e.amount)), l(a, d(h, {
|
|
20
20
|
get when() {
|
|
21
|
-
return
|
|
21
|
+
return r();
|
|
22
22
|
},
|
|
23
23
|
get children() {
|
|
24
24
|
return [(() => {
|
|
25
|
-
var
|
|
26
|
-
return
|
|
27
|
-
})(),
|
|
25
|
+
var u = j();
|
|
26
|
+
return l(u, () => n(e.compareAt)), u;
|
|
27
|
+
})(), d(q, {
|
|
28
28
|
tone: "danger",
|
|
29
29
|
get children() {
|
|
30
|
-
return ["-",
|
|
30
|
+
return ["-", I(() => t()), "%"];
|
|
31
31
|
}
|
|
32
32
|
})];
|
|
33
33
|
}
|
|
34
|
-
}), null),
|
|
35
|
-
var
|
|
36
|
-
return
|
|
34
|
+
}), null), b((u) => {
|
|
35
|
+
var c = x("inline-flex items-center gap-2", e.class), s = x("font-bold text-foreground", D[e.size ?? "md"]);
|
|
36
|
+
return c !== u.e && $(a, u.e = c), s !== u.t && $(o, u.t = s), u;
|
|
37
37
|
}, {
|
|
38
38
|
e: void 0,
|
|
39
39
|
t: void 0
|
|
40
|
-
}),
|
|
40
|
+
}), a;
|
|
41
41
|
})();
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
const
|
|
43
|
+
var L = /* @__PURE__ */ g('<div><button type=button aria-label="Decrease quantity"class="grid h-8 w-8 place-items-center hover:bg-muted disabled:opacity-40"></button><span class="grid min-w-[2.5rem] place-items-center tabular-nums"></span><button type=button aria-label="Increase quantity"class="grid h-8 w-8 place-items-center hover:bg-muted disabled:opacity-40">');
|
|
44
|
+
function z(e) {
|
|
45
|
+
const n = () => e.min ?? 0, r = () => e.max ?? Number.MAX_SAFE_INTEGER, t = (u) => Math.min(r(), Math.max(n(), u)), a = () => e.onChange(t(e.value - 1)), o = () => e.onChange(t(e.value + 1));
|
|
46
46
|
return (() => {
|
|
47
|
-
var
|
|
48
|
-
return
|
|
47
|
+
var u = L(), c = u.firstChild, s = c.nextSibling, f = s.nextSibling;
|
|
48
|
+
return c.$$click = a, l(c, d(M, {
|
|
49
49
|
class: "h-4 w-4"
|
|
50
|
-
})),
|
|
50
|
+
})), l(s, () => e.value), f.$$click = o, l(f, d(P, {
|
|
51
51
|
class: "h-4 w-4"
|
|
52
|
-
})),
|
|
53
|
-
var
|
|
54
|
-
return
|
|
52
|
+
})), b((i) => {
|
|
53
|
+
var m = x("inline-flex items-stretch rounded-md border border-input", e.class), v = e.disabled || e.value <= n(), _ = e.disabled || e.value >= r();
|
|
54
|
+
return m !== i.e && $(u, i.e = m), v !== i.t && (c.disabled = i.t = v), _ !== i.a && (f.disabled = i.a = _), i;
|
|
55
55
|
}, {
|
|
56
56
|
e: void 0,
|
|
57
57
|
t: void 0,
|
|
58
58
|
a: void 0
|
|
59
|
-
}),
|
|
59
|
+
}), u;
|
|
60
60
|
})();
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
const
|
|
62
|
+
S(["click"]);
|
|
63
|
+
var G = /* @__PURE__ */ g("<span>"), O = /* @__PURE__ */ g('<div class="relative aspect-square overflow-hidden rounded-lg bg-muted"><img loading=lazy class="h-full w-full object-cover">', !0, !1, !1), Q = /* @__PURE__ */ g('<span class="text-[11px] font-medium uppercase tracking-wide text-muted-foreground">'), X = /* @__PURE__ */ g('<span class="w-fit rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground">'), Z = /* @__PURE__ */ g('<div class="mt-3 flex flex-1 flex-col gap-1.5"><p class="line-clamp-1 font-medium text-foreground">');
|
|
64
|
+
const H = {
|
|
65
65
|
sale: "bg-destructive text-destructive-foreground",
|
|
66
66
|
new: "bg-primary text-primary-foreground",
|
|
67
67
|
featured: "bg-accent text-accent-foreground"
|
|
68
68
|
};
|
|
69
|
-
function
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
return /sale|off|%|deal/.test(
|
|
69
|
+
function J(e, n) {
|
|
70
|
+
if (n) return n;
|
|
71
|
+
const r = (e ?? "").toLowerCase();
|
|
72
|
+
return /sale|off|%|deal/.test(r) ? "sale" : /new/.test(r) ? "new" : "featured";
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
74
|
+
function de(e) {
|
|
75
|
+
return d(E, {
|
|
76
76
|
glass: !0,
|
|
77
77
|
glow: !0,
|
|
78
|
+
get tilt() {
|
|
79
|
+
return e.tilt;
|
|
80
|
+
},
|
|
81
|
+
get spotlight() {
|
|
82
|
+
return e.spotlight;
|
|
83
|
+
},
|
|
78
84
|
get class() {
|
|
79
|
-
return
|
|
85
|
+
return x("flex h-full flex-col overflow-hidden p-4", e.class);
|
|
80
86
|
},
|
|
81
87
|
get children() {
|
|
82
88
|
return [(() => {
|
|
83
|
-
var
|
|
84
|
-
return n
|
|
89
|
+
var n = O(), r = n.firstChild;
|
|
90
|
+
return l(n, d(h, {
|
|
85
91
|
get when() {
|
|
86
92
|
return e.badge;
|
|
87
93
|
},
|
|
88
94
|
get children() {
|
|
89
|
-
var t =
|
|
90
|
-
return
|
|
95
|
+
var t = G();
|
|
96
|
+
return l(t, () => e.badge), b(() => $(t, x("absolute -right-9 top-3.5 w-32 rotate-45 py-1 text-center text-[11px] font-semibold uppercase tracking-wide shadow-md", H[J(e.badge, e.badgeTone)]))), t;
|
|
91
97
|
}
|
|
92
|
-
}), null),
|
|
93
|
-
var
|
|
94
|
-
return
|
|
98
|
+
}), null), b((t) => {
|
|
99
|
+
var a = e.image, o = e.title;
|
|
100
|
+
return a !== t.e && y(r, "src", t.e = a), o !== t.t && y(r, "alt", t.t = o), t;
|
|
95
101
|
}, {
|
|
96
102
|
e: void 0,
|
|
97
103
|
t: void 0
|
|
98
|
-
}),
|
|
104
|
+
}), n;
|
|
99
105
|
})(), (() => {
|
|
100
|
-
var
|
|
101
|
-
return n
|
|
106
|
+
var n = Z(), r = n.firstChild;
|
|
107
|
+
return l(n, d(h, {
|
|
102
108
|
get when() {
|
|
103
109
|
return e.brand;
|
|
104
110
|
},
|
|
105
111
|
get children() {
|
|
106
|
-
var t =
|
|
107
|
-
return
|
|
112
|
+
var t = Q();
|
|
113
|
+
return l(t, () => e.brand), t;
|
|
108
114
|
}
|
|
109
|
-
}),
|
|
115
|
+
}), r), l(r, () => e.title), l(n, d(h, {
|
|
110
116
|
get when() {
|
|
111
117
|
return e.category;
|
|
112
118
|
},
|
|
113
119
|
get children() {
|
|
114
|
-
var t =
|
|
115
|
-
return
|
|
120
|
+
var t = X();
|
|
121
|
+
return l(t, () => e.category), t;
|
|
116
122
|
}
|
|
117
|
-
}), null), n
|
|
123
|
+
}), null), l(n, d(h, {
|
|
118
124
|
get when() {
|
|
119
125
|
return e.rating !== void 0;
|
|
120
126
|
},
|
|
121
127
|
get children() {
|
|
122
|
-
return
|
|
128
|
+
return d(R, {
|
|
123
129
|
get value() {
|
|
124
130
|
return e.rating;
|
|
125
131
|
},
|
|
@@ -127,7 +133,7 @@ function ue(e) {
|
|
|
127
133
|
max: 5
|
|
128
134
|
});
|
|
129
135
|
}
|
|
130
|
-
}), null), n
|
|
136
|
+
}), null), l(n, d(T, {
|
|
131
137
|
get amount() {
|
|
132
138
|
return e.price;
|
|
133
139
|
},
|
|
@@ -140,55 +146,55 @@ function ue(e) {
|
|
|
140
146
|
get locale() {
|
|
141
147
|
return e.locale;
|
|
142
148
|
}
|
|
143
|
-
}), null), n
|
|
149
|
+
}), null), l(n, d(h, {
|
|
144
150
|
get when() {
|
|
145
151
|
return e.onAddToCart;
|
|
146
152
|
},
|
|
147
153
|
get children() {
|
|
148
|
-
return
|
|
154
|
+
return d(A, {
|
|
149
155
|
class: "mt-auto w-full",
|
|
150
|
-
onClick: () => {
|
|
151
|
-
var
|
|
152
|
-
|
|
156
|
+
onClick: (t) => {
|
|
157
|
+
var a;
|
|
158
|
+
t.stopPropagation(), (a = e.onAddToCart) == null || a.call(e);
|
|
153
159
|
},
|
|
154
160
|
children: "Add to cart"
|
|
155
161
|
});
|
|
156
162
|
}
|
|
157
|
-
}), null),
|
|
163
|
+
}), null), n;
|
|
158
164
|
})()];
|
|
159
165
|
}
|
|
160
166
|
});
|
|
161
167
|
}
|
|
162
|
-
var
|
|
163
|
-
function
|
|
168
|
+
var K = /* @__PURE__ */ g("<div>");
|
|
169
|
+
function oe(e) {
|
|
164
170
|
return (() => {
|
|
165
|
-
var
|
|
166
|
-
return n
|
|
171
|
+
var n = K();
|
|
172
|
+
return l(n, () => e.children), b(() => $(n, x("grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4", e.class))), n;
|
|
167
173
|
})();
|
|
168
174
|
}
|
|
169
|
-
var
|
|
170
|
-
function
|
|
171
|
-
const
|
|
175
|
+
var V = /* @__PURE__ */ g('<img class="h-16 w-16 shrink-0 rounded-md bg-muted object-cover">'), W = /* @__PURE__ */ g('<button type=button aria-label="Remove item"class="text-muted-foreground hover:text-foreground">'), Y = /* @__PURE__ */ g('<div><div class="min-w-[8rem] flex-1"><p class="line-clamp-1 font-medium text-foreground"></p></div><span class="min-w-[4rem] text-right font-medium tabular-nums text-foreground">');
|
|
176
|
+
function se(e) {
|
|
177
|
+
const n = () => e.price * e.quantity, r = (t) => new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
172
178
|
style: "currency",
|
|
173
179
|
currency: e.currency ?? "USD"
|
|
174
180
|
}).format(t);
|
|
175
181
|
return (() => {
|
|
176
|
-
var t =
|
|
177
|
-
return
|
|
182
|
+
var t = Y(), a = t.firstChild, o = a.firstChild, u = a.nextSibling;
|
|
183
|
+
return l(t, d(h, {
|
|
178
184
|
get when() {
|
|
179
185
|
return e.image;
|
|
180
186
|
},
|
|
181
187
|
get children() {
|
|
182
|
-
var
|
|
183
|
-
return
|
|
184
|
-
var f = e.image,
|
|
185
|
-
return f !==
|
|
188
|
+
var c = V();
|
|
189
|
+
return b((s) => {
|
|
190
|
+
var f = e.image, i = e.title;
|
|
191
|
+
return f !== s.e && y(c, "src", s.e = f), i !== s.t && y(c, "alt", s.t = i), s;
|
|
186
192
|
}, {
|
|
187
193
|
e: void 0,
|
|
188
194
|
t: void 0
|
|
189
|
-
}),
|
|
195
|
+
}), c;
|
|
190
196
|
}
|
|
191
|
-
}),
|
|
197
|
+
}), a), l(o, () => e.title), l(a, d(T, {
|
|
192
198
|
get amount() {
|
|
193
199
|
return e.price;
|
|
194
200
|
},
|
|
@@ -199,108 +205,129 @@ function ie(e) {
|
|
|
199
205
|
return e.locale;
|
|
200
206
|
},
|
|
201
207
|
size: "sm"
|
|
202
|
-
}), null),
|
|
208
|
+
}), null), l(t, d(z, {
|
|
203
209
|
get value() {
|
|
204
210
|
return e.quantity;
|
|
205
211
|
},
|
|
206
|
-
onChange: (
|
|
207
|
-
var
|
|
208
|
-
return (
|
|
212
|
+
onChange: (c) => {
|
|
213
|
+
var s;
|
|
214
|
+
return (s = e.onQuantityChange) == null ? void 0 : s.call(e, c);
|
|
209
215
|
},
|
|
210
216
|
min: 1
|
|
211
|
-
}),
|
|
217
|
+
}), u), l(u, () => r(n())), l(t, d(h, {
|
|
212
218
|
get when() {
|
|
213
219
|
return e.onRemove;
|
|
214
220
|
},
|
|
215
221
|
get children() {
|
|
216
|
-
var
|
|
217
|
-
return
|
|
218
|
-
var
|
|
219
|
-
return (
|
|
220
|
-
},
|
|
222
|
+
var c = W();
|
|
223
|
+
return c.$$click = () => {
|
|
224
|
+
var s;
|
|
225
|
+
return (s = e.onRemove) == null ? void 0 : s.call(e);
|
|
226
|
+
}, l(c, d(U, {
|
|
221
227
|
class: "h-4 w-4"
|
|
222
|
-
})),
|
|
228
|
+
})), c;
|
|
223
229
|
}
|
|
224
|
-
}), null),
|
|
230
|
+
}), null), b(() => $(t, x("flex flex-wrap items-center gap-4", e.class))), t;
|
|
225
231
|
})();
|
|
226
232
|
}
|
|
227
|
-
|
|
228
|
-
var
|
|
229
|
-
function
|
|
230
|
-
const
|
|
233
|
+
S(["click"]);
|
|
234
|
+
var p = /* @__PURE__ */ g('<div><div class="my-3 border-t border-border"></div><div class="flex items-center justify-between text-base font-bold text-foreground"><span>Total</span><span class=tabular-nums>'), ee = /* @__PURE__ */ g('<div class="flex items-center justify-between py-1 text-sm"><span class=text-muted-foreground></span><span class="tabular-nums text-foreground">');
|
|
235
|
+
function me(e) {
|
|
236
|
+
const n = (r) => new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
231
237
|
style: "currency",
|
|
232
238
|
currency: e.currency ?? "USD"
|
|
233
|
-
}).format(
|
|
239
|
+
}).format(r);
|
|
234
240
|
return (() => {
|
|
235
|
-
var
|
|
236
|
-
return
|
|
241
|
+
var r = p(), t = r.firstChild, a = t.nextSibling, o = a.firstChild, u = o.nextSibling;
|
|
242
|
+
return l(r, d(k, {
|
|
237
243
|
get each() {
|
|
238
244
|
return e.lines;
|
|
239
245
|
},
|
|
240
|
-
children: (
|
|
241
|
-
var
|
|
242
|
-
return
|
|
246
|
+
children: (c) => (() => {
|
|
247
|
+
var s = ee(), f = s.firstChild, i = f.nextSibling;
|
|
248
|
+
return l(f, () => c.label), l(i, () => n(c.amount)), s;
|
|
243
249
|
})()
|
|
244
|
-
}), t),
|
|
250
|
+
}), t), l(u, () => n(e.total)), l(r, d(h, {
|
|
245
251
|
get when() {
|
|
246
252
|
return e.onCheckout;
|
|
247
253
|
},
|
|
248
254
|
get children() {
|
|
249
|
-
return
|
|
255
|
+
return d(A, {
|
|
250
256
|
class: "mt-4 w-full",
|
|
251
257
|
onClick: () => {
|
|
252
|
-
var
|
|
253
|
-
return (
|
|
258
|
+
var c;
|
|
259
|
+
return (c = e.onCheckout) == null ? void 0 : c.call(e);
|
|
254
260
|
},
|
|
255
261
|
get children() {
|
|
256
262
|
return e.checkoutLabel ?? "Checkout";
|
|
257
263
|
}
|
|
258
264
|
});
|
|
259
265
|
}
|
|
260
|
-
}), null),
|
|
266
|
+
}), null), b(() => $(r, x("card glow-edge rounded-xl p-5 text-card-foreground", e.class))), r;
|
|
261
267
|
})();
|
|
262
268
|
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
t ?
|
|
269
|
+
var te = /* @__PURE__ */ g('<div><p class="text-sm font-semibold text-foreground"></p><div class=space-y-1.5>'), ne = /* @__PURE__ */ g('<span class="text-xs text-muted-foreground">'), re = /* @__PURE__ */ g('<div class="flex items-center justify-between gap-2">');
|
|
270
|
+
function ge(e) {
|
|
271
|
+
const n = (r, t) => {
|
|
272
|
+
const a = e.selected.slice(), o = a.indexOf(r);
|
|
273
|
+
t ? o === -1 && a.push(r) : o !== -1 && a.splice(o, 1), e.onChange(a);
|
|
268
274
|
};
|
|
269
275
|
return (() => {
|
|
270
|
-
var
|
|
271
|
-
return
|
|
276
|
+
var r = te(), t = r.firstChild, a = t.nextSibling;
|
|
277
|
+
return l(t, () => e.title), l(a, d(k, {
|
|
272
278
|
get each() {
|
|
273
279
|
return e.options;
|
|
274
280
|
},
|
|
275
|
-
children: (
|
|
276
|
-
var
|
|
277
|
-
return
|
|
281
|
+
children: (o) => (() => {
|
|
282
|
+
var u = re();
|
|
283
|
+
return l(u, d(F, {
|
|
278
284
|
get checked() {
|
|
279
|
-
return e.selected.includes(
|
|
285
|
+
return e.selected.includes(o.value);
|
|
280
286
|
},
|
|
281
|
-
onChange: (
|
|
287
|
+
onChange: (c) => n(o.value, c),
|
|
282
288
|
get label() {
|
|
283
|
-
return
|
|
289
|
+
return o.label;
|
|
284
290
|
}
|
|
285
|
-
}), null),
|
|
291
|
+
}), null), l(u, d(h, {
|
|
286
292
|
get when() {
|
|
287
|
-
return
|
|
293
|
+
return o.count != null;
|
|
288
294
|
},
|
|
289
295
|
get children() {
|
|
290
|
-
var
|
|
291
|
-
return
|
|
296
|
+
var c = ne();
|
|
297
|
+
return l(c, () => o.count), c;
|
|
292
298
|
}
|
|
293
|
-
}), null),
|
|
299
|
+
}), null), u;
|
|
294
300
|
})()
|
|
295
|
-
})),
|
|
301
|
+
})), b(() => $(r, x("space-y-2", e.class))), r;
|
|
296
302
|
})();
|
|
297
303
|
}
|
|
304
|
+
function fe(e = []) {
|
|
305
|
+
const [n, r] = N(e), t = (i, m = 1) => {
|
|
306
|
+
r((v) => v.find((w) => w.product.id === i.id) ? v.map(
|
|
307
|
+
(w) => w.product.id === i.id ? { ...w, qty: w.qty + m } : w
|
|
308
|
+
) : [...v, { product: i, qty: m }]);
|
|
309
|
+
}, a = (i) => {
|
|
310
|
+
r((m) => m.filter((v) => v.product.id !== i));
|
|
311
|
+
}, o = (i, m) => {
|
|
312
|
+
if (m <= 0) {
|
|
313
|
+
a(i);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
r((v) => v.map((_) => _.product.id === i ? { ..._, qty: m } : _));
|
|
317
|
+
}, u = () => {
|
|
318
|
+
r([]);
|
|
319
|
+
}, c = C(() => n().reduce((i, m) => i + m.qty, 0)), s = C(
|
|
320
|
+
() => n().reduce((i, m) => i + m.product.price * m.qty, 0)
|
|
321
|
+
);
|
|
322
|
+
return { items: n, add: t, remove: a, setQty: o, clear: u, count: c, subtotal: s, has: (i) => n().some((m) => m.product.id === i) };
|
|
323
|
+
}
|
|
298
324
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
325
|
+
se as CartLine,
|
|
326
|
+
me as CartSummary,
|
|
327
|
+
ge as FilterGroup,
|
|
328
|
+
T as PriceTag,
|
|
329
|
+
de as ProductCard,
|
|
330
|
+
oe as ProductGrid,
|
|
331
|
+
z as QuantityStepper,
|
|
332
|
+
fe as createCart
|
|
306
333
|
};
|