independer-design-system 1.7.0 → 1.7.2
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/module.json
CHANGED
|
@@ -9,6 +9,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
9
9
|
type: StringConstructor;
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
|
+
size: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
validator: (value: unknown) => boolean;
|
|
16
|
+
};
|
|
17
|
+
icon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
12
21
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
22
|
label: {
|
|
14
23
|
type: StringConstructor;
|
|
@@ -18,7 +27,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
18
27
|
type: StringConstructor;
|
|
19
28
|
default: string;
|
|
20
29
|
};
|
|
30
|
+
size: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
validator: (value: unknown) => boolean;
|
|
34
|
+
};
|
|
35
|
+
icon: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
21
39
|
}>> & Readonly<{}>, {
|
|
22
40
|
label: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
size: string;
|
|
23
43
|
color: string;
|
|
24
44
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="flex items-center
|
|
4
|
-
:class="
|
|
3
|
+
class="inline-flex items-center justify-center rounded-full font-sans font-semibold whitespace-nowrap"
|
|
4
|
+
:class="[colorClasses, sizeClasses.root]"
|
|
5
5
|
>
|
|
6
|
+
<Icon
|
|
7
|
+
v-if="icon"
|
|
8
|
+
:name="icon"
|
|
9
|
+
class="shrink-0 object-contain"
|
|
10
|
+
:class="sizeClasses.image"
|
|
11
|
+
/>
|
|
6
12
|
{{ label }}
|
|
7
13
|
</div>
|
|
8
14
|
</template>
|
|
@@ -20,20 +26,54 @@ const props = defineProps({
|
|
|
20
26
|
color: {
|
|
21
27
|
type: String,
|
|
22
28
|
default: "secondary-subtle"
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "xs",
|
|
33
|
+
validator: (value) => ["xs", "sm", "md", "lg"].includes(value)
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
23
38
|
}
|
|
24
39
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
const colors = {
|
|
41
|
+
"neutral-subtle": "bg-neutral-subtlest text-text-default",
|
|
42
|
+
"neutral-strong": "bg-neutral-strong text-white",
|
|
43
|
+
"neutral-outline": "bg-transparent text-text-default ring-1 ring-inset ring-border-default-strong",
|
|
44
|
+
"spotlight-subtle": "bg-spotlight text-text-spotlight-strong",
|
|
45
|
+
"spotlight-strong": "bg-blue-600 text-white",
|
|
46
|
+
"spotlight-outline": "bg-transparent text-text-spotlight-strong ring-1 ring-inset ring-border-spotlight",
|
|
47
|
+
"brand-primary-subtle": "bg-brand-primary-subtler text-brand-primary-strong",
|
|
48
|
+
"brand-primary": "bg-brand-primary text-white",
|
|
49
|
+
"brand-primary-strong": "bg-brand-primary-strong text-white",
|
|
50
|
+
"brand-primary-outline": "bg-transparent text-brand-primary-strong ring-1 ring-inset ring-brand-primary",
|
|
51
|
+
"positive-subtle": "bg-green-100 text-green-900",
|
|
52
|
+
"positive-strong": "bg-green-700 text-white",
|
|
53
|
+
"positive-outline": "bg-transparent text-green-800 ring-1 ring-inset ring-green-600",
|
|
54
|
+
"warning-subtle": "bg-warning text-orange-900",
|
|
55
|
+
"warning-strong": "bg-warning-strong text-orange-1000",
|
|
56
|
+
"warning-outline": "bg-transparent text-orange-800 ring-1 ring-inset ring-orange-400",
|
|
57
|
+
"negative-subtle": "bg-red-100 text-red-900",
|
|
58
|
+
"negative-strong": "bg-red-600 text-white",
|
|
59
|
+
"negative-outline": "bg-transparent text-red-800 ring-1 ring-inset ring-red-600",
|
|
60
|
+
"brand-accent-subtle": "bg-accent-subtlest text-text-accent-inverse",
|
|
61
|
+
"brand-accent": "bg-accent text-text-accent-inverse",
|
|
62
|
+
"brand-secondary-subtlest": "bg-brand-secondary-subtlest text-text-expert-strong",
|
|
63
|
+
"expert-advice": "bg-brand-secondary-subtle text-text-expert-strong",
|
|
64
|
+
"own-insurance": "bg-brand-primary-subtlest text-brand-primary-strong",
|
|
65
|
+
"disabled": "bg-neutral-subtlest text-grey-500",
|
|
66
|
+
// Legacy aliases
|
|
67
|
+
"secondary-subtle": "bg-peach-200 text-peach-900",
|
|
68
|
+
"primary-subtle": "bg-purple-200 text-purple-dark",
|
|
69
|
+
"blue-subtle": "bg-blue-200 text-blue-900"
|
|
70
|
+
};
|
|
71
|
+
const sizes = {
|
|
72
|
+
xs: { root: "gap-1 px-2 py-1 text-xs leading-4", image: "size-4" },
|
|
73
|
+
sm: { root: "gap-1 px-2 py-1 text-sm leading-5", image: "size-5" },
|
|
74
|
+
md: { root: "gap-1 h-9 px-3 text-sm leading-5", image: "size-5" },
|
|
75
|
+
lg: { root: "gap-2 px-4 py-2 text-base leading-6", image: "size-6" }
|
|
76
|
+
};
|
|
77
|
+
const colorClasses = computed(() => colors[props.color] ?? colors["secondary-subtle"]);
|
|
78
|
+
const sizeClasses = computed(() => sizes[props.size] ?? sizes.xs);
|
|
39
79
|
</script>
|
|
@@ -9,6 +9,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
9
9
|
type: StringConstructor;
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
|
+
size: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
validator: (value: unknown) => boolean;
|
|
16
|
+
};
|
|
17
|
+
icon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
12
21
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
22
|
label: {
|
|
14
23
|
type: StringConstructor;
|
|
@@ -18,7 +27,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
18
27
|
type: StringConstructor;
|
|
19
28
|
default: string;
|
|
20
29
|
};
|
|
30
|
+
size: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
validator: (value: unknown) => boolean;
|
|
34
|
+
};
|
|
35
|
+
icon: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
21
39
|
}>> & Readonly<{}>, {
|
|
22
40
|
label: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
size: string;
|
|
23
43
|
color: string;
|
|
24
44
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/package.json
CHANGED