@veritree/ui 0.21.1-0 → 0.21.1-1
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
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
:class="[
|
|
4
|
+
// default styles
|
|
5
|
+
headless
|
|
6
|
+
? 'avatar'
|
|
7
|
+
: 'flex items-center justify-center overflow-hidden rounded-full bg-white border border-solid',
|
|
8
|
+
// variant styles
|
|
9
|
+
headless ? `avatar--${variant}` : null,
|
|
10
|
+
// sizes styles
|
|
11
|
+
headless
|
|
12
|
+
? `avatar--${size}`
|
|
13
|
+
: isSmall
|
|
14
|
+
? 'h-8 w-8'
|
|
15
|
+
: isLarge
|
|
16
|
+
? 'h-10 w-10'
|
|
17
|
+
: null,
|
|
18
|
+
]"
|
|
12
19
|
>
|
|
13
20
|
<slot></slot>
|
|
14
21
|
</div>
|
|
@@ -18,32 +25,28 @@
|
|
|
18
25
|
export default {
|
|
19
26
|
name: 'VTAvatar',
|
|
20
27
|
|
|
21
|
-
provide() {
|
|
22
|
-
return {
|
|
23
|
-
api: () => {
|
|
24
|
-
const { dark: isDark, headless: isHeadless, light: isLight } = this;
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
isDark,
|
|
28
|
-
isHeadless,
|
|
29
|
-
isLight,
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
|
|
35
28
|
props: {
|
|
36
29
|
headless: {
|
|
37
30
|
type: Boolean,
|
|
38
31
|
default: false,
|
|
39
32
|
},
|
|
40
|
-
|
|
41
|
-
type:
|
|
42
|
-
default:
|
|
33
|
+
variant: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'primary',
|
|
43
36
|
},
|
|
44
|
-
|
|
45
|
-
type:
|
|
46
|
-
default:
|
|
37
|
+
size: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'large',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
computed: {
|
|
44
|
+
isLarge() {
|
|
45
|
+
return this.size === 'large';
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
isSmall() {
|
|
49
|
+
return this.size === 'small';
|
|
47
50
|
},
|
|
48
51
|
},
|
|
49
52
|
};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
? 'button'
|
|
12
12
|
: isIcon
|
|
13
13
|
? 'inline-flex items-center justify-center rounded-full [&_svg]:max-h-full [&_svg]:max-w-full'
|
|
14
|
-
: '
|
|
14
|
+
: 'inline-flex rounded border border-solid px-4 text-sm font-semibold leading-none no-underline transition-all',
|
|
15
15
|
// variant styles
|
|
16
16
|
headless
|
|
17
17
|
? `button--${variant}`
|