@kiva/kv-components 3.61.0 → 3.62.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
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.62.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.62.0...@kiva/kv-components@3.62.1) (2024-03-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * remove centering on voting card category ([fc0d036](https://github.com/kiva/kv-ui-elements/commit/fc0d03604bcdf6157b716a93d3e62d758e765aad))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.62.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.61.0...@kiva/kv-components@3.62.0) (2024-03-05)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * add comment regarding inject ([7a98c3b](https://github.com/kiva/kv-ui-elements/commit/7a98c3b017c9472c14ef0a26fdad53864aaf3ada))
23
+ * add provide to commenting stories ([01c1e53](https://github.com/kiva/kv-ui-elements/commit/01c1e5305cda4d2885afa1c4a4784630e7a6047d))
24
+
25
+
26
+ ### Features
27
+
28
+ * update reply to match other commenting buttons ([6ad68a3](https://github.com/kiva/kv-ui-elements/commit/6ad68a3ddcce48089d12bd473f8fa3bfd7c30b5f))
29
+
30
+
31
+
32
+
33
+
6
34
  # [3.61.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.60.0...@kiva/kv-components@3.61.0) (2024-03-04)
7
35
 
8
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.61.0",
3
+ "version": "3.62.1",
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": "5a1b6f22bba95529946eaf398992273b8e117d6b"
78
+ "gitHead": "987be7ae143b387454a2f9d931851bc2652c1dd2"
79
79
  }
@@ -191,6 +191,7 @@ export default {
191
191
 
192
192
  const numberOfReplies = computed(() => comment?.value?.children_counts?.comment ?? 0);
193
193
 
194
+ // The fetchLenderInfo method must be provided in the parent component
194
195
  const fetchLenderInfo = inject('fetchLenderInfo');
195
196
 
196
197
  onMounted(async () => {
@@ -1,8 +1,8 @@
1
1
  <!-- eslint-disable max-len -->
2
2
  <template>
3
- <button
3
+ <kv-button
4
+ variant="ghost"
4
5
  aria-label="Reply"
5
- class="tw-font-medium tw-flex tw-items-center tw-gap-x-0.5"
6
6
  @click="$emit('click')"
7
7
  >
8
8
  <svg
@@ -24,14 +24,19 @@
24
24
  {{ numberOfReplies }}
25
25
  </span>
26
26
  <span>
27
- Reply
27
+ reply
28
28
  </span>
29
- </button>
29
+ </kv-button>
30
30
  </template>
31
31
 
32
32
  <script>
33
+ import KvButton from './KvButton.vue';
34
+
33
35
  export default {
34
36
  name: 'KvCommentsReplyButton',
37
+ components: {
38
+ KvButton,
39
+ },
35
40
  props: {
36
41
  /**
37
42
  * The number of replies to the comment.
@@ -46,3 +51,17 @@ export default {
46
51
  ],
47
52
  };
48
53
  </script>
54
+
55
+ <style lang="postcss" scoped>
56
+ >>> span {
57
+ @apply tw-min-h-0;
58
+ }
59
+
60
+ >>> span > span {
61
+ @apply tw-py-0 tw-px-0.5 tw-flex tw-items-center;
62
+ }
63
+
64
+ >>> svg {
65
+ @apply tw-mx-0.5;
66
+ }
67
+ </style>
@@ -8,7 +8,6 @@
8
8
  tw-p-1
9
9
  tw-flex
10
10
  tw-flex-col
11
- tw-items-center
12
11
  tw-justify-between
13
12
  tw-max-w-300"
14
13
  >
@@ -6,11 +6,20 @@ export default {
6
6
  component: KvCommentsContainer,
7
7
  };
8
8
 
9
+ const TEST_USER_NAME = 'Jess';
10
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
11
+
9
12
  const story = (args) => {
10
13
  const template = (templateArgs, { argTypes }) => ({
11
14
  props: Object.keys(argTypes),
12
15
  components: { KvCommentsContainer },
13
16
  setup() { return { args: templateArgs }; },
17
+ provide: {
18
+ fetchLenderInfo: () => Promise.resolve({
19
+ name: TEST_USER_NAME,
20
+ image: { url: TEST_USER_IMAGE },
21
+ }),
22
+ },
14
23
  template: `
15
24
  <div style="max-width: 800px;">
16
25
  <KvCommentsContainer v-bind="args" />
@@ -28,8 +37,8 @@ export const Default = story({ comments });
28
37
  export const UserData = story(
29
38
  {
30
39
  comments,
31
- userDisplayName: 'Jess',
32
- userImageUrl: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg',
40
+ userDisplayName: TEST_USER_NAME,
41
+ userImageUrl: TEST_USER_IMAGE,
33
42
  userPublicId: 'Jess1234',
34
43
  },
35
44
  );
@@ -5,12 +5,20 @@ export default {
5
5
  title: 'KvCommentsList',
6
6
  component: KvCommentsList,
7
7
  };
8
+ const TEST_USER_NAME = 'Jess';
9
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
8
10
 
9
11
  const story = (args) => {
10
12
  const template = (templateArgs, { argTypes }) => ({
11
13
  props: Object.keys(argTypes),
12
14
  components: { KvCommentsList },
13
15
  setup() { return { args: templateArgs }; },
16
+ provide: {
17
+ fetchLenderInfo: () => Promise.resolve({
18
+ name: TEST_USER_NAME,
19
+ image: { url: TEST_USER_IMAGE },
20
+ }),
21
+ },
14
22
  template: `
15
23
  <KvCommentsList v-bind="args" />
16
24
  `,
@@ -26,8 +34,8 @@ export const Default = story({ comments });
26
34
  export const UserData = story(
27
35
  {
28
36
  comments,
29
- userDisplayName: 'Jess',
30
- userImageUrl: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg',
37
+ userDisplayName: TEST_USER_NAME,
38
+ userImageUrl: TEST_USER_IMAGE,
31
39
  userPublicId: 'Jess1234',
32
40
  },
33
41
  );
@@ -6,11 +6,20 @@ export default {
6
6
  component: KvCommentsListItem,
7
7
  };
8
8
 
9
+ const TEST_USER_NAME = 'Jess';
10
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
11
+
9
12
  const story = (args) => {
10
13
  const template = (templateArgs, { argTypes }) => ({
11
14
  props: Object.keys(argTypes),
12
15
  components: { KvCommentsListItem },
13
16
  setup() { return { args: templateArgs }; },
17
+ provide: {
18
+ fetchLenderInfo: () => Promise.resolve({
19
+ name: TEST_USER_NAME,
20
+ image: { url: TEST_USER_IMAGE },
21
+ }),
22
+ },
14
23
  template: `
15
24
  <KvCommentsListItem v-bind="args" />
16
25
  `,
@@ -29,8 +38,8 @@ export const ChildComments = story({ comment: childComments });
29
38
  export const UserData = story(
30
39
  {
31
40
  comment: childComments,
32
- userDisplayName: 'Jess',
33
- userImageUrl: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg',
41
+ userDisplayName: TEST_USER_NAME,
42
+ userImageUrl: TEST_USER_IMAGE,
34
43
  userPublicId: 'Jess1234',
35
44
  },
36
45
  );