@kiva/kv-components 3.8.0 → 3.9.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,33 @@
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.9.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.9.0...@kiva/kv-components@3.9.1) (2022-10-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * turn off pre-wrap whitespace for KvExpandableQuestion and prose for the title of the component ([753abef](https://github.com/kiva/kv-ui-elements/commit/753abef7b01d2d8928ac432ed87675a95d715688))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.9.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.8.0...@kiva/kv-components@3.9.0) (2022-10-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * removed extra space on line 23 ([c8a3226](https://github.com/kiva/kv-ui-elements/commit/c8a32264ede0b628f578b98c4ac8256a539fd28d))
23
+
24
+
25
+ ### Features
26
+
27
+ * fixed bugs in KvExpandableQuestion (arrow functionality and slot content rendering) ([4ab9f47](https://github.com/kiva/kv-ui-elements/commit/4ab9f477200d53b89ce6a4ae0328215268dd4019))
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.8.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.7.1...@kiva/kv-components@3.8.0) (2022-10-04)
7
34
 
8
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.8.0",
3
+ "version": "3.9.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -69,5 +69,5 @@
69
69
  "optional": true
70
70
  }
71
71
  },
72
- "gitHead": "ea1adfefc0d8e3169fc80b7745a01a6cd1b07c58"
72
+ "gitHead": "edebcbb693d604ef870d83e4142a3647e68e3f4a"
73
73
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div>
2
+ <div class="tw-whitespace-normal">
3
3
  <button
4
- class="tw-w-full tw-py-2 tw-flex tw-justify-between"
4
+ class="tw-w-full tw-py-2 tw-flex tw-justify-between tw-not-prose"
5
5
  @click="toggleFAQ"
6
6
  >
7
7
  <h3 class="tw-text-subhead tw-text-left">
@@ -10,15 +10,20 @@
10
10
  <kv-material-icon
11
11
  class="tw-w-4 tw-h-4"
12
12
  :icon="open ? mdiChevronUp : mdiChevronDown"
13
- @click="open = !open"
13
+ @click="toggleFAQ"
14
14
  />
15
15
  </button>
16
16
  <kv-expandable easing="ease-in-out">
17
17
  <div
18
18
  v-show="open"
19
19
  class="tw-prose tw-pb-4 tw-pt-2"
20
- v-html="content"
21
20
  >
21
+ <slot></slot>
22
+ <div
23
+ v-if="content !== ''"
24
+ v-html="content"
25
+ >
26
+ </div>
22
27
  </div>
23
28
  </kv-expandable>
24
29
  </div>
@@ -22,17 +22,17 @@ export const Default = DefaultTemplate.bind({});
22
22
 
23
23
  const expandableQuestions = [
24
24
  {
25
- title: 'expandable question title one',
25
+ title: 'expandable question one',
26
26
  content: '<p> Hello, KvAccordion Contents! </p>',
27
27
  id: 'expandable-question-test-1',
28
28
  },
29
29
  {
30
- title: 'expandable question title two',
30
+ title: 'expandable question two',
31
31
  content: '<p> Hello, KvAccordion Contents! </p>',
32
32
  id: 'expandable-question-test-2',
33
33
  },
34
34
  {
35
- title: 'expandable question title three',
35
+ title: 'expandable question three',
36
36
  content: '<p> Hello, KvAccordion Contents! </p>',
37
37
  id: 'expandable-question-test-3',
38
38
  },
@@ -68,3 +68,62 @@ const GroupTemplate = () => ({
68
68
  });
69
69
 
70
70
  export const ExpandableSet = GroupTemplate.bind({});
71
+
72
+ const SlotContentTemplate = () => ({
73
+ components: { KvExpandableQuestion },
74
+ template: `
75
+ <div style="padding: 20px;">
76
+ <kv-expandable-question
77
+ id="expandable-question-test"
78
+ title="expandable question with slot content"
79
+ >
80
+ <p> A created slot! </p>
81
+ </kv-expandable-question>
82
+ </div>
83
+ `,
84
+ });
85
+
86
+ export const SlotContent = SlotContentTemplate.bind({});
87
+
88
+ const ProseWrappedTemplate = () => ({
89
+ components: { KvExpandableQuestion },
90
+ template: `
91
+ <div class="rich-text-content tw-prose tw-whitespace-pre-wrap tw-mb-2 md:tw-mb-3" data-testid="rich-text-container">
92
+ <h4><!--[-->Our commitment<!--]--></h4>
93
+ <h2><!--[--><!--[-->100% of your loan goes toward <!--]--><!--[--><b><!--[-->supporting borrowers.<!--]--></b><!--]--><!--]--></h2>
94
+ <section class="tw-relative tw-w-full">
95
+ <div class="tw-pt-4 tw-pb-4 lg:tw-pt-8 lg:tw-pb-8 tw-relative tw-w-full tw-overflow-hidden tw-z-1 tw-top-0">
96
+ <div>
97
+ <div style="">
98
+ <div class="tw-divide-y tw-whitespace-normal">
99
+ <kv-expandable-question
100
+ id="expandable-question-test"
101
+ title="Why Lending?"
102
+ >
103
+ <p>If you needed to buy a delivery truck for your business, you probably wouldn’t ask for donations; you’d apply for a loan.</p><p>But what about the billion people without access to traditional finance? That's where you—and Kiva—come in. Kiva loans give people the power and resources to build the life they choose. By crowdfunding smaller amounts—called microloans—we can help more borrowers get funded.</p><p>With Kiva, you can use the same dollars again and again, helping a new borrower each time your loan is repaid. Your same $25 could help someone open a salon, support a child’s education, invest in community solar panels, and so on!</p>
104
+ </kv-expandable-question>
105
+ <kv-expandable-question
106
+ id="expandable-question-test"
107
+ title="How does Kiva make money ?"
108
+ >
109
+ <p>We cover most of our operating costs through voluntary donations made by Kiva lenders. As a 501(c)3 U.S. nonprofit, the remainder of our costs are covered through grants and donations from foundations and supporters. Additionally, select lending partners contribute small platform fees as we continue building innovative technologies that help create a more financially inclusive world.</p>
110
+ <p>Kiva never takes a fee from lenders. 100% of funds lent on Kiva go to funding loans.</p>
111
+ </kv-expandable-question>
112
+ <kv-expandable-question
113
+ id="expandable-question-test"
114
+ title="Do Kiva borrowers pay any interest on their loans?"
115
+ >
116
+ <p>Kiva partners with microfinance institutions, nonprofits, and other organizations to disburse loans in the communities we serve.</p>
117
+ <p>Most borrowers do pay interest to these local lending partners to help cover their operation costs. We verify that these rates are appropriate for the region and we only choose partners who have fair, non-predatory lending practices and prioritize social good.</p>
118
+ <p>Some borrowers funded through Kiva do receive 0% interest loans, including most direct loans, which are loans not made through a local lending partner.</p>
119
+ </kv-expandable-question>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </section>
125
+ </div>
126
+ `,
127
+ });
128
+
129
+ export const ProseWrappedQuestion = ProseWrappedTemplate.bind({});