@veritree/ui 0.76.1-7 → 0.76.1-9

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.76.1-7",
3
+ "version": "0.76.1-9",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -7,7 +7,7 @@
7
7
  : '-mx-4 flex items-center justify-between gap-x-3 p-4 md:-mx-6 md:px-6 md:py-5',
8
8
  ]"
9
9
  >
10
- <slot></slot>
10
+ <slot :hide="hide"></slot>
11
11
  </component>
12
12
  </template>
13
13
 
@@ -15,6 +15,8 @@
15
15
  export default {
16
16
  name: 'VTDialogFooter',
17
17
 
18
+ inject: ['apiDialog'],
19
+
18
20
  props: {
19
21
  headless: {
20
22
  type: Boolean,
@@ -25,5 +27,11 @@ export default {
25
27
  default: 'footer',
26
28
  },
27
29
  },
30
+
31
+ methods: {
32
+ hide() {
33
+ this.apiDialog().hide();
34
+ },
35
+ },
28
36
  };
29
37
  </script>
@@ -3,7 +3,7 @@
3
3
  :class="[
4
4
  headless
5
5
  ? 'progress-bar'
6
- : 'relative min-h-[12px] w-full overflow-hidden rounded bg-gray-200',
6
+ : 'relative min-h-[12px] w-full flex items-stretch overflow-hidden rounded bg-gray-200',
7
7
  ]"
8
8
  role="progressbar"
9
9
  aria-valuemin="0"
@@ -11,14 +11,13 @@
11
11
  :aria-valuenow="value"
12
12
  :aria-label="label"
13
13
  >
14
- <div
15
- :class="[
16
- headless
17
- ? 'progress-bar__indicator'
18
- : 'bg-secondary-300 absolute left-0 h-full transition-all duration-500',
19
- ]"
20
- :style="{ width: `${percentageComputed}%` }"
21
- ></div>
14
+ <slot>
15
+ <VTProgressBarIndicator
16
+ :headless="headless"
17
+ :percentage="percentageComputed"
18
+ :variant="variant"
19
+ />
20
+ </slot>
22
21
  </div>
23
22
  </template>
24
23
 
@@ -49,6 +48,10 @@ export default {
49
48
  type: String,
50
49
  default: 'rounded-full',
51
50
  },
51
+ variant: {
52
+ type: String,
53
+ default: 'default', // default, alert, warning
54
+ },
52
55
  },
53
56
 
54
57
  computed: {
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <div
3
+ :class="[
4
+ headless
5
+ ? 'progress-bar__indicator'
6
+ : `${backgroundComputed} min-h-min transition-all duration-500`,
7
+ ]"
8
+ :style="{ width: `${percentage}%` }"
9
+ ></div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'VTProgressBarIndicator',
15
+
16
+ props: {
17
+ headless: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ percentage: {
22
+ type: [String, Number],
23
+ default: null,
24
+ },
25
+ variant: {
26
+ type: String,
27
+ default: 'default', // default, alert, warning
28
+ },
29
+ },
30
+
31
+ computed: {
32
+ backgroundComputed() {
33
+ if (this.variant === 'default') {
34
+ return 'bg-secondary-300';
35
+ }
36
+
37
+ if (this.variant === 'error') {
38
+ return 'bg-error-500';
39
+ }
40
+
41
+ if (this.variant === 'warning') {
42
+ return 'bg-warning-500';
43
+ }
44
+ },
45
+ },
46
+ };
47
+ </script>