@kiva/kv-components 3.0.5 → 3.2.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,43 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * event name in emits ([06813fd](https://github.com/kiva/kv-ui-elements/commit/06813fda75cf9a169b9e5afd33549b9eb77b33a1))
12
+ * remove unused event ([345cd90](https://github.com/kiva/kv-ui-elements/commit/345cd903ab5d6725de34d2085a2c8e65cba6933f))
13
+
14
+
15
+ ### Features
16
+
17
+ * add payload to track closing events ([275c81d](https://github.com/kiva/kv-ui-elements/commit/275c81da659fa586500b9d21607ba5c69c4e5839))
18
+ * add tailored emit event for MARS-199 experiment in kvLightbox ([8499206](https://github.com/kiva/kv-ui-elements/commit/8499206381c9e5bf1ac0ae4ab913b91b07ba906e))
19
+
20
+
21
+
22
+
23
+
24
+ # [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)
25
+
26
+
27
+ ### Features
28
+
29
+ * 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))
30
+
31
+
32
+
33
+
34
+
35
+ ## [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)
36
+
37
+ **Note:** Version bump only for package @kiva/kv-components
38
+
39
+
40
+
41
+
42
+
6
43
  ## [3.0.5](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.0.4...@kiva/kv-components@3.0.5) (2022-05-27)
7
44
 
8
45
  **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.5",
3
+ "version": "3.2.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.0.1",
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": "755f33ac5b3f1dc771a42881da3a449feff69df2"
71
+ "gitHead": "d5530b779a1ae57e21fb31a23d0098deec908502"
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
  });
@@ -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
 
@@ -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
  >