@kiva/kv-components 3.106.0 → 3.107.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.
Files changed (179) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/CHANGELOG.md +22 -0
  3. package/dist/components/.storybook/main.js +85 -0
  4. package/dist/components/.storybook/package.json +3 -0
  5. package/dist/components/.storybook/preview.js +61 -0
  6. package/dist/components/.storybook/tailwind.css +5 -0
  7. package/dist/components/KvAccordionItem.vue +130 -0
  8. package/dist/components/KvActivityRow.vue +33 -0
  9. package/dist/components/KvBorrowerImage.vue +179 -0
  10. package/dist/components/KvButton.vue +287 -0
  11. package/dist/components/KvCarousel.vue +297 -0
  12. package/dist/components/KvCartModal.vue +365 -0
  13. package/dist/components/KvCheckbox.vue +203 -0
  14. package/dist/components/KvChip.vue +54 -0
  15. package/dist/components/KvClassicLoanCard.vue +527 -0
  16. package/dist/components/KvCommentsAdd.vue +135 -0
  17. package/dist/components/KvCommentsContainer.vue +84 -0
  18. package/dist/components/KvCommentsHeartButton.vue +70 -0
  19. package/dist/components/KvCommentsList.vue +68 -0
  20. package/dist/components/KvCommentsListItem.vue +241 -0
  21. package/dist/components/KvCommentsReplyButton.vue +52 -0
  22. package/dist/components/KvContentfulImg.vue +273 -0
  23. package/dist/components/KvCountdownTimer.vue +59 -0
  24. package/dist/components/KvExpandable.vue +84 -0
  25. package/dist/components/KvExpandableQuestion.vue +120 -0
  26. package/dist/components/KvFlag.vue +120 -0
  27. package/dist/components/KvGrid.vue +28 -0
  28. package/dist/components/KvImpactDashboardHeader.vue +40 -0
  29. package/dist/components/KvInlineActivityCard.vue +55 -0
  30. package/dist/components/KvInlineActivityFeed.vue +38 -0
  31. package/dist/components/KvIntroductionLoanCard.vue +446 -0
  32. package/dist/components/KvLendAmountButton.vue +65 -0
  33. package/dist/components/KvLendCta.vue +451 -0
  34. package/dist/components/KvLightbox.vue +334 -0
  35. package/dist/components/KvLineGraph.vue +128 -0
  36. package/dist/components/KvLoadingPlaceholder.vue +38 -0
  37. package/dist/components/KvLoadingSpinner.vue +81 -0
  38. package/dist/components/KvLoanActivities.vue +268 -0
  39. package/dist/components/KvLoanBookmark.vue +39 -0
  40. package/dist/components/KvLoanCallouts.vue +53 -0
  41. package/dist/components/KvLoanProgressGroup.vue +76 -0
  42. package/dist/components/KvLoanTag.vue +88 -0
  43. package/dist/components/KvLoanTeamPick.vue +44 -0
  44. package/dist/components/KvLoanUse.vue +92 -0
  45. package/dist/components/KvMap.vue +599 -0
  46. package/dist/components/KvMaterialIcon.vue +47 -0
  47. package/dist/components/KvPageContainer.vue +15 -0
  48. package/dist/components/KvPagination.vue +198 -0
  49. package/dist/components/KvPieChart.vue +257 -0
  50. package/dist/components/KvPopper.vue +178 -0
  51. package/dist/components/KvProgressBar.vue +149 -0
  52. package/dist/components/KvRadio.vue +198 -0
  53. package/dist/components/KvSelect.vue +114 -0
  54. package/dist/components/KvSideSheet.vue +134 -0
  55. package/dist/components/KvSwitch.vue +143 -0
  56. package/dist/components/KvTab.vue +90 -0
  57. package/dist/components/KvTabPanel.vue +64 -0
  58. package/dist/components/KvTabs.vue +182 -0
  59. package/dist/components/KvTextInput.vue +247 -0
  60. package/dist/components/KvTextLink.vue +138 -0
  61. package/dist/components/KvThemeProvider.vue +122 -0
  62. package/dist/components/KvToast.vue +221 -0
  63. package/dist/components/KvTooltip.vue +168 -0
  64. package/dist/components/KvTreeMapChart.vue +229 -0
  65. package/dist/components/KvUserAvatar.vue +132 -0
  66. package/dist/components/KvVerticalCarousel.vue +156 -0
  67. package/dist/components/KvVotingCard.vue +160 -0
  68. package/dist/components/KvVotingCardV2.vue +154 -0
  69. package/dist/components/KvWideLoanCard.vue +432 -0
  70. package/dist/components/stories/Forms.stories.js +62 -0
  71. package/dist/components/stories/KvAccordionItem.stories.js +24 -0
  72. package/dist/components/stories/KvActivityRow.stories.js +25 -0
  73. package/dist/components/stories/KvBorrowerImage.stories.js +68 -0
  74. package/dist/components/stories/KvButton.stories.js +144 -0
  75. package/dist/components/stories/KvCarousel.stories.js +426 -0
  76. package/dist/components/stories/KvCartModal.stories.js +54 -0
  77. package/dist/components/stories/KvCheckbox.stories.js +163 -0
  78. package/dist/components/stories/KvChip.stories.js +43 -0
  79. package/dist/components/stories/KvClassicLoanCard.stories.js +480 -0
  80. package/dist/components/stories/KvCommentsAdd.stories.js +32 -0
  81. package/dist/components/stories/KvCommentsContainer.stories.js +42 -0
  82. package/dist/components/stories/KvCommentsHeartButton.stories.js +25 -0
  83. package/dist/components/stories/KvCommentsList.stories.js +39 -0
  84. package/dist/components/stories/KvCommentsListItem.stories.js +45 -0
  85. package/dist/components/stories/KvCommentsReplyButton.stories.js +21 -0
  86. package/dist/components/stories/KvContentfulImg.stories.js +196 -0
  87. package/dist/components/stories/KvCountdownTimer.stories.js +30 -0
  88. package/dist/components/stories/KvExpandableQuestion.stories.js +129 -0
  89. package/dist/components/stories/KvFlag.stories.js +36 -0
  90. package/dist/components/stories/KvGrid.stories.js +97 -0
  91. package/dist/components/stories/KvImpactDashboardHeader.stories.js +22 -0
  92. package/dist/components/stories/KvInlineActivityCard.stories.js +69 -0
  93. package/dist/components/stories/KvInlineActivityFeed.stories.js +76 -0
  94. package/dist/components/stories/KvIntroductionLoanCard.stories.js +208 -0
  95. package/dist/components/stories/KvLendAmountButton.stories.js +31 -0
  96. package/dist/components/stories/KvLendCta.stories.js +177 -0
  97. package/dist/components/stories/KvLightbox.stories.js +304 -0
  98. package/dist/components/stories/KvLineGraph.stories.js +52 -0
  99. package/dist/components/stories/KvLoadingPlaceholder.stories.js +17 -0
  100. package/dist/components/stories/KvLoadingSpinner.stories.js +52 -0
  101. package/dist/components/stories/KvLoanActivities.stories.js +104 -0
  102. package/dist/components/stories/KvLoanBookmark.stories.js +22 -0
  103. package/dist/components/stories/KvLoanCallouts.stories.js +22 -0
  104. package/dist/components/stories/KvLoanProgressGroup.stories.js +29 -0
  105. package/dist/components/stories/KvLoanTag.stories.js +61 -0
  106. package/dist/components/stories/KvLoanTeamPick.stories.js +20 -0
  107. package/dist/components/stories/KvLoanUse.stories.js +60 -0
  108. package/dist/components/stories/KvMap.stories.js +121 -0
  109. package/dist/components/stories/KvMaterialIcon.stories.js +201 -0
  110. package/dist/components/stories/KvPageContainer.stories.js +50 -0
  111. package/dist/components/stories/KvPagination.stories.js +70 -0
  112. package/dist/components/stories/KvPieChart.stories.js +47 -0
  113. package/dist/components/stories/KvProgressBar.stories.js +53 -0
  114. package/dist/components/stories/KvRadio.stories.js +140 -0
  115. package/dist/components/stories/KvSelect.stories.js +125 -0
  116. package/dist/components/stories/KvSideSheet.stories.js +50 -0
  117. package/dist/components/stories/KvSwitch.stories.js +66 -0
  118. package/dist/components/stories/KvTabs.stories.js +106 -0
  119. package/dist/components/stories/KvTextInput.stories.js +194 -0
  120. package/dist/components/stories/KvTextLink.stories.js +55 -0
  121. package/dist/components/stories/KvThemeProvider.stories.js +178 -0
  122. package/dist/components/stories/KvToast.stories.js +117 -0
  123. package/dist/components/stories/KvTooltip.stories.js +26 -0
  124. package/dist/components/stories/KvTreeMapChart.stories.js +42 -0
  125. package/dist/components/stories/KvUserAvatar.stories.js +47 -0
  126. package/dist/components/stories/KvVerticalCarousel.stories.js +168 -0
  127. package/dist/components/stories/KvVotingCard.stories.js +33 -0
  128. package/dist/components/stories/KvVotingCardV2.stories.js +89 -0
  129. package/dist/components/stories/KvWideLoanCard.stories.js +292 -0
  130. package/dist/components/stories/StyleguidePrimitives.stories.js +499 -0
  131. package/dist/components/stories/StyleguideProse.stories.js +215 -0
  132. package/dist/data/countries-borders.json +1 -0
  133. package/dist/data/ne_110m_admin_0_countries.json +1 -0
  134. package/dist/utils/Alea.cjs +87 -0
  135. package/dist/utils/Alea.js +9 -0
  136. package/dist/utils/attrs.cjs +50 -0
  137. package/dist/utils/attrs.js +7 -0
  138. package/dist/utils/carousels.cjs +184 -0
  139. package/dist/utils/carousels.js +8 -0
  140. package/dist/utils/chunk-3HK4G4NT.js +27 -0
  141. package/dist/utils/chunk-55HF2ORX.js +201 -0
  142. package/dist/utils/chunk-AY3PR5S4.js +54 -0
  143. package/dist/utils/chunk-AZPWOFD5.js +148 -0
  144. package/dist/utils/chunk-B5J5WLAH.js +18 -0
  145. package/dist/utils/chunk-GPSH6OPA.js +64 -0
  146. package/dist/utils/chunk-HIY5IW65.js +28 -0
  147. package/dist/utils/chunk-HV3AUBFT.js +15 -0
  148. package/dist/utils/chunk-MSMZIN54.js +110 -0
  149. package/dist/utils/chunk-OXJCCNNW.js +30 -0
  150. package/dist/utils/chunk-S3MABILA.js +22 -0
  151. package/dist/utils/chunk-VIGEMAKO.js +249 -0
  152. package/dist/utils/chunk-YCNMJ4YV.js +37 -0
  153. package/dist/utils/chunk-YFEC5ODJ.js +129 -0
  154. package/dist/utils/expander.cjs +78 -0
  155. package/dist/utils/expander.js +9 -0
  156. package/dist/utils/imageUtils.cjs +54 -0
  157. package/dist/utils/imageUtils.js +9 -0
  158. package/dist/utils/index.cjs +1118 -0
  159. package/dist/utils/index.js +166 -0
  160. package/dist/utils/loanCard.cjs +222 -0
  161. package/dist/utils/loanCard.js +9 -0
  162. package/dist/utils/loanUtils.cjs +170 -0
  163. package/dist/utils/loanUtils.js +23 -0
  164. package/dist/utils/mapUtils.cjs +276 -0
  165. package/dist/utils/mapUtils.js +15 -0
  166. package/dist/utils/printing.cjs +42 -0
  167. package/dist/utils/printing.js +9 -0
  168. package/dist/utils/scrollLock.cjs +54 -0
  169. package/dist/utils/scrollLock.js +13 -0
  170. package/dist/utils/throttle.cjs +38 -0
  171. package/dist/utils/throttle.js +7 -0
  172. package/dist/utils/touchEvents.cjs +47 -0
  173. package/dist/utils/touchEvents.js +11 -0
  174. package/dist/utils/treemap.cjs +133 -0
  175. package/dist/utils/treemap.js +7 -0
  176. package/package.json +12 -4
  177. package/utils/index.js +14 -0
  178. package/vue/KvVerticalCarousel.vue +1 -1
  179. package/index.js +0 -3
