@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.
- package/.eslintrc.cjs +1 -0
- package/CHANGELOG.md +22 -0
- package/dist/components/.storybook/main.js +85 -0
- package/dist/components/.storybook/package.json +3 -0
- package/dist/components/.storybook/preview.js +61 -0
- package/dist/components/.storybook/tailwind.css +5 -0
- package/dist/components/KvAccordionItem.vue +130 -0
- package/dist/components/KvActivityRow.vue +33 -0
- package/dist/components/KvBorrowerImage.vue +179 -0
- package/dist/components/KvButton.vue +287 -0
- package/dist/components/KvCarousel.vue +297 -0
- package/dist/components/KvCartModal.vue +365 -0
- package/dist/components/KvCheckbox.vue +203 -0
- package/dist/components/KvChip.vue +54 -0
- package/dist/components/KvClassicLoanCard.vue +527 -0
- package/dist/components/KvCommentsAdd.vue +135 -0
- package/dist/components/KvCommentsContainer.vue +84 -0
- package/dist/components/KvCommentsHeartButton.vue +70 -0
- package/dist/components/KvCommentsList.vue +68 -0
- package/dist/components/KvCommentsListItem.vue +241 -0
- package/dist/components/KvCommentsReplyButton.vue +52 -0
- package/dist/components/KvContentfulImg.vue +273 -0
- package/dist/components/KvCountdownTimer.vue +59 -0
- package/dist/components/KvExpandable.vue +84 -0
- package/dist/components/KvExpandableQuestion.vue +120 -0
- package/dist/components/KvFlag.vue +120 -0
- package/dist/components/KvGrid.vue +28 -0
- package/dist/components/KvImpactDashboardHeader.vue +40 -0
- package/dist/components/KvInlineActivityCard.vue +55 -0
- package/dist/components/KvInlineActivityFeed.vue +38 -0
- package/dist/components/KvIntroductionLoanCard.vue +446 -0
- package/dist/components/KvLendAmountButton.vue +65 -0
- package/dist/components/KvLendCta.vue +451 -0
- package/dist/components/KvLightbox.vue +334 -0
- package/dist/components/KvLineGraph.vue +128 -0
- package/dist/components/KvLoadingPlaceholder.vue +38 -0
- package/dist/components/KvLoadingSpinner.vue +81 -0
- package/dist/components/KvLoanActivities.vue +268 -0
- package/dist/components/KvLoanBookmark.vue +39 -0
- package/dist/components/KvLoanCallouts.vue +53 -0
- package/dist/components/KvLoanProgressGroup.vue +76 -0
- package/dist/components/KvLoanTag.vue +88 -0
- package/dist/components/KvLoanTeamPick.vue +44 -0
- package/dist/components/KvLoanUse.vue +92 -0
- package/dist/components/KvMap.vue +599 -0
- package/dist/components/KvMaterialIcon.vue +47 -0
- package/dist/components/KvPageContainer.vue +15 -0
- package/dist/components/KvPagination.vue +198 -0
- package/dist/components/KvPieChart.vue +257 -0
- package/dist/components/KvPopper.vue +178 -0
- package/dist/components/KvProgressBar.vue +149 -0
- package/dist/components/KvRadio.vue +198 -0
- package/dist/components/KvSelect.vue +114 -0
- package/dist/components/KvSideSheet.vue +134 -0
- package/dist/components/KvSwitch.vue +143 -0
- package/dist/components/KvTab.vue +90 -0
- package/dist/components/KvTabPanel.vue +64 -0
- package/dist/components/KvTabs.vue +182 -0
- package/dist/components/KvTextInput.vue +247 -0
- package/dist/components/KvTextLink.vue +138 -0
- package/dist/components/KvThemeProvider.vue +122 -0
- package/dist/components/KvToast.vue +221 -0
- package/dist/components/KvTooltip.vue +168 -0
- package/dist/components/KvTreeMapChart.vue +229 -0
- package/dist/components/KvUserAvatar.vue +132 -0
- package/dist/components/KvVerticalCarousel.vue +156 -0
- package/dist/components/KvVotingCard.vue +160 -0
- package/dist/components/KvVotingCardV2.vue +154 -0
- package/dist/components/KvWideLoanCard.vue +432 -0
- package/dist/components/stories/Forms.stories.js +62 -0
- package/dist/components/stories/KvAccordionItem.stories.js +24 -0
- package/dist/components/stories/KvActivityRow.stories.js +25 -0
- package/dist/components/stories/KvBorrowerImage.stories.js +68 -0
- package/dist/components/stories/KvButton.stories.js +144 -0
- package/dist/components/stories/KvCarousel.stories.js +426 -0
- package/dist/components/stories/KvCartModal.stories.js +54 -0
- package/dist/components/stories/KvCheckbox.stories.js +163 -0
- package/dist/components/stories/KvChip.stories.js +43 -0
- package/dist/components/stories/KvClassicLoanCard.stories.js +480 -0
- package/dist/components/stories/KvCommentsAdd.stories.js +32 -0
- package/dist/components/stories/KvCommentsContainer.stories.js +42 -0
- package/dist/components/stories/KvCommentsHeartButton.stories.js +25 -0
- package/dist/components/stories/KvCommentsList.stories.js +39 -0
- package/dist/components/stories/KvCommentsListItem.stories.js +45 -0
- package/dist/components/stories/KvCommentsReplyButton.stories.js +21 -0
- package/dist/components/stories/KvContentfulImg.stories.js +196 -0
- package/dist/components/stories/KvCountdownTimer.stories.js +30 -0
- package/dist/components/stories/KvExpandableQuestion.stories.js +129 -0
- package/dist/components/stories/KvFlag.stories.js +36 -0
- package/dist/components/stories/KvGrid.stories.js +97 -0
- package/dist/components/stories/KvImpactDashboardHeader.stories.js +22 -0
- package/dist/components/stories/KvInlineActivityCard.stories.js +69 -0
- package/dist/components/stories/KvInlineActivityFeed.stories.js +76 -0
- package/dist/components/stories/KvIntroductionLoanCard.stories.js +208 -0
- package/dist/components/stories/KvLendAmountButton.stories.js +31 -0
- package/dist/components/stories/KvLendCta.stories.js +177 -0
- package/dist/components/stories/KvLightbox.stories.js +304 -0
- package/dist/components/stories/KvLineGraph.stories.js +52 -0
- package/dist/components/stories/KvLoadingPlaceholder.stories.js +17 -0
- package/dist/components/stories/KvLoadingSpinner.stories.js +52 -0
- package/dist/components/stories/KvLoanActivities.stories.js +104 -0
- package/dist/components/stories/KvLoanBookmark.stories.js +22 -0
- package/dist/components/stories/KvLoanCallouts.stories.js +22 -0
- package/dist/components/stories/KvLoanProgressGroup.stories.js +29 -0
- package/dist/components/stories/KvLoanTag.stories.js +61 -0
- package/dist/components/stories/KvLoanTeamPick.stories.js +20 -0
- package/dist/components/stories/KvLoanUse.stories.js +60 -0
- package/dist/components/stories/KvMap.stories.js +121 -0
- package/dist/components/stories/KvMaterialIcon.stories.js +201 -0
- package/dist/components/stories/KvPageContainer.stories.js +50 -0
- package/dist/components/stories/KvPagination.stories.js +70 -0
- package/dist/components/stories/KvPieChart.stories.js +47 -0
- package/dist/components/stories/KvProgressBar.stories.js +53 -0
- package/dist/components/stories/KvRadio.stories.js +140 -0
- package/dist/components/stories/KvSelect.stories.js +125 -0
- package/dist/components/stories/KvSideSheet.stories.js +50 -0
- package/dist/components/stories/KvSwitch.stories.js +66 -0
- package/dist/components/stories/KvTabs.stories.js +106 -0
- package/dist/components/stories/KvTextInput.stories.js +194 -0
- package/dist/components/stories/KvTextLink.stories.js +55 -0
- package/dist/components/stories/KvThemeProvider.stories.js +178 -0
- package/dist/components/stories/KvToast.stories.js +117 -0
- package/dist/components/stories/KvTooltip.stories.js +26 -0
- package/dist/components/stories/KvTreeMapChart.stories.js +42 -0
- package/dist/components/stories/KvUserAvatar.stories.js +47 -0
- package/dist/components/stories/KvVerticalCarousel.stories.js +168 -0
- package/dist/components/stories/KvVotingCard.stories.js +33 -0
- package/dist/components/stories/KvVotingCardV2.stories.js +89 -0
- package/dist/components/stories/KvWideLoanCard.stories.js +292 -0
- package/dist/components/stories/StyleguidePrimitives.stories.js +499 -0
- package/dist/components/stories/StyleguideProse.stories.js +215 -0
- package/dist/data/countries-borders.json +1 -0
- package/dist/data/ne_110m_admin_0_countries.json +1 -0
- package/dist/utils/Alea.cjs +87 -0
- package/dist/utils/Alea.js +9 -0
- package/dist/utils/attrs.cjs +50 -0
- package/dist/utils/attrs.js +7 -0
- package/dist/utils/carousels.cjs +184 -0
- package/dist/utils/carousels.js +8 -0
- package/dist/utils/chunk-3HK4G4NT.js +27 -0
- package/dist/utils/chunk-55HF2ORX.js +201 -0
- package/dist/utils/chunk-AY3PR5S4.js +54 -0
- package/dist/utils/chunk-AZPWOFD5.js +148 -0
- package/dist/utils/chunk-B5J5WLAH.js +18 -0
- package/dist/utils/chunk-GPSH6OPA.js +64 -0
- package/dist/utils/chunk-HIY5IW65.js +28 -0
- package/dist/utils/chunk-HV3AUBFT.js +15 -0
- package/dist/utils/chunk-MSMZIN54.js +110 -0
- package/dist/utils/chunk-OXJCCNNW.js +30 -0
- package/dist/utils/chunk-S3MABILA.js +22 -0
- package/dist/utils/chunk-VIGEMAKO.js +249 -0
- package/dist/utils/chunk-YCNMJ4YV.js +37 -0
- package/dist/utils/chunk-YFEC5ODJ.js +129 -0
- package/dist/utils/expander.cjs +78 -0
- package/dist/utils/expander.js +9 -0
- package/dist/utils/imageUtils.cjs +54 -0
- package/dist/utils/imageUtils.js +9 -0
- package/dist/utils/index.cjs +1118 -0
- package/dist/utils/index.js +166 -0
- package/dist/utils/loanCard.cjs +222 -0
- package/dist/utils/loanCard.js +9 -0
- package/dist/utils/loanUtils.cjs +170 -0
- package/dist/utils/loanUtils.js +23 -0
- package/dist/utils/mapUtils.cjs +276 -0
- package/dist/utils/mapUtils.js +15 -0
- package/dist/utils/printing.cjs +42 -0
- package/dist/utils/printing.js +9 -0
- package/dist/utils/scrollLock.cjs +54 -0
- package/dist/utils/scrollLock.js +13 -0
- package/dist/utils/throttle.cjs +38 -0
- package/dist/utils/throttle.js +7 -0
- package/dist/utils/touchEvents.cjs +47 -0
- package/dist/utils/touchEvents.js +11 -0
- package/dist/utils/treemap.cjs +133 -0
- package/dist/utils/treemap.js +7 -0
- package/package.json +12 -4
- package/utils/index.js +14 -0
- package/vue/KvVerticalCarousel.vue +1 -1
- package/index.js +0 -3
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import KvCheckbox from '../KvCheckbox.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Forms/KvCheckbox',
|
|
5
|
+
component: KvCheckbox,
|
|
6
|
+
args: {
|
|
7
|
+
checked: false,
|
|
8
|
+
disabled: false,
|
|
9
|
+
valid: true,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args, {
|
|
14
|
+
argTypes,
|
|
15
|
+
}) => ({
|
|
16
|
+
props: Object.keys(argTypes),
|
|
17
|
+
components: {
|
|
18
|
+
KvCheckbox,
|
|
19
|
+
},
|
|
20
|
+
data: () => ({
|
|
21
|
+
checkboxExampleModel: false,
|
|
22
|
+
}),
|
|
23
|
+
template: `
|
|
24
|
+
<div>
|
|
25
|
+
<kv-checkbox
|
|
26
|
+
:disabled="disabled"
|
|
27
|
+
:valid="valid"
|
|
28
|
+
v-model="checkboxExampleModel"
|
|
29
|
+
@change="onChange"
|
|
30
|
+
@focus="onFocus"
|
|
31
|
+
>
|
|
32
|
+
Checkbox is checked: {{checkboxExampleModel}}
|
|
33
|
+
</kv-checkbox>
|
|
34
|
+
</div>`,
|
|
35
|
+
methods: {
|
|
36
|
+
onChange(e) {
|
|
37
|
+
console.log(e);
|
|
38
|
+
},
|
|
39
|
+
onFocus(e) {
|
|
40
|
+
console.log(e);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const Default = Template.bind({});
|
|
46
|
+
|
|
47
|
+
export const Disabled = Template.bind({});
|
|
48
|
+
Disabled.args = {
|
|
49
|
+
disabled: true,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Invalid = Template.bind({});
|
|
53
|
+
Invalid.args = {
|
|
54
|
+
valid: false,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const WithoutVModel = (args, {
|
|
58
|
+
argTypes,
|
|
59
|
+
}) => ({
|
|
60
|
+
props: Object.keys(argTypes),
|
|
61
|
+
components: {
|
|
62
|
+
KvCheckbox,
|
|
63
|
+
},
|
|
64
|
+
data: () => ({
|
|
65
|
+
checkboxExampleModel: false,
|
|
66
|
+
}),
|
|
67
|
+
template: `
|
|
68
|
+
<div>
|
|
69
|
+
<kv-checkbox
|
|
70
|
+
:modelValue="checkboxExampleModel"
|
|
71
|
+
@change="(val) => checkboxExampleModel = val"
|
|
72
|
+
:disabled="disabled"
|
|
73
|
+
>
|
|
74
|
+
Checkbox is checked: {{checkboxExampleModel}}
|
|
75
|
+
</kv-checkbox>
|
|
76
|
+
</div>`,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export const Multiple = (args, {
|
|
80
|
+
argTypes,
|
|
81
|
+
}) => ({
|
|
82
|
+
props: Object.keys(argTypes),
|
|
83
|
+
components: {
|
|
84
|
+
KvCheckbox,
|
|
85
|
+
},
|
|
86
|
+
data: () => ({
|
|
87
|
+
checkboxExampleModel1: false,
|
|
88
|
+
checkboxExampleModel2: false,
|
|
89
|
+
checkboxExampleModel3: false,
|
|
90
|
+
checkboxExampleModel4: false,
|
|
91
|
+
}),
|
|
92
|
+
template: `
|
|
93
|
+
<div class="tw-flex tw-flex-col tw-gap-2">
|
|
94
|
+
<kv-checkbox
|
|
95
|
+
:modelValue="checkboxExampleModel1"
|
|
96
|
+
@change="(val) => checkboxExampleModel1 = val"
|
|
97
|
+
>
|
|
98
|
+
One is checked: {{checkboxExampleModel1}}
|
|
99
|
+
</kv-checkbox>
|
|
100
|
+
<kv-checkbox
|
|
101
|
+
:modelValue="checkboxExampleModel2"
|
|
102
|
+
@change="(val) => checkboxExampleModel2 = val"
|
|
103
|
+
:disabled="true"
|
|
104
|
+
>
|
|
105
|
+
Two is checked: {{checkboxExampleModel2}}
|
|
106
|
+
</kv-checkbox>
|
|
107
|
+
<kv-checkbox
|
|
108
|
+
:modelValue="checkboxExampleModel3"
|
|
109
|
+
@change="(val) => checkboxExampleModel3 = val"
|
|
110
|
+
>
|
|
111
|
+
Three is checked: {{checkboxExampleModel3}}
|
|
112
|
+
</kv-checkbox>
|
|
113
|
+
<kv-checkbox
|
|
114
|
+
:modelValue="checkboxExampleModel4"
|
|
115
|
+
@change="(val) => checkboxExampleModel4 = val"
|
|
116
|
+
>
|
|
117
|
+
Four is long lorem ipsum nulla duis velit occaecat consectetur pariatur enim eu nostrud. <a href="https://placeholder.com">Irure et cupidatat</a> veniam sit enim proident exercitation ut Lorem do. Commodo ad veniam commodo est amet pariatur: {{checkboxExampleModel4}}
|
|
118
|
+
</kv-checkbox>
|
|
119
|
+
</div>`,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const ArrayModelTemplate = (args, {
|
|
123
|
+
argTypes,
|
|
124
|
+
}) => ({
|
|
125
|
+
props: Object.keys(argTypes),
|
|
126
|
+
components: {
|
|
127
|
+
KvCheckbox,
|
|
128
|
+
},
|
|
129
|
+
data: () => ({
|
|
130
|
+
checkboxExampleModel: ['item1', 'item2'],
|
|
131
|
+
}),
|
|
132
|
+
template: `
|
|
133
|
+
<div class="tw-flex tw-flex-col tw-gap-2">
|
|
134
|
+
<kv-checkbox
|
|
135
|
+
value="item1"
|
|
136
|
+
v-model="checkboxExampleModel"
|
|
137
|
+
@change="onChange"
|
|
138
|
+
>
|
|
139
|
+
item1
|
|
140
|
+
</kv-checkbox>
|
|
141
|
+
<kv-checkbox
|
|
142
|
+
value="item2"
|
|
143
|
+
v-model="checkboxExampleModel"
|
|
144
|
+
@change="onChange"
|
|
145
|
+
>
|
|
146
|
+
item2
|
|
147
|
+
</kv-checkbox>
|
|
148
|
+
<kv-checkbox
|
|
149
|
+
value="item3"
|
|
150
|
+
v-model="checkboxExampleModel"
|
|
151
|
+
@change="onChange"
|
|
152
|
+
>
|
|
153
|
+
item3
|
|
154
|
+
</kv-checkbox>
|
|
155
|
+
<div>Checked items: <span v-for="item in checkboxExampleModel" :key="item">{{item}} </span></div>
|
|
156
|
+
</div>`,
|
|
157
|
+
methods: {
|
|
158
|
+
onChange(e) {
|
|
159
|
+
console.log(e);
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
export const ArrayModel = ArrayModelTemplate.bind({});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import KvChip from '../KvChip.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'KvChip',
|
|
5
|
+
component: KvChip,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const story = (args) => {
|
|
9
|
+
const template = (_args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { KvChip },
|
|
12
|
+
template: `
|
|
13
|
+
<kv-chip
|
|
14
|
+
>
|
|
15
|
+
<p> Chip Title </p>
|
|
16
|
+
</kv-chip>
|
|
17
|
+
`,
|
|
18
|
+
});
|
|
19
|
+
template.args = args;
|
|
20
|
+
return template;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Default = story();
|
|
24
|
+
export const LongChipTitle = (args, { argTypes }) => ({
|
|
25
|
+
props: Object.keys(argTypes),
|
|
26
|
+
components: { KvChip },
|
|
27
|
+
template: `
|
|
28
|
+
<kv-chip
|
|
29
|
+
>
|
|
30
|
+
<p> Longer Chip Title </p>
|
|
31
|
+
</kv-chip>
|
|
32
|
+
`,
|
|
33
|
+
});
|
|
34
|
+
export const EmailAddress = (args, { argTypes }) => ({
|
|
35
|
+
props: Object.keys(argTypes),
|
|
36
|
+
components: { KvChip },
|
|
37
|
+
template: `
|
|
38
|
+
<kv-chip
|
|
39
|
+
>
|
|
40
|
+
<h4> @BankofAmerica.com </h4>
|
|
41
|
+
</kv-chip>
|
|
42
|
+
`,
|
|
43
|
+
});
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import KvClassicLoanCard from '../KvClassicLoanCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'KvClassicLoanCard',
|
|
5
|
+
component: KvClassicLoanCard,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const story = (args) => {
|
|
9
|
+
const template = (_args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { KvClassicLoanCard },
|
|
12
|
+
template: `
|
|
13
|
+
<div style="width: 600px;">
|
|
14
|
+
<kv-classic-loan-card
|
|
15
|
+
:loanId="loanId"
|
|
16
|
+
:loan="loan"
|
|
17
|
+
:custom-loan-details="customLoanDetails"
|
|
18
|
+
:use-full-width="useFullWidth"
|
|
19
|
+
:show-tags="showTags"
|
|
20
|
+
:category-page-name="categoryPageName"
|
|
21
|
+
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
22
|
+
:five-dollars-selected="fiveDollarsSelected"
|
|
23
|
+
:large-card="largeCard"
|
|
24
|
+
:is-adding="isAdding"
|
|
25
|
+
:is-visitor="isVisitor"
|
|
26
|
+
:basket-items="basketItems"
|
|
27
|
+
:is-bookmarked="isBookmarked"
|
|
28
|
+
:kv-track-function="kvTrackFunction"
|
|
29
|
+
:photo-path="photoPath"
|
|
30
|
+
:show-view-loan="showViewLoan"
|
|
31
|
+
:custom-callouts="customCallouts"
|
|
32
|
+
:is-team-pick="isTeamPick"
|
|
33
|
+
:combined-activities="combinedActivities"
|
|
34
|
+
:showContributors="showContributors"
|
|
35
|
+
:enable-huge-amount="enableHugeAmount"
|
|
36
|
+
:primary-button-text="primaryButtonText"
|
|
37
|
+
:secondary-button-text="secondaryButtonText"
|
|
38
|
+
:secondary-button-handler="secondaryButtonHandler"
|
|
39
|
+
@show-loan-details="showLoanDetails"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
`,
|
|
43
|
+
methods: {
|
|
44
|
+
showLoanDetails() {
|
|
45
|
+
console.log('show-loan-details');
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
template.args = args;
|
|
50
|
+
return template;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const nextWeek = new Date();
|
|
54
|
+
nextWeek.setDate(new Date().getDate() + 7);
|
|
55
|
+
|
|
56
|
+
const loan = {
|
|
57
|
+
id: 1,
|
|
58
|
+
name: 'Alan',
|
|
59
|
+
geocode: {
|
|
60
|
+
city: 'Lyantonde',
|
|
61
|
+
state: 'Central Region',
|
|
62
|
+
country: {
|
|
63
|
+
isoCode: 'UG',
|
|
64
|
+
name: 'Uganda',
|
|
65
|
+
region: 'Africa',
|
|
66
|
+
__typename: 'Country',
|
|
67
|
+
},
|
|
68
|
+
__typename: 'Geocode',
|
|
69
|
+
},
|
|
70
|
+
image: { hash: '9673d0722a7675b9b8d11f90849d9b44' },
|
|
71
|
+
fundraisingPercent: 0.5,
|
|
72
|
+
unreservedAmount: '500.00',
|
|
73
|
+
use: 'to purchase heifers to increase headcount of cattle and sales of organic milk.',
|
|
74
|
+
status: 'fundraising',
|
|
75
|
+
loanAmount: '1000.00',
|
|
76
|
+
borrowerCount: 1,
|
|
77
|
+
activity: {
|
|
78
|
+
id: 61,
|
|
79
|
+
name: 'Dairy',
|
|
80
|
+
__typename: 'Activity',
|
|
81
|
+
},
|
|
82
|
+
sector: {
|
|
83
|
+
id: 1,
|
|
84
|
+
name: 'Agriculture',
|
|
85
|
+
__typename: 'Sector',
|
|
86
|
+
},
|
|
87
|
+
plannedExpirationDate: nextWeek.toISOString(),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const combinedActivities = [
|
|
91
|
+
{
|
|
92
|
+
key: 'Mon Nov 13 2023',
|
|
93
|
+
data: [
|
|
94
|
+
{
|
|
95
|
+
lenderName: 'Erica',
|
|
96
|
+
lenderImage: 'https://www.development.kiva.org/img/s100/4d844ac2c0b77a8a522741b908ea5c32.jpg',
|
|
97
|
+
text: 'Erica lent $5',
|
|
98
|
+
date: '2023-11-13T10:51:10Z',
|
|
99
|
+
type: 'LendingAction',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'Tue Nov 07 2023',
|
|
105
|
+
data: [
|
|
106
|
+
{
|
|
107
|
+
lenderName: 'Joy',
|
|
108
|
+
lenderImage: 'https://www.development.kiva.org/img/s100/4d844ac2c0b77a8a522741b908ea5c32.jpg',
|
|
109
|
+
text: 'Joy left comment <span class="tw-italic">"I know him and his wife and they work hard to make everything they do the best. His farm and bake goods are amazing. He just keeps working harder and harder to do more and reach out to the community in everyway."</span>',
|
|
110
|
+
date: '2023-11-08T02:37:56Z',
|
|
111
|
+
type: 'Comment',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
lenderName: 'Joy',
|
|
115
|
+
lenderImage: 'https://www.development.kiva.org/img/s100/4d844ac2c0b77a8a522741b908ea5c32.jpg',
|
|
116
|
+
text: 'Joy lent $25',
|
|
117
|
+
date: '2023-11-08T02:32:20Z',
|
|
118
|
+
type: 'LendingAction',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
const kvTrackFunction = () => { };
|
|
125
|
+
|
|
126
|
+
const photoPath = 'https://www-kiva-org.freetls.fastly.net/img/';
|
|
127
|
+
|
|
128
|
+
export const Loading = story({
|
|
129
|
+
loanId: loan.id,
|
|
130
|
+
loan: undefined,
|
|
131
|
+
kvTrackFunction,
|
|
132
|
+
photoPath,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export const PartialLoading = story({
|
|
136
|
+
loanId: loan.id,
|
|
137
|
+
loan: {
|
|
138
|
+
...loan,
|
|
139
|
+
unreservedAmount: undefined,
|
|
140
|
+
fundraisingPercent: undefined,
|
|
141
|
+
},
|
|
142
|
+
kvTrackFunction,
|
|
143
|
+
photoPath,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const UseFullWidth = story({
|
|
147
|
+
loanId: loan.id,
|
|
148
|
+
loan,
|
|
149
|
+
kvTrackFunction,
|
|
150
|
+
photoPath,
|
|
151
|
+
useFullWidth: true,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export const ShowTags = story({
|
|
155
|
+
loanId: loan.id,
|
|
156
|
+
loan: {
|
|
157
|
+
...loan,
|
|
158
|
+
loanFundraisingInfo: {
|
|
159
|
+
fundedAmount: '950.00',
|
|
160
|
+
isExpiringSoon: false,
|
|
161
|
+
reservedAmount: '0.00',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
kvTrackFunction,
|
|
165
|
+
photoPath,
|
|
166
|
+
showTags: true,
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
export const CustomCallouts = story({
|
|
170
|
+
loanId: loan.id,
|
|
171
|
+
loan: {
|
|
172
|
+
...loan,
|
|
173
|
+
loanFundraisingInfo: {
|
|
174
|
+
fundedAmount: '950.00',
|
|
175
|
+
isExpiringSoon: false,
|
|
176
|
+
reservedAmount: '0.00',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
kvTrackFunction,
|
|
180
|
+
photoPath,
|
|
181
|
+
showTags: true,
|
|
182
|
+
customCallouts: ['Loan Length: 15mo'],
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export const CustomCalloutsWrap = story({
|
|
186
|
+
loanId: loan.id,
|
|
187
|
+
loan: {
|
|
188
|
+
...loan,
|
|
189
|
+
loanFundraisingInfo: {
|
|
190
|
+
fundedAmount: '950.00',
|
|
191
|
+
isExpiringSoon: false,
|
|
192
|
+
reservedAmount: '0.00',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
kvTrackFunction,
|
|
196
|
+
photoPath,
|
|
197
|
+
showTags: true,
|
|
198
|
+
customCallouts: ['Loan Length: 15mo', 'Long Dairy Processing'],
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
export const Matched = story({
|
|
202
|
+
loanId: loan.id,
|
|
203
|
+
loan: {
|
|
204
|
+
...loan,
|
|
205
|
+
matchingText: 'Matched by Ebay',
|
|
206
|
+
matchRatio: 1,
|
|
207
|
+
loanFundraisingInfo: {
|
|
208
|
+
fundedAmount: '200.00',
|
|
209
|
+
isExpiringSoon: false,
|
|
210
|
+
reservedAmount: '0.00',
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
kvTrackFunction,
|
|
214
|
+
photoPath,
|
|
215
|
+
showTags: true,
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
export const AllSharesReserved = story({
|
|
219
|
+
loanId: loan.id,
|
|
220
|
+
loan: {
|
|
221
|
+
...loan,
|
|
222
|
+
unreservedAmount: '0.00',
|
|
223
|
+
fundraisingPercent: 1,
|
|
224
|
+
},
|
|
225
|
+
kvTrackFunction,
|
|
226
|
+
photoPath,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
export const InBasket = story({
|
|
230
|
+
loanId: loan.id,
|
|
231
|
+
loan,
|
|
232
|
+
kvTrackFunction,
|
|
233
|
+
photoPath,
|
|
234
|
+
basketItems: [{ id: loan.id, __typename: 'LoanReservation' }],
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export const LargeCardLoading = story({
|
|
238
|
+
loanId: loan.id,
|
|
239
|
+
loan: undefined,
|
|
240
|
+
kvTrackFunction,
|
|
241
|
+
photoPath,
|
|
242
|
+
largeCard: true,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
export const LargeCard = story({
|
|
246
|
+
loanId: loan.id,
|
|
247
|
+
loan,
|
|
248
|
+
showTags: true,
|
|
249
|
+
largeCard: true,
|
|
250
|
+
kvTrackFunction,
|
|
251
|
+
photoPath,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export const LongCallouts = story({
|
|
255
|
+
loanId: loan.id,
|
|
256
|
+
loan: {
|
|
257
|
+
...loan,
|
|
258
|
+
activity: { id: 1, name: 'Longer activity name test that will be longer than 50% of the card' },
|
|
259
|
+
},
|
|
260
|
+
showTags: true,
|
|
261
|
+
kvTrackFunction,
|
|
262
|
+
photoPath,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export const LseLoan = story({
|
|
266
|
+
loanId: loan.id,
|
|
267
|
+
loan: {
|
|
268
|
+
...loan,
|
|
269
|
+
loanFundraisingInfo: {
|
|
270
|
+
fundedAmount: '950.00',
|
|
271
|
+
isExpiringSoon: false,
|
|
272
|
+
reservedAmount: '0.00',
|
|
273
|
+
},
|
|
274
|
+
partnerName: 'N/A, direct to Novulis',
|
|
275
|
+
tags: [
|
|
276
|
+
'user_favorite',
|
|
277
|
+
'#Woman-Owned Business',
|
|
278
|
+
'#Animals',
|
|
279
|
+
'#Repeat Borrower',
|
|
280
|
+
'#Supporting Family',
|
|
281
|
+
'#Eco-friendly',
|
|
282
|
+
'#Single parent',
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
kvTrackFunction,
|
|
286
|
+
photoPath,
|
|
287
|
+
showTags: true,
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
export const Bookmarked = story({
|
|
291
|
+
loanId: loan.id,
|
|
292
|
+
loan,
|
|
293
|
+
isBookmarked: true,
|
|
294
|
+
isVisitor: false,
|
|
295
|
+
kvTrackFunction,
|
|
296
|
+
photoPath,
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
export const Adding = story({
|
|
300
|
+
loanId: loan.id,
|
|
301
|
+
loan,
|
|
302
|
+
isAdding: true,
|
|
303
|
+
kvTrackFunction,
|
|
304
|
+
photoPath,
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
export const FiveDollarNotes = story({
|
|
308
|
+
loanId: loan.id,
|
|
309
|
+
loan,
|
|
310
|
+
enableFiveDollarsNotes: true,
|
|
311
|
+
kvTrackFunction,
|
|
312
|
+
photoPath,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
export const FiveDollarsSelected = story({
|
|
316
|
+
loanId: loan.id,
|
|
317
|
+
loan,
|
|
318
|
+
enableFiveDollarsNotes: true,
|
|
319
|
+
fiveDollarsSelected: true,
|
|
320
|
+
kvTrackFunction,
|
|
321
|
+
photoPath,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const ViewLoan = story({
|
|
325
|
+
loanId: loan.id,
|
|
326
|
+
loan,
|
|
327
|
+
kvTrackFunction,
|
|
328
|
+
photoPath,
|
|
329
|
+
showViewLoan: true,
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
export const ViewLoanFunded = story({
|
|
333
|
+
loanId: loan.id,
|
|
334
|
+
loan: {
|
|
335
|
+
...loan,
|
|
336
|
+
unreservedAmount: '0.00',
|
|
337
|
+
fundraisingPercent: 1,
|
|
338
|
+
},
|
|
339
|
+
kvTrackFunction,
|
|
340
|
+
photoPath,
|
|
341
|
+
showViewLoan: true,
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
export const LendAgain = story({
|
|
345
|
+
loanId: loan.id,
|
|
346
|
+
loan: {
|
|
347
|
+
...loan,
|
|
348
|
+
userProperties: { lentTo: true },
|
|
349
|
+
},
|
|
350
|
+
kvTrackFunction,
|
|
351
|
+
photoPath,
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
export const TeamPick = story({
|
|
355
|
+
loanId: loan.id,
|
|
356
|
+
loan,
|
|
357
|
+
kvTrackFunction,
|
|
358
|
+
photoPath,
|
|
359
|
+
isTeamPick: true,
|
|
360
|
+
isVisitor: false,
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
export const TeamPickVisitor = story({
|
|
364
|
+
loanId: loan.id,
|
|
365
|
+
loan,
|
|
366
|
+
kvTrackFunction,
|
|
367
|
+
photoPath,
|
|
368
|
+
isTeamPick: true,
|
|
369
|
+
isVisitor: true,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
export const ActivityFeed = story({
|
|
373
|
+
loanId: loan.id,
|
|
374
|
+
loan: {
|
|
375
|
+
...loan,
|
|
376
|
+
loanFundraisingInfo: {
|
|
377
|
+
fundedAmount: '950.00',
|
|
378
|
+
isExpiringSoon: false,
|
|
379
|
+
reservedAmount: '0.00',
|
|
380
|
+
},
|
|
381
|
+
lenders: {
|
|
382
|
+
totalCount: 7,
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
kvTrackFunction,
|
|
386
|
+
photoPath,
|
|
387
|
+
combinedActivities,
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
export const HugeLentAmount = story({
|
|
391
|
+
loanId: loan.id,
|
|
392
|
+
loan: {
|
|
393
|
+
...loan,
|
|
394
|
+
unreservedAmount: '850.00',
|
|
395
|
+
},
|
|
396
|
+
kvTrackFunction,
|
|
397
|
+
photoPath,
|
|
398
|
+
isVisitor: false,
|
|
399
|
+
enableHugeAmount: true,
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
export const SupportButton = story({
|
|
403
|
+
loanId: loan.id,
|
|
404
|
+
loan,
|
|
405
|
+
primaryButtonText: 'Support',
|
|
406
|
+
kvTrackFunction,
|
|
407
|
+
photoPath,
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
export const SupportAgain = story({
|
|
411
|
+
loanId: loan.id,
|
|
412
|
+
loan: {
|
|
413
|
+
...loan,
|
|
414
|
+
userProperties: { lentTo: true },
|
|
415
|
+
},
|
|
416
|
+
primaryButtonText: 'Support',
|
|
417
|
+
kvTrackFunction,
|
|
418
|
+
photoPath,
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
export const CustomShowLoanDetails = story({
|
|
422
|
+
loanId: loan.id,
|
|
423
|
+
loan: {
|
|
424
|
+
...loan,
|
|
425
|
+
userProperties: { lentTo: true },
|
|
426
|
+
},
|
|
427
|
+
primaryButtonText: 'Support',
|
|
428
|
+
kvTrackFunction,
|
|
429
|
+
photoPath,
|
|
430
|
+
customLoanDetails: true,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
export const RemoveButton = story({
|
|
434
|
+
loanId: loan.id,
|
|
435
|
+
loan,
|
|
436
|
+
kvTrackFunction,
|
|
437
|
+
photoPath,
|
|
438
|
+
basketItems: [{ id: loan.id, __typename: 'LoanReservation' }],
|
|
439
|
+
secondaryButtonText: 'Remove Loan',
|
|
440
|
+
secondaryButtonHandler: () => { },
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
export const ContributorsAndAmount = story({
|
|
444
|
+
loanId: loan.id,
|
|
445
|
+
loan: {
|
|
446
|
+
...loan,
|
|
447
|
+
loanFundraisingInfo: {
|
|
448
|
+
fundedAmount: '950.00',
|
|
449
|
+
reservedAmount: '0.00',
|
|
450
|
+
isExpiringSoon: false,
|
|
451
|
+
},
|
|
452
|
+
lenders: {
|
|
453
|
+
totalCount: 7,
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
kvTrackFunction,
|
|
457
|
+
photoPath,
|
|
458
|
+
showContributors: true,
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
export const USLoan = story({
|
|
462
|
+
loanId: loan.id,
|
|
463
|
+
loan: {
|
|
464
|
+
...loan,
|
|
465
|
+
geocode: {
|
|
466
|
+
city: 'Kittanning',
|
|
467
|
+
state: 'PA',
|
|
468
|
+
country: {
|
|
469
|
+
isoCode: 'US',
|
|
470
|
+
name: 'United States',
|
|
471
|
+
region: 'North America',
|
|
472
|
+
__typename: 'Country',
|
|
473
|
+
},
|
|
474
|
+
__typename: 'Geocode',
|
|
475
|
+
},
|
|
476
|
+
distributionModel: 'direct',
|
|
477
|
+
},
|
|
478
|
+
kvTrackFunction,
|
|
479
|
+
photoPath,
|
|
480
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import KvCommentsAdd from '../KvCommentsAdd.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'KvCommentsAdd',
|
|
5
|
+
component: KvCommentsAdd,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const story = (args) => {
|
|
9
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { KvCommentsAdd },
|
|
12
|
+
setup() { return { args: templateArgs }; },
|
|
13
|
+
template: `
|
|
14
|
+
<div style="max-width: 800px;">
|
|
15
|
+
<KvCommentsAdd v-bind="args" />
|
|
16
|
+
</div>
|
|
17
|
+
`,
|
|
18
|
+
});
|
|
19
|
+
template.args = args;
|
|
20
|
+
return template;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Default = story({});
|
|
24
|
+
|
|
25
|
+
export const UserName = story({
|
|
26
|
+
userDisplayName: 'User',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const UserInfo = story({
|
|
30
|
+
userImageUrl: 'https://via.placeholder.com/50x50',
|
|
31
|
+
userDisplayName: 'User',
|
|
32
|
+
});
|