@kiva/kv-components 3.0.6 → 3.3.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
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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.3.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.2.0...@kiva/kv-components@3.3.0) (2022-08-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* added class to placeholder story to show support ([ed4e6c9](https://github.com/kiva/kv-ui-elements/commit/ed4e6c984b6a52b238862004266ada10c9cb0c95))
|
|
12
|
+
* added non-static class and style to placeholder as example ([4fd5e98](https://github.com/kiva/kv-ui-elements/commit/4fd5e98d41c900f69b56614980c688ebd43f6176))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* placeholder component ([b29facc](https://github.com/kiva/kv-ui-elements/commit/b29facc8c8fcdb9761cc9e58e2530ea1e3b4a2f8))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# [3.2.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.1.0...@kiva/kv-components@3.2.0) (2022-08-04)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* event name in emits ([06813fd](https://github.com/kiva/kv-ui-elements/commit/06813fda75cf9a169b9e5afd33549b9eb77b33a1))
|
|
29
|
+
* remove unused event ([345cd90](https://github.com/kiva/kv-ui-elements/commit/345cd903ab5d6725de34d2085a2c8e65cba6933f))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* add payload to track closing events ([275c81d](https://github.com/kiva/kv-ui-elements/commit/275c81da659fa586500b9d21607ba5c69c4e5839))
|
|
35
|
+
* add tailored emit event for MARS-199 experiment in kvLightbox ([8499206](https://github.com/kiva/kv-ui-elements/commit/8499206381c9e5bf1ac0ae4ab913b91b07ba906e))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [3.1.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.0.6...@kiva/kv-components@3.1.0) (2022-07-19)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* add new caution variant to buttons ([#191](https://github.com/kiva/kv-ui-elements/issues/191)) ([14f3eb6](https://github.com/kiva/kv-ui-elements/commit/14f3eb6548bfc925cc2cb656966829f127a8864e))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [3.0.6](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.0.5...@kiva/kv-components@3.0.6) (2022-06-23)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @kiva/kv-components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"test": "npm run lint"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kiva/kv-tokens": "^2.
|
|
53
|
+
"@kiva/kv-tokens": "^2.2.0",
|
|
54
54
|
"@mdi/js": "^5.9.55",
|
|
55
55
|
"@vueuse/integrations": "^7.6.0",
|
|
56
56
|
"aria-hidden": "^1.1.3",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"optional": true
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "a2d53f16ab9b5f1eeb174d372a7ac50bc9c9f691"
|
|
72
72
|
}
|
package/vue/KvButton.vue
CHANGED
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
type: String,
|
|
85
85
|
default: 'primary',
|
|
86
86
|
validator(value) {
|
|
87
|
-
return ['primary', 'secondary', 'link', 'ghost', 'danger'].includes(value);
|
|
87
|
+
return ['primary', 'secondary', 'link', 'ghost', 'danger', 'caution'].includes(value);
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
/**
|
|
@@ -114,6 +114,7 @@ export default {
|
|
|
114
114
|
const loadingColor = computed(() => {
|
|
115
115
|
switch (variant.value) {
|
|
116
116
|
case 'secondary':
|
|
117
|
+
case 'caution':
|
|
117
118
|
return 'black';
|
|
118
119
|
case 'ghost':
|
|
119
120
|
return 'brand';
|
|
@@ -166,6 +167,14 @@ export default {
|
|
|
166
167
|
classes = `${classes} tw-bg-primary hover:tw-bg-secondary`;
|
|
167
168
|
}
|
|
168
169
|
break;
|
|
170
|
+
case 'caution':
|
|
171
|
+
classes = 'tw-text-primary tw-border-transparent';
|
|
172
|
+
if (state.value === 'active') {
|
|
173
|
+
classes = `${classes} tw-bg-caution-highlight`;
|
|
174
|
+
} else {
|
|
175
|
+
classes = `${classes} tw-bg-caution hover:tw-bg-caution-highlight`;
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
169
178
|
}
|
|
170
179
|
return classes;
|
|
171
180
|
});
|
package/vue/KvLightbox.vue
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
tw-w-6 tw-h-6 tw--m-2
|
|
80
80
|
hover:tw-text-action-highlight
|
|
81
81
|
"
|
|
82
|
-
@click.stop="hide"
|
|
82
|
+
@click.stop="hide('close-x')"
|
|
83
83
|
>
|
|
84
84
|
<kv-material-icon
|
|
85
85
|
class="tw-w-3 tw-h-3"
|
|
@@ -233,7 +233,7 @@ export default {
|
|
|
233
233
|
return 'dialog';
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
const hide = () => {
|
|
236
|
+
const hide = (closedBy = '') => {
|
|
237
237
|
// scroll any content inside the lightbox back to top
|
|
238
238
|
if (kvLightbox.value && kvLightboxBody.value) {
|
|
239
239
|
deactivateFocusTrap();
|
|
@@ -252,7 +252,7 @@ export default {
|
|
|
252
252
|
* @event lightbox-closed
|
|
253
253
|
* @type {Event}
|
|
254
254
|
*/
|
|
255
|
-
emit('lightbox-closed');
|
|
255
|
+
emit('lightbox-closed', { type: closedBy });
|
|
256
256
|
};
|
|
257
257
|
|
|
258
258
|
onKeyUp = (e) => {
|
|
@@ -263,7 +263,7 @@ export default {
|
|
|
263
263
|
|
|
264
264
|
const onScreenClick = () => {
|
|
265
265
|
if (!preventClose.value) {
|
|
266
|
-
hide();
|
|
266
|
+
hide('background-click');
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="
|
|
4
|
+
loading-placeholder
|
|
5
|
+
tw-w-full tw-h-full
|
|
6
|
+
tw-relative
|
|
7
|
+
tw-overflow-hidden
|
|
8
|
+
tw-bg-tertiary
|
|
9
|
+
tw-rounded-sm
|
|
10
|
+
"
|
|
11
|
+
>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style scoped>
|
|
16
|
+
.loading-placeholder::before {
|
|
17
|
+
content: '';
|
|
18
|
+
display: block;
|
|
19
|
+
position: absolute;
|
|
20
|
+
height: 100%;
|
|
21
|
+
width: 100%;
|
|
22
|
+
top: 0;
|
|
23
|
+
transform: translateX(100%);
|
|
24
|
+
background:
|
|
25
|
+
linear-gradient(to right, transparent 0%, rgb(var(--bg-secondary)) 50%, transparent 100%);
|
|
26
|
+
animation: loading-placeholder 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes loading-placeholder {
|
|
30
|
+
from {
|
|
31
|
+
transform: translateX(-100%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
to {
|
|
35
|
+
transform: translateX(100%);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
variant: {
|
|
8
8
|
control: {
|
|
9
9
|
type: 'select',
|
|
10
|
-
options: ['primary', 'secondary', 'link', 'danger', 'ghost'],
|
|
10
|
+
options: ['primary', 'secondary', 'link', 'danger', 'ghost', 'caution'],
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
state: {
|
|
@@ -44,7 +44,7 @@ const VariantTemplate = (args, { argTypes }) => ({
|
|
|
44
44
|
template: `
|
|
45
45
|
<ul>
|
|
46
46
|
<li
|
|
47
|
-
v-for="variant in ['primary', 'secondary', 'link', 'danger', 'ghost']"
|
|
47
|
+
v-for="variant in ['primary', 'secondary', 'link', 'danger', 'ghost', 'caution']"
|
|
48
48
|
:key="variant"
|
|
49
49
|
class="tw-mb-2"
|
|
50
50
|
>
|
|
@@ -89,6 +89,11 @@ VariantGhost.args = {
|
|
|
89
89
|
variant: 'ghost',
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
+
export const VariantCaution = Template.bind({});
|
|
93
|
+
VariantCaution.args = {
|
|
94
|
+
variant: 'caution',
|
|
95
|
+
};
|
|
96
|
+
|
|
92
97
|
// States
|
|
93
98
|
export const StateLoading = VariantTemplate.bind({});
|
|
94
99
|
StateLoading.args = {
|
|
@@ -117,7 +122,7 @@ export const FullWidth = (args, { argTypes }) => ({
|
|
|
117
122
|
template: `
|
|
118
123
|
<ul>
|
|
119
124
|
<li
|
|
120
|
-
v-for="variant in ['primary', 'secondary', 'link', 'danger', 'ghost']"
|
|
125
|
+
v-for="variant in ['primary', 'secondary', 'link', 'danger', 'ghost', 'caution']"
|
|
121
126
|
:key="variant"
|
|
122
127
|
class="tw-mb-2"
|
|
123
128
|
>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import KvLoadingPlaceholder from '../KvLoadingPlaceholder.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'KvLoadingPlaceholder',
|
|
5
|
+
component: KvLoadingPlaceholder,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const DefaultTemplate = () => ({
|
|
9
|
+
components: { KvLoadingPlaceholder },
|
|
10
|
+
template: `
|
|
11
|
+
<div style="padding: 20px;">
|
|
12
|
+
<kv-loading-placeholder class="tw-py-1" :class="{ 'tw-px-1': true }" style="height: 50px;" :style="{ width: '400px' }" />
|
|
13
|
+
</div>
|
|
14
|
+
`,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const Default = DefaultTemplate.bind({});
|