sprintify-ui 0.0.130 → 0.0.131
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
CHANGED
|
@@ -3070,26 +3070,14 @@ const na = /* @__PURE__ */ vt(tc, [["render", ic]]), lc = { class: "relative w-f
|
|
|
3070
3070
|
}), Lc = /* @__PURE__ */ me({
|
|
3071
3071
|
__name: "BaseBadge",
|
|
3072
3072
|
props: {
|
|
3073
|
-
contrast: {
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
}
|
|
3077
|
-
color: {
|
|
3078
|
-
default: "gray",
|
|
3079
|
-
type: String
|
|
3080
|
-
},
|
|
3081
|
-
size: {
|
|
3082
|
-
default: "base",
|
|
3083
|
-
type: String
|
|
3084
|
-
},
|
|
3085
|
-
icon: {
|
|
3086
|
-
default: void 0,
|
|
3087
|
-
type: String
|
|
3088
|
-
}
|
|
3073
|
+
contrast: { default: "high" },
|
|
3074
|
+
color: { default: "gray" },
|
|
3075
|
+
size: { default: "base" },
|
|
3076
|
+
icon: { default: void 0 }
|
|
3089
3077
|
},
|
|
3090
3078
|
setup(e) {
|
|
3091
3079
|
const i = e, r = G(() => i.color == "gray" ? i.contrast == "high" ? "bg-slate-600 text-white" : "bg-slate-100 text-slate-800" : i.color == "red" ? i.contrast == "high" ? "bg-red-600 text-white" : "bg-red-100 text-red-900" : i.color == "orange" ? i.contrast == "high" ? "bg-orange-500 text-white" : "bg-orange-100 text-yellow-900" : i.color == "yellow" ? i.contrast == "high" ? "bg-yellow-500 text-white" : "bg-yellow-100 text-yellow-900" : i.color == "green" ? i.contrast == "high" ? "bg-green-600 text-white" : "bg-green-100 text-green-900" : i.color == "blue" ? i.contrast == "high" ? "bg-blue-600 text-white" : "bg-blue-100 text-blue-900" : i.color == "indigo" ? i.contrast == "high" ? "bg-indigo-600 text-white" : "bg-indigo-100 text-indigo-900" : i.color == "purple" ? i.contrast == "high" ? "bg-purple-600 text-white" : "bg-purple-100 text-purple-900" : i.color == "pink" ? i.contrast == "high" ? "bg-pink-600 text-white" : "bg-pink-100 text-pink-900" : i.color ? "" : "bg-slate-100 text-slate-900"), n = G(() => {
|
|
3092
|
-
if (i.color.startsWith("#") || i.color.startsWith("rgb")) {
|
|
3080
|
+
if (i.color && (i.color.startsWith("#") || i.color.startsWith("rgb"))) {
|
|
3093
3081
|
let a = "white";
|
|
3094
3082
|
return i.contrast == "low" && (a = "rgba(0,0,0,0.8)"), {
|
|
3095
3083
|
backgroundColor: i.color,
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
icon
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
-
contrast: {
|
|
21
|
-
default: string;
|
|
22
|
-
type: PropType<"high" | "low">;
|
|
23
|
-
};
|
|
24
|
-
color: {
|
|
25
|
-
default: string;
|
|
26
|
-
type: PropType<string>;
|
|
27
|
-
};
|
|
28
|
-
size: {
|
|
29
|
-
default: string;
|
|
30
|
-
type: PropType<"base" | "lg">;
|
|
31
|
-
};
|
|
32
|
-
icon: {
|
|
33
|
-
default: undefined;
|
|
34
|
-
type: PropType<string | undefined>;
|
|
35
|
-
};
|
|
36
|
-
}>>, {
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
contrast: 'low' | 'high';
|
|
3
|
+
color: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'pink' | string;
|
|
4
|
+
size: 'base' | 'lg';
|
|
5
|
+
icon?: string | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
contrast: string;
|
|
8
|
+
color: string;
|
|
9
|
+
size: string;
|
|
10
|
+
icon: undefined;
|
|
11
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
contrast: 'low' | 'high';
|
|
13
|
+
color: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'pink' | string;
|
|
14
|
+
size: 'base' | 'lg';
|
|
15
|
+
icon?: string | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
contrast: string;
|
|
37
18
|
color: string;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
size: string;
|
|
20
|
+
icon: undefined;
|
|
21
|
+
}>>>, {
|
|
22
|
+
color: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'pink' | string;
|
|
23
|
+
icon: string;
|
|
24
|
+
size: 'base' | 'lg';
|
|
25
|
+
contrast: 'low' | 'high';
|
|
41
26
|
}>, {
|
|
42
27
|
default: (_: {}) => any;
|
|
43
28
|
}>;
|
|
44
29
|
export default _default;
|
|
30
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
31
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
32
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
+
} : {
|
|
35
|
+
type: import('vue').PropType<T[K]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type __VLS_WithDefaults<P, D> = {
|
|
40
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
41
|
+
default: D[K];
|
|
42
|
+
} : P[K];
|
|
43
|
+
};
|
|
45
44
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
45
|
new (): {
|
|
47
46
|
$slots: S;
|
package/package.json
CHANGED
|
@@ -10,17 +10,12 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script lang="ts" setup>
|
|
13
|
-
import { PropType } from 'vue';
|
|
14
13
|
import { BaseIcon } from '.';
|
|
15
14
|
|
|
16
|
-
const props =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
color: {
|
|
22
|
-
default: 'gray',
|
|
23
|
-
type: String as PropType<
|
|
15
|
+
const props = withDefaults(
|
|
16
|
+
defineProps<{
|
|
17
|
+
contrast: 'low' | 'high';
|
|
18
|
+
color:
|
|
24
19
|
| 'gray'
|
|
25
20
|
| 'red'
|
|
26
21
|
| 'orange'
|
|
@@ -30,18 +25,17 @@ const props = defineProps({
|
|
|
30
25
|
| 'indigo'
|
|
31
26
|
| 'purple'
|
|
32
27
|
| 'pink'
|
|
33
|
-
| string
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
28
|
+
| string;
|
|
29
|
+
size: 'base' | 'lg';
|
|
30
|
+
icon?: string;
|
|
31
|
+
}>(),
|
|
32
|
+
{
|
|
33
|
+
contrast: 'high',
|
|
34
|
+
color: 'gray',
|
|
35
|
+
size: 'base',
|
|
36
|
+
icon: undefined,
|
|
37
|
+
}
|
|
38
|
+
);
|
|
45
39
|
|
|
46
40
|
const colorClasses = computed(() => {
|
|
47
41
|
if (props.color == 'gray') {
|
|
@@ -105,7 +99,10 @@ const colorClasses = computed(() => {
|
|
|
105
99
|
});
|
|
106
100
|
|
|
107
101
|
const colorStyle = computed((): Record<string, string> => {
|
|
108
|
-
if (
|
|
102
|
+
if (
|
|
103
|
+
props.color &&
|
|
104
|
+
(props.color.startsWith('#') || props.color.startsWith('rgb'))
|
|
105
|
+
) {
|
|
109
106
|
let textColor = 'white';
|
|
110
107
|
|
|
111
108
|
if (props.contrast == 'low') {
|