@kiva/kv-components 3.34.0 → 3.35.0
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/CHANGELOG.md +11 -0
- package/package.json +2 -2
- package/vue/KvProgressBar.vue +23 -1
- package/vue/stories/KvProgressBar.stories.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.35.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.34.0...@kiva/kv-components@3.35.0) (2023-08-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* adding new option to the loan progress bar bg ([89afa0a](https://github.com/kiva/kv-ui-elements/commit/89afa0ad20cd64a794441d187da534006a3aeef2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.34.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.33.0...@kiva/kv-components@3.34.0) (2023-08-02)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.35.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"optional": true
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "4475c2f9110f86d6cc5f743dd2370181c605a4bb"
|
|
79
79
|
}
|
package/vue/KvProgressBar.vue
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="
|
|
4
4
|
tw-h-1 tw-w-full tw-rounded-full tw-overflow-hidden tw-relative
|
|
5
|
-
tw-bg-secondary
|
|
6
5
|
"
|
|
6
|
+
:class="backgroundVariant"
|
|
7
7
|
role="progressbar"
|
|
8
8
|
:aria-label="ariaLabel"
|
|
9
9
|
:aria-valuemin="min"
|
|
@@ -77,6 +77,17 @@ export default {
|
|
|
77
77
|
return ['primary', 'ghost', 'danger', 'caution'].includes(value);
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
|
+
/**
|
|
81
|
+
* Appearance of the progress bar background
|
|
82
|
+
* `secondary (default), tertiary
|
|
83
|
+
* */
|
|
84
|
+
bgVariant: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: 'secondary',
|
|
87
|
+
validator(value) {
|
|
88
|
+
return ['secondary', 'tertiary'].includes(value);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
80
91
|
},
|
|
81
92
|
setup(props) {
|
|
82
93
|
const {
|
|
@@ -84,6 +95,7 @@ export default {
|
|
|
84
95
|
max,
|
|
85
96
|
value,
|
|
86
97
|
variant,
|
|
98
|
+
bgVariant,
|
|
87
99
|
} = toRefs(props);
|
|
88
100
|
const loaded = ref(false);
|
|
89
101
|
|
|
@@ -107,6 +119,15 @@ export default {
|
|
|
107
119
|
}
|
|
108
120
|
});
|
|
109
121
|
|
|
122
|
+
const backgroundVariant = computed(() => {
|
|
123
|
+
switch (bgVariant.value) {
|
|
124
|
+
case 'tertiary':
|
|
125
|
+
return 'tw-bg-tertiary';
|
|
126
|
+
default:
|
|
127
|
+
return 'tw-bg-secondary';
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
110
131
|
const animateProgressBar = () => {
|
|
111
132
|
loaded.value = true;
|
|
112
133
|
};
|
|
@@ -121,6 +142,7 @@ export default {
|
|
|
121
142
|
percent,
|
|
122
143
|
animateProgressBar,
|
|
123
144
|
variantClass,
|
|
145
|
+
backgroundVariant,
|
|
124
146
|
};
|
|
125
147
|
},
|
|
126
148
|
};
|
|
@@ -9,6 +9,7 @@ export default {
|
|
|
9
9
|
value: 50,
|
|
10
10
|
ariaLabel: 'Amount the loan has fundraised',
|
|
11
11
|
variant: 'primary',
|
|
12
|
+
bgVariant: 'secondary',
|
|
12
13
|
},
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -22,6 +23,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
22
23
|
:max="max"
|
|
23
24
|
:value="value"
|
|
24
25
|
:variant="variant"
|
|
26
|
+
:bg-variant="bgVariant"
|
|
25
27
|
|
|
26
28
|
></kv-progress-bar>`,
|
|
27
29
|
});
|
|
@@ -44,3 +46,8 @@ export const VariantGhost = Template.bind({});
|
|
|
44
46
|
VariantGhost.args = {
|
|
45
47
|
variant: 'ghost',
|
|
46
48
|
};
|
|
49
|
+
|
|
50
|
+
export const BgVariantTertiary = Template.bind({});
|
|
51
|
+
BgVariantTertiary.args = {
|
|
52
|
+
bgVariant: 'tertiary',
|
|
53
|
+
};
|