@a4ui/core 0.18.0 → 0.19.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-DIzLQltI.js +431 -0
- package/dist/commerce.js +1 -1
- package/dist/elements.css +4 -0
- package/dist/elements.iife.js +2 -2
- package/dist/elements.js +275 -251
- package/dist/full.css +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +288 -284
- package/dist/ui/Button.d.ts +10 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/ui/Button.tsx +51 -17
- package/src/ui/Carousel.tsx +12 -6
- package/dist/Checkbox-BZjX1GMG.js +0 -407
package/dist/ui/Button.d.ts
CHANGED
|
@@ -13,6 +13,16 @@ interface ButtonProps extends ParentProps, Omit<JSX.ButtonHTMLAttributes<HTMLBut
|
|
|
13
13
|
* costs nothing when off.
|
|
14
14
|
*/
|
|
15
15
|
ripple?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* When set, the button renders as an `<a href>` (a link) instead of a
|
|
18
|
+
* `<button>`, keeping the variant look, focus ring, and ripple. Use for
|
|
19
|
+
* navigation / router links and `tel:`/`mailto:` CTAs.
|
|
20
|
+
*/
|
|
21
|
+
href?: string;
|
|
22
|
+
/** Anchor `target` — only used when `href` is set. */
|
|
23
|
+
target?: string;
|
|
24
|
+
/** Anchor `rel` — only used when `href` is set. */
|
|
25
|
+
rel?: string;
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* Base button primitive: a plain `<button>` with A4ui's variants, focus ring,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// import '@a4ui/core/styles.css'
|
|
9
9
|
// import { Button, Card, Modal } from '@a4ui/core'
|
|
10
10
|
|
|
11
|
-
export const A4UI_VERSION = '0.
|
|
11
|
+
export const A4UI_VERSION = '0.19.0'
|
|
12
12
|
|
|
13
13
|
// Helpers (src/lib) — generic, framework-level utilities.
|
|
14
14
|
export { cn } from './lib/cn'
|
package/src/ui/Button.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSX, ParentProps } from 'solid-js'
|
|
2
|
-
import { splitProps } from 'solid-js'
|
|
2
|
+
import { Show, splitProps } from 'solid-js'
|
|
3
3
|
|
|
4
4
|
import { cn } from '../lib/cn'
|
|
5
5
|
import { spawnRipple } from './Ripple'
|
|
@@ -31,6 +31,16 @@ interface ButtonProps extends ParentProps, Omit<JSX.ButtonHTMLAttributes<HTMLBut
|
|
|
31
31
|
* costs nothing when off.
|
|
32
32
|
*/
|
|
33
33
|
ripple?: boolean
|
|
34
|
+
/**
|
|
35
|
+
* When set, the button renders as an `<a href>` (a link) instead of a
|
|
36
|
+
* `<button>`, keeping the variant look, focus ring, and ripple. Use for
|
|
37
|
+
* navigation / router links and `tel:`/`mailto:` CTAs.
|
|
38
|
+
*/
|
|
39
|
+
href?: string
|
|
40
|
+
/** Anchor `target` — only used when `href` is set. */
|
|
41
|
+
target?: string
|
|
42
|
+
/** Anchor `rel` — only used when `href` is set. */
|
|
43
|
+
rel?: string
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
/**
|
|
@@ -44,28 +54,52 @@ interface ButtonProps extends ParentProps, Omit<JSX.ButtonHTMLAttributes<HTMLBut
|
|
|
44
54
|
* ```
|
|
45
55
|
*/
|
|
46
56
|
export function Button(props: ButtonProps): JSX.Element {
|
|
47
|
-
const [local, rest] = splitProps(props, [
|
|
57
|
+
const [local, rest] = splitProps(props, [
|
|
58
|
+
'variant',
|
|
59
|
+
'class',
|
|
60
|
+
'type',
|
|
61
|
+
'children',
|
|
62
|
+
'ripple',
|
|
63
|
+
'onPointerDown',
|
|
64
|
+
'href',
|
|
65
|
+
'target',
|
|
66
|
+
'rel',
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
const classes = (): string =>
|
|
70
|
+
cn(
|
|
71
|
+
BUTTON_BASE,
|
|
72
|
+
VARIANT_CLASSES[local.variant ?? 'primary'],
|
|
73
|
+
local.ripple && 'relative overflow-hidden',
|
|
74
|
+
local.class,
|
|
75
|
+
)
|
|
48
76
|
|
|
49
|
-
const handlePointerDown:
|
|
77
|
+
const handlePointerDown = (event: PointerEvent & { currentTarget: HTMLElement }): void => {
|
|
50
78
|
if (local.ripple) spawnRipple(event.currentTarget, event, { opacity: 0.35 })
|
|
51
79
|
const user = local.onPointerDown
|
|
52
|
-
if (typeof user === 'function') user(event)
|
|
53
|
-
else if (user) user[0](user[1], event)
|
|
80
|
+
if (typeof user === 'function') user(event as never)
|
|
81
|
+
else if (user) user[0](user[1], event as never)
|
|
54
82
|
}
|
|
55
83
|
|
|
56
84
|
return (
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)}
|
|
65
|
-
onPointerDown={handlePointerDown}
|
|
66
|
-
{...rest}
|
|
85
|
+
<Show
|
|
86
|
+
when={local.href !== undefined}
|
|
87
|
+
fallback={
|
|
88
|
+
<button type={local.type ?? 'button'} class={classes()} onPointerDown={handlePointerDown} {...rest}>
|
|
89
|
+
{local.children}
|
|
90
|
+
</button>
|
|
91
|
+
}
|
|
67
92
|
>
|
|
68
|
-
|
|
69
|
-
|
|
93
|
+
<a
|
|
94
|
+
href={local.href}
|
|
95
|
+
target={local.target}
|
|
96
|
+
rel={local.rel}
|
|
97
|
+
class={classes()}
|
|
98
|
+
onPointerDown={handlePointerDown}
|
|
99
|
+
{...(rest as JSX.AnchorHTMLAttributes<HTMLAnchorElement>)}
|
|
100
|
+
>
|
|
101
|
+
{local.children}
|
|
102
|
+
</a>
|
|
103
|
+
</Show>
|
|
70
104
|
)
|
|
71
105
|
}
|
package/src/ui/Carousel.tsx
CHANGED
|
@@ -146,18 +146,24 @@ export function Carousel(props: CarouselProps): JSX.Element {
|
|
|
146
146
|
</button>
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
|
-
<div class="flex items-center justify-center gap-
|
|
149
|
+
<div class="flex items-center justify-center gap-1">
|
|
150
150
|
<For each={props.slides}>
|
|
151
151
|
{(_, i) => (
|
|
152
|
+
// 24×24 hit target (a11y target-size) around a small visual dot.
|
|
152
153
|
<button
|
|
153
154
|
type="button"
|
|
154
155
|
aria-label={`Go to slide ${i() + 1}`}
|
|
156
|
+
aria-current={index() === i() ? 'true' : undefined}
|
|
155
157
|
onClick={() => go(i())}
|
|
156
|
-
class=
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
class="grid h-6 w-6 place-items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
159
|
+
>
|
|
160
|
+
<span
|
|
161
|
+
class={cn(
|
|
162
|
+
'h-2 w-2 rounded-full transition-colors',
|
|
163
|
+
index() === i() ? 'bg-primary' : 'bg-muted',
|
|
164
|
+
)}
|
|
165
|
+
/>
|
|
166
|
+
</button>
|
|
161
167
|
)}
|
|
162
168
|
</For>
|
|
163
169
|
</div>
|
|
@@ -1,407 +0,0 @@
|
|
|
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
|
-
import { c as m } from "./cn-B6yFEsav.js";
|
|
4
|
-
import { animate as L, inView as Q } from "motion";
|
|
5
|
-
import { Star as B } from "lucide-solid";
|
|
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
|
-
neutral: "bg-muted text-muted-foreground ring-border",
|
|
9
|
-
success: "bg-emerald-500/15 text-emerald-600 ring-emerald-500/30",
|
|
10
|
-
warning: "bg-amber-500/15 text-amber-600 ring-amber-500/30",
|
|
11
|
-
danger: "bg-rose-500/15 text-rose-600 ring-rose-500/30",
|
|
12
|
-
info: "bg-sky-500/15 text-sky-600 ring-sky-500/30"
|
|
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
|
-
function $e(t) {
|
|
15
|
-
const [e, r] = x(t, ["tone", "class", "children", "pulse"]);
|
|
16
|
-
return (() => {
|
|
17
|
-
var n = J();
|
|
18
|
-
return y(n, b({
|
|
19
|
-
get class() {
|
|
20
|
-
return m(Z, W[e.tone ?? "neutral"], e.class);
|
|
21
|
-
}
|
|
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;
|
|
30
|
-
})();
|
|
31
|
-
}
|
|
32
|
-
const I = "a4ui-effects";
|
|
33
|
-
function Y() {
|
|
34
|
-
try {
|
|
35
|
-
return window.localStorage;
|
|
36
|
-
} catch {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function ee() {
|
|
41
|
-
var e;
|
|
42
|
-
try {
|
|
43
|
-
if (new URLSearchParams(window.location.search).get("calm") === "1") return !1;
|
|
44
|
-
} catch {
|
|
45
|
-
}
|
|
46
|
-
const t = (e = Y()) == null ? void 0 : e.getItem(I);
|
|
47
|
-
return t === null ? !0 : t === "1";
|
|
48
|
-
}
|
|
49
|
-
function N(t) {
|
|
50
|
-
typeof document > "u" || document.documentElement.classList.toggle("calm", !t);
|
|
51
|
-
}
|
|
52
|
-
const U = ee();
|
|
53
|
-
N(U);
|
|
54
|
-
const [z, te] = _(U);
|
|
55
|
-
function _e() {
|
|
56
|
-
return z;
|
|
57
|
-
}
|
|
58
|
-
function ne() {
|
|
59
|
-
return !z();
|
|
60
|
-
}
|
|
61
|
-
function Ee(t) {
|
|
62
|
-
var e;
|
|
63
|
-
(e = Y()) == null || e.setItem(I, t ? "1" : "0"), N(t), te(t);
|
|
64
|
-
}
|
|
65
|
-
const re = "(prefers-reduced-motion: reduce)";
|
|
66
|
-
function oe() {
|
|
67
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(re).matches;
|
|
68
|
-
}
|
|
69
|
-
const X = "a4ui-motion-forced";
|
|
70
|
-
function j() {
|
|
71
|
-
try {
|
|
72
|
-
return window.localStorage;
|
|
73
|
-
} catch {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
var D;
|
|
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() {
|
|
81
|
-
return R;
|
|
82
|
-
}
|
|
83
|
-
function ke(t) {
|
|
84
|
-
var e;
|
|
85
|
-
(e = j()) == null || e.setItem(X, t ? "1" : "0"), typeof document < "u" && document.documentElement.classList.toggle("force-motion", t), ae(t);
|
|
86
|
-
}
|
|
87
|
-
function w() {
|
|
88
|
-
return ne() || oe() && !R();
|
|
89
|
-
}
|
|
90
|
-
function Se(t, e = 600) {
|
|
91
|
-
const [r, n] = _(0);
|
|
92
|
-
let o;
|
|
93
|
-
return K(() => {
|
|
94
|
-
const a = t();
|
|
95
|
-
if (o == null || o.stop(), w()) {
|
|
96
|
-
n(a);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const l = F(r);
|
|
100
|
-
l !== a && (o = L(l, a, {
|
|
101
|
-
duration: e / 1e3,
|
|
102
|
-
ease: "easeOut",
|
|
103
|
-
onUpdate: (u) => n(u)
|
|
104
|
-
}));
|
|
105
|
-
}), E(() => o == null ? void 0 : o.stop()), r;
|
|
106
|
-
}
|
|
107
|
-
function Le(t, e = {}) {
|
|
108
|
-
w() || L(
|
|
109
|
-
t,
|
|
110
|
-
{ opacity: [0, 1], y: [e.y ?? 8, 0] },
|
|
111
|
-
{ duration: e.duration ?? 0.32, delay: e.delay ?? 0, ease: "easeOut" }
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
function Re(t, e = {}) {
|
|
115
|
-
if (w()) return () => {
|
|
116
|
-
};
|
|
117
|
-
t.style.opacity = "0";
|
|
118
|
-
let r = !1;
|
|
119
|
-
return Q(
|
|
120
|
-
t,
|
|
121
|
-
() => {
|
|
122
|
-
r || (r = !0, L(
|
|
123
|
-
t,
|
|
124
|
-
{ opacity: [0, 1], y: [e.y ?? 16, 0] },
|
|
125
|
-
{ duration: e.duration ?? 0.5, ease: "easeOut" }
|
|
126
|
-
));
|
|
127
|
-
},
|
|
128
|
-
{ amount: e.amount ?? 0.2 }
|
|
129
|
-
);
|
|
130
|
-
}
|
|
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");
|
|
135
|
-
u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
|
|
136
|
-
position: "absolute",
|
|
137
|
-
left: `${o}px`,
|
|
138
|
-
top: `${a}px`,
|
|
139
|
-
width: `${l}px`,
|
|
140
|
-
height: `${l}px`,
|
|
141
|
-
borderRadius: "9999px",
|
|
142
|
-
background: r.color ?? "currentColor",
|
|
143
|
-
pointerEvents: "none",
|
|
144
|
-
transform: "translate(-50%,-50%) scale(0)"
|
|
145
|
-
}), t.appendChild(u);
|
|
146
|
-
const s = u.animate([{
|
|
147
|
-
transform: "translate(-50%,-50%) scale(0)",
|
|
148
|
-
opacity: String(r.opacity ?? 0.3)
|
|
149
|
-
}, {
|
|
150
|
-
transform: "translate(-50%,-50%) scale(1)",
|
|
151
|
-
opacity: "0"
|
|
152
|
-
}], {
|
|
153
|
-
duration: 600,
|
|
154
|
-
easing: "ease-out"
|
|
155
|
-
}), i = () => u.remove();
|
|
156
|
-
s.finished.then(i).catch(i);
|
|
157
|
-
}
|
|
158
|
-
function Me(t) {
|
|
159
|
-
let e;
|
|
160
|
-
const r = (n) => {
|
|
161
|
-
e && G(e, n, {
|
|
162
|
-
color: t.color,
|
|
163
|
-
opacity: t.opacity
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
return (() => {
|
|
167
|
-
var n = ie();
|
|
168
|
-
n.$$pointerdown = r;
|
|
169
|
-
var o = e;
|
|
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;
|
|
171
|
-
})();
|
|
172
|
-
}
|
|
173
|
-
k(["pointerdown"]);
|
|
174
|
-
var le = /* @__PURE__ */ g("<button>");
|
|
175
|
-
const se = {
|
|
176
|
-
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
177
|
-
secondary: "bg-muted text-foreground hover:bg-muted/70",
|
|
178
|
-
outline: "border border-border bg-transparent text-foreground hover:bg-muted",
|
|
179
|
-
ghost: "bg-transparent text-foreground hover:bg-muted"
|
|
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, {
|
|
184
|
-
opacity: 0.35
|
|
185
|
-
});
|
|
186
|
-
const a = e.onPointerDown;
|
|
187
|
-
typeof a == "function" ? a(o) : a && a[0](a[1], o);
|
|
188
|
-
};
|
|
189
|
-
return (() => {
|
|
190
|
-
var o = le();
|
|
191
|
-
return o.$$pointerdown = n, y(o, b({
|
|
192
|
-
get type() {
|
|
193
|
-
return e.type ?? "button";
|
|
194
|
-
},
|
|
195
|
-
get class() {
|
|
196
|
-
return m(ce, se[e.variant ?? "primary"], e.ripple && "relative overflow-hidden", e.class);
|
|
197
|
-
}
|
|
198
|
-
}, r), !1, !0), f(o, () => e.children), o;
|
|
199
|
-
})();
|
|
200
|
-
}
|
|
201
|
-
k(["pointerdown"]);
|
|
202
|
-
var ue = /* @__PURE__ */ g("<div>");
|
|
203
|
-
function V(t, e = {}) {
|
|
204
|
-
if (w()) return () => {
|
|
205
|
-
};
|
|
206
|
-
const r = document.createElement("span");
|
|
207
|
-
r.setAttribute("aria-hidden", "true"), r.className = "pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300", t.appendChild(r);
|
|
208
|
-
const n = e.size ?? 180, o = e.color ?? "hsl(var(--primary))", a = (i, c) => {
|
|
209
|
-
r.style.background = `radial-gradient(${n}px circle at ${i}px ${c}px, color-mix(in srgb, ${o} 30%, transparent), transparent 70%)`;
|
|
210
|
-
}, l = (i) => {
|
|
211
|
-
const c = t.getBoundingClientRect();
|
|
212
|
-
a(i.clientX - c.left, i.clientY - c.top);
|
|
213
|
-
}, u = () => {
|
|
214
|
-
r.style.opacity = "1";
|
|
215
|
-
}, s = () => {
|
|
216
|
-
r.style.opacity = "0";
|
|
217
|
-
};
|
|
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();
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function Oe(t) {
|
|
223
|
-
let e;
|
|
224
|
-
return S(() => {
|
|
225
|
-
const r = V(e, {
|
|
226
|
-
color: t.color,
|
|
227
|
-
size: t.size
|
|
228
|
-
});
|
|
229
|
-
E(r);
|
|
230
|
-
}), (() => {
|
|
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;
|
|
233
|
-
})();
|
|
234
|
-
}
|
|
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 () => {
|
|
238
|
-
};
|
|
239
|
-
e.style.willChange = "transform";
|
|
240
|
-
const n = (a) => {
|
|
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)`;
|
|
243
|
-
}, o = () => {
|
|
244
|
-
e.style.transition = "transform 0.4s ease", e.style.transform = "perspective(800px) rotateX(0deg) rotateY(0deg) scale(1)";
|
|
245
|
-
};
|
|
246
|
-
return t.addEventListener("pointermove", n), t.addEventListener("pointerleave", o), () => {
|
|
247
|
-
t.removeEventListener("pointermove", n), t.removeEventListener("pointerleave", o), e.style.transform = "", e.style.transition = "", e.style.willChange = "";
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
function Te(t) {
|
|
251
|
-
let e, r;
|
|
252
|
-
return S(() => {
|
|
253
|
-
const n = H(e, r, {
|
|
254
|
-
max: t.max
|
|
255
|
-
});
|
|
256
|
-
E(n);
|
|
257
|
-
}), (() => {
|
|
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;
|
|
262
|
-
})();
|
|
263
|
-
}
|
|
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;
|
|
267
|
-
let o;
|
|
268
|
-
return S(() => {
|
|
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()));
|
|
271
|
-
}), (() => {
|
|
272
|
-
var a = M(), l = o;
|
|
273
|
-
return typeof l == "function" ? $(l, a) : o = a, y(a, b({
|
|
274
|
-
get class() {
|
|
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);
|
|
276
|
-
}
|
|
277
|
-
}, r), !1, !0), f(a, () => e.children), a;
|
|
278
|
-
})();
|
|
279
|
-
}
|
|
280
|
-
function De(t) {
|
|
281
|
-
const [e, r] = x(t, ["class", "children"]);
|
|
282
|
-
return (() => {
|
|
283
|
-
var n = M();
|
|
284
|
-
return y(n, b({
|
|
285
|
-
get class() {
|
|
286
|
-
return m("flex flex-col space-y-1.5 p-6", e.class);
|
|
287
|
-
}
|
|
288
|
-
}, r), !1, !0), f(n, () => e.children), n;
|
|
289
|
-
})();
|
|
290
|
-
}
|
|
291
|
-
function Pe(t) {
|
|
292
|
-
const [e, r] = x(t, ["class", "children"]);
|
|
293
|
-
return (() => {
|
|
294
|
-
var n = fe();
|
|
295
|
-
return y(n, b({
|
|
296
|
-
get class() {
|
|
297
|
-
return m("text-lg font-semibold leading-none tracking-tight", e.class);
|
|
298
|
-
}
|
|
299
|
-
}, r), !1, !0), f(n, () => e.children), n;
|
|
300
|
-
})();
|
|
301
|
-
}
|
|
302
|
-
function Fe(t) {
|
|
303
|
-
const [e, r] = x(t, ["class", "children"]);
|
|
304
|
-
return (() => {
|
|
305
|
-
var n = M();
|
|
306
|
-
return y(n, b({
|
|
307
|
-
get class() {
|
|
308
|
-
return m("p-6 pt-0", e.class);
|
|
309
|
-
}
|
|
310
|
-
}, r), !1, !0), f(n, () => e.children), n;
|
|
311
|
-
})();
|
|
312
|
-
}
|
|
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) {
|
|
315
|
-
const [e, r] = _(0), n = () => t.max ?? 5, o = () => Array.from({
|
|
316
|
-
length: n()
|
|
317
|
-
}, (s, i) => i + 1), a = () => e() > 0 ? e() : t.value, l = (s) => {
|
|
318
|
-
var i;
|
|
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, {
|
|
322
|
-
get when() {
|
|
323
|
-
return !t.readonly;
|
|
324
|
-
},
|
|
325
|
-
get fallback() {
|
|
326
|
-
return (() => {
|
|
327
|
-
var s = ge();
|
|
328
|
-
return f(s, p(T, {
|
|
329
|
-
get each() {
|
|
330
|
-
return o();
|
|
331
|
-
},
|
|
332
|
-
children: (i) => p(B, {
|
|
333
|
-
get class() {
|
|
334
|
-
return u(i);
|
|
335
|
-
},
|
|
336
|
-
"aria-hidden": "true"
|
|
337
|
-
})
|
|
338
|
-
})), h((i) => {
|
|
339
|
-
var c = m("inline-flex items-center gap-1", t.class), d = `Rating ${t.value} of ${n()}`;
|
|
340
|
-
return c !== i.e && v(s, i.e = c), d !== i.t && C(s, "aria-label", i.t = d), i;
|
|
341
|
-
}, {
|
|
342
|
-
e: void 0,
|
|
343
|
-
t: void 0
|
|
344
|
-
}), s;
|
|
345
|
-
})();
|
|
346
|
-
},
|
|
347
|
-
get children() {
|
|
348
|
-
var s = me();
|
|
349
|
-
return s.addEventListener("mouseleave", () => r(0)), f(s, p(T, {
|
|
350
|
-
get each() {
|
|
351
|
-
return o();
|
|
352
|
-
},
|
|
353
|
-
children: (i) => (() => {
|
|
354
|
-
var c = he();
|
|
355
|
-
return c.$$keydown = (d) => {
|
|
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, {
|
|
358
|
-
get class() {
|
|
359
|
-
return u(i);
|
|
360
|
-
},
|
|
361
|
-
"aria-hidden": "true"
|
|
362
|
-
})), h((d) => {
|
|
363
|
-
var A = t.value === i, O = `Rate ${i} of ${n()}`;
|
|
364
|
-
return A !== d.e && C(c, "aria-checked", d.e = A), O !== d.t && C(c, "aria-label", d.t = O), d;
|
|
365
|
-
}, {
|
|
366
|
-
e: void 0,
|
|
367
|
-
t: void 0
|
|
368
|
-
}), c;
|
|
369
|
-
})()
|
|
370
|
-
})), h(() => v(s, m("inline-flex items-center gap-1", t.class))), s;
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
k(["click", "keydown"]);
|
|
375
|
-
var pe = /* @__PURE__ */ g('<label><input type=checkbox class="h-4 w-4 rounded border-input accent-primary">');
|
|
376
|
-
function Ye(t) {
|
|
377
|
-
return (() => {
|
|
378
|
-
var e = pe(), r = e.firstChild;
|
|
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;
|
|
380
|
-
})();
|
|
381
|
-
}
|
|
382
|
-
export {
|
|
383
|
-
$e as B,
|
|
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
|
-
De as f,
|
|
394
|
-
Pe as g,
|
|
395
|
-
Ee as h,
|
|
396
|
-
Me as i,
|
|
397
|
-
V as j,
|
|
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
|
|
407
|
-
};
|