vueless 0.0.147 → 0.0.149
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/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
8
|
const { config, getAttrs } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const { items } = config.value;
|
|
9
|
+
const { label, items } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaItems = cva({
|
|
12
12
|
base: items.base,
|
|
@@ -14,6 +14,12 @@ export function useAttrs(props) {
|
|
|
14
14
|
compoundVariants: items.compoundVariants,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
const cvaLabel = cva({
|
|
18
|
+
base: label.base,
|
|
19
|
+
variants: label.variants,
|
|
20
|
+
compoundVariants: label.compoundVariants,
|
|
21
|
+
});
|
|
22
|
+
|
|
17
23
|
const itemsClasses = computed(() =>
|
|
18
24
|
cvaItems({
|
|
19
25
|
size: props.size,
|
|
@@ -21,7 +27,13 @@ export function useAttrs(props) {
|
|
|
21
27
|
}),
|
|
22
28
|
);
|
|
23
29
|
|
|
24
|
-
const
|
|
30
|
+
const labelClasses = computed(() =>
|
|
31
|
+
cvaLabel({
|
|
32
|
+
block: props.block,
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const labelAttrs = getAttrs("label", { isComponent: true, classes: labelClasses });
|
|
25
37
|
const itemsAttrs = getAttrs("items", { classes: itemsClasses });
|
|
26
38
|
const itemAttrs = getAttrs("item", { isComponent: true });
|
|
27
39
|
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
label:
|
|
2
|
+
label: {
|
|
3
|
+
base: "flex flex-wrap",
|
|
4
|
+
variants: {
|
|
5
|
+
block: {
|
|
6
|
+
true: "w-full",
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
},
|
|
3
10
|
items: {
|
|
4
11
|
base: "flex flex-wrap",
|
|
5
12
|
variants: {
|
|
6
13
|
size: {
|
|
7
|
-
"2xs": "gap-
|
|
8
|
-
xs: "gap-
|
|
9
|
-
sm: "gap-
|
|
10
|
-
md: "gap-
|
|
11
|
-
lg: "gap-
|
|
12
|
-
xl: "gap-
|
|
14
|
+
"2xs": "gap-0.5",
|
|
15
|
+
xs: "gap-1",
|
|
16
|
+
sm: "gap-1.5",
|
|
17
|
+
md: "gap-2",
|
|
18
|
+
lg: "gap-2.5",
|
|
19
|
+
xl: "gap-3",
|
|
13
20
|
},
|
|
14
21
|
separated: {
|
|
15
22
|
false: `
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ULabel
|
|
3
|
-
:size="
|
|
3
|
+
:size="labelSize"
|
|
4
4
|
:label="label"
|
|
5
5
|
:description="description"
|
|
6
6
|
:align="labelAlign"
|
|
@@ -191,6 +191,19 @@ const selectedValue = computed({
|
|
|
191
191
|
set: (value) => emit("update:modelValue", value),
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
+
const labelSize = computed(() => {
|
|
195
|
+
const sizes = {
|
|
196
|
+
"2xs": "sm",
|
|
197
|
+
xs: "sm",
|
|
198
|
+
sm: "md",
|
|
199
|
+
md: "md",
|
|
200
|
+
lg: "lg",
|
|
201
|
+
xl: "lg",
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
return sizes[props.size];
|
|
205
|
+
});
|
|
206
|
+
|
|
194
207
|
const type = computed(() => {
|
|
195
208
|
return props.multiple ? TYPE_CHECKBOX : TYPE_RADIO;
|
|
196
209
|
});
|
|
@@ -3,7 +3,7 @@ export default /*tw*/ {
|
|
|
3
3
|
base: "",
|
|
4
4
|
variants: {
|
|
5
5
|
separated: {
|
|
6
|
-
false: "rounded-none",
|
|
6
|
+
false: "!rounded-none",
|
|
7
7
|
},
|
|
8
8
|
},
|
|
9
9
|
},
|
|
@@ -18,12 +18,12 @@ export default /*tw*/ {
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
compoundVariants: [
|
|
21
|
-
{ color: "grayscale", variant: "primary", class: "!bg-
|
|
22
|
-
{ color: "grayscale", variant: "secondary", class: "!text-
|
|
23
|
-
{ color: "grayscale", variant: "thirdary", class: "!text-
|
|
24
|
-
{ color: "white", variant: "primary", class: "!text-
|
|
25
|
-
{ color: "white", variant: "secondary", class: "!text-
|
|
26
|
-
{ color: "white", variant: "thirdary", class: "!text-
|
|
21
|
+
{ color: "grayscale", variant: "primary", class: "!bg-brand-700 !border-brand-700" },
|
|
22
|
+
{ color: "grayscale", variant: "secondary", class: "!text-brand-700 !border-brand-700 !bg-brand-50 !bg-opacity-100" },
|
|
23
|
+
{ color: "grayscale", variant: "thirdary", class: "!text-brand-700 !bg-brand-50" },
|
|
24
|
+
{ color: "white", variant: "primary", class: "!text-brand-700 !border-brand-600 !bg-brand-50" },
|
|
25
|
+
{ color: "white", variant: "secondary", class: "!text-brand-700 !border-brand-600 !bg-brand-50" },
|
|
26
|
+
{ color: "white", variant: "thirdary", class: "!text-brand-700 !bg-brand-50" },
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|