@@ -0,0 +1,42 @@
1
+ import KvCommentsContainer from '../KvCommentsContainer.vue';
2
+ import { publicLenderId, comments } from '../../tests/fixtures/mockCommentsData';
3
+
4
+ export default {
5
+ title: 'KvCommentsContainer',
6
+ component: KvCommentsContainer,
7
+ };
8
+
9
+ const TEST_USER_NAME = 'Jess';
10
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
11
+
12
+ const story = (args) => {
13
+ const template = (templateArgs, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
15
+ components: { KvCommentsContainer },
16
+ setup() { return { args: templateArgs }; },
17
+ provide: {
18
+ fetchLenderInfo: () => Promise.resolve({
19
+ name: TEST_USER_NAME,
20
+ image: { url: TEST_USER_IMAGE },
21
+ }),
22
+ },
23
+ template: `
24
+ <div style="max-width: 800px;">
25
+ <KvCommentsContainer v-bind="args" />
26
+ </div>
27
+ `,
28
+ });
29
+ template.args = args;
30
+ return template;
31
+ };
32
+
33
+ export const Default = story({ comments });
34
+
35
+ export const UserData = story(
36
+ {
37
+ comments,
38
+ userDisplayName: TEST_USER_NAME,
39
+ userImageUrl: TEST_USER_IMAGE,
40
+ userPublicId: publicLenderId,
41
+ },
42
+ );
@@ -0,0 +1,25 @@
1
+ import KvCommentsHeartButton from '../KvCommentsHeartButton.vue';
2
+
3
+ export default {
4
+ title: 'KvCommentsHeartButton',
5
+ component: KvCommentsHeartButton,
6
+ };
7
+
8
+ const story = (args) => {
9
+ const template = (templateArgs, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: { KvCommentsHeartButton },
12
+ setup() { return { args: templateArgs }; },
13
+ template: `
14
+ <KvCommentsHeartButton v-bind="args" />
15
+ `,
16
+ });
17
+ template.args = args;
18
+ return template;
19
+ };
20
+
21
+ export const Default = story({});
22
+
23
+ export const IsSmall = story({ isSmall: true });
24
+
25
+ export const IsLiked = story({ isLiked: true });
@@ -0,0 +1,39 @@
1
+ import KvCommentsList from '../KvCommentsList.vue';
2
+ import { publicLenderId, comments } from '../../tests/fixtures/mockCommentsData';
3
+
4
+ export default {
5
+ title: 'KvCommentsList',
6
+ component: KvCommentsList,
7
+ };
8
+ const TEST_USER_NAME = 'Jess';
9
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
10
+
11
+ const story = (args) => {
12
+ const template = (templateArgs, { argTypes }) => ({
13
+ props: Object.keys(argTypes),
14
+ components: { KvCommentsList },
15
+ setup() { return { args: templateArgs }; },
16
+ provide: {
17
+ fetchLenderInfo: () => Promise.resolve({
18
+ name: TEST_USER_NAME,
19
+ image: { url: TEST_USER_IMAGE },
20
+ }),
21
+ },
22
+ template: `
23
+ <KvCommentsList v-bind="args" />
24
+ `,
25
+ });
26
+ template.args = args;
27
+ return template;
28
+ };
29
+
30
+ export const Default = story({ comments });
31
+
32
+ export const UserData = story(
33
+ {
34
+ comments,
35
+ userDisplayName: TEST_USER_NAME,
36
+ userImageUrl: TEST_USER_IMAGE,
37
+ userPublicId: publicLenderId,
38
+ },
39
+ );
@@ -0,0 +1,45 @@
1
+ import KvCommentsListItem from '../KvCommentsListItem.vue';
2
+ import { publicLenderId, comments } from '../../tests/fixtures/mockCommentsData';
3
+
4
+ export default {
5
+ title: 'KvCommentsListItem',
6
+ component: KvCommentsListItem,
7
+ };
8
+
9
+ const TEST_USER_NAME = 'Jess';
10
+ const TEST_USER_IMAGE = 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg';
11
+
12
+ const story = (args) => {
13
+ const template = (templateArgs, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
15
+ components: { KvCommentsListItem },
16
+ setup() { return { args: templateArgs }; },
17
+ provide: {
18
+ fetchLenderInfo: () => Promise.resolve({
19
+ name: TEST_USER_NAME,
20
+ image: { url: TEST_USER_IMAGE },
21
+ }),
22
+ },
23
+ template: `
24
+ <KvCommentsListItem v-bind="args" />
25
+ `,
26
+ });
27
+ template.args = args;
28
+ return template;
29
+ };
30
+
31
+ const comment = comments[0];
32
+ const childComments = comments[0];
33
+
34
+ export const Default = story({ comment });
35
+
36
+ export const ChildComments = story({ comment: childComments });
37
+
38
+ export const UserData = story(
39
+ {
40
+ comment: childComments,
41
+ userDisplayName: TEST_USER_NAME,
42
+ userImageUrl: TEST_USER_IMAGE,
43
+ userPublicId: publicLenderId,
44
+ },
45
+ );
@@ -0,0 +1,21 @@
1
+ import KvCommentsReplyButton from '../KvCommentsReplyButton.vue';
2
+
3
+ export default {
4
+ title: 'KvCommentsReplyButton',
5
+ component: KvCommentsReplyButton,
6
+ };
7
+
8
+ const story = (args) => {
9
+ const template = (templateArgs, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: { KvCommentsReplyButton },
12
+ setup() { return { args: templateArgs }; },
13
+ template: `
14
+ <KvCommentsReplyButton v-bind="args" />
15
+ `,
16
+ });
17
+ template.args = args;
18
+ return template;
19
+ };
20
+
21
+ export const Default = story({});
@@ -0,0 +1,196 @@
1
+ import KvContentfulImg from '../KvContentfulImg.vue';
2
+
3
+ export default {
4
+ title: 'KvContentfulImg',
5
+ component: KvContentfulImg,
6
+ args: {
7
+ contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/35lkLRfbLxzFPlDVgA4aKI/c435630d811f9ad35ddfc88eaea22b08/Blog-import-1082518_us_shawn_16.jpg',
8
+ fallbackFormat: 'jpg',
9
+ width: 200,
10
+ height: null,
11
+ alt: null,
12
+ loading: 'lazy',
13
+ sourceSizes: null,
14
+ },
15
+ argTypes: {
16
+ fallbackFormat: {
17
+ control: {
18
+ type: 'select',
19
+ options: ['jpg', 'png', 'webp'],
20
+ },
21
+ },
22
+ loading: {
23
+ control: {
24
+ type: 'select',
25
+ options: ['lazy', 'eager'],
26
+ },
27
+ },
28
+ fit: {
29
+ control: {
30
+ type: 'select',
31
+ options: ['pad', 'fill', 'scale', 'crop', 'thumb'],
32
+ },
33
+ },
34
+ focus: {
35
+ control: {
36
+ type: 'select',
37
+ options: ['center', 'top', 'right', 'left', 'bottom', 'top_right', 'top_left', 'bottom_right', 'bottom_left', 'face', 'faces'],
38
+ },
39
+ },
40
+ },
41
+ };
42
+
43
+ export const Default = (args, { argTypes }) => ({
44
+ props: Object.keys(argTypes),
45
+ components: {
46
+ KvContentfulImg,
47
+ },
48
+ template: `
49
+ <kv-contentful-img
50
+ :contentful-src="contentfulSrc"
51
+ :fallback-format="fallbackFormat"
52
+ :width="width"
53
+ :height="height"
54
+ alt="Descriptive alt text"
55
+ :loading="loading"
56
+ :fit="fit"
57
+ :focus="focus"
58
+ />
59
+ `,
60
+ });
61
+
62
+ export const ResponsiveImageSet = (args, { argTypes }) => ({
63
+ props: Object.keys(argTypes),
64
+ components: {
65
+ KvContentfulImg,
66
+ },
67
+ template: `
68
+ <kv-contentful-img
69
+ :contentful-src="contentfulSrc"
70
+ :fallback-format="fallbackFormat"
71
+ :alt="alt"
72
+ :loading="loading"
73
+ :height="540"
74
+ :source-sizes="sourceSizes"
75
+ :fit="fit"
76
+ :focus="focus"
77
+ />
78
+ `,
79
+ });
80
+
81
+ ResponsiveImageSet.args = {
82
+ fit: 'fill',
83
+ focus: 'face',
84
+ sourceSizes: [
85
+ {
86
+ width: 1920,
87
+ height: 650,
88
+ media: 'min-width: 1441px',
89
+ },
90
+ {
91
+ width: 1440,
92
+ height: 620,
93
+ media: 'min-width: 1025px',
94
+ },
95
+ {
96
+ width: 1024,
97
+ height: 441,
98
+ media: 'min-width: 681px',
99
+ },
100
+ {
101
+ width: 680,
102
+ height: 372,
103
+ media: 'min-width: 481px',
104
+ },
105
+ {
106
+ width: 480,
107
+ height: 540,
108
+ media: 'min-width: 0px',
109
+ },
110
+ ],
111
+ contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7mY5ZujL9UfbluRkVkHgkX/5ec83a74e7c1dc387f3fa35af34f5243/mg-hppromo-1-wxga-retina.jpg',
112
+ };
113
+
114
+ export const AdaptiveImageSet = (args, { argTypes }) => ({
115
+ props: Object.keys(argTypes),
116
+ components: {
117
+ KvContentfulImg,
118
+ },
119
+ template: `
120
+ <kv-contentful-img
121
+ :contentful-src="contentfulSrc"
122
+ :fallback-format="fallbackFormat"
123
+ :alt="alt"
124
+ :loading="loading"
125
+ :height="540"
126
+ :source-sizes="sourceSizes"
127
+ />
128
+ `,
129
+ });
130
+ AdaptiveImageSet.args = {
131
+ sourceSizes: [
132
+ {
133
+ width: 1186,
134
+ height: 948,
135
+ media: 'min-width: 1025px',
136
+ url: '//images.ctfassets.net/j0p9a6ql0rn7/V0FQ3TmvSVVX5zXCX9l9A/363cf644709b838f2e3478facd0a6959/wrd2021-hero-lg-2x.jpg',
137
+ },
138
+ {
139
+ width: 670,
140
+ height: 915,
141
+ media: 'min-width: 735px',
142
+ url: '//images.ctfassets.net/j0p9a6ql0rn7/2co41o2KujCSIIAIFc63DH/4fe9fe22b521a590911704e2c42a6cfc/wrd2021-hero-med-2x.jpg',
143
+ },
144
+ {
145
+ width: 670,
146
+ height: 914,
147
+ media: 'min-width: 0px',
148
+ url: '//images.ctfassets.net/j0p9a6ql0rn7/28iKvNatAphyTreO5XQM8V/70246776d7b24ddcc638af696ca10bad/wrd2021-hero-sm-2x.jpg',
149
+ },
150
+ ],
151
+ contentfulSrc: '//images.ctfassets.net/j0p9a6ql0rn7/V0FQ3TmvSVVX5zXCX9l9A/363cf644709b838f2e3478facd0a6959/wrd2021-hero-lg-2x.jpg',
152
+ };
153
+
154
+ export const WithCaption = (args, { argTypes }) => ({
155
+ props: Object.keys(argTypes),
156
+ components: {
157
+ KvContentfulImg,
158
+ },
159
+ template: `
160
+ <kv-contentful-img
161
+ :contentful-src="contentfulSrc"
162
+ :fallback-format="fallbackFormat"
163
+ :width="width"
164
+ :height="height"
165
+ alt="^ A descriptive caption"
166
+ :loading="loading"
167
+ :fit="fit"
168
+ :focus="focus"
169
+ />
170
+ `,
171
+ });
172
+
173
+ export const GiantImage = (args, { argTypes }) => ({
174
+ props: Object.keys(argTypes),
175
+ components: {
176
+ KvContentfulImg,
177
+ },
178
+ template: `
179
+ <kv-contentful-img
180
+ :contentful-src="contentfulSrc"
181
+ :fallback-format="fallbackFormat"
182
+ :width="width"
183
+ :height="height"
184
+ alt="Descriptive alt text"
185
+ :loading="loading"
186
+ :fit="fit"
187
+ :focus="focus"
188
+ />
189
+ `,
190
+ });
191
+
192
+ GiantImage.args = {
193
+ contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7dVINOyAxRaXM8p6aq7p5s/9213f63ff10dec57c5f740c056afe8a8/gradient-hero-bg__1_.jpg',
194
+ width: 4000,
195
+ height: 2000,
196
+ };
@@ -0,0 +1,30 @@
1
+ import KvCountdownTimer from '../KvCountdownTimer.vue';
2
+
3
+ export default {
4
+ title: 'KvCountdownTimer',
5
+ component: KvCountdownTimer,
6
+ };
7
+
8
+ const story = (args) => {
9
+ const template = (_args, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: {
12
+ KvCountdownTimer,
13
+ },
14
+ template: `
15
+ <kv-countdown-timer
16
+ :ms-left="msLeft"
17
+ />
18
+ `,
19
+ });
20
+ template.args = args;
21
+ return template;
22
+ };
23
+
24
+ export const Seconds = story({ msLeft: 1000 * 10 });
25
+
26
+ export const Tomorrow = story({ msLeft: 1000 * 60 * 60 * 24 });
27
+
28
+ export const Expired = story({ msLeft: 0 });
29
+
30
+ export const Overmorrow = story({ msLeft: 1000 * 60 * 60 * 48 });
@@ -0,0 +1,129 @@
1
+ import KvExpandableQuestion from '../KvExpandableQuestion.vue';
2
+
3
+ export default {
4
+ title: 'KvExpandableQuestion',
5
+ component: KvExpandableQuestion,
6
+ };
7
+
8
+ const DefaultTemplate = () => ({
9
+ components: { KvExpandableQuestion },
10
+ template: `
11
+ <div style="padding: 20px;">
12
+ <kv-expandable-question
13
+ id="expandable-question-test"
14
+ title="expandable-question-title"
15
+ content="<p> Hello, KvAccordion Contents! </p>"
16
+ />
17
+ </div>
18
+ `,
19
+ });
20
+
21
+ export const Default = DefaultTemplate.bind({});
22
+
23
+ const expandableQuestions = [
24
+ {
25
+ title: 'expandable question one',
26
+ content: '<p> Hello, KvAccordion Contents! </p>',
27
+ id: 'expandable-question-test-1',
28
+ },
29
+ {
30
+ title: 'expandable question two',
31
+ content: '<p> Hello, KvAccordion Contents! </p>',
32
+ id: 'expandable-question-test-2',
33
+ },
34
+ {
35
+ title: 'expandable question three',
36
+ content: '<p> Hello, KvAccordion Contents! </p>',
37
+ id: 'expandable-question-test-3',
38
+ },
39
+ ];
40
+
41
+ const GroupTemplate = () => ({
42
+ components: { KvExpandableQuestion },
43
+ data: () => ({
44
+ questions: expandableQuestions,
45
+ }),
46
+ methods: {
47
+ kvTrackMock(
48
+ category,
49
+ action,
50
+ label,
51
+ ) {
52
+ console.log(category, action, label);
53
+ },
54
+ },
55
+ template: `
56
+ <div style="padding: 20px;">
57
+ <kv-expandable-question
58
+ v-for="(question, index) in questions"
59
+ :key="index"
60
+ :id="question.id"
61
+ :title="question.title"
62
+ :content="question.content"
63
+ :active="question.id === 'expandable-question-test-2'"
64
+ :kv-track-function="kvTrackMock"
65
+ />
66
+ </div>
67
+ `,
68
+ });
69
+
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({});
@@ -0,0 +1,36 @@
1
+ import KvFlag from '../KvFlag.vue';
2
+
3
+ export default {
4
+ title: 'Components/KvFlag',
5
+ component: KvFlag,
6
+ };
7
+
8
+ const story = (args) => {
9
+ const template = (templateArgs, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: { KvFlag },
12
+ setup() { return { args: templateArgs }; },
13
+ template: `
14
+ <div style="width: 100px; height: 100px;">
15
+ <KvFlag v-bind="args" />
16
+ </div>
17
+ `,
18
+ });
19
+ template.args = args;
20
+ return template;
21
+ };
22
+
23
+ // SVG based on the country code
24
+ export const InlineSvg = story({ country: 'TO' });
25
+ // SVG based on the country code with custom width
26
+ export const InlineSvgCustomWidth = story({ country: 'DE', widthOverride: '40px' });
27
+
28
+ // SVG Sqaure based on the country code
29
+ export const SquareInlineSvg = story({ country: 'ME', aspectRatio: '1x1', showName: true });
30
+ // SVG Sqaure based on the country code with custom width
31
+ export const SquareInlineSvgCustomWidth = story({
32
+ country: 'SA',
33
+ inlineSvg: true,
34
+ widthOverride: '40px',
35
+ aspectRatio: '1x1',
36
+ });
@@ -0,0 +1,97 @@
1
+ import KvGrid from '../KvGrid.vue';
2
+ import KvPageContainer from '../KvPageContainer.vue';
3
+
4
+ export default {
5
+ title: 'Layout/KvGrid',
6
+ component: KvGrid,
7
+ parameters: {
8
+ layout: 'fullscreen',
9
+ },
10
+ };
11
+
12
+ const TwelveColumnsTemplate = () => ({
13
+ components: { KvGrid, KvPageContainer },
14
+ template: `
15
+ <div class="demo">
16
+ <component is="style">
17
+ .demo * { outline: 1px solid red !important; }
18
+ </component>
19
+
20
+ <kv-page-container>
21
+ <h2 class="tw-mb-2">Twelve Even Columns</h2>
22
+ <kv-grid class="tw-grid-cols-12">
23
+ <div class="tw-bg-tertiary tw-h-16">1</div>
24
+ <div class="tw-bg-tertiary tw-h-16">2</div>
25
+ <div class="tw-bg-tertiary tw-h-16">3</div>
26
+ <div class="tw-bg-tertiary tw-h-16">4</div>
27
+ <div class="tw-bg-tertiary tw-h-16">5</div>
28
+ <div class="tw-bg-tertiary tw-h-16">6</div>
29
+ <div class="tw-bg-tertiary tw-h-16">7</div>
30
+ <div class="tw-bg-tertiary tw-h-16">8</div>
31
+ <div class="tw-bg-tertiary tw-h-16">9</div>
32
+ <div class="tw-bg-tertiary tw-h-16">10</div>
33
+ <div class="tw-bg-tertiary tw-h-16">11</div>
34
+ <div class="tw-bg-tertiary tw-h-16">12</div>
35
+ </kv-grid>
36
+ </kv-page-container>
37
+ </div>`,
38
+ });
39
+
40
+ const ResponsiveColumnsTemplate = () => ({
41
+ components: { KvGrid, KvPageContainer },
42
+ template: `
43
+ <div class="demo">
44
+ <component is="style">
45
+ .demo * { outline: 1px solid red !important; }
46
+ </component>
47
+
48
+ <kv-page-container>
49
+ <h2 class="tw-mb-2">Two on small, 3 on medium, 4 on large</h2>
50
+ <kv-grid class="tw-grid-cols-2 md:tw-grid-cols-3 lg:tw-grid-cols-4">
51
+ <div class="tw-bg-tertiary tw-h-16">1</div>
52
+ <div class="tw-bg-tertiary tw-h-16">2</div>
53
+ <div class="tw-bg-tertiary tw-h-16">3</div>
54
+ <div class="tw-bg-tertiary tw-h-16">4</div>
55
+ <div class="tw-bg-tertiary tw-h-16">5</div>
56
+ <div class="tw-bg-tertiary tw-h-16">6</div>
57
+ <div class="tw-bg-tertiary tw-h-16">7</div>
58
+ <div class="tw-bg-tertiary tw-h-16">8</div>
59
+ <div class="tw-bg-tertiary tw-h-16">9</div>
60
+ <div class="tw-bg-tertiary tw-h-16">10</div>
61
+ <div class="tw-bg-tertiary tw-h-16">11</div>
62
+ <div class="tw-bg-tertiary tw-h-16">12</div>
63
+ </kv-grid>
64
+ </kv-page-container>
65
+ </div>`,
66
+ });
67
+
68
+ const NestedTemplate = () => ({
69
+ components: { KvGrid, KvPageContainer },
70
+ template: `
71
+ <div class="demo">
72
+ <component is="style">
73
+ .demo * { outline: 1px solid red !important; }
74
+ </component>
75
+
76
+ <kv-page-container>
77
+ <h2 class="tw-mb-2">Nested</h2>
78
+ <kv-grid class="tw-grid-cols-2">
79
+ <div class="tw-bg-tertiary"><p>1</p></div>
80
+ <div class="tw-bg-tertiary">
81
+ <p>2</p>
82
+ <p>The grid below is inside a grid column</p>
83
+ <kv-grid class="tw-grid-cols-4">
84
+ <div class="tw-bg-tertiary tw-h-16">1</div>
85
+ <div class="tw-bg-tertiary tw-h-16">2</div>
86
+ <div class="tw-bg-tertiary tw-h-16">3</div>
87
+ <div class="tw-bg-tertiary tw-h-16">4</div>
88
+ </kv-grid>
89
+ </div>
90
+ </kv-grid>
91
+ </kv-page-container>
92
+ </div>`,
93
+ });
94
+
95
+ export const TwelveColumns = TwelveColumnsTemplate.bind({});
96
+ export const ResponsiveColumns = ResponsiveColumnsTemplate.bind({});
97
+ export const Nested = NestedTemplate.bind({});
@@ -0,0 +1,22 @@
1
+ import KvImpactDashboardHeader from '../KvImpactDashboardHeader.vue';
2
+
3
+ export default {
4
+ title: 'KvImpactDashboardHeader',
5
+ component: KvImpactDashboardHeader,
6
+ };
7
+
8
+ const story = (args) => {
9
+ const template = (_args, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: { KvImpactDashboardHeader },
12
+ template: `
13
+ <div class="tw-bg-secondary tw-pb-7">
14
+ <kv-impact-dashboard-header />
15
+ </div>
16
+ `,
17
+ });
18
+ template.args = args;
19
+ return template;
20
+ };
21
+
22
+ export const Default = story();