@craftile/editor 0.1.2 → 0.1.3
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/Button.vue_vue_type_script_setup_true_lang-C_TGGfLr.js +70 -0
- package/dist/index.js +2631 -2585
- package/dist/types/i18n.d.ts +1 -0
- package/dist/types/ui.d.ts +6 -1
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +4 -0
- package/package.json +11 -7
- package/dist/index.umd.cjs +0 -7
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent as p, computed as f, createElementBlock as a, openBlock as n, unref as g, normalizeClass as r, createCommentVNode as b, createElementVNode as s, renderSlot as m } from "vue";
|
|
2
|
+
const y = ["type", "disabled"], h = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "animate-spin h-4 w-4 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
fill: "none",
|
|
7
|
+
viewBox: "0 0 24 24"
|
|
8
|
+
}, x = /* @__PURE__ */ p({
|
|
9
|
+
__name: "Button",
|
|
10
|
+
props: {
|
|
11
|
+
variant: { default: "default" },
|
|
12
|
+
size: { default: "md" },
|
|
13
|
+
type: { default: "button" },
|
|
14
|
+
disabled: { type: Boolean, default: !1 },
|
|
15
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
16
|
+
square: { type: Boolean, default: !1 },
|
|
17
|
+
loading: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
setup(l) {
|
|
20
|
+
const i = {
|
|
21
|
+
default: "bg-white text-gray-900 hover:bg-gray-50 border border-gray-200",
|
|
22
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
23
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90",
|
|
24
|
+
accent: "bg-accent text-accent-foreground hover:bg-accent/90",
|
|
25
|
+
sutble: "bg-accent-foreground text-accent",
|
|
26
|
+
destructive: "bg-red-600 text-white hover:bg-red-700"
|
|
27
|
+
}, d = {
|
|
28
|
+
sm: "h-6 px-3 text-xs",
|
|
29
|
+
md: "h-8 px-4",
|
|
30
|
+
lg: "h-10 px-6 text-base"
|
|
31
|
+
}, c = {
|
|
32
|
+
sm: "w-6 h-6 text-xs p-0",
|
|
33
|
+
md: "w-8 h-8 p-0",
|
|
34
|
+
lg: "w-10 h-10 text-base p-0"
|
|
35
|
+
}, t = l, u = f(() => t.disabled || t.loading);
|
|
36
|
+
return (e, o) => (n(), a("button", {
|
|
37
|
+
class: r(["inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none cursor-pointer relative", [
|
|
38
|
+
i[e.variant],
|
|
39
|
+
t.square ? c[e.size] : d[e.size],
|
|
40
|
+
e.fullWidth && "w-full"
|
|
41
|
+
]]),
|
|
42
|
+
type: e.type,
|
|
43
|
+
disabled: g(u)
|
|
44
|
+
}, [
|
|
45
|
+
e.loading ? (n(), a("svg", h, [...o[0] || (o[0] = [
|
|
46
|
+
s("circle", {
|
|
47
|
+
class: "opacity-25",
|
|
48
|
+
cx: "12",
|
|
49
|
+
cy: "12",
|
|
50
|
+
r: "10",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
"stroke-width": "4"
|
|
53
|
+
}, null, -1),
|
|
54
|
+
s("path", {
|
|
55
|
+
class: "opacity-75",
|
|
56
|
+
fill: "currentColor",
|
|
57
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
58
|
+
}, null, -1)
|
|
59
|
+
])])) : b("", !0),
|
|
60
|
+
s("span", {
|
|
61
|
+
class: r(["inline-flex items-center gap-2", { invisible: e.loading }])
|
|
62
|
+
}, [
|
|
63
|
+
m(e.$slots, "default")
|
|
64
|
+
], 2)
|
|
65
|
+
], 10, y));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
x as _
|
|
70
|
+
};
|