@a4ui/core 0.15.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/README.md +12 -12
- package/dist/Checkbox-DMx0y81E.js +407 -0
- 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 +2794 -2716
- package/dist/full.css +111 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2918 -3110
- package/dist/styles.css +66 -0
- package/dist/ui/Badge.d.ts +6 -0
- package/dist/ui/Button.d.ts +7 -0
- package/dist/ui/Card.d.ts +15 -1
- 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/Ripple.d.ts +14 -1
- package/dist/ui/Skeleton.d.ts +10 -3
- package/dist/ui/Spotlight.d.ts +15 -2
- package/dist/ui/TiltCard.d.ts +14 -1
- package/package.json +1 -1
- package/src/commerce/ProductCard.tsx +17 -1
- package/src/index.ts +4 -4
- package/src/ui/Accordion.tsx +3 -1
- package/src/ui/Badge.tsx +14 -2
- package/src/ui/Button.tsx +24 -2
- package/src/ui/Card.tsx +32 -3
- 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/Ripple.tsx +64 -75
- package/src/ui/Skeleton.tsx +17 -5
- package/src/ui/SpeedDial.tsx +3 -1
- package/src/ui/Spotlight.tsx +51 -40
- package/src/ui/TiltCard.tsx +51 -42
- package/dist/Checkbox-DQcDOBLd.js +0 -168
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { spread as g, mergeProps as m, insert as i, template as d, createComponent as v, effect as h, setAttribute as x, className as y, delegateEvents as E } from "solid-js/web";
|
|
2
|
-
import { splitProps as f, createSignal as S, Show as L, For as p } from "solid-js";
|
|
3
|
-
import { c } from "./cn-B6yFEsav.js";
|
|
4
|
-
import { Star as C } from "lucide-solid";
|
|
5
|
-
var B = /* @__PURE__ */ d("<span>");
|
|
6
|
-
const R = {
|
|
7
|
-
neutral: "bg-muted text-muted-foreground ring-border",
|
|
8
|
-
success: "bg-emerald-500/15 text-emerald-600 ring-emerald-500/30",
|
|
9
|
-
warning: "bg-amber-500/15 text-amber-600 ring-amber-500/30",
|
|
10
|
-
danger: "bg-rose-500/15 text-rose-600 ring-rose-500/30",
|
|
11
|
-
info: "bg-sky-500/15 text-sky-600 ring-sky-500/30"
|
|
12
|
-
}, T = "badge inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold ring-1 ring-inset whitespace-nowrap";
|
|
13
|
-
function q(r) {
|
|
14
|
-
const [e, n] = f(r, ["tone", "class", "children"]);
|
|
15
|
-
return (() => {
|
|
16
|
-
var t = B();
|
|
17
|
-
return g(t, m({
|
|
18
|
-
get class() {
|
|
19
|
-
return c(T, R[e.tone ?? "neutral"], e.class);
|
|
20
|
-
}
|
|
21
|
-
}, n), !1, !0), i(t, () => e.children), t;
|
|
22
|
-
})();
|
|
23
|
-
}
|
|
24
|
-
var D = /* @__PURE__ */ d("<button>");
|
|
25
|
-
const N = {
|
|
26
|
-
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
27
|
-
secondary: "bg-muted text-foreground hover:bg-muted/70",
|
|
28
|
-
outline: "border border-border bg-transparent text-foreground hover:bg-muted",
|
|
29
|
-
ghost: "bg-transparent text-foreground hover:bg-muted"
|
|
30
|
-
}, G = "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";
|
|
31
|
-
function z(r) {
|
|
32
|
-
const [e, n] = f(r, ["variant", "class", "type", "children"]);
|
|
33
|
-
return (() => {
|
|
34
|
-
var t = D();
|
|
35
|
-
return g(t, m({
|
|
36
|
-
get type() {
|
|
37
|
-
return e.type ?? "button";
|
|
38
|
-
},
|
|
39
|
-
get class() {
|
|
40
|
-
return c(G, N[e.variant ?? "primary"], e.class);
|
|
41
|
-
}
|
|
42
|
-
}, n), !1, !0), i(t, () => e.children), t;
|
|
43
|
-
})();
|
|
44
|
-
}
|
|
45
|
-
var $ = /* @__PURE__ */ d("<div>"), H = /* @__PURE__ */ d("<h2>");
|
|
46
|
-
function J(r) {
|
|
47
|
-
const [e, n] = f(r, ["class", "children", "glass", "glow"]), t = () => (e.glow ?? e.glass) === !0;
|
|
48
|
-
return (() => {
|
|
49
|
-
var u = $();
|
|
50
|
-
return g(u, m({
|
|
51
|
-
get class() {
|
|
52
|
-
return c(e.glass ? "card rounded-xl text-card-foreground" : "rounded-xl border border-border bg-card text-card-foreground shadow-sm", t() && "glow-edge", e.class);
|
|
53
|
-
}
|
|
54
|
-
}, n), !1, !0), i(u, () => e.children), u;
|
|
55
|
-
})();
|
|
56
|
-
}
|
|
57
|
-
function K(r) {
|
|
58
|
-
const [e, n] = f(r, ["class", "children"]);
|
|
59
|
-
return (() => {
|
|
60
|
-
var t = $();
|
|
61
|
-
return g(t, m({
|
|
62
|
-
get class() {
|
|
63
|
-
return c("flex flex-col space-y-1.5 p-6", e.class);
|
|
64
|
-
}
|
|
65
|
-
}, n), !1, !0), i(t, () => e.children), t;
|
|
66
|
-
})();
|
|
67
|
-
}
|
|
68
|
-
function Q(r) {
|
|
69
|
-
const [e, n] = f(r, ["class", "children"]);
|
|
70
|
-
return (() => {
|
|
71
|
-
var t = H();
|
|
72
|
-
return g(t, m({
|
|
73
|
-
get class() {
|
|
74
|
-
return c("text-lg font-semibold leading-none tracking-tight", e.class);
|
|
75
|
-
}
|
|
76
|
-
}, n), !1, !0), i(t, () => e.children), t;
|
|
77
|
-
})();
|
|
78
|
-
}
|
|
79
|
-
function W(r) {
|
|
80
|
-
const [e, n] = f(r, ["class", "children"]);
|
|
81
|
-
return (() => {
|
|
82
|
-
var t = $();
|
|
83
|
-
return g(t, m({
|
|
84
|
-
get class() {
|
|
85
|
-
return c("p-6 pt-0", e.class);
|
|
86
|
-
}
|
|
87
|
-
}, n), !1, !0), i(t, () => e.children), t;
|
|
88
|
-
})();
|
|
89
|
-
}
|
|
90
|
-
var M = /* @__PURE__ */ d("<div role=radiogroup>"), O = /* @__PURE__ */ d("<div role=img>"), P = /* @__PURE__ */ d('<button type=button role=radio class="rounded outline-none focus-visible:ring-2 focus-visible:ring-ring/40">');
|
|
91
|
-
function X(r) {
|
|
92
|
-
const [e, n] = S(0), t = () => r.max ?? 5, u = () => Array.from({
|
|
93
|
-
length: t()
|
|
94
|
-
}, (s, a) => a + 1), A = () => e() > 0 ? e() : r.value, b = (s) => {
|
|
95
|
-
var a;
|
|
96
|
-
r.readonly || (a = r.onChange) == null || a.call(r, s);
|
|
97
|
-
}, k = (s) => c("h-5 w-5 transition-colors", s <= A() ? "fill-primary text-primary" : "fill-transparent text-muted-foreground");
|
|
98
|
-
return v(L, {
|
|
99
|
-
get when() {
|
|
100
|
-
return !r.readonly;
|
|
101
|
-
},
|
|
102
|
-
get fallback() {
|
|
103
|
-
return (() => {
|
|
104
|
-
var s = O();
|
|
105
|
-
return i(s, v(p, {
|
|
106
|
-
get each() {
|
|
107
|
-
return u();
|
|
108
|
-
},
|
|
109
|
-
children: (a) => v(C, {
|
|
110
|
-
get class() {
|
|
111
|
-
return k(a);
|
|
112
|
-
},
|
|
113
|
-
"aria-hidden": "true"
|
|
114
|
-
})
|
|
115
|
-
})), h((a) => {
|
|
116
|
-
var o = c("inline-flex items-center gap-1", r.class), l = `Rating ${r.value} of ${t()}`;
|
|
117
|
-
return o !== a.e && y(s, a.e = o), l !== a.t && x(s, "aria-label", a.t = l), a;
|
|
118
|
-
}, {
|
|
119
|
-
e: void 0,
|
|
120
|
-
t: void 0
|
|
121
|
-
}), s;
|
|
122
|
-
})();
|
|
123
|
-
},
|
|
124
|
-
get children() {
|
|
125
|
-
var s = M();
|
|
126
|
-
return s.addEventListener("mouseleave", () => n(0)), i(s, v(p, {
|
|
127
|
-
get each() {
|
|
128
|
-
return u();
|
|
129
|
-
},
|
|
130
|
-
children: (a) => (() => {
|
|
131
|
-
var o = P();
|
|
132
|
-
return o.$$keydown = (l) => {
|
|
133
|
-
l.key === "ArrowRight" || l.key === "ArrowUp" ? (l.preventDefault(), b(Math.min(r.value + 1, t()))) : (l.key === "ArrowLeft" || l.key === "ArrowDown") && (l.preventDefault(), b(Math.max(r.value - 1, 0)));
|
|
134
|
-
}, o.$$click = () => b(a), o.addEventListener("blur", () => n(0)), o.addEventListener("focus", () => n(a)), o.addEventListener("mouseenter", () => n(a)), i(o, v(C, {
|
|
135
|
-
get class() {
|
|
136
|
-
return k(a);
|
|
137
|
-
},
|
|
138
|
-
"aria-hidden": "true"
|
|
139
|
-
})), h((l) => {
|
|
140
|
-
var w = r.value === a, _ = `Rate ${a} of ${t()}`;
|
|
141
|
-
return w !== l.e && x(o, "aria-checked", l.e = w), _ !== l.t && x(o, "aria-label", l.t = _), l;
|
|
142
|
-
}, {
|
|
143
|
-
e: void 0,
|
|
144
|
-
t: void 0
|
|
145
|
-
}), o;
|
|
146
|
-
})()
|
|
147
|
-
})), h(() => y(s, c("inline-flex items-center gap-1", r.class))), s;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
E(["click", "keydown"]);
|
|
152
|
-
var U = /* @__PURE__ */ d('<label><input type=checkbox class="h-4 w-4 rounded border-input accent-primary">');
|
|
153
|
-
function Y(r) {
|
|
154
|
-
return (() => {
|
|
155
|
-
var e = U(), n = e.firstChild;
|
|
156
|
-
return n.addEventListener("change", (t) => r.onChange(t.currentTarget.checked)), i(e, () => r.label, null), h(() => y(e, c("inline-flex items-center gap-2 text-sm text-foreground", r.class))), h(() => n.checked = r.checked), e;
|
|
157
|
-
})();
|
|
158
|
-
}
|
|
159
|
-
export {
|
|
160
|
-
q as B,
|
|
161
|
-
J as C,
|
|
162
|
-
X as R,
|
|
163
|
-
z as a,
|
|
164
|
-
Y as b,
|
|
165
|
-
W as c,
|
|
166
|
-
K as d,
|
|
167
|
-
Q as e
|
|
168
|
-
};
|