@a4ui/core 0.16.0 → 0.17.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-DMx0y81E.js} +152 -145
- package/dist/commerce/ProductCard.d.ts +10 -0
- package/dist/commerce.js +54 -48
- package/dist/elements.css +111 -0
- package/dist/elements.iife.js +3 -3
- package/dist/elements.js +590 -583
- package/dist/full.css +111 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2660 -2635
- package/dist/styles.css +66 -0
- package/dist/ui/Badge.d.ts +6 -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/Skeleton.d.ts +10 -3
- package/package.json +1 -1
- package/src/commerce/ProductCard.tsx +17 -1
- package/src/index.ts +1 -1
- package/src/ui/Accordion.tsx +3 -1
- package/src/ui/Badge.tsx +14 -2
- 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/Skeleton.tsx +17 -5
- package/src/ui/SpeedDial.tsx +3 -1
|
@@ -1,66 +1,73 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { splitProps as
|
|
1
|
+
import { spread as y, mergeProps as b, insert as f, createComponent as p, template as g, effect as h, className as v, use as $, delegateEvents as k, setAttribute as C } from "solid-js/web";
|
|
2
|
+
import { splitProps as x, Show as P, createSignal as _, createEffect as K, untrack as F, onCleanup as E, onMount as S, For as T } from "solid-js";
|
|
3
3
|
import { c as m } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { animate as L, inView as Q } from "motion";
|
|
5
5
|
import { Star as B } from "lucide-solid";
|
|
6
|
-
var q = /* @__PURE__ */ g("<span>");
|
|
7
|
-
const
|
|
6
|
+
var q = /* @__PURE__ */ g('<span class="relative flex h-1.5 w-1.5"aria-hidden=true><span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-75"></span><span class="relative inline-flex h-1.5 w-1.5 rounded-full bg-current">'), J = /* @__PURE__ */ g("<span>");
|
|
7
|
+
const W = {
|
|
8
8
|
neutral: "bg-muted text-muted-foreground ring-border",
|
|
9
9
|
success: "bg-emerald-500/15 text-emerald-600 ring-emerald-500/30",
|
|
10
10
|
warning: "bg-amber-500/15 text-amber-600 ring-amber-500/30",
|
|
11
11
|
danger: "bg-rose-500/15 text-rose-600 ring-rose-500/30",
|
|
12
12
|
info: "bg-sky-500/15 text-sky-600 ring-sky-500/30"
|
|
13
|
-
},
|
|
13
|
+
}, Z = "badge inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold ring-1 ring-inset whitespace-nowrap";
|
|
14
14
|
function $e(t) {
|
|
15
|
-
const [e, r] =
|
|
15
|
+
const [e, r] = x(t, ["tone", "class", "children", "pulse"]);
|
|
16
16
|
return (() => {
|
|
17
|
-
var n =
|
|
18
|
-
return
|
|
17
|
+
var n = J();
|
|
18
|
+
return y(n, b({
|
|
19
19
|
get class() {
|
|
20
|
-
return m(
|
|
20
|
+
return m(Z, W[e.tone ?? "neutral"], e.class);
|
|
21
21
|
}
|
|
22
|
-
}, r), !1, !0), f(n, (
|
|
22
|
+
}, r), !1, !0), f(n, p(P, {
|
|
23
|
+
get when() {
|
|
24
|
+
return e.pulse;
|
|
25
|
+
},
|
|
26
|
+
get children() {
|
|
27
|
+
return q();
|
|
28
|
+
}
|
|
29
|
+
}), null), f(n, () => e.children, null), n;
|
|
23
30
|
})();
|
|
24
31
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
32
|
+
const I = "a4ui-effects";
|
|
33
|
+
function Y() {
|
|
27
34
|
try {
|
|
28
35
|
return window.localStorage;
|
|
29
36
|
} catch {
|
|
30
37
|
return null;
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
|
-
function
|
|
40
|
+
function ee() {
|
|
34
41
|
var e;
|
|
35
42
|
try {
|
|
36
43
|
if (new URLSearchParams(window.location.search).get("calm") === "1") return !1;
|
|
37
44
|
} catch {
|
|
38
45
|
}
|
|
39
|
-
const t = (e =
|
|
46
|
+
const t = (e = Y()) == null ? void 0 : e.getItem(I);
|
|
40
47
|
return t === null ? !0 : t === "1";
|
|
41
48
|
}
|
|
42
|
-
function
|
|
49
|
+
function N(t) {
|
|
43
50
|
typeof document > "u" || document.documentElement.classList.toggle("calm", !t);
|
|
44
51
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const [
|
|
48
|
-
function
|
|
49
|
-
return
|
|
52
|
+
const U = ee();
|
|
53
|
+
N(U);
|
|
54
|
+
const [z, te] = _(U);
|
|
55
|
+
function _e() {
|
|
56
|
+
return z;
|
|
50
57
|
}
|
|
51
|
-
function
|
|
52
|
-
return !
|
|
58
|
+
function ne() {
|
|
59
|
+
return !z();
|
|
53
60
|
}
|
|
54
|
-
function
|
|
61
|
+
function Ee(t) {
|
|
55
62
|
var e;
|
|
56
|
-
(e =
|
|
63
|
+
(e = Y()) == null || e.setItem(I, t ? "1" : "0"), N(t), te(t);
|
|
57
64
|
}
|
|
58
|
-
const
|
|
59
|
-
function
|
|
60
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(
|
|
65
|
+
const re = "(prefers-reduced-motion: reduce)";
|
|
66
|
+
function oe() {
|
|
67
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(re).matches;
|
|
61
68
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
69
|
+
const X = "a4ui-motion-forced";
|
|
70
|
+
function j() {
|
|
64
71
|
try {
|
|
65
72
|
return window.localStorage;
|
|
66
73
|
} catch {
|
|
@@ -68,44 +75,44 @@ function X() {
|
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
var D;
|
|
71
|
-
const [R,
|
|
72
|
-
typeof document < "u" && document.documentElement.classList.toggle("force-motion",
|
|
73
|
-
function
|
|
78
|
+
const [R, ae] = _(((D = j()) == null ? void 0 : D.getItem(X)) === "1");
|
|
79
|
+
typeof document < "u" && document.documentElement.classList.toggle("force-motion", F(R));
|
|
80
|
+
function Ce() {
|
|
74
81
|
return R;
|
|
75
82
|
}
|
|
76
|
-
function
|
|
83
|
+
function ke(t) {
|
|
77
84
|
var e;
|
|
78
|
-
(e =
|
|
85
|
+
(e = j()) == null || e.setItem(X, t ? "1" : "0"), typeof document < "u" && document.documentElement.classList.toggle("force-motion", t), ae(t);
|
|
79
86
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
87
|
+
function w() {
|
|
88
|
+
return ne() || oe() && !R();
|
|
82
89
|
}
|
|
83
|
-
function
|
|
90
|
+
function Se(t, e = 600) {
|
|
84
91
|
const [r, n] = _(0);
|
|
85
92
|
let o;
|
|
86
|
-
return
|
|
93
|
+
return K(() => {
|
|
87
94
|
const a = t();
|
|
88
|
-
if (o == null || o.stop(),
|
|
95
|
+
if (o == null || o.stop(), w()) {
|
|
89
96
|
n(a);
|
|
90
97
|
return;
|
|
91
98
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
99
|
+
const l = F(r);
|
|
100
|
+
l !== a && (o = L(l, a, {
|
|
94
101
|
duration: e / 1e3,
|
|
95
102
|
ease: "easeOut",
|
|
96
103
|
onUpdate: (u) => n(u)
|
|
97
104
|
}));
|
|
98
105
|
}), E(() => o == null ? void 0 : o.stop()), r;
|
|
99
106
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
107
|
+
function Le(t, e = {}) {
|
|
108
|
+
w() || L(
|
|
102
109
|
t,
|
|
103
110
|
{ opacity: [0, 1], y: [e.y ?? 8, 0] },
|
|
104
111
|
{ duration: e.duration ?? 0.32, delay: e.delay ?? 0, ease: "easeOut" }
|
|
105
112
|
);
|
|
106
113
|
}
|
|
107
|
-
function
|
|
108
|
-
if (
|
|
114
|
+
function Re(t, e = {}) {
|
|
115
|
+
if (w()) return () => {
|
|
109
116
|
};
|
|
110
117
|
t.style.opacity = "0";
|
|
111
118
|
let r = !1;
|
|
@@ -121,22 +128,22 @@ function Le(t, e = {}) {
|
|
|
121
128
|
{ amount: e.amount ?? 0.2 }
|
|
122
129
|
);
|
|
123
130
|
}
|
|
124
|
-
var
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
127
|
-
const n = t.getBoundingClientRect(), o = e.clientX - n.left, a = e.clientY - n.top,
|
|
131
|
+
var ie = /* @__PURE__ */ g("<span>");
|
|
132
|
+
function G(t, e, r = {}) {
|
|
133
|
+
if (w()) return;
|
|
134
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, a = e.clientY - n.top, l = 2 * Math.max(Math.hypot(o, a), Math.hypot(n.width - o, a), Math.hypot(o, n.height - a), Math.hypot(n.width - o, n.height - a)), u = document.createElement("span");
|
|
128
135
|
u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
|
|
129
136
|
position: "absolute",
|
|
130
137
|
left: `${o}px`,
|
|
131
138
|
top: `${a}px`,
|
|
132
|
-
width: `${
|
|
133
|
-
height: `${
|
|
139
|
+
width: `${l}px`,
|
|
140
|
+
height: `${l}px`,
|
|
134
141
|
borderRadius: "9999px",
|
|
135
142
|
background: r.color ?? "currentColor",
|
|
136
143
|
pointerEvents: "none",
|
|
137
144
|
transform: "translate(-50%,-50%) scale(0)"
|
|
138
145
|
}), t.appendChild(u);
|
|
139
|
-
const
|
|
146
|
+
const s = u.animate([{
|
|
140
147
|
transform: "translate(-50%,-50%) scale(0)",
|
|
141
148
|
opacity: String(r.opacity ?? 0.3)
|
|
142
149
|
}, {
|
|
@@ -146,93 +153,93 @@ function j(t, e, r = {}) {
|
|
|
146
153
|
duration: 600,
|
|
147
154
|
easing: "ease-out"
|
|
148
155
|
}), i = () => u.remove();
|
|
149
|
-
|
|
156
|
+
s.finished.then(i).catch(i);
|
|
150
157
|
}
|
|
151
|
-
function
|
|
158
|
+
function Me(t) {
|
|
152
159
|
let e;
|
|
153
160
|
const r = (n) => {
|
|
154
|
-
e &&
|
|
161
|
+
e && G(e, n, {
|
|
155
162
|
color: t.color,
|
|
156
163
|
opacity: t.opacity
|
|
157
164
|
});
|
|
158
165
|
};
|
|
159
166
|
return (() => {
|
|
160
|
-
var n =
|
|
167
|
+
var n = ie();
|
|
161
168
|
n.$$pointerdown = r;
|
|
162
169
|
var o = e;
|
|
163
|
-
return typeof o == "function" ?
|
|
170
|
+
return typeof o == "function" ? $(o, n) : e = n, f(n, () => t.children), h(() => v(n, m("relative inline-block overflow-hidden", t.class))), n;
|
|
164
171
|
})();
|
|
165
172
|
}
|
|
166
173
|
k(["pointerdown"]);
|
|
167
|
-
var
|
|
174
|
+
var le = /* @__PURE__ */ g("<button>");
|
|
168
175
|
const se = {
|
|
169
176
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
170
177
|
secondary: "bg-muted text-foreground hover:bg-muted/70",
|
|
171
178
|
outline: "border border-border bg-transparent text-foreground hover:bg-muted",
|
|
172
179
|
ghost: "bg-transparent text-foreground hover:bg-muted"
|
|
173
|
-
},
|
|
174
|
-
function
|
|
175
|
-
const [e, r] =
|
|
176
|
-
e.ripple &&
|
|
180
|
+
}, ce = "inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-[color,background-color,transform] duration-150 active:scale-[0.97] focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
181
|
+
function Ae(t) {
|
|
182
|
+
const [e, r] = x(t, ["variant", "class", "type", "children", "ripple", "onPointerDown"]), n = (o) => {
|
|
183
|
+
e.ripple && G(o.currentTarget, o, {
|
|
177
184
|
opacity: 0.35
|
|
178
185
|
});
|
|
179
186
|
const a = e.onPointerDown;
|
|
180
187
|
typeof a == "function" ? a(o) : a && a[0](a[1], o);
|
|
181
188
|
};
|
|
182
189
|
return (() => {
|
|
183
|
-
var o =
|
|
184
|
-
return o.$$pointerdown = n,
|
|
190
|
+
var o = le();
|
|
191
|
+
return o.$$pointerdown = n, y(o, b({
|
|
185
192
|
get type() {
|
|
186
193
|
return e.type ?? "button";
|
|
187
194
|
},
|
|
188
195
|
get class() {
|
|
189
|
-
return m(
|
|
196
|
+
return m(ce, se[e.variant ?? "primary"], e.ripple && "relative overflow-hidden", e.class);
|
|
190
197
|
}
|
|
191
198
|
}, r), !1, !0), f(o, () => e.children), o;
|
|
192
199
|
})();
|
|
193
200
|
}
|
|
194
201
|
k(["pointerdown"]);
|
|
195
|
-
var
|
|
196
|
-
function
|
|
197
|
-
if (
|
|
202
|
+
var ue = /* @__PURE__ */ g("<div>");
|
|
203
|
+
function V(t, e = {}) {
|
|
204
|
+
if (w()) return () => {
|
|
198
205
|
};
|
|
199
206
|
const r = document.createElement("span");
|
|
200
207
|
r.setAttribute("aria-hidden", "true"), r.className = "pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300", t.appendChild(r);
|
|
201
208
|
const n = e.size ?? 180, o = e.color ?? "hsl(var(--primary))", a = (i, c) => {
|
|
202
209
|
r.style.background = `radial-gradient(${n}px circle at ${i}px ${c}px, color-mix(in srgb, ${o} 30%, transparent), transparent 70%)`;
|
|
203
|
-
},
|
|
210
|
+
}, l = (i) => {
|
|
204
211
|
const c = t.getBoundingClientRect();
|
|
205
212
|
a(i.clientX - c.left, i.clientY - c.top);
|
|
206
213
|
}, u = () => {
|
|
207
214
|
r.style.opacity = "1";
|
|
208
|
-
},
|
|
215
|
+
}, s = () => {
|
|
209
216
|
r.style.opacity = "0";
|
|
210
217
|
};
|
|
211
|
-
return t.addEventListener("pointermove",
|
|
212
|
-
t.removeEventListener("pointermove",
|
|
218
|
+
return t.addEventListener("pointermove", l), t.addEventListener("pointerenter", u), t.addEventListener("pointerleave", s), () => {
|
|
219
|
+
t.removeEventListener("pointermove", l), t.removeEventListener("pointerenter", u), t.removeEventListener("pointerleave", s), r.remove();
|
|
213
220
|
};
|
|
214
221
|
}
|
|
215
|
-
function
|
|
222
|
+
function Oe(t) {
|
|
216
223
|
let e;
|
|
217
224
|
return S(() => {
|
|
218
|
-
const r =
|
|
225
|
+
const r = V(e, {
|
|
219
226
|
color: t.color,
|
|
220
227
|
size: t.size
|
|
221
228
|
});
|
|
222
229
|
E(r);
|
|
223
230
|
}), (() => {
|
|
224
|
-
var r =
|
|
225
|
-
return typeof n == "function" ?
|
|
231
|
+
var r = ue(), n = e;
|
|
232
|
+
return typeof n == "function" ? $(n, r) : e = r, f(r, () => t.children), h(() => v(r, m("relative overflow-hidden", t.class))), r;
|
|
226
233
|
})();
|
|
227
234
|
}
|
|
228
|
-
var
|
|
229
|
-
function
|
|
230
|
-
if (
|
|
235
|
+
var de = /* @__PURE__ */ g("<div style=perspective:800px><div style=transform-style:preserve-3d>");
|
|
236
|
+
function H(t, e, r = {}) {
|
|
237
|
+
if (w()) return () => {
|
|
231
238
|
};
|
|
232
239
|
e.style.willChange = "transform";
|
|
233
240
|
const n = (a) => {
|
|
234
|
-
const
|
|
235
|
-
e.style.transition = "transform 0.15s ease-out", e.style.transform = `perspective(800px) rotateX(${(
|
|
241
|
+
const l = t.getBoundingClientRect(), u = (a.clientX - l.left) / l.width - 0.5, s = (a.clientY - l.top) / l.height - 0.5, i = r.max ?? 10;
|
|
242
|
+
e.style.transition = "transform 0.15s ease-out", e.style.transform = `perspective(800px) rotateX(${(s * -2 * i).toFixed(2)}deg) rotateY(${(u * 2 * i).toFixed(2)}deg) scale(1.02)`;
|
|
236
243
|
}, o = () => {
|
|
237
244
|
e.style.transition = "transform 0.4s ease", e.style.transform = "perspective(800px) rotateX(0deg) rotateY(0deg) scale(1)";
|
|
238
245
|
};
|
|
@@ -240,89 +247,89 @@ function V(t, e, r = {}) {
|
|
|
240
247
|
t.removeEventListener("pointermove", n), t.removeEventListener("pointerleave", o), e.style.transform = "", e.style.transition = "", e.style.willChange = "";
|
|
241
248
|
};
|
|
242
249
|
}
|
|
243
|
-
function
|
|
250
|
+
function Te(t) {
|
|
244
251
|
let e, r;
|
|
245
252
|
return S(() => {
|
|
246
|
-
const n =
|
|
253
|
+
const n = H(e, r, {
|
|
247
254
|
max: t.max
|
|
248
255
|
});
|
|
249
256
|
E(n);
|
|
250
257
|
}), (() => {
|
|
251
|
-
var n =
|
|
252
|
-
typeof a == "function" ?
|
|
253
|
-
var
|
|
254
|
-
return typeof
|
|
258
|
+
var n = de(), o = n.firstChild, a = e;
|
|
259
|
+
typeof a == "function" ? $(a, n) : e = n;
|
|
260
|
+
var l = r;
|
|
261
|
+
return typeof l == "function" ? $(l, o) : r = o, f(o, () => t.children), h(() => v(n, m("inline-block", t.class))), n;
|
|
255
262
|
})();
|
|
256
263
|
}
|
|
257
|
-
var M = /* @__PURE__ */ g("<div>"),
|
|
258
|
-
function
|
|
259
|
-
const [e, r] =
|
|
264
|
+
var M = /* @__PURE__ */ g("<div>"), fe = /* @__PURE__ */ g("<h2>");
|
|
265
|
+
function Be(t) {
|
|
266
|
+
const [e, r] = x(t, ["class", "children", "glass", "glow", "tilt", "spotlight"]), n = () => (e.glow ?? e.glass) === !0;
|
|
260
267
|
let o;
|
|
261
268
|
return S(() => {
|
|
262
|
-
const a = [e.tilt && o ?
|
|
263
|
-
E(() => a.forEach((
|
|
269
|
+
const a = [e.tilt && o ? H(o, o) : null, e.spotlight && o ? V(o) : null].filter((l) => l !== null);
|
|
270
|
+
E(() => a.forEach((l) => l()));
|
|
264
271
|
}), (() => {
|
|
265
|
-
var a = M(),
|
|
266
|
-
return typeof
|
|
272
|
+
var a = M(), l = o;
|
|
273
|
+
return typeof l == "function" ? $(l, a) : o = a, y(a, b({
|
|
267
274
|
get class() {
|
|
268
275
|
return m(e.glass ? "card rounded-xl text-card-foreground" : "rounded-xl border border-border bg-card text-card-foreground shadow-sm", n() && "glow-edge", e.spotlight && "relative overflow-hidden", e.tilt && "will-change-transform", e.class);
|
|
269
276
|
}
|
|
270
277
|
}, r), !1, !0), f(a, () => e.children), a;
|
|
271
278
|
})();
|
|
272
279
|
}
|
|
273
|
-
function
|
|
274
|
-
const [e, r] =
|
|
280
|
+
function De(t) {
|
|
281
|
+
const [e, r] = x(t, ["class", "children"]);
|
|
275
282
|
return (() => {
|
|
276
283
|
var n = M();
|
|
277
|
-
return
|
|
284
|
+
return y(n, b({
|
|
278
285
|
get class() {
|
|
279
286
|
return m("flex flex-col space-y-1.5 p-6", e.class);
|
|
280
287
|
}
|
|
281
288
|
}, r), !1, !0), f(n, () => e.children), n;
|
|
282
289
|
})();
|
|
283
290
|
}
|
|
284
|
-
function
|
|
285
|
-
const [e, r] =
|
|
291
|
+
function Pe(t) {
|
|
292
|
+
const [e, r] = x(t, ["class", "children"]);
|
|
286
293
|
return (() => {
|
|
287
|
-
var n =
|
|
288
|
-
return
|
|
294
|
+
var n = fe();
|
|
295
|
+
return y(n, b({
|
|
289
296
|
get class() {
|
|
290
297
|
return m("text-lg font-semibold leading-none tracking-tight", e.class);
|
|
291
298
|
}
|
|
292
299
|
}, r), !1, !0), f(n, () => e.children), n;
|
|
293
300
|
})();
|
|
294
301
|
}
|
|
295
|
-
function
|
|
296
|
-
const [e, r] =
|
|
302
|
+
function Fe(t) {
|
|
303
|
+
const [e, r] = x(t, ["class", "children"]);
|
|
297
304
|
return (() => {
|
|
298
305
|
var n = M();
|
|
299
|
-
return
|
|
306
|
+
return y(n, b({
|
|
300
307
|
get class() {
|
|
301
308
|
return m("p-6 pt-0", e.class);
|
|
302
309
|
}
|
|
303
310
|
}, r), !1, !0), f(n, () => e.children), n;
|
|
304
311
|
})();
|
|
305
312
|
}
|
|
306
|
-
var
|
|
307
|
-
function
|
|
313
|
+
var me = /* @__PURE__ */ g("<div role=radiogroup>"), ge = /* @__PURE__ */ g("<div role=img>"), he = /* @__PURE__ */ g('<button type=button role=radio class="rounded outline-none focus-visible:ring-2 focus-visible:ring-ring/40">');
|
|
314
|
+
function Ie(t) {
|
|
308
315
|
const [e, r] = _(0), n = () => t.max ?? 5, o = () => Array.from({
|
|
309
316
|
length: n()
|
|
310
|
-
}, (
|
|
317
|
+
}, (s, i) => i + 1), a = () => e() > 0 ? e() : t.value, l = (s) => {
|
|
311
318
|
var i;
|
|
312
|
-
t.readonly || (i = t.onChange) == null || i.call(t,
|
|
313
|
-
}, u = (
|
|
314
|
-
return
|
|
319
|
+
t.readonly || (i = t.onChange) == null || i.call(t, s);
|
|
320
|
+
}, u = (s) => m("h-5 w-5 transition-colors", s <= a() ? "fill-primary text-primary" : "fill-transparent text-muted-foreground");
|
|
321
|
+
return p(P, {
|
|
315
322
|
get when() {
|
|
316
323
|
return !t.readonly;
|
|
317
324
|
},
|
|
318
325
|
get fallback() {
|
|
319
326
|
return (() => {
|
|
320
|
-
var
|
|
321
|
-
return f(
|
|
327
|
+
var s = ge();
|
|
328
|
+
return f(s, p(T, {
|
|
322
329
|
get each() {
|
|
323
330
|
return o();
|
|
324
331
|
},
|
|
325
|
-
children: (i) =>
|
|
332
|
+
children: (i) => p(B, {
|
|
326
333
|
get class() {
|
|
327
334
|
return u(i);
|
|
328
335
|
},
|
|
@@ -330,24 +337,24 @@ function Fe(t) {
|
|
|
330
337
|
})
|
|
331
338
|
})), h((i) => {
|
|
332
339
|
var c = m("inline-flex items-center gap-1", t.class), d = `Rating ${t.value} of ${n()}`;
|
|
333
|
-
return c !== i.e && v(
|
|
340
|
+
return c !== i.e && v(s, i.e = c), d !== i.t && C(s, "aria-label", i.t = d), i;
|
|
334
341
|
}, {
|
|
335
342
|
e: void 0,
|
|
336
343
|
t: void 0
|
|
337
|
-
}),
|
|
344
|
+
}), s;
|
|
338
345
|
})();
|
|
339
346
|
},
|
|
340
347
|
get children() {
|
|
341
|
-
var
|
|
342
|
-
return
|
|
348
|
+
var s = me();
|
|
349
|
+
return s.addEventListener("mouseleave", () => r(0)), f(s, p(T, {
|
|
343
350
|
get each() {
|
|
344
351
|
return o();
|
|
345
352
|
},
|
|
346
353
|
children: (i) => (() => {
|
|
347
|
-
var c =
|
|
354
|
+
var c = he();
|
|
348
355
|
return c.$$keydown = (d) => {
|
|
349
|
-
d.key === "ArrowRight" || d.key === "ArrowUp" ? (d.preventDefault(),
|
|
350
|
-
}, c.$$click = () =>
|
|
356
|
+
d.key === "ArrowRight" || d.key === "ArrowUp" ? (d.preventDefault(), l(Math.min(t.value + 1, n()))) : (d.key === "ArrowLeft" || d.key === "ArrowDown") && (d.preventDefault(), l(Math.max(t.value - 1, 0)));
|
|
357
|
+
}, c.$$click = () => l(i), c.addEventListener("blur", () => r(0)), c.addEventListener("focus", () => r(i)), c.addEventListener("mouseenter", () => r(i)), f(c, p(B, {
|
|
351
358
|
get class() {
|
|
352
359
|
return u(i);
|
|
353
360
|
},
|
|
@@ -360,41 +367,41 @@ function Fe(t) {
|
|
|
360
367
|
t: void 0
|
|
361
368
|
}), c;
|
|
362
369
|
})()
|
|
363
|
-
})), h(() => v(
|
|
370
|
+
})), h(() => v(s, m("inline-flex items-center gap-1", t.class))), s;
|
|
364
371
|
}
|
|
365
372
|
});
|
|
366
373
|
}
|
|
367
374
|
k(["click", "keydown"]);
|
|
368
|
-
var
|
|
369
|
-
function
|
|
375
|
+
var pe = /* @__PURE__ */ g('<label><input type=checkbox class="h-4 w-4 rounded border-input accent-primary">');
|
|
376
|
+
function Ye(t) {
|
|
370
377
|
return (() => {
|
|
371
|
-
var e =
|
|
378
|
+
var e = pe(), r = e.firstChild;
|
|
372
379
|
return r.addEventListener("change", (n) => t.onChange(n.currentTarget.checked)), f(e, () => t.label, null), h(() => v(e, m("inline-flex items-center gap-2 text-sm text-foreground", t.class))), h(() => r.checked = t.checked), e;
|
|
373
380
|
})();
|
|
374
381
|
}
|
|
375
382
|
export {
|
|
376
383
|
$e as B,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
Be as C,
|
|
385
|
+
Ie as R,
|
|
386
|
+
Oe as S,
|
|
387
|
+
Te as T,
|
|
388
|
+
Ae as a,
|
|
389
|
+
Ye as b,
|
|
390
|
+
Se as c,
|
|
391
|
+
Fe as d,
|
|
392
|
+
Le as e,
|
|
393
|
+
Ee as f,
|
|
387
394
|
De as g,
|
|
388
|
-
|
|
389
|
-
|
|
395
|
+
Pe as h,
|
|
396
|
+
Me as i,
|
|
390
397
|
V as j,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
H as k,
|
|
399
|
+
ne as l,
|
|
400
|
+
w as m,
|
|
401
|
+
ke as n,
|
|
402
|
+
Ce as o,
|
|
403
|
+
oe as p,
|
|
404
|
+
Re as r,
|
|
405
|
+
G as s,
|
|
406
|
+
_e as u
|
|
400
407
|
};
|
|
@@ -19,6 +19,16 @@ export interface ProductCardProps {
|
|
|
19
19
|
currency?: string;
|
|
20
20
|
locale?: string;
|
|
21
21
|
onAddToCart?: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* 3D hover tilt toward the cursor — forwarded to the underlying {@link Card}
|
|
24
|
+
* ({@link attachTilt}). Engine-free and reduced-motion aware.
|
|
25
|
+
*/
|
|
26
|
+
tilt?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Cursor-following radial glow inside the card — forwarded to the underlying
|
|
29
|
+
* {@link Card} ({@link attachSpotlight}). Engine-free and reduced-motion aware.
|
|
30
|
+
*/
|
|
31
|
+
spotlight?: boolean;
|
|
22
32
|
class?: string;
|
|
23
33
|
}
|
|
24
34
|
/**
|