sprintify-ui 0.12.21 → 0.12.22
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/sprintify-ui.es.js +22 -15
- package/package.json +1 -1
- package/src/components/BaseBadge.vue +18 -13
- package/src/components/BaseButton.vue +13 -9
package/dist/sprintify-ui.es.js
CHANGED
|
@@ -9133,16 +9133,19 @@ const _2 = {
|
|
|
9133
9133
|
const w = ["btn"];
|
|
9134
9134
|
return o.color && (o.color in r ? w.push(r[o.color]) : w.push("hover:enabled:opacity-80")), s.value && w.push((T = on[s.value]) == null ? void 0 : T.buttonClass), l.value && w.push("p-0 aspect-1 justify-center"), Qe(w, o.class);
|
|
9135
9135
|
}), u = S(() => {
|
|
9136
|
-
if (o.color && !(o.color in r))
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9136
|
+
if (o.color && !(o.color in r))
|
|
9137
|
+
try {
|
|
9138
|
+
const w = Sl(o.color);
|
|
9139
|
+
return {
|
|
9140
|
+
backgroundColor: w.backgroundColor,
|
|
9141
|
+
color: w.textColor,
|
|
9142
|
+
borderColor: w.borderColor,
|
|
9143
|
+
borderWidth: "1px",
|
|
9144
|
+
borderStyle: "solid"
|
|
9145
|
+
};
|
|
9146
|
+
} catch {
|
|
9147
|
+
console.warn(`[BaseButton] "${o.color}" is not a valid color.`);
|
|
9148
|
+
}
|
|
9146
9149
|
return {};
|
|
9147
9150
|
}), c = S(() => {
|
|
9148
9151
|
const w = ["flex items-center w-full"];
|
|
@@ -11718,11 +11721,15 @@ const YM = ["src"], GM = ["fill"], JM = ["font-size"], XM = { class: "truncate"
|
|
|
11718
11721
|
},
|
|
11719
11722
|
setup(n) {
|
|
11720
11723
|
const t = n, e = S(() => {
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11724
|
+
try {
|
|
11725
|
+
const a = Sl(t.color, t.contrast == "high"), u = {
|
|
11726
|
+
backgroundColor: a.backgroundColor,
|
|
11727
|
+
color: a.textColor
|
|
11728
|
+
};
|
|
11729
|
+
return t.bordered && (u.borderColor = a.borderColor, u.borderWidth = "1px", u.borderStyle = "solid"), u;
|
|
11730
|
+
} catch {
|
|
11731
|
+
return console.warn(`[BaseBadge] "${t.color}" is not a valid color.`), {};
|
|
11732
|
+
}
|
|
11726
11733
|
}), r = S(() => Object.keys(on).includes(t.size) ? t.size : "md"), o = mf(), i = S(() => !!o.default), s = S(() => {
|
|
11727
11734
|
const a = "inline-flex items-center rounded leading-tight", u = {
|
|
11728
11735
|
xs: "text-[9px]",
|
package/package.json
CHANGED
|
@@ -43,20 +43,25 @@ const props = withDefaults(
|
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
const colorStyle = computed((): Record<string, string> => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
try {
|
|
47
|
+
const config = getColorConfig(props.color, props.contrast == 'high');
|
|
48
|
+
|
|
49
|
+
const styles: Record<string, string> = {
|
|
50
|
+
backgroundColor: config.backgroundColor,
|
|
51
|
+
color: config.textColor,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
if (props.bordered) {
|
|
55
|
+
styles.borderColor = config.borderColor;
|
|
56
|
+
styles.borderWidth = '1px';
|
|
57
|
+
styles.borderStyle = 'solid';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return styles;
|
|
61
|
+
} catch {
|
|
62
|
+
console.warn(`[BaseBadge] "${props.color}" is not a valid color.`);
|
|
63
|
+
return {};
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
return styles;
|
|
60
65
|
});
|
|
61
66
|
|
|
62
67
|
const sizeInternal = computed(() => {
|
|
@@ -207,15 +207,19 @@ const classes = computed(() => {
|
|
|
207
207
|
|
|
208
208
|
const styles = computed(() => {
|
|
209
209
|
if (props.color && !(props.color in colors)) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
210
|
+
try {
|
|
211
|
+
const config = getColorConfig(props.color);
|
|
212
|
+
|
|
213
|
+
return {
|
|
214
|
+
backgroundColor: config.backgroundColor,
|
|
215
|
+
color: config.textColor,
|
|
216
|
+
borderColor: config.borderColor,
|
|
217
|
+
borderWidth: '1px',
|
|
218
|
+
borderStyle: 'solid',
|
|
219
|
+
};
|
|
220
|
+
} catch {
|
|
221
|
+
console.warn(`[BaseButton] "${props.color}" is not a valid color.`);
|
|
222
|
+
}
|
|
219
223
|
}
|
|
220
224
|
|
|
221
225
|
return {};
|