@veritree/ui 0.48.2 → 0.49.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.
@@ -69,7 +69,7 @@ export const floatingUiContentMixin = {
69
69
 
70
70
  e.stopPropagation();
71
71
 
72
- if (this.visible && !this.el.contains(e.target)) {
72
+ if (this.visible && !this.el?.contains(e.target)) {
73
73
  this.componentTrigger.cancel();
74
74
  }
75
75
  },
@@ -48,6 +48,10 @@ export const formControlMixin = {
48
48
  isError() {
49
49
  return this.variant === 'error';
50
50
  },
51
+
52
+ isSuccess() {
53
+ return this.variant === 'success';
54
+ },
51
55
  },
52
56
  };
53
57
 
@@ -63,6 +67,8 @@ export const formControlStyleMixin = {
63
67
  ? `${this.name}--${this.variant}`
64
68
  : this.isError
65
69
  ? 'border-error-300'
70
+ : this.isSuccess
71
+ ? 'border-success-300'
66
72
  : 'border-gray-300',
67
73
  // height styles
68
74
  this.headless
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.48.2",
3
+ "version": "0.49.1",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -6,19 +6,7 @@
6
6
  headless ? `form-feedback--${variant}` : null,
7
7
  ]"
8
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
- />
9
+ <component v-if="showIcon" :is="icon" :class="iconClassComputed" />
22
10
  <span
23
11
  :class="[headless ? 'form-feedback--text' : 'text-caption text-gray-500']"
24
12
  >
@@ -54,18 +42,38 @@ export default {
54
42
  },
55
43
 
56
44
  computed: {
57
- isError() {
58
- return this.variant === 'error';
59
- },
60
-
61
45
  icon() {
62
46
  if (this.variant === 'success') return IconCheck;
63
47
  return IconWarning;
64
48
  },
65
49
 
50
+ iconClassComputed() {
51
+ return [
52
+ this.headless
53
+ ? 'form-feedback__icon'
54
+ : 'relative top-1 h-4 w-4 shrink-0',
55
+ // variant styles
56
+ this.headless
57
+ ? `form-feedback__icon--${this.variant}`
58
+ : this.isError
59
+ ? 'text-error-500'
60
+ : this.isSuccess
61
+ ? 'text-success-500'
62
+ : null,
63
+ ];
64
+ },
65
+
66
66
  showIcon() {
67
67
  return !this.hideIcon;
68
68
  },
69
+
70
+ isError() {
71
+ return this.variant === 'error';
72
+ },
73
+
74
+ isSuccess() {
75
+ return this.variant === 'success';
76
+ },
69
77
  },
70
78
 
71
79
  methods: {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="grid grid-cols-1 md:grid-cols-2 md:gap-4">
2
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-2">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <VTInput v-model="date" type="date" />
2
+ <VTInput v-model="date" type="date" @change="$emit('change')" />
3
3
  </template>
4
4
 
5
5
  <script>