@stachelock/ui 0.2.7 → 0.2.9
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/{ComboboxInput.vue_vue_type_script_setup_true_lang-2dJNxQUF.js → ComboboxInput.vue_vue_type_script_setup_true_lang-LE2kDHpU.js} +2 -2
- package/dist/{ComboboxInput.vue_vue_type_script_setup_true_lang-2dJNxQUF.js.map → ComboboxInput.vue_vue_type_script_setup_true_lang-LE2kDHpU.js.map} +1 -1
- package/dist/{UiLoading.vue_vue_type_script_setup_true_lang-DCz52-Me.js → UiLoading.vue_vue_type_script_setup_true_lang-KbLKA4SA.js} +13 -13
- package/dist/UiLoading.vue_vue_type_script_setup_true_lang-KbLKA4SA.js.map +1 -0
- package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-D4-B3A7K.js +51 -0
- package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-D4-B3A7K.js.map +1 -0
- package/dist/components/Badge.js +11 -11
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Button.js +56 -51
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Loading.js +1 -1
- package/dist/components/LoadingDots.js +22 -19
- package/dist/components/LoadingDots.js.map +1 -1
- package/dist/components/ProgressBar.js +1 -1
- package/dist/components/RadialProgressBar.js +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/inputs/ComboboxInput.js +1 -1
- package/dist/src/components/UiButton.d.ts.map +1 -1
- package/dist/src/components/UiLoadingDots.d.ts.map +1 -1
- package/dist/src/components/UiProgressBar.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/UiLoading.vue_vue_type_script_setup_true_lang-DCz52-Me.js.map +0 -1
- package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-0zFKwh43.js +0 -46
- package/dist/UiProgressBar.vue_vue_type_script_setup_true_lang-0zFKwh43.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as d, computed as n, createElementBlock as a, openBlock as r, normalizeClass as o, createCommentVNode as p, createElementVNode as l, toDisplayString as
|
|
1
|
+
import { defineComponent as d, computed as n, createElementBlock as a, openBlock as r, normalizeClass as o, createCommentVNode as p, createElementVNode as l, toDisplayString as m } from "vue";
|
|
2
2
|
const g = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "sl-absolute sl-inset-0 sl-bg-white sl-bg-opacity-75 dark:sl-bg-gray-900 dark:sl-bg-opacity-75 sl-flex sl-items-center sl-justify-center sl-z-50"
|
|
@@ -11,11 +11,11 @@ const g = {
|
|
|
11
11
|
overlay: { type: Boolean, default: !1 },
|
|
12
12
|
className: {}
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const t =
|
|
14
|
+
setup(x) {
|
|
15
|
+
const t = x, y = n(() => {
|
|
16
16
|
const s = ["sl-flex sl-items-center sl-justify-center"];
|
|
17
17
|
return t.overlay ? s.push("sl-relative") : s.push("sl-flex-col sl-space-y-2"), t.className && s.push(t.className), s;
|
|
18
|
-
}),
|
|
18
|
+
}), i = n(() => {
|
|
19
19
|
const e = {
|
|
20
20
|
xs: "sl-h-3 sl-w-3",
|
|
21
21
|
sm: "sl-h-4 sl-w-4",
|
|
@@ -24,7 +24,7 @@ const g = {
|
|
|
24
24
|
xl: "sl-h-10 sl-w-10",
|
|
25
25
|
"2xl": "sl-h-12 sl-w-12"
|
|
26
26
|
}, s = {
|
|
27
|
-
primary: "sl-text-
|
|
27
|
+
primary: "sl-text-primary-600",
|
|
28
28
|
secondary: "sl-text-gray-600",
|
|
29
29
|
dark: "sl-text-gray-700",
|
|
30
30
|
light: "sl-text-gray-400",
|
|
@@ -37,7 +37,7 @@ const g = {
|
|
|
37
37
|
e[t.size || "md"],
|
|
38
38
|
s[t.theme || "primary"]
|
|
39
39
|
];
|
|
40
|
-
}),
|
|
40
|
+
}), c = n(() => {
|
|
41
41
|
const e = {
|
|
42
42
|
xs: "sl-text-xs",
|
|
43
43
|
sm: "sl-text-sm",
|
|
@@ -67,7 +67,7 @@ const g = {
|
|
|
67
67
|
e.overlay ? (r(), a("div", g, [
|
|
68
68
|
l("div", u, [
|
|
69
69
|
l("div", {
|
|
70
|
-
class: o(
|
|
70
|
+
class: o(i.value)
|
|
71
71
|
}, s[0] || (s[0] = [
|
|
72
72
|
l("svg", {
|
|
73
73
|
class: "sl-animate-spin",
|
|
@@ -91,12 +91,12 @@ const g = {
|
|
|
91
91
|
]), 2),
|
|
92
92
|
e.text ? (r(), a("p", {
|
|
93
93
|
key: 0,
|
|
94
|
-
class: o(
|
|
95
|
-
},
|
|
94
|
+
class: o(c.value)
|
|
95
|
+
}, m(e.text), 3)) : p("", !0)
|
|
96
96
|
])
|
|
97
97
|
])) : (r(), a("div", {
|
|
98
98
|
key: 1,
|
|
99
|
-
class: o(
|
|
99
|
+
class: o(i.value)
|
|
100
100
|
}, s[1] || (s[1] = [
|
|
101
101
|
l("svg", {
|
|
102
102
|
class: "sl-animate-spin",
|
|
@@ -120,12 +120,12 @@ const g = {
|
|
|
120
120
|
]), 2)),
|
|
121
121
|
e.text && !e.overlay ? (r(), a("p", {
|
|
122
122
|
key: 2,
|
|
123
|
-
class: o(
|
|
124
|
-
},
|
|
123
|
+
class: o(c.value)
|
|
124
|
+
}, m(e.text), 3)) : p("", !0)
|
|
125
125
|
], 2));
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
export {
|
|
129
129
|
f as _
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=UiLoading.vue_vue_type_script_setup_true_lang-
|
|
131
|
+
//# sourceMappingURL=UiLoading.vue_vue_type_script_setup_true_lang-KbLKA4SA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiLoading.vue_vue_type_script_setup_true_lang-KbLKA4SA.js","sources":["../src/components/UiLoading.vue"],"sourcesContent":["<template>\n <div :class=\"containerClasses\">\n <div v-if=\"overlay\" class=\"sl-absolute sl-inset-0 sl-bg-white sl-bg-opacity-75 dark:sl-bg-gray-900 dark:sl-bg-opacity-75 sl-flex sl-items-center sl-justify-center sl-z-50\">\n <div class=\"sl-flex sl-flex-col sl-items-center\">\n <div :class=\"spinnerClasses\">\n <svg class=\"sl-animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle\n class=\"sl-opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n class=\"sl-opacity-75\"\n fill=\"currentColor\"\n 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\"\n />\n </svg>\n </div>\n <p v-if=\"text\" :class=\"textClasses\">{{ text }}</p>\n </div>\n </div>\n <div v-else :class=\"spinnerClasses\">\n <svg class=\"sl-animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle\n class=\"sl-opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"4\"\n />\n <path\n class=\"sl-opacity-75\"\n fill=\"currentColor\"\n 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\"\n />\n </svg>\n </div>\n <p v-if=\"text && !overlay\" :class=\"textClasses\">{{ text }}</p>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport type { LoadingType } from '../types/ui';\n\ninterface LoadingProps extends LoadingType {}\n\nconst props = withDefaults(defineProps<LoadingProps>(), {\n theme: 'primary',\n size: 'md',\n overlay: false,\n});\n\nconst containerClasses = computed(() => {\n const base = 'sl-flex sl-items-center sl-justify-center';\n const classes = [base];\n\n if (props.overlay) {\n classes.push('sl-relative');\n } else {\n classes.push('sl-flex-col sl-space-y-2');\n }\n\n if (props.className) {\n classes.push(props.className);\n }\n\n return classes;\n});\n\nconst spinnerClasses = computed(() => {\n const sizeMapping: Record<string, string> = {\n xs: 'sl-h-3 sl-w-3',\n sm: 'sl-h-4 sl-w-4',\n md: 'sl-h-6 sl-w-6',\n lg: 'sl-h-8 sl-w-8',\n xl: 'sl-h-10 sl-w-10',\n '2xl': 'sl-h-12 sl-w-12',\n };\n\n const colorMapping: Record<string, string> = {\n primary: 'sl-text-primary-600',\n secondary: 'sl-text-gray-600',\n dark: 'sl-text-gray-700',\n light: 'sl-text-gray-400',\n success: 'sl-text-green-600',\n warning: 'sl-text-yellow-600',\n danger: 'sl-text-red-600',\n ghost: 'sl-text-gray-600',\n };\n\n return [\n sizeMapping[props.size || 'md'],\n colorMapping[props.theme || 'primary']\n ];\n});\n\nconst textClasses = computed(() => {\n const sizeMapping: Record<string, string> = {\n xs: 'sl-text-xs',\n sm: 'sl-text-sm',\n md: 'sl-text-base',\n lg: 'sl-text-lg',\n xl: 'sl-text-xl',\n '2xl': 'sl-text-2xl',\n };\n\n const colorMapping: Record<string, string> = {\n primary: 'sl-text-stachelock-700',\n secondary: 'sl-text-gray-700',\n dark: 'sl-text-gray-800',\n light: 'sl-text-gray-500',\n success: 'sl-text-green-700',\n warning: 'sl-text-yellow-700',\n danger: 'sl-text-red-700',\n ghost: 'sl-text-gray-700',\n };\n\n return [\n sizeMapping[props.size || 'md'],\n colorMapping[props.theme || 'primary'],\n 'sl-font-medium'\n ];\n});\n</script>\n\n\n"],"names":["props","__props","containerClasses","computed","classes","spinnerClasses","sizeMapping","colorMapping","textClasses","_createElementBlock","overlay","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","text"],"mappings":";;;;;;;;;;;;;;AAmDA,UAAMA,IAAQC,GAMRC,IAAmBC,EAAS,MAAM;AAEtC,YAAMC,IAAU,CADH,2CACQ;AAErB,aAAIJ,EAAM,UACRI,EAAQ,KAAK,aAAa,IAE1BA,EAAQ,KAAK,0BAA0B,GAGrCJ,EAAM,aACRI,EAAQ,KA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D,OAAM;AAAA,cAAkB,MAAK;AAAA,cAAO,SAAQ;AAAA,YAAA;cAC/CA,EAOE,UAAA;AAAA,gBANA,OAAM;AAAA,gBACN,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,gBAAa;AAAA,cAAA;cAEfA,EAIE,QAAA;AAAA,gBAHA,OAAM;AAAA,gBACN,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;;;UAICE,EAAAA,aAATN,EAAkD,KAAA;AAAA;YAAlC,SAAOD,EAAA,KAAW;AAAA,UAAA,KAAKO,EAAAA,IAAI,GAAA,CAAA;;kBAG/CN,EAgBM,OAAA;AAAA;QAhBO,SAAOJ,EAAA,KAAc;AAAA,MAAA;QAChCQ,EAcM,OAAA;AAAA,UAdD,OAAM;AAAA,UAAkB,MAAK;AAAA,UAAO,SAAQ;AAAA,QAAA;UAC/CA,EAOE,UAAA;AAAA,YANA,OAAM;AAAA,YACN,IAAG;AAAA,YACH,IAAG;AAAA,YACH,GAAE;AAAA,YACF,QAAO;AAAA,YACP,gBAAa;AAAA,UAAA;UAEfA,EAIE,QAAA;AAAA,YAHA,OAAM;AAAA,YACN,MAAK;AAAA,YACL,GAAE;AAAA,UAAA;;;MAICE,EAAAA,SAASL,EAAAA,gBAAlBD,EAA8D,KAAA;AAAA;QAAlC,SAAOD,EAAA,KAAW;AAAA,MAAA,KAAKO,EAAAA,IAAI,GAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as i, ref as u, watch as d, createElementBlock as s, openBlock as t, createElementVNode as r, createCommentVNode as n, toDisplayString as c, normalizeStyle as m } from "vue";
|
|
2
|
+
const b = { class: "sl-flex sl-justify-between sl-mb-1" }, f = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "sl-text-base sl-font-medium",
|
|
5
|
+
style: { color: "var(--sl-color-primary-700, #566e4b)" }
|
|
6
|
+
}, y = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "sl-text-sm sl-font-medium",
|
|
9
|
+
style: { color: "var(--sl-color-primary-700, #566e4b)" }
|
|
10
|
+
}, p = { class: "sl-w-full sl-bg-gray-200 sl-rounded-full sl-h-2.5" }, v = /* @__PURE__ */ i({
|
|
11
|
+
__name: "UiProgressBar",
|
|
12
|
+
props: {
|
|
13
|
+
progress: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0,
|
|
16
|
+
required: !0
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
showProgressLabel: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(e) {
|
|
28
|
+
const o = e, l = u(o.progress);
|
|
29
|
+
return d(() => o.progress, (a) => {
|
|
30
|
+
l.value = a;
|
|
31
|
+
}), (a, g) => (t(), s("div", null, [
|
|
32
|
+
r("div", b, [
|
|
33
|
+
e.label && e.label.length > 0 ? (t(), s("span", f, c(e.label), 1)) : n("", !0),
|
|
34
|
+
e.showProgressLabel ? (t(), s("span", y, c(l.value) + "%", 1)) : n("", !0)
|
|
35
|
+
]),
|
|
36
|
+
r("div", p, [
|
|
37
|
+
r("div", {
|
|
38
|
+
class: "sl-h-2.5 sl-rounded-full sl-transition-all sl-duration-500 sl-ease-out",
|
|
39
|
+
style: m({
|
|
40
|
+
width: `${l.value}%`,
|
|
41
|
+
backgroundColor: "var(--sl-color-primary-600, #6b8a5e)"
|
|
42
|
+
})
|
|
43
|
+
}, null, 4)
|
|
44
|
+
])
|
|
45
|
+
]));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
v as _
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=UiProgressBar.vue_vue_type_script_setup_true_lang-D4-B3A7K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiProgressBar.vue_vue_type_script_setup_true_lang-D4-B3A7K.js","sources":["../src/components/UiProgressBar.vue"],"sourcesContent":["<template>\n <div>\n <div class=\"sl-flex sl-justify-between sl-mb-1\">\n <span v-if=\"label && label.length > 0\" class=\"sl-text-base sl-font-medium\" style=\"color: var(--sl-color-primary-700, #566e4b);\">{{ label }}</span>\n <span v-if=\"showProgressLabel\" class=\"sl-text-sm sl-font-medium\" style=\"color: var(--sl-color-primary-700, #566e4b);\">{{ progress }}%</span>\n </div>\n <div class=\"sl-w-full sl-bg-gray-200 sl-rounded-full sl-h-2.5\">\n <div class=\"sl-h-2.5 sl-rounded-full sl-transition-all sl-duration-500 sl-ease-out\" \n :style=\"{ \n width: `${progress}%`,\n backgroundColor: 'var(--sl-color-primary-600, #6b8a5e)'\n }\" />\n </div>\n </div>\n</template>\n \n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\n\n// Props\nconst props = defineProps({\n progress: {\n type: Number,\n default: 0,\n required: true\n },\n label: {\n type: String,\n default: ''\n },\n showProgressLabel: {\n type: Boolean,\n default: false\n }\n});\n\nconst progress = ref(props.progress);\n\n// Watch for changes to props.progress and update local state\nwatch(() => props.progress, (newValue) => {\n progress.value = newValue;\n});\n</script>\n \n<style scoped>\n</style>\n"],"names":["props","__props","progress","ref","watch","newValue","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_toDisplayString","_openBlock","_hoisted_3","_hoisted_4","_normalizeStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,UAAMA,IAAQC,GAgBRC,IAAWC,EAAIH,EAAM,QAAQ;AAGnC,WAAAI,EAAM,MAAMJ,EAAM,UAAU,CAACK,MAAa;AACxC,MAAAH,EAAS,QAAQG;AAAA,IACnB,CAAC,mBAxCCC,EAYM,OAAA,MAAA;AAAA,MAXJC,EAGM,OAHNC,GAGM;AAAA,QAFQP,EAAA,SAASA,EAAA,MAAM,SAAM,UAAjCK,EAAkJ,QAAlJG,GAAkJC,EAAfT,EAAA,KAAK,GAAA,CAAA;QAC5HA,EAAA,qBAAZU,EAAA,GAAAL,EAA4I,QAA5IM,GAA4IF,EAAnBR,EAAA,KAAQ,IAAG,KAAC,CAAA;;MAEvIK,EAMM,OANNM,GAMM;AAAA,QALJN,EAIO,OAAA;AAAA,UAJF,OAAM;AAAA,UACR,OAAKO,EAAA;AAAA,sBAAyBZ,EAAA,KAAQ;AAAA;;;;;;;"}
|
package/dist/components/Badge.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as g, computed as o, createElementBlock as d, openBlock as i, normalizeClass as p, unref as l, renderSlot as c } from "vue";
|
|
2
|
+
import { _ as m } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const u = "sl-inline-flex sl-items-center sl-font-medium sl-ring-1 sl-ring-inset sl-p-4", y = /* @__PURE__ */ g({
|
|
4
4
|
__name: "UiBadge",
|
|
5
5
|
props: {
|
|
6
6
|
theme: { default: "primary" },
|
|
7
7
|
shape: { default: "default" },
|
|
8
8
|
size: { default: "md" }
|
|
9
9
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const s =
|
|
10
|
+
setup(r) {
|
|
11
|
+
const s = r, t = o(() => ({
|
|
12
12
|
// Use the same color scheme as in UiButton
|
|
13
|
-
primary: "sl-bg-
|
|
13
|
+
primary: "sl-bg-primary-50 sl-text-primary-600 sl-ring-primary-600/10",
|
|
14
14
|
dark: "sl-bg-gray-50 sl-text-gray-600 sl-ring-gray-500/10",
|
|
15
15
|
secondary: "sl-bg-gray-100 sl-text-gray-800 sl-ring-gray-300",
|
|
16
16
|
light: "sl-bg-white sl-text-gray-800 sl-ring-gray-300",
|
|
@@ -29,14 +29,14 @@ const m = "sl-inline-flex sl-items-center sl-font-medium sl-ring-1 sl-ring-inset
|
|
|
29
29
|
md: "sl-px-3 sl-py-1 sl-text-sm",
|
|
30
30
|
lg: "sl-px-4 sl-py-1.5 sl-text-md"
|
|
31
31
|
}[s.size];
|
|
32
|
-
return (e,
|
|
33
|
-
class:
|
|
32
|
+
return (e, x) => (i(), d("span", {
|
|
33
|
+
class: p([u, l(a), t.value, l(n)])
|
|
34
34
|
}, [
|
|
35
|
-
|
|
35
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
36
36
|
], 2));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), _ = /* @__PURE__ */ m(y, [["__scopeId", "data-v-22c23dac"]]);
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
_ as default
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../src/components/UiBadge.vue"],"sourcesContent":["<template>\n <span :class=\"[badgeClass, roundedClass, colorClass, sizeClass]\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue';\n\ninterface BadgeProps {\n theme?: 'primary' | 'dark' | 'secondary' | 'light' | 'warning' | 'danger' | 'success' | 'ghost';\n shape?: 'circular' | 'rounded' | 'default';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n}\n\nconst props = withDefaults(defineProps<BadgeProps>(), {\n theme: 'primary',\n shape: 'default',\n size: 'md'\n});\n\nconst badgeClass = 'sl-inline-flex sl-items-center sl-font-medium sl-ring-1 sl-ring-inset sl-p-4';\n\nconst colorClass = computed(() => {\n const baseClasses = {\n // Use the same color scheme as in UiButton\n primary: 'sl-bg-
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../src/components/UiBadge.vue"],"sourcesContent":["<template>\n <span :class=\"[badgeClass, roundedClass, colorClass, sizeClass]\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue';\n\ninterface BadgeProps {\n theme?: 'primary' | 'dark' | 'secondary' | 'light' | 'warning' | 'danger' | 'success' | 'ghost';\n shape?: 'circular' | 'rounded' | 'default';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n}\n\nconst props = withDefaults(defineProps<BadgeProps>(), {\n theme: 'primary',\n shape: 'default',\n size: 'md'\n});\n\nconst badgeClass = 'sl-inline-flex sl-items-center sl-font-medium sl-ring-1 sl-ring-inset sl-p-4';\n\nconst colorClass = computed(() => {\n const baseClasses = {\n // Use the same color scheme as in UiButton\n primary: 'sl-bg-primary-50 sl-text-primary-600 sl-ring-primary-600/10',\n dark: 'sl-bg-gray-50 sl-text-gray-600 sl-ring-gray-500/10',\n secondary: 'sl-bg-gray-100 sl-text-gray-800 sl-ring-gray-300',\n light: 'sl-bg-white sl-text-gray-800 sl-ring-gray-300',\n warning: 'sl-bg-yellow-50 sl-text-yellow-800 sl-ring-yellow-600/20',\n danger: 'sl-bg-red-50 sl-text-red-700 sl-ring-red-600/10',\n success: 'sl-bg-green-50 sl-text-green-700 sl-ring-green-600/20',\n ghost: 'sl-bg-white sl-text-gray-400 sl-ring-gray-400/20',\n };\n return baseClasses[props.theme];\n});\n\nconst roundedClass = {\n circular: 'sl-rounded-full',\n rounded: 'sl-rounded-lg',\n default: 'sl-rounded-md', // Default rounded class\n}[props.shape];\n\nconst sizeClass = {\n xs: 'sl-px-1 sl-py-0.5 sl-text-4xs',\n sm: 'sl-px-2 sl-py-0.5 sl-text-xs',\n md: 'sl-px-3 sl-py-1 sl-text-sm',\n lg: 'sl-px-4 sl-py-1.5 sl-text-md',\n}[props.size];\n</script>\n\n<style scoped>\n/* Add any additional styling here */\n</style>\n"],"names":["badgeClass","props","__props","colorClass","computed","roundedClass","sizeClass","_createElementBlock","_unref","_renderSlot","_ctx"],"mappings":";;AAqBA,MAAMA,IAAa;;;;;;;;AANnB,UAAMC,IAAQC,GAQRC,IAAaC,EAAS,OACN;AAAA;AAAA,MAElB,SAAS;AAAA,MACT,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,OAAO;AAAA,IAAA,GAEUH,EAAM,KAAK,CAC/B,GAEKI,IAAe;AAAA,MACnB,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA;AAAA,IAAA,EACTJ,EAAM,KAAK,GAEPK,IAAY;AAAA,MAChB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,EACJL,EAAM,IAAI;2BAhDVM,EAEO,QAAA;AAAA,MAFA,UAAQP,GAAYQ,MAAcL,EAAA,OAAYK,EAAAF,CAAA,CAAS,CAAA;AAAA,IAAA;MAC5DG,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,IAAA;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as R, defineAsyncComponent as q, computed as o, ref as k, onMounted as D, nextTick as B, watch as U, createElementBlock as t, openBlock as r, normalizeStyle as G, normalizeClass as n, createCommentVNode as u, createElementVNode as H, renderSlot as f, Fragment as J, createVNode as h, unref as d, toDisplayString as K } from "vue";
|
|
2
|
+
import { _ as Q } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const X = ["disabled", "data-theme"], Y = { class: "sl-absolute sl-top-0 sl-right-0 sl-transform sl-translate-x-1/2 -sl-translate-y-1/2" }, Z = {
|
|
4
4
|
key: 6,
|
|
5
5
|
class: "sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-bg-opacity-75 sl-bg-white dark:sl-bg-opacity-75 dark:sl-bg-gray-700 sl-rounded sl-z-10"
|
|
6
|
-
},
|
|
6
|
+
}, ee = { key: 0 }, se = "sl-ml-auto sl-flex sl-items-center", L = "sl-absolute sl-right-0 sl-top-1/2 -sl-translate-y-1/2 sl-pr-0 sl-flex sl-items-center", le = /* @__PURE__ */ R({
|
|
7
7
|
__name: "UiButton",
|
|
8
8
|
props: {
|
|
9
9
|
replaceLeadingIconWithLoading: { type: Boolean, default: !1 },
|
|
@@ -31,7 +31,7 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
31
31
|
},
|
|
32
32
|
emits: ["button-click", "hover-enter", "hover-leave"],
|
|
33
33
|
setup(I, { emit: z }) {
|
|
34
|
-
const y =
|
|
34
|
+
const y = q(() => import("./Loading.js")), e = I, m = z, c = o(() => !!e.loading), b = o(() => e.replaceLeadingIconWithLoading || !1), v = k(null), g = k(e.theme ?? "primary"), _ = (s) => {
|
|
35
35
|
for (; s && s !== document.documentElement; ) {
|
|
36
36
|
const l = window.getComputedStyle(s).backgroundColor;
|
|
37
37
|
if (l && l !== "rgba(0, 0, 0, 0)" && l !== "transparent")
|
|
@@ -47,16 +47,16 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
47
47
|
if (!l) return;
|
|
48
48
|
window.getComputedStyle(s).backgroundColor === l && (g.value = g.value === "light" ? "primary" : "light");
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
D(() => {
|
|
51
51
|
B(x);
|
|
52
|
-
}),
|
|
52
|
+
}), U(
|
|
53
53
|
() => e.theme,
|
|
54
54
|
(s) => {
|
|
55
55
|
g.value = s || "primary", B(x);
|
|
56
56
|
},
|
|
57
57
|
{ immediate: !1 }
|
|
58
58
|
);
|
|
59
|
-
const i = o(() => g.value), w = o(() => e.loadingSize || e.size || "md"),
|
|
59
|
+
const i = o(() => g.value), w = o(() => e.loadingSize || e.size || "md"), S = o(() => {
|
|
60
60
|
const s = {
|
|
61
61
|
primary: "sl-text-stachelock-600 sl-border sl-border-stachelock-600 hover:sl-bg-stachelock-50 hover:sl-border-stachelock-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
62
62
|
dark: "sl-text-gray-700 sl-border sl-border-gray-700 hover:sl-bg-gray-50 hover:sl-border-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
@@ -67,7 +67,7 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
67
67
|
success: "sl-text-green-500 sl-border sl-border-green-500 hover:sl-bg-green-50 hover:sl-border-green-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
68
68
|
ghost: "sl-text-gray-800 sl-border sl-border-transparent sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none"
|
|
69
69
|
}, l = {
|
|
70
|
-
primary: "sl-border sl-border-transparent sl-
|
|
70
|
+
primary: "sl-border sl-border-transparent sl-text-white sl-shadow-sm focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
71
71
|
dark: "sl-border sl-border-transparent sl-bg-gray-700 sl-text-white sl-shadow-sm hover:sl-bg-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
72
72
|
secondary: "sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300",
|
|
73
73
|
light: "sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300",
|
|
@@ -77,13 +77,13 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
77
77
|
ghost: "sl-border sl-border-transparent sl-text-gray-800 sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none"
|
|
78
78
|
};
|
|
79
79
|
return e.outlined ? `${s[i.value] || ""} sl-bg-transparent` : l[i.value] || "";
|
|
80
|
-
}),
|
|
80
|
+
}), M = {
|
|
81
81
|
square: "",
|
|
82
82
|
rounded: "sl-rounded",
|
|
83
83
|
"rounded-md": "sl-rounded-md",
|
|
84
84
|
"rounded-lg": "sl-rounded-lg",
|
|
85
85
|
"rounded-full": "sl-rounded-full"
|
|
86
|
-
},
|
|
86
|
+
}, C = o(() => M[e.rounded || "rounded-md"]), j = o(() => ({
|
|
87
87
|
xs: "sl-p-0.5",
|
|
88
88
|
sm: "sl-p-1",
|
|
89
89
|
md: "sl-p-2",
|
|
@@ -101,11 +101,11 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
101
101
|
if (e.customClass)
|
|
102
102
|
return e.customClass;
|
|
103
103
|
const l = [...[
|
|
104
|
-
|
|
104
|
+
C.value,
|
|
105
105
|
j.value,
|
|
106
106
|
$.value,
|
|
107
107
|
E.value,
|
|
108
|
-
|
|
108
|
+
S.value,
|
|
109
109
|
e.disabled ? "sl-cursor-not-allowed" : "sl-cursor-pointer",
|
|
110
110
|
"focus:sl-ring-0",
|
|
111
111
|
"sl-relative",
|
|
@@ -113,85 +113,90 @@ const K = ["disabled"], Q = { class: "sl-absolute sl-top-0 sl-right-0 sl-transfo
|
|
|
113
113
|
"sl-items-center",
|
|
114
114
|
"sl-justify-center"
|
|
115
115
|
]];
|
|
116
|
-
return
|
|
117
|
-
}), O = o(() => e.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
return C.value === "sl-rounded-full" ? l.push("sl-px-1", "sl-py-1") : l.push("sl-px-2.5", "sl-py-2"), e.centerLeadingIcon && !a.value ? l.push("sl-w-full", "sl-h-full") : (e.leadingIcon || e.inlineFlex || e.trailingIcon) && l.push("sl-inline-flex"), l.filter(Boolean);
|
|
117
|
+
}), O = o(() => e.theme === "primary" ? {
|
|
118
|
+
backgroundColor: "var(--sl-color-primary-600, #6b8a5e)",
|
|
119
|
+
"--tw-ring-color": "var(--sl-color-primary-500, #7a966e)"
|
|
120
|
+
} : {}), F = o(() => e.trailingOverlay ? L : se), N = o(() => e.trailingOverlay ? `${L} sl-h-5 sl-w-5` : "sl-ml-2 sl-h-5 sl-w-5 sl-flex sl-items-center"), p = o(() => e.centerLeadingIcon && !a.value ? "sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-w-full sl-h-full" : e.centerLeadingIcon ? "sl-h-full sl-flex sl-items-center sl-justify-center" : a.value ? "-sl-ml-0.5 sl-h-5 sl-w-5 sl-flex sl-items-center sl-justify-center" : "sl-flex sl-items-center sl-justify-center"), V = () => {
|
|
121
|
+
m("button-click");
|
|
121
122
|
}, W = () => {
|
|
122
|
-
|
|
123
|
-
}, A =
|
|
124
|
-
|
|
123
|
+
m("hover-enter");
|
|
124
|
+
}, A = () => {
|
|
125
|
+
m("hover-leave");
|
|
126
|
+
}, P = e.showLoadingTitle || !1;
|
|
127
|
+
return (s, l) => (r(), t("button", {
|
|
125
128
|
ref_key: "buttonRef",
|
|
126
129
|
ref: v,
|
|
127
130
|
type: "button",
|
|
128
131
|
disabled: e.disabled,
|
|
129
|
-
class:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
class: n(T.value),
|
|
133
|
+
style: G(O.value),
|
|
134
|
+
"data-theme": e.theme,
|
|
135
|
+
onClick: V,
|
|
136
|
+
onMouseenter: W,
|
|
137
|
+
onMouseleave: A
|
|
133
138
|
}, [
|
|
134
|
-
e.centerLeadingIcon && !a.value ? (
|
|
139
|
+
e.centerLeadingIcon && !a.value ? (r(), t("div", {
|
|
135
140
|
key: 0,
|
|
136
|
-
class:
|
|
141
|
+
class: n(p.value)
|
|
137
142
|
}, [
|
|
138
|
-
|
|
139
|
-
], 2)) : (
|
|
140
|
-
|
|
143
|
+
f(s.$slots, "leading-icon", {}, void 0, !0)
|
|
144
|
+
], 2)) : (r(), t(J, { key: 1 }, [
|
|
145
|
+
b.value && c.value ? (r(), t("div", {
|
|
141
146
|
key: 0,
|
|
142
|
-
class:
|
|
147
|
+
class: n(["sl-flex sl-items-center sl-justify-center", [p.value, a.value ? "" : "sl-h-full sl-w-full"]])
|
|
143
148
|
}, [
|
|
144
149
|
h(d(y), {
|
|
145
150
|
theme: i.value,
|
|
146
151
|
size: w.value
|
|
147
152
|
}, null, 8, ["theme", "size"])
|
|
148
|
-
], 2)) : e.leadingIcon ? (
|
|
153
|
+
], 2)) : e.leadingIcon ? (r(), t("div", {
|
|
149
154
|
key: 1,
|
|
150
|
-
class:
|
|
155
|
+
class: n(p.value)
|
|
151
156
|
}, [
|
|
152
|
-
|
|
157
|
+
f(s.$slots, "leading-icon", {}, void 0, !0)
|
|
153
158
|
], 2)) : u("", !0)
|
|
154
159
|
], 64)),
|
|
155
|
-
a.value ? (
|
|
160
|
+
a.value ? (r(), t("span", {
|
|
156
161
|
key: 2,
|
|
157
|
-
class:
|
|
162
|
+
class: n(["sl-flex-1 sl-text-center", [
|
|
158
163
|
{ "sl-truncate sl-max-w-[150px]": s.truncateLabel },
|
|
159
164
|
{ "sl-mx-auto": !e.leadingIcon && !e.trailingIcon }
|
|
160
165
|
]])
|
|
161
|
-
},
|
|
166
|
+
}, K(e.label), 3)) : (!b.value || !c.value) && !e.centerLeadingIcon ? (r(), t("span", {
|
|
162
167
|
key: 3,
|
|
163
|
-
class:
|
|
168
|
+
class: n(["sl-flex", e.centerLabel || !e.leadingIcon && !e.trailingIcon ? "sl-justify-center sl-items-center sl-flex-1" : "sl-flex-1"])
|
|
164
169
|
}, [
|
|
165
|
-
|
|
170
|
+
f(s.$slots, "default", {}, void 0, !0)
|
|
166
171
|
], 2)) : u("", !0),
|
|
167
|
-
e.trailingLoading &&
|
|
172
|
+
e.trailingLoading && c.value ? (r(), t("div", {
|
|
168
173
|
key: 4,
|
|
169
|
-
class:
|
|
174
|
+
class: n(F.value)
|
|
170
175
|
}, [
|
|
171
176
|
h(d(y), {
|
|
172
177
|
theme: i.value,
|
|
173
178
|
size: e.trailingLoadingSize || "sm"
|
|
174
179
|
}, null, 8, ["theme", "size"])
|
|
175
|
-
], 2)) : e.trailingIcon ? (
|
|
180
|
+
], 2)) : e.trailingIcon ? (r(), t("div", {
|
|
176
181
|
key: 5,
|
|
177
|
-
class:
|
|
182
|
+
class: n(N.value)
|
|
178
183
|
}, [
|
|
179
|
-
|
|
184
|
+
f(s.$slots, "trailing-icon", {}, void 0, !0)
|
|
180
185
|
], 2)) : u("", !0),
|
|
181
|
-
|
|
182
|
-
|
|
186
|
+
H("div", Y, [
|
|
187
|
+
f(s.$slots, "badge", {}, void 0, !0)
|
|
183
188
|
]),
|
|
184
|
-
|
|
189
|
+
c.value && !b.value && !e.trailingLoading ? (r(), t("div", Z, [
|
|
185
190
|
h(d(y), {
|
|
186
191
|
theme: i.value,
|
|
187
192
|
size: w.value
|
|
188
193
|
}, null, 8, ["theme", "size"]),
|
|
189
|
-
d(
|
|
194
|
+
d(P) ? (r(), t("p", ee, "Loading...")) : u("", !0)
|
|
190
195
|
])) : u("", !0)
|
|
191
|
-
],
|
|
196
|
+
], 46, X));
|
|
192
197
|
}
|
|
193
|
-
}),
|
|
198
|
+
}), ne = /* @__PURE__ */ Q(le, [["__scopeId", "data-v-1fe16850"]]);
|
|
194
199
|
export {
|
|
195
|
-
|
|
200
|
+
ne as default
|
|
196
201
|
};
|
|
197
202
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/components/UiButton.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n type=\"button\"\n :disabled=\"props.disabled\"\n :class=\"buttonClasses\"\n @click=\"onClick\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- Leading Icon Area (or Loading Replacement) -->\n <template v-if=\"props.centerLeadingIcon && !isLabelPresent\">\n <div :class=\"leadingIconClasses\">\n <slot name=\"leading-icon\" />\n </div>\n </template>\n <template v-else>\n <div\n v-if=\"replaceLeadingIconWithLoading && loading\"\n class=\"sl-flex sl-items-center sl-justify-center\"\n :class=\"[leadingIconClasses, !isLabelPresent ? 'sl-h-full sl-w-full' : '']\"\n >\n <Loading :theme=\"theme\" :size=\"loadingSize\" />\n </div>\n <div v-else-if=\"props.leadingIcon\" :class=\"leadingIconClasses\">\n <slot name=\"leading-icon\" />\n </div>\n </template>\n\n <!-- Button Content -->\n <span\n v-if=\"isLabelPresent\"\n class=\"sl-flex-1 sl-text-center\"\n :class=\"[\n { 'sl-truncate sl-max-w-[150px]': truncateLabel },\n { 'sl-mx-auto': !props.leadingIcon && !props.trailingIcon }\n ]\"\n >\n {{ props.label }}\n </span>\n <span\n v-else-if=\"(!replaceLeadingIconWithLoading || !loading) && !props.centerLeadingIcon\"\n class=\"sl-flex\"\n :class=\"props.centerLabel || (!props.leadingIcon && !props.trailingIcon) ? 'sl-justify-center sl-items-center sl-flex-1' : 'sl-flex-1'\"\n >\n <slot />\n </span>\n\n <!-- Trailing Icon or Loading -->\n <div v-if=\"props.trailingLoading && loading\" :class=\"trailingLoadingClasses\">\n <Loading :theme=\"theme\" :size=\"props.trailingLoadingSize || 'sm'\" />\n </div>\n <div v-else-if=\"props.trailingIcon\" :class=\"trailingIconClasses\">\n <slot name=\"trailing-icon\" />\n </div>\n\n <!-- Badge Slot -->\n <div class=\"sl-absolute sl-top-0 sl-right-0 sl-transform sl-translate-x-1/2 -sl-translate-y-1/2\">\n <slot name=\"badge\" />\n </div>\n\n <!-- Overlay Loading (if not replacing the leading icon and not using trailing loading) -->\n <div\n v-if=\"loading && !replaceLeadingIconWithLoading && !props.trailingLoading\"\n class=\"sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-bg-opacity-75 sl-bg-white dark:sl-bg-opacity-75 dark:sl-bg-gray-700 sl-rounded sl-z-10\"\n >\n <Loading :theme=\"theme\" :size=\"loadingSize\" />\n <p v-if=\"showLoadingTitle\">Loading...</p>\n </div>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, defineAsyncComponent, ref, onMounted, watch, nextTick } from 'vue';\nimport type { ButtonType, RoundedType, Theme } from '../types/ui';\n\n// Asynchronously load the Loading component\nconst Loading = defineAsyncComponent(() => import('./UiLoading.vue'));\n\n// Define props using the ButtonType interface\ninterface ButtonProps extends ButtonType {\n replaceLeadingIconWithLoading?: boolean;\n centerLeadingIcon?: boolean;\n /**\n * When enabled, shows loading indicator in trailing position instead of overlay\n */\n trailingLoading?: boolean;\n /**\n * Size of the loading indicator when using trailingLoading\n */\n trailingLoadingSize?: import('../types/ui').Size;\n /**\n * Positions trailing loading/icon absolutely at the far right, centered vertically.\n */\n trailingOverlay?: boolean;\n /**\n * When enabled the button will attempt to automatically choose a contrasting\n * colour theme if its background matches that of its closest non-transparent\n * ancestor.\n */\n autoContrast?: boolean;\n}\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n theme: 'primary',\n size: 'md',\n rounded: 'rounded-md',\n disabled: false,\n expanded: false,\n outlined: false,\n loading: false,\n leadingIcon: false,\n trailingIcon: false,\n showLoadingTitle: false,\n truncateLabel: false,\n centerLabel: false,\n inlineFlex: false,\n replaceLeadingIconWithLoading: false,\n centerLeadingIcon: false,\n trailingLoading: false,\n trailingOverlay: false,\n autoContrast: false,\n});\n\n// Define the emits\nconst emit = defineEmits<{\n 'button-click': []\n 'hover-enter': []\n 'hover-leave': []\n}>();\n\n// Reactive computed properties\nconst loading = computed(() => Boolean(props.loading));\nconst replaceLeadingIconWithLoading = computed(() => props.replaceLeadingIconWithLoading || false);\n\n// Reference to the underlying button element\nconst buttonRef = ref<HTMLElement | null>(null);\n\n// Internal reactive theme value that may be overridden for auto-contrast\nconst resolvedTheme = ref<Theme>(props.theme ?? 'primary');\n\nconst findParentBackground = (node: HTMLElement | null): string | null => {\n while (node && node !== document.documentElement) {\n const bg = window.getComputedStyle(node).backgroundColor;\n if (bg && bg !== 'rgba(0, 0, 0, 0)' && bg !== 'transparent') {\n return bg;\n }\n node = node.parentElement as HTMLElement | null;\n }\n return null;\n};\n\nconst adjustThemeBasedOnBackground = (): void => {\n if (!props.autoContrast) return;\n const el = buttonRef.value;\n if (!el) return;\n\n const parentBg = findParentBackground(el.parentElement as HTMLElement | null);\n if (!parentBg) return;\n\n const buttonBg = window.getComputedStyle(el).backgroundColor;\n\n if (buttonBg === parentBg) {\n resolvedTheme.value = resolvedTheme.value === 'light' ? 'primary' : 'light';\n }\n};\n\nonMounted(() => {\n nextTick(adjustThemeBasedOnBackground);\n});\n\nwatch(\n () => props.theme,\n (newTheme) => {\n resolvedTheme.value = newTheme || 'primary';\n nextTick(adjustThemeBasedOnBackground);\n },\n { immediate: false }\n);\n\n// Public computed theme\nconst theme = computed(() => resolvedTheme.value);\n\n// Compute loading size with fallback\nconst loadingSize = computed(() => props.loadingSize || props.size || 'md');\n\n// Styling computed properties\nconst colorClass = computed(() => {\n const outlineBaseClasses: Record<string, string> = {\n primary: 'sl-text-stachelock-600 sl-border sl-border-stachelock-600 hover:sl-bg-stachelock-50 hover:sl-border-stachelock-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n dark: 'sl-text-gray-700 sl-border sl-border-gray-700 hover:sl-bg-gray-50 hover:sl-border-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n secondary: 'sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n light: 'sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n warning: 'sl-text-yellow-500 sl-border sl-border-yellow-500 hover:sl-bg-yellow-50 hover:sl-border-yellow-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n danger: 'sl-text-red-500 sl-border sl-border-red-500 hover:sl-bg-red-50 hover:sl-border-red-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n success: 'sl-text-green-500 sl-border sl-border-green-500 hover:sl-bg-green-50 hover:sl-border-green-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n ghost: 'sl-text-gray-800 sl-border sl-border-transparent sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none',\n };\n\n const filledBaseClasses: Record<string, string> = {\n primary: 'sl-border sl-border-transparent sl-bg-stachelock-600 sl-text-white sl-shadow-sm hover:sl-bg-stachelock-700 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n dark: 'sl-border sl-border-transparent sl-bg-gray-700 sl-text-white sl-shadow-sm hover:sl-bg-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n secondary: 'sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300',\n light: 'sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300',\n warning: 'sl-border sl-border-transparent sl-bg-yellow-400 sl-text-white sl-shadow-sm hover:sl-bg-yellow-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n danger: 'sl-border sl-border-transparent sl-bg-red-500 sl-text-white sl-shadow-sm hover:sl-bg-red-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n success: 'sl-border sl-border-transparent sl-bg-green-500 sl-text-white sl-shadow-sm hover:sl-bg-green-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n ghost: 'sl-border sl-border-transparent sl-text-gray-800 sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none',\n };\n\n if (props.outlined) {\n return `${outlineBaseClasses[theme.value] || ''} sl-bg-transparent`;\n } else {\n return filledBaseClasses[theme.value] || '';\n }\n});\n\nconst roundedClassMap: Record<RoundedType, string> = {\n square: '',\n rounded: 'sl-rounded',\n 'rounded-md': 'sl-rounded-md',\n 'rounded-lg': 'sl-rounded-lg',\n 'rounded-full': 'sl-rounded-full',\n};\n\nconst roundedClass = computed(() => roundedClassMap[props.rounded || 'rounded-md']);\n\nconst sizeClass = computed(() => {\n const sizeMapping: Record<string, string> = {\n xs: 'sl-p-0.5',\n sm: 'sl-p-1',\n md: 'sl-p-2',\n lg: 'sl-p-3',\n xl: 'sl-p-4',\n '2xl': 'sl-p-5',\n };\n return sizeMapping[props.size || 'md'];\n});\n\nconst textClass = computed(() => {\n const textMapping: Record<string, string> = {\n xs: 'sl-text-xs sl-font-regular',\n sm: 'sl-text-sm sl-font-regular',\n md: 'sl-text-base sl-font-medium',\n lg: 'sl-text-lg sl-font-medium',\n xl: 'sl-text-xl sl-font-medium',\n '2xl': 'sl-text-2xl sl-font-medium',\n };\n return textMapping[props.size || 'sm'];\n});\n\nconst expandedClass = computed(() => (props.expanded ? 'sl-w-full' : ''));\n\nconst isLabelPresent = computed(() => !!props.label && props.label.length > 0);\n\nconst buttonClasses = computed(() => {\n if (props.customClass) {\n return props.customClass;\n }\n\n const coreClasses = [\n roundedClass.value,\n sizeClass.value,\n textClass.value,\n expandedClass.value,\n colorClass.value,\n props.disabled ? 'sl-cursor-not-allowed' : 'sl-cursor-pointer',\n 'focus:sl-ring-0',\n 'sl-relative',\n 'sl-flex',\n 'sl-items-center',\n 'sl-justify-center',\n ];\n\n const finalClasses = [...coreClasses];\n\n if (roundedClass.value === 'sl-rounded-full') {\n finalClasses.push('sl-px-1', 'sl-py-1');\n } else {\n finalClasses.push('sl-px-2.5', 'sl-py-2');\n }\n\n if (props.centerLeadingIcon && !isLabelPresent.value) {\n finalClasses.push('sl-w-full', 'sl-h-full');\n } else {\n if (props.leadingIcon || props.inlineFlex || props.trailingIcon) {\n finalClasses.push('sl-inline-flex');\n }\n }\n\n return finalClasses.filter(Boolean);\n});\n\nconst trailingBaseClasses = 'sl-ml-auto sl-flex sl-items-center';\nconst trailingAbsoluteClasses = 'sl-absolute sl-right-0 sl-top-1/2 -sl-translate-y-1/2 sl-pr-0 sl-flex sl-items-center';\nconst trailingLoadingClasses = computed(() => props.trailingOverlay ? trailingAbsoluteClasses : trailingBaseClasses);\nconst trailingIconClasses = computed(() => props.trailingOverlay ? `${trailingAbsoluteClasses} sl-h-5 sl-w-5` : 'sl-ml-2 sl-h-5 sl-w-5 sl-flex sl-items-center');\n\nconst leadingIconClasses = computed(() => {\n if (props.centerLeadingIcon && !isLabelPresent.value) {\n return 'sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-w-full sl-h-full';\n }\n if (props.centerLeadingIcon) {\n return 'sl-h-full sl-flex sl-items-center sl-justify-center';\n }\n if (!isLabelPresent.value) {\n return 'sl-flex sl-items-center sl-justify-center';\n }\n return '-sl-ml-0.5 sl-h-5 sl-w-5 sl-flex sl-items-center sl-justify-center';\n});\n\nconst onClick = (): void => {\n emit('button-click');\n};\n\nconst onMouseEnter = (): void => {\n emit('hover-enter');\n};\n\nconst onMouseLeave = (): void => {\n emit('hover-leave');\n};\n\nconst showLoadingTitle = props.showLoadingTitle || false;\n</script>\n\n<style scoped>\n/* Component-specific styles if needed */\n</style>\n\n\n"],"names":["trailingBaseClasses","trailingAbsoluteClasses","Loading","defineAsyncComponent","props","__props","emit","__emit","loading","computed","replaceLeadingIconWithLoading","buttonRef","ref","resolvedTheme","findParentBackground","node","bg","adjustThemeBasedOnBackground","el","parentBg","onMounted","nextTick","watch","newTheme","theme","loadingSize","colorClass","outlineBaseClasses","filledBaseClasses","roundedClassMap","roundedClass","sizeClass","textClass","expandedClass","isLabelPresent","buttonClasses","finalClasses","trailingLoadingClasses","trailingIconClasses","leadingIconClasses","onClick","onMouseEnter","onMouseLeave","showLoadingTitle","_createElementBlock","_renderSlot","_ctx","_Fragment","_normalizeClass","_createVNode","_unref","truncateLabel","_toDisplayString","_createElementVNode","_hoisted_2","_openBlock","_hoisted_3"],"mappings":";;;;;mBAqSMA,IAAsB,sCACtBC,IAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzNhC,UAAMC,IAAUC,EAAqB,MAAM,OAAO,cAAiB,CAAC,GA0B9DC,IAAQC,GAsBRC,IAAOC,GAOPC,IAAUC,EAAS,MAAM,EAAQL,EAAM,OAAQ,GAC/CM,IAAgCD,EAAS,MAAML,EAAM,iCAAiC,EAAK,GAG3FO,IAAYC,EAAwB,IAAI,GAGxCC,IAAgBD,EAAWR,EAAM,SAAS,SAAS,GAEnDU,IAAuB,CAACC,MAA4C;AACxE,aAAOA,KAAQA,MAAS,SAAS,mBAAiB;AAChD,cAAMC,IAAK,OAAO,iBAAiBD,CAAI,EAAE;AACzC,YAAIC,KAAMA,MAAO,sBAAsBA,MAAO;AAC5C,iBAAOA;AAET,QAAAD,IAAOA,EAAK;AAAA,MACd;AACA,aAAO;AAAA,IACT,GAEME,IAA+B,MAAY;AAC/C,UAAI,CAACb,EAAM,aAAc;AACzB,YAAMc,IAAKP,EAAU;AACrB,UAAI,CAACO,EAAI;AAET,YAAMC,IAAWL,EAAqBI,EAAG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AAA;AAAA,QAAY;SAKnIgD,EAAAhD,EAAM,KAAK,GAAA,CAAA,MAGD,CAAAM,EAAA,SAA6B,CAAKF,EAAA,UAAO,CAAMJ,EAAM,0BADpEwC,EAMO,QAAA;AAAA;QAJL,OAAKI,EAAA,CAAC,WACE5C,EAAM,eAAW,CAAMA,EAAM,eAAW,CAAKA,EAAM,eAAY,gDAAA,WAAA,CAAA;AAAA,MAAA;QAEvEyC,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAIC1C,EAAM,mBAAmBI,EAAA,cAApCoC,EAEM,OAAA;AAAA;QAFwC,SAAOP,EAAA,KAAsB;AAAA,MAAA;QACzEY,EAAoEC,EAAAhD,CAAA,GAAA;AAAA,UAA1D,OAAOsB,EAAA;AAAA,UAAQ,MAAMpB,EAAM,uBAAmB;AAAA,QAAA;eAE1CA,EAAM,qBAAtBwC,EAEM,OAAA;AAAA;QAF+B,SAAON,EAAA,KAAmB;AAAA,MAAA;QAC7DO,EAA6BC,EAAA,QAAA,iBAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAI/BO,EAEM,OAFNC,GAEM;AAAA,QADJT,EAAqBC,EAAA,QAAA,SAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAKftC,EAAA,SAAO,CAAKE,EAAA,SAA6B,CAAKN,EAAM,mBAD5DmD,EAAA,GAAAX,EAMM,OANNY,GAMM;AAAA,QAFJP,EAA8CC,EAAAhD,CAAA,GAAA;AAAA,UAApC,OAAOsB,EAAA;AAAA,UAAQ,MAAMC,EAAA;AAAA,QAAA;QACtByB,EAAAP,CAAA,KAATY,EAAA,GAAAX,EAAyC,QAAd,YAAU;;;;;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/components/UiButton.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n type=\"button\"\n :disabled=\"props.disabled\"\n :class=\"buttonClasses\"\n :style=\"buttonStyles\"\n :data-theme=\"props.theme\"\n @click=\"onClick\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- Leading Icon Area (or Loading Replacement) -->\n <template v-if=\"props.centerLeadingIcon && !isLabelPresent\">\n <div :class=\"leadingIconClasses\">\n <slot name=\"leading-icon\" />\n </div>\n </template>\n <template v-else>\n <div\n v-if=\"replaceLeadingIconWithLoading && loading\"\n class=\"sl-flex sl-items-center sl-justify-center\"\n :class=\"[leadingIconClasses, !isLabelPresent ? 'sl-h-full sl-w-full' : '']\"\n >\n <Loading :theme=\"theme\" :size=\"loadingSize\" />\n </div>\n <div v-else-if=\"props.leadingIcon\" :class=\"leadingIconClasses\">\n <slot name=\"leading-icon\" />\n </div>\n </template>\n\n <!-- Button Content -->\n <span\n v-if=\"isLabelPresent\"\n class=\"sl-flex-1 sl-text-center\"\n :class=\"[\n { 'sl-truncate sl-max-w-[150px]': truncateLabel },\n { 'sl-mx-auto': !props.leadingIcon && !props.trailingIcon }\n ]\"\n >\n {{ props.label }}\n </span>\n <span\n v-else-if=\"(!replaceLeadingIconWithLoading || !loading) && !props.centerLeadingIcon\"\n class=\"sl-flex\"\n :class=\"props.centerLabel || (!props.leadingIcon && !props.trailingIcon) ? 'sl-justify-center sl-items-center sl-flex-1' : 'sl-flex-1'\"\n >\n <slot />\n </span>\n\n <!-- Trailing Icon or Loading -->\n <div v-if=\"props.trailingLoading && loading\" :class=\"trailingLoadingClasses\">\n <Loading :theme=\"theme\" :size=\"props.trailingLoadingSize || 'sm'\" />\n </div>\n <div v-else-if=\"props.trailingIcon\" :class=\"trailingIconClasses\">\n <slot name=\"trailing-icon\" />\n </div>\n\n <!-- Badge Slot -->\n <div class=\"sl-absolute sl-top-0 sl-right-0 sl-transform sl-translate-x-1/2 -sl-translate-y-1/2\">\n <slot name=\"badge\" />\n </div>\n\n <!-- Overlay Loading (if not replacing the leading icon and not using trailing loading) -->\n <div\n v-if=\"loading && !replaceLeadingIconWithLoading && !props.trailingLoading\"\n class=\"sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-bg-opacity-75 sl-bg-white dark:sl-bg-opacity-75 dark:sl-bg-gray-700 sl-rounded sl-z-10\"\n >\n <Loading :theme=\"theme\" :size=\"loadingSize\" />\n <p v-if=\"showLoadingTitle\">Loading...</p>\n </div>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, defineAsyncComponent, ref, onMounted, watch, nextTick } from 'vue';\nimport type { ButtonType, RoundedType, Theme } from '../types/ui';\n\n// Asynchronously load the Loading component\nconst Loading = defineAsyncComponent(() => import('./UiLoading.vue'));\n\n// Define props using the ButtonType interface\ninterface ButtonProps extends ButtonType {\n replaceLeadingIconWithLoading?: boolean;\n centerLeadingIcon?: boolean;\n /**\n * When enabled, shows loading indicator in trailing position instead of overlay\n */\n trailingLoading?: boolean;\n /**\n * Size of the loading indicator when using trailingLoading\n */\n trailingLoadingSize?: import('../types/ui').Size;\n /**\n * Positions trailing loading/icon absolutely at the far right, centered vertically.\n */\n trailingOverlay?: boolean;\n /**\n * When enabled the button will attempt to automatically choose a contrasting\n * colour theme if its background matches that of its closest non-transparent\n * ancestor.\n */\n autoContrast?: boolean;\n}\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n theme: 'primary',\n size: 'md',\n rounded: 'rounded-md',\n disabled: false,\n expanded: false,\n outlined: false,\n loading: false,\n leadingIcon: false,\n trailingIcon: false,\n showLoadingTitle: false,\n truncateLabel: false,\n centerLabel: false,\n inlineFlex: false,\n replaceLeadingIconWithLoading: false,\n centerLeadingIcon: false,\n trailingLoading: false,\n trailingOverlay: false,\n autoContrast: false,\n});\n\n// Define the emits\nconst emit = defineEmits<{\n 'button-click': []\n 'hover-enter': []\n 'hover-leave': []\n}>();\n\n// Reactive computed properties\nconst loading = computed(() => Boolean(props.loading));\nconst replaceLeadingIconWithLoading = computed(() => props.replaceLeadingIconWithLoading || false);\n\n// Reference to the underlying button element\nconst buttonRef = ref<HTMLElement | null>(null);\n\n// Internal reactive theme value that may be overridden for auto-contrast\nconst resolvedTheme = ref<Theme>(props.theme ?? 'primary');\n\nconst findParentBackground = (node: HTMLElement | null): string | null => {\n while (node && node !== document.documentElement) {\n const bg = window.getComputedStyle(node).backgroundColor;\n if (bg && bg !== 'rgba(0, 0, 0, 0)' && bg !== 'transparent') {\n return bg;\n }\n node = node.parentElement as HTMLElement | null;\n }\n return null;\n};\n\nconst adjustThemeBasedOnBackground = (): void => {\n if (!props.autoContrast) return;\n const el = buttonRef.value;\n if (!el) return;\n\n const parentBg = findParentBackground(el.parentElement as HTMLElement | null);\n if (!parentBg) return;\n\n const buttonBg = window.getComputedStyle(el).backgroundColor;\n\n if (buttonBg === parentBg) {\n resolvedTheme.value = resolvedTheme.value === 'light' ? 'primary' : 'light';\n }\n};\n\nonMounted(() => {\n nextTick(adjustThemeBasedOnBackground);\n});\n\nwatch(\n () => props.theme,\n (newTheme) => {\n resolvedTheme.value = newTheme || 'primary';\n nextTick(adjustThemeBasedOnBackground);\n },\n { immediate: false }\n);\n\n// Public computed theme\nconst theme = computed(() => resolvedTheme.value);\n\n// Compute loading size with fallback\nconst loadingSize = computed(() => props.loadingSize || props.size || 'md');\n\n// Styling computed properties\nconst colorClass = computed(() => {\n const outlineBaseClasses: Record<string, string> = {\n primary: 'sl-text-stachelock-600 sl-border sl-border-stachelock-600 hover:sl-bg-stachelock-50 hover:sl-border-stachelock-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n dark: 'sl-text-gray-700 sl-border sl-border-gray-700 hover:sl-bg-gray-50 hover:sl-border-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n secondary: 'sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n light: 'sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n warning: 'sl-text-yellow-500 sl-border sl-border-yellow-500 hover:sl-bg-yellow-50 hover:sl-border-yellow-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n danger: 'sl-text-red-500 sl-border sl-border-red-500 hover:sl-bg-red-50 hover:sl-border-red-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n success: 'sl-text-green-500 sl-border sl-border-green-500 hover:sl-bg-green-50 hover:sl-border-green-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n ghost: 'sl-text-gray-800 sl-border sl-border-transparent sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none',\n };\n\n const filledBaseClasses: Record<string, string> = {\n primary: 'sl-border sl-border-transparent sl-text-white sl-shadow-sm focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n dark: 'sl-border sl-border-transparent sl-bg-gray-700 sl-text-white sl-shadow-sm hover:sl-bg-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n secondary: 'sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300',\n light: 'sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300',\n warning: 'sl-border sl-border-transparent sl-bg-yellow-400 sl-text-white sl-shadow-sm hover:sl-bg-yellow-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n danger: 'sl-border sl-border-transparent sl-bg-red-500 sl-text-white sl-shadow-sm hover:sl-bg-red-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n success: 'sl-border sl-border-transparent sl-bg-green-500 sl-text-white sl-shadow-sm hover:sl-bg-green-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50',\n ghost: 'sl-border sl-border-transparent sl-text-gray-800 sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none',\n };\n\n if (props.outlined) {\n return `${outlineBaseClasses[theme.value] || ''} sl-bg-transparent`;\n } else {\n return filledBaseClasses[theme.value] || '';\n }\n});\n\nconst roundedClassMap: Record<RoundedType, string> = {\n square: '',\n rounded: 'sl-rounded',\n 'rounded-md': 'sl-rounded-md',\n 'rounded-lg': 'sl-rounded-lg',\n 'rounded-full': 'sl-rounded-full',\n};\n\nconst roundedClass = computed(() => roundedClassMap[props.rounded || 'rounded-md']);\n\nconst sizeClass = computed(() => {\n const sizeMapping: Record<string, string> = {\n xs: 'sl-p-0.5',\n sm: 'sl-p-1',\n md: 'sl-p-2',\n lg: 'sl-p-3',\n xl: 'sl-p-4',\n '2xl': 'sl-p-5',\n };\n return sizeMapping[props.size || 'md'];\n});\n\nconst textClass = computed(() => {\n const textMapping: Record<string, string> = {\n xs: 'sl-text-xs sl-font-regular',\n sm: 'sl-text-sm sl-font-regular',\n md: 'sl-text-base sl-font-medium',\n lg: 'sl-text-lg sl-font-medium',\n xl: 'sl-text-xl sl-font-medium',\n '2xl': 'sl-text-2xl sl-font-medium',\n };\n return textMapping[props.size || 'sm'];\n});\n\nconst expandedClass = computed(() => (props.expanded ? 'sl-w-full' : ''));\n\nconst isLabelPresent = computed(() => !!props.label && props.label.length > 0);\n\nconst buttonClasses = computed(() => {\n if (props.customClass) {\n return props.customClass;\n }\n\n const coreClasses = [\n roundedClass.value,\n sizeClass.value,\n textClass.value,\n expandedClass.value,\n colorClass.value,\n props.disabled ? 'sl-cursor-not-allowed' : 'sl-cursor-pointer',\n 'focus:sl-ring-0',\n 'sl-relative',\n 'sl-flex',\n 'sl-items-center',\n 'sl-justify-center',\n ];\n\n const finalClasses = [...coreClasses];\n\n if (roundedClass.value === 'sl-rounded-full') {\n finalClasses.push('sl-px-1', 'sl-py-1');\n } else {\n finalClasses.push('sl-px-2.5', 'sl-py-2');\n }\n\n if (props.centerLeadingIcon && !isLabelPresent.value) {\n finalClasses.push('sl-w-full', 'sl-h-full');\n } else {\n if (props.leadingIcon || props.inlineFlex || props.trailingIcon) {\n finalClasses.push('sl-inline-flex');\n }\n }\n\n return finalClasses.filter(Boolean);\n});\n\nconst buttonStyles = computed(() => {\n if (props.theme === 'primary') {\n return {\n backgroundColor: 'var(--sl-color-primary-600, #6b8a5e)',\n '--tw-ring-color': 'var(--sl-color-primary-500, #7a966e)',\n };\n }\n return {};\n});\n\nconst trailingBaseClasses = 'sl-ml-auto sl-flex sl-items-center';\nconst trailingAbsoluteClasses = 'sl-absolute sl-right-0 sl-top-1/2 -sl-translate-y-1/2 sl-pr-0 sl-flex sl-items-center';\nconst trailingLoadingClasses = computed(() => props.trailingOverlay ? trailingAbsoluteClasses : trailingBaseClasses);\nconst trailingIconClasses = computed(() => props.trailingOverlay ? `${trailingAbsoluteClasses} sl-h-5 sl-w-5` : 'sl-ml-2 sl-h-5 sl-w-5 sl-flex sl-items-center');\n\nconst leadingIconClasses = computed(() => {\n if (props.centerLeadingIcon && !isLabelPresent.value) {\n return 'sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-w-full sl-h-full';\n }\n if (props.centerLeadingIcon) {\n return 'sl-h-full sl-flex sl-items-center sl-justify-center';\n }\n if (!isLabelPresent.value) {\n return 'sl-flex sl-items-center sl-justify-center';\n }\n return '-sl-ml-0.5 sl-h-5 sl-w-5 sl-flex sl-items-center sl-justify-center';\n});\n\nconst onClick = (): void => {\n emit('button-click');\n};\n\nconst onMouseEnter = (): void => {\n emit('hover-enter');\n};\n\nconst onMouseLeave = (): void => {\n emit('hover-leave');\n};\n\nconst showLoadingTitle = props.showLoadingTitle || false;\n</script>\n\n<style scoped>\n/* Component-specific styles if needed */\nbutton[data-theme=\"primary\"]:hover {\n background-color: var(--sl-color-primary-700, #566e4b) !important;\n}\n</style>\n\n\n"],"names":["trailingBaseClasses","trailingAbsoluteClasses","Loading","defineAsyncComponent","props","__props","emit","__emit","loading","computed","replaceLeadingIconWithLoading","buttonRef","ref","resolvedTheme","findParentBackground","node","bg","adjustThemeBasedOnBackground","el","parentBg","onMounted","nextTick","watch","newTheme","theme","loadingSize","colorClass","outlineBaseClasses","filledBaseClasses","roundedClassMap","roundedClass","sizeClass","textClass","expandedClass","isLabelPresent","buttonClasses","finalClasses","buttonStyles","trailingLoadingClasses","trailingIconClasses","leadingIconClasses","onClick","onMouseEnter","onMouseLeave","showLoadingTitle","_createElementBlock","_renderSlot","_ctx","_Fragment","_normalizeClass","_createVNode","_unref","truncateLabel","_toDisplayString","_createElementVNode","_hoisted_2","_openBlock","_hoisted_3"],"mappings":";;;;;oBAiTMA,KAAsB,sCACtBC,IAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnOhC,UAAMC,IAAUC,EAAqB,MAAM,OAAO,cAAiB,CAAC,GA0B9DC,IAAQC,GAsBRC,IAAOC,GAOPC,IAAUC,EAAS,MAAM,EAAQL,EAAM,OAAQ,GAC/CM,IAAgCD,EAAS,MAAML,EAAM,iCAAiC,EAAK,GAG3FO,IAAYC,EAAwB,IAAI,GAGxCC,IAAgBD,EAAWR,EAAM,SAAS,SAAS,GAEnDU,IAAuB,CAACC,MAA4C;AACxE,aAAOA,KAAQA,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A,QAAA,SAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAKfvC,EAAA,SAAO,CAAKE,EAAA,SAA6B,CAAKN,EAAM,mBAD5DoD,EAAA,GAAAX,EAMM,OANNY,GAMM;AAAA,QAFJP,EAA8CC,EAAAjD,CAAA,GAAA;AAAA,UAApC,OAAOsB,EAAA;AAAA,UAAQ,MAAMC,EAAA;AAAA,QAAA;QACtB0B,EAAAP,CAAA,KAATY,EAAA,GAAAX,EAAyC,SAAd,YAAU;;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { defineComponent as m, computed as g, createElementBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as m, computed as g, createElementBlock as s, openBlock as e, createElementVNode as l, toDisplayString as a, normalizeClass as n, Fragment as d, renderList as r, normalizeStyle as c } from "vue";
|
|
2
|
+
import { _ as y } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const x = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "sl-bg-white sl-px-6 sl-py-24 sm:sl-py-32 lg:sl-px-8"
|
|
6
|
-
}, f = { class: "sl-mx-auto sl-max-w-2xl sl-text-center" }, v = {
|
|
6
|
+
}, f = { class: "sl-mx-auto sl-max-w-2xl sl-text-center" }, v = {
|
|
7
|
+
class: "sl-text-base sl-font-semibold sl-leading-7",
|
|
8
|
+
style: { color: "var(--sl-color-primary-600, #6b8a5e)" }
|
|
9
|
+
}, b = { class: "sl-mt-2 sl-text-4xl sl-font-bold sl-tracking-tight sl-text-gray-900 sm:sl-text-6xl" }, p = { class: "sl-flex sl-justify-center sl-mt-6" }, k = { class: "sl-mt-6 sl-text-lg sl-leading-8 sl-text-gray-600" }, h = {
|
|
7
10
|
key: 1,
|
|
8
11
|
class: "sl-flex sl-justify-center sl-mt-6"
|
|
9
12
|
}, _ = /* @__PURE__ */ m({
|
|
@@ -11,7 +14,7 @@ const y = {
|
|
|
11
14
|
props: {
|
|
12
15
|
backgroundColor: {
|
|
13
16
|
type: String,
|
|
14
|
-
default: "#
|
|
17
|
+
default: "var(--sl-color-primary-600, #6b8a5e)"
|
|
15
18
|
},
|
|
16
19
|
size: {
|
|
17
20
|
type: String,
|
|
@@ -33,36 +36,36 @@ const y = {
|
|
|
33
36
|
},
|
|
34
37
|
setup(t) {
|
|
35
38
|
const u = t, i = g(() => `dots-${u.size}`);
|
|
36
|
-
return (C, S) => t.title && t.subtitle && t.caption ? (e(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return (C, S) => t.title && t.subtitle && t.caption ? (e(), s("div", x, [
|
|
40
|
+
l("div", f, [
|
|
41
|
+
l("p", v, a(t.caption), 1),
|
|
42
|
+
l("h2", b, a(t.title), 1),
|
|
43
|
+
l("div", p, [
|
|
44
|
+
l("div", {
|
|
42
45
|
class: n(["loader-dots", i.value])
|
|
43
46
|
}, [
|
|
44
|
-
(e(),
|
|
47
|
+
(e(), s(d, null, r(4, (o) => l("div", {
|
|
45
48
|
key: o,
|
|
46
49
|
class: "dots-div",
|
|
47
|
-
style:
|
|
50
|
+
style: c({ backgroundColor: t.backgroundColor })
|
|
48
51
|
}, null, 4)), 64))
|
|
49
52
|
], 2)
|
|
50
53
|
]),
|
|
51
|
-
|
|
54
|
+
l("p", k, a(t.subtitle), 1)
|
|
52
55
|
])
|
|
53
|
-
])) : (e(),
|
|
54
|
-
|
|
56
|
+
])) : (e(), s("div", h, [
|
|
57
|
+
l("div", {
|
|
55
58
|
class: n(["loader-dots", i.value])
|
|
56
59
|
}, [
|
|
57
|
-
(e(),
|
|
60
|
+
(e(), s(d, null, r(4, (o) => l("div", {
|
|
58
61
|
key: o,
|
|
59
62
|
class: "dots-div",
|
|
60
|
-
style:
|
|
63
|
+
style: c({ backgroundColor: t.backgroundColor })
|
|
61
64
|
}, null, 4)), 64))
|
|
62
65
|
], 2)
|
|
63
66
|
]));
|
|
64
67
|
}
|
|
65
|
-
}), L = /* @__PURE__ */
|
|
68
|
+
}), L = /* @__PURE__ */ y(_, [["__scopeId", "data-v-b6dd98d0"]]);
|
|
66
69
|
export {
|
|
67
70
|
L as default
|
|
68
71
|
};
|