@veritree/ui 0.21.1-0 → 0.21.1-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.21.1-0",
3
+ "version": "0.21.1-2",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,14 +1,21 @@
1
1
  <template>
2
2
  <div
3
- :class="{
4
- Avatar: headless,
5
- 'flex items-center justify-center overflow-hidden rounded-full':
6
- !headless,
7
- 'h-10 w-10': !small,
8
- 'h-8 w-8': small,
9
- 'border border-solid': !dark,
10
- 'bg-white text-fd-500': dark,
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
- dark: {
41
- type: Boolean,
42
- default: false,
33
+ variant: {
34
+ type: String,
35
+ default: 'primary',
43
36
  },
44
- small: {
45
- type: Boolean,
46
- default: false,
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
  };