@veritree/ui 0.19.2-17 → 0.19.2-18

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.19.2-17",
3
+ "version": "0.19.2-18",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,7 +1,27 @@
1
1
  <template>
2
- <div class="form-feedback" :class="classes">
3
- <component :is="icon" v-if="showIcon" />
4
- <span class="text-gray-500"><slot></slot></span>
2
+ <div
3
+ :class="[
4
+ headless ? 'form-feedback' : 'mt-1 flex items-baseline gap-2',
5
+ // variant styles
6
+ headless ? `form-feedback--${variant}` : null,
7
+ ]"
8
+ >
9
+ <component
10
+ v-if="showIcon"
11
+ :is="icon"
12
+ :class="[
13
+ headless ? 'form-feedback__icon' : 'relative top-1 h-4 w-4 shrink-0',
14
+ // variant styles
15
+ headless
16
+ ? `form-feedback__icon--${variant}`
17
+ : isError
18
+ ? 'text-error-500'
19
+ : null,
20
+ ]"
21
+ />
22
+ <span :class="[headless ? 'form-feedback--text' : 'text-sm text-gray-500']">
23
+ <slot />
24
+ </span>
5
25
  </div>
6
26
  </template>
7
27
 
@@ -17,32 +37,23 @@ export default {
17
37
  },
18
38
 
19
39
  props: {
20
- variant: {
21
- type: [String, Object],
22
- default: '',
23
- validator(value) {
24
- if (value === '' || typeof value === 'object') {
25
- return true;
26
- }
27
-
28
- return ['success', 'warning', 'error'].includes(value);
29
- },
30
- },
31
40
  hideIcon: {
32
41
  type: Boolean,
33
42
  default: false,
34
43
  },
44
+ headless: {
45
+ type: Boolean,
46
+ default: false,
47
+ },
48
+ variant: {
49
+ type: [String, Object],
50
+ default: '',
51
+ },
35
52
  },
36
53
 
37
54
  computed: {
38
- classes() {
39
- const classes = {};
40
-
41
- if (this.variant) {
42
- classes[`form-feedback--${this.variant}`] = true;
43
- }
44
-
45
- return classes;
55
+ isError() {
56
+ return this.variant === 'error';
46
57
  },
47
58
 
48
59
  icon() {