@kiva/kv-components 3.107.0 → 3.107.2
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 +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.js +9 -0
- package/dist/utils/attrs.js +7 -0
- package/dist/utils/carousels.js +8 -0
- package/dist/{attrs.js → utils/chunk-3HK4G4NT.js} +1 -0
- package/dist/{loanCard.js → utils/chunk-55HF2ORX.js} +1 -0
- package/dist/{expander.js → utils/chunk-AY3PR5S4.js} +3 -2
- package/dist/{carousels.js → utils/chunk-AZPWOFD5.js} +1 -0
- package/dist/{printing.js → utils/chunk-B5J5WLAH.js} +1 -0
- package/dist/{Alea.js → utils/chunk-GPSH6OPA.js} +2 -1
- package/dist/{scrollLock.js → utils/chunk-HIY5IW65.js} +2 -1
- package/dist/{treemap.js → utils/chunk-MSMZIN54.js} +1 -0
- package/dist/{imageUtils.js → utils/chunk-OXJCCNNW.js} +1 -0
- package/dist/{touchEvents.js → utils/chunk-S3MABILA.js} +3 -2
- package/dist/{mapUtils.js → utils/chunk-VIGEMAKO.js} +5 -4
- package/dist/utils/chunk-YCNMJ4YV.js +37 -0
- package/dist/{loanUtils.js → utils/chunk-YFEC5ODJ.js} +7 -6
- package/dist/utils/expander.js +9 -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.js +9 -0
- package/dist/utils/loanUtils.js +23 -0
- package/dist/utils/mapUtils.js +15 -0
- package/dist/utils/printing.js +9 -0
- package/dist/utils/scrollLock.js +13 -0
- package/dist/{throttle.js → utils/throttle.js} +1 -0
- package/dist/utils/touchEvents.js +11 -0
- package/dist/utils/treemap.js +7 -0
- package/package.json +11 -7
- package/utils/index.js +14 -0
- package/index.js +0 -3
- /package/dist/{Alea.cjs → utils/Alea.cjs} +0 -0
- /package/dist/{attrs.cjs → utils/attrs.cjs} +0 -0
- /package/dist/{carousels.cjs → utils/carousels.cjs} +0 -0
- /package/dist/{chunk-HV3AUBFT.js → utils/chunk-HV3AUBFT.js} +0 -0
- /package/dist/{expander.cjs → utils/expander.cjs} +0 -0
- /package/dist/{imageUtils.cjs → utils/imageUtils.cjs} +0 -0
- /package/dist/{loanCard.cjs → utils/loanCard.cjs} +0 -0
- /package/dist/{loanUtils.cjs → utils/loanUtils.cjs} +0 -0
- /package/dist/{mapUtils.cjs → utils/mapUtils.cjs} +0 -0
- /package/dist/{printing.cjs → utils/printing.cjs} +0 -0
- /package/dist/{scrollLock.cjs → utils/scrollLock.cjs} +0 -0
- /package/dist/{throttle.cjs → utils/throttle.cjs} +0 -0
- /package/dist/{touchEvents.cjs → utils/touchEvents.cjs} +0 -0
- /package/dist/{treemap.cjs → utils/treemap.cjs} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import KvRadio from '../KvRadio.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Forms/KvRadio',
|
|
5
|
+
component: KvRadio,
|
|
6
|
+
args: {
|
|
7
|
+
checked: false,
|
|
8
|
+
disabled: false,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args, {
|
|
13
|
+
argTypes,
|
|
14
|
+
}) => ({
|
|
15
|
+
props: Object.keys(argTypes),
|
|
16
|
+
components: {
|
|
17
|
+
KvRadio,
|
|
18
|
+
},
|
|
19
|
+
data: () => ({
|
|
20
|
+
radioExampleModel: 'three',
|
|
21
|
+
}),
|
|
22
|
+
template: `
|
|
23
|
+
<div>
|
|
24
|
+
<fieldset>
|
|
25
|
+
<legend class="tw-text-h4 tw-mb-2">Choose a Radio</legend>
|
|
26
|
+
<div class="tw-flex tw-flex-col tw-gap-2 tw-mb-2">
|
|
27
|
+
<kv-radio
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
value="one"
|
|
30
|
+
v-model="radioExampleModel"
|
|
31
|
+
@change="onChange"
|
|
32
|
+
@focus="onFocus"
|
|
33
|
+
>
|
|
34
|
+
One radio button
|
|
35
|
+
</kv-radio>
|
|
36
|
+
<kv-radio
|
|
37
|
+
:disabled="disabled"
|
|
38
|
+
value="two"
|
|
39
|
+
v-model="radioExampleModel"
|
|
40
|
+
@change="onChange"
|
|
41
|
+
@focus="onFocus"
|
|
42
|
+
>
|
|
43
|
+
Two radio button
|
|
44
|
+
</kv-radio>
|
|
45
|
+
<kv-radio
|
|
46
|
+
:disabled="disabled"
|
|
47
|
+
value="three"
|
|
48
|
+
v-model="radioExampleModel"
|
|
49
|
+
@change="onChange"
|
|
50
|
+
@focus="onFocus"
|
|
51
|
+
>
|
|
52
|
+
Three radio button
|
|
53
|
+
</kv-radio>
|
|
54
|
+
<kv-radio
|
|
55
|
+
:disabled="disabled"
|
|
56
|
+
value="four"
|
|
57
|
+
v-model="radioExampleModel"
|
|
58
|
+
@change="onChange"
|
|
59
|
+
@focus="onFocus"
|
|
60
|
+
>
|
|
61
|
+
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.
|
|
62
|
+
</kv-radio>
|
|
63
|
+
</div>
|
|
64
|
+
</fieldset>
|
|
65
|
+
<p>Selected: {{radioExampleModel}}</p>
|
|
66
|
+
</div>`,
|
|
67
|
+
methods: {
|
|
68
|
+
onChange(val) {
|
|
69
|
+
console.log(val);
|
|
70
|
+
},
|
|
71
|
+
onFocus(e) {
|
|
72
|
+
console.log(e);
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Default = Template.bind({});
|
|
78
|
+
|
|
79
|
+
export const Disabled = Template.bind({});
|
|
80
|
+
Disabled.args = {
|
|
81
|
+
disabled: true,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const WithoutVModel = (args, {
|
|
85
|
+
argTypes,
|
|
86
|
+
}) => ({
|
|
87
|
+
props: Object.keys(argTypes),
|
|
88
|
+
components: {
|
|
89
|
+
KvRadio,
|
|
90
|
+
},
|
|
91
|
+
data: () => ({
|
|
92
|
+
radioExampleModel: 'three',
|
|
93
|
+
}),
|
|
94
|
+
template: `
|
|
95
|
+
<div>
|
|
96
|
+
<fieldset>
|
|
97
|
+
<legend class="tw-text-h4 tw-mb-2">Choose a Radio</legend>
|
|
98
|
+
<div class="tw-flex tw-flex-col tw-gap-2 tw-mb-2">
|
|
99
|
+
<kv-radio
|
|
100
|
+
:disabled="disabled"
|
|
101
|
+
value="one"
|
|
102
|
+
name="my_group"
|
|
103
|
+
:checked="radioExampleModel === 'one'"
|
|
104
|
+
@change="(val) => radioExampleModel = val"
|
|
105
|
+
>
|
|
106
|
+
One radio button
|
|
107
|
+
</kv-radio>
|
|
108
|
+
<kv-radio
|
|
109
|
+
:disabled="true"
|
|
110
|
+
value="two"
|
|
111
|
+
name="my_group"
|
|
112
|
+
:checked="radioExampleModel === 'two'"
|
|
113
|
+
@change="(val) => radioExampleModel = val"
|
|
114
|
+
>
|
|
115
|
+
Two radio button
|
|
116
|
+
</kv-radio>
|
|
117
|
+
<kv-radio
|
|
118
|
+
:disabled="disabled"
|
|
119
|
+
value="three"
|
|
120
|
+
name="my_group"
|
|
121
|
+
:checked="radioExampleModel === 'three'"
|
|
122
|
+
@change="(val) => radioExampleModel = val"
|
|
123
|
+
>
|
|
124
|
+
Three radio button
|
|
125
|
+
</kv-radio>
|
|
126
|
+
<kv-radio
|
|
127
|
+
:disabled="disabled"
|
|
128
|
+
value="four"
|
|
129
|
+
name="my_group"
|
|
130
|
+
:checked="radioExampleModel === 'four'"
|
|
131
|
+
@change="(val) => radioExampleModel = val"
|
|
132
|
+
>
|
|
133
|
+
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.
|
|
134
|
+
</kv-radio>
|
|
135
|
+
</div>
|
|
136
|
+
</fieldset>
|
|
137
|
+
<p>Selected: {{radioExampleModel}}</p>
|
|
138
|
+
</div>
|
|
139
|
+
`,
|
|
140
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import KvSelect from '../KvSelect.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Forms/KvSelect',
|
|
5
|
+
component: KvSelect,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args, {
|
|
9
|
+
argTypes,
|
|
10
|
+
}) => ({
|
|
11
|
+
props: Object.keys(argTypes),
|
|
12
|
+
components: {
|
|
13
|
+
KvSelect,
|
|
14
|
+
},
|
|
15
|
+
data: () => ({
|
|
16
|
+
exampleModel: 'example2',
|
|
17
|
+
}),
|
|
18
|
+
template: `
|
|
19
|
+
<div>
|
|
20
|
+
<label
|
|
21
|
+
for="example-id"
|
|
22
|
+
class="tw-text-h4 tw-block"
|
|
23
|
+
>
|
|
24
|
+
Choose an example
|
|
25
|
+
</label>
|
|
26
|
+
<kv-select
|
|
27
|
+
id="example-id"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
@change="onChange"
|
|
30
|
+
v-model="exampleModel"
|
|
31
|
+
class="tw-mt-2"
|
|
32
|
+
>
|
|
33
|
+
<option value="example1">Example one</option>
|
|
34
|
+
<option value="example2">Example two</option>
|
|
35
|
+
<option value="example3">Example three</option>
|
|
36
|
+
</kv-select>
|
|
37
|
+
</div>`,
|
|
38
|
+
methods: {
|
|
39
|
+
onChange(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 LabelHidden = (args, {
|
|
53
|
+
argTypes,
|
|
54
|
+
}) => ({
|
|
55
|
+
props: Object.keys(argTypes),
|
|
56
|
+
components: {
|
|
57
|
+
KvSelect,
|
|
58
|
+
},
|
|
59
|
+
data: () => ({
|
|
60
|
+
exampleModel: 'example1',
|
|
61
|
+
}),
|
|
62
|
+
template: `
|
|
63
|
+
<div>
|
|
64
|
+
<label
|
|
65
|
+
for="example-id"
|
|
66
|
+
class="tw-text-h4 tw-block tw-sr-only"
|
|
67
|
+
>
|
|
68
|
+
Choose an example
|
|
69
|
+
</label>
|
|
70
|
+
|
|
71
|
+
<kv-select
|
|
72
|
+
id="example-id"
|
|
73
|
+
:disabled="disabled"
|
|
74
|
+
@change="onChange"
|
|
75
|
+
v-model="exampleModel"
|
|
76
|
+
>
|
|
77
|
+
<option value="example1">Example one</option>
|
|
78
|
+
<option value="example2">Example two</option>
|
|
79
|
+
<option value="example3">Example three</option>
|
|
80
|
+
</kv-select>
|
|
81
|
+
</div>`,
|
|
82
|
+
methods: {
|
|
83
|
+
onChange(e) {
|
|
84
|
+
console.log(e);
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const WidthSet = (args, {
|
|
90
|
+
argTypes,
|
|
91
|
+
}) => ({
|
|
92
|
+
props: Object.keys(argTypes),
|
|
93
|
+
components: {
|
|
94
|
+
KvSelect,
|
|
95
|
+
},
|
|
96
|
+
data: () => ({
|
|
97
|
+
exampleModel: 'example1',
|
|
98
|
+
}),
|
|
99
|
+
template: `
|
|
100
|
+
<div class="w-full">
|
|
101
|
+
<label
|
|
102
|
+
for="example-id"
|
|
103
|
+
class="tw-text-h4 tw-block"
|
|
104
|
+
>
|
|
105
|
+
Choose an example
|
|
106
|
+
</label>
|
|
107
|
+
|
|
108
|
+
<kv-select
|
|
109
|
+
id="example-id"
|
|
110
|
+
:disabled="disabled"
|
|
111
|
+
@change="onChange"
|
|
112
|
+
v-model="exampleModel"
|
|
113
|
+
class="tw-mt-2 tw-w-full"
|
|
114
|
+
>
|
|
115
|
+
<option value="example1">Example one</option>
|
|
116
|
+
<option value="example2">Example two</option>
|
|
117
|
+
<option value="example3">Example three</option>
|
|
118
|
+
</kv-select>
|
|
119
|
+
</div>`,
|
|
120
|
+
methods: {
|
|
121
|
+
onChange(e) {
|
|
122
|
+
console.log(e);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import KvSideSheet from '../KvSideSheet.vue';
|
|
2
|
+
import KvButton from '../KvButton.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'KvSideSheet',
|
|
6
|
+
component: KvSideSheet,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args, {
|
|
10
|
+
argTypes,
|
|
11
|
+
}) => ({
|
|
12
|
+
props: Object.keys(argTypes),
|
|
13
|
+
components: {
|
|
14
|
+
KvSideSheet,
|
|
15
|
+
KvButton,
|
|
16
|
+
},
|
|
17
|
+
template: `
|
|
18
|
+
<div>
|
|
19
|
+
<kv-button @click="isVisible = true">Show Side Sheet</kv-button>
|
|
20
|
+
<kv-side-sheet
|
|
21
|
+
:visible="isVisible"
|
|
22
|
+
:kv-track-function="kvTrackMock"
|
|
23
|
+
track-event-category="new-loan-card"
|
|
24
|
+
:show-go-to-link="true"
|
|
25
|
+
@side-sheet-closed="isVisible = false"
|
|
26
|
+
>
|
|
27
|
+
<div>
|
|
28
|
+
Some content
|
|
29
|
+
</div>
|
|
30
|
+
</kv-side-sheet>
|
|
31
|
+
</div>`,
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
isVisible: args.visible,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
kvTrackMock(
|
|
39
|
+
category,
|
|
40
|
+
action,
|
|
41
|
+
label,
|
|
42
|
+
property,
|
|
43
|
+
value,
|
|
44
|
+
) {
|
|
45
|
+
console.log(category, action, label, property, value);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const Default = Template.bind({});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import KvSwitch from '../KvSwitch.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Forms/KvSwitch',
|
|
5
|
+
component: KvSwitch,
|
|
6
|
+
args: {
|
|
7
|
+
checked: false,
|
|
8
|
+
disabled: false,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args, {
|
|
13
|
+
argTypes,
|
|
14
|
+
}) => ({
|
|
15
|
+
props: Object.keys(argTypes),
|
|
16
|
+
components: {
|
|
17
|
+
KvSwitch,
|
|
18
|
+
},
|
|
19
|
+
data: () => ({
|
|
20
|
+
switchExampleModel: false,
|
|
21
|
+
}),
|
|
22
|
+
template: `
|
|
23
|
+
<div>
|
|
24
|
+
<kv-switch
|
|
25
|
+
:disabled="disabled"
|
|
26
|
+
v-model="switchExampleModel"
|
|
27
|
+
@change="onChange"
|
|
28
|
+
>
|
|
29
|
+
Switch is switched: {{switchExampleModel}}
|
|
30
|
+
</kv-switch>
|
|
31
|
+
</div>`,
|
|
32
|
+
methods: {
|
|
33
|
+
onChange(e) {
|
|
34
|
+
console.log(e);
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const Default = Template.bind({});
|
|
40
|
+
|
|
41
|
+
export const Disabled = Template.bind({});
|
|
42
|
+
Disabled.args = {
|
|
43
|
+
disabled: true,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const WithoutVModel = (args, {
|
|
47
|
+
argTypes,
|
|
48
|
+
}) => ({
|
|
49
|
+
props: Object.keys(argTypes),
|
|
50
|
+
components: {
|
|
51
|
+
KvSwitch,
|
|
52
|
+
},
|
|
53
|
+
data: () => ({
|
|
54
|
+
switchExampleModel: false,
|
|
55
|
+
}),
|
|
56
|
+
template: `
|
|
57
|
+
<div>
|
|
58
|
+
<kv-switch
|
|
59
|
+
:modelValue="switchExampleModel"
|
|
60
|
+
@update:modelValue="(val) => switchExampleModel = val"
|
|
61
|
+
:disabled="disabled"
|
|
62
|
+
>
|
|
63
|
+
Switch is switched: {{switchExampleModel}}
|
|
64
|
+
</kv-switch>
|
|
65
|
+
</div>`,
|
|
66
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import KvTabs from '../KvTabs.vue';
|
|
2
|
+
import KvTab from '../KvTab.vue';
|
|
3
|
+
import KvTabPanel from '../KvTabPanel.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'KvTabs',
|
|
7
|
+
component: KvTabs,
|
|
8
|
+
args: {
|
|
9
|
+
vertical: true,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const DefaultTemplate = () => ({
|
|
14
|
+
components: { KvTabs, KvTab, KvTabPanel },
|
|
15
|
+
template: `
|
|
16
|
+
<kv-tabs @tab-changed="handleTabChanged">
|
|
17
|
+
<template #tabNav>
|
|
18
|
+
<kv-tab forPanel="demo-1-first">First</kv-tab>
|
|
19
|
+
<kv-tab forPanel="demo-1-second">Second</kv-tab>
|
|
20
|
+
<kv-tab forPanel="demo-1-third">Third</kv-tab>
|
|
21
|
+
<kv-tab forPanel="demo-1-forth">Forth is longer</kv-tab>
|
|
22
|
+
</template>
|
|
23
|
+
<template #tabPanels>
|
|
24
|
+
<kv-tab-panel id="demo-1-first"><p>First Panel</p></kv-tab-panel>
|
|
25
|
+
<kv-tab-panel id="demo-1-second"><p>Second Panel has <br>longer<br>content</p></kv-tab-panel>
|
|
26
|
+
<kv-tab-panel id="demo-1-third"><p>Third Panel</p></kv-tab-panel>
|
|
27
|
+
<kv-tab-panel id="demo-1-forth"><p>Forth Panel</p></kv-tab-panel>
|
|
28
|
+
</template>
|
|
29
|
+
</kv-tabs>
|
|
30
|
+
`,
|
|
31
|
+
methods: {
|
|
32
|
+
handleTabChanged(index) {
|
|
33
|
+
console.log(index);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const InitialTabSelection = () => ({
|
|
39
|
+
components: { KvTabs, KvTab, KvTabPanel },
|
|
40
|
+
template: `
|
|
41
|
+
<kv-tabs @tab-changed="handleTabChanged">
|
|
42
|
+
<template #tabNav>
|
|
43
|
+
<kv-tab forPanel="demo-2-first">First tab name</kv-tab>
|
|
44
|
+
<kv-tab forPanel="demo-2-second" :selected="true">Second is initially selected</kv-tab>
|
|
45
|
+
<kv-tab forPanel="demo-2-third">Third tab name</kv-tab>
|
|
46
|
+
<kv-tab forPanel="demo-2-forth">Forth tab name is quite long</kv-tab>
|
|
47
|
+
</template>
|
|
48
|
+
<template #tabPanels>
|
|
49
|
+
<kv-tab-panel id="demo-2-first"><p>First Panel</p></kv-tab-panel>
|
|
50
|
+
<kv-tab-panel id="demo-2-second"><p>Second Panel has <br>longer<br>content</p></kv-tab-panel>
|
|
51
|
+
<kv-tab-panel id="demo-2-third"><p>Third Panel</p></kv-tab-panel>
|
|
52
|
+
<kv-tab-panel id="demo-2-forth"><p>Forth Panel</p></kv-tab-panel>
|
|
53
|
+
</template>
|
|
54
|
+
</kv-tabs>
|
|
55
|
+
`,
|
|
56
|
+
methods: {
|
|
57
|
+
handleTabChanged(index) {
|
|
58
|
+
console.log(index);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const VerticalOrientation = (args, { argTypes }) => ({
|
|
64
|
+
props: Object.keys(argTypes),
|
|
65
|
+
components: { KvTabs, KvTab, KvTabPanel },
|
|
66
|
+
template: `
|
|
67
|
+
<kv-tabs @tab-changed="handleTabChanged" :vertical="vertical">
|
|
68
|
+
<template #tabNav>
|
|
69
|
+
<kv-tab :vertical="vertical" forPanel="demo-1-first">First</kv-tab>
|
|
70
|
+
<kv-tab :vertical="vertical" forPanel="demo-1-second">Second</kv-tab>
|
|
71
|
+
<kv-tab :vertical="vertical" forPanel="demo-1-third">Third</kv-tab>
|
|
72
|
+
<kv-tab :vertical="vertical" forPanel="demo-1-forth">Forth is longer</kv-tab>
|
|
73
|
+
</template>
|
|
74
|
+
<template #tabPanels>
|
|
75
|
+
<kv-tab-panel id="demo-1-first"><p>First Panel</p></kv-tab-panel>
|
|
76
|
+
<kv-tab-panel id="demo-1-second"><p>Second Panel has <br>longer<br>content</p></kv-tab-panel>
|
|
77
|
+
<kv-tab-panel id="demo-1-third"><p>Third Panel</p></kv-tab-panel>
|
|
78
|
+
<kv-tab-panel id="demo-1-forth"><p>Forth Panel</p></kv-tab-panel>
|
|
79
|
+
</template>
|
|
80
|
+
</kv-tabs>
|
|
81
|
+
`,
|
|
82
|
+
methods: {
|
|
83
|
+
handleTabChanged(index) {
|
|
84
|
+
console.log(index);
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const MultipleOnAPage = () => ({
|
|
90
|
+
components: { KvTabs, KvTab, KvTabPanel },
|
|
91
|
+
template: `
|
|
92
|
+
<div>
|
|
93
|
+
<div class="tw-mb-8">
|
|
94
|
+
${DefaultTemplate().template}
|
|
95
|
+
</div>
|
|
96
|
+
<div class="tw-mb-8">
|
|
97
|
+
${InitialTabSelection().template}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
`,
|
|
101
|
+
methods: {
|
|
102
|
+
handleTabChanged(index) {
|
|
103
|
+
console.log(index);
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { mdiMagnify } from '@mdi/js';
|
|
2
|
+
import { nanoid } from 'nanoid';
|
|
3
|
+
import KvTextInput from '../KvTextInput.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Forms/KvTextInput',
|
|
7
|
+
component: KvTextInput,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const DefaultTemplate = (args, {
|
|
11
|
+
argTypes,
|
|
12
|
+
}) => ({
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
components: {
|
|
15
|
+
KvTextInput,
|
|
16
|
+
},
|
|
17
|
+
data: () => ({
|
|
18
|
+
textInputModel: '1640 Riverside Drive',
|
|
19
|
+
uuid: `kvt-${nanoid(10)}`,
|
|
20
|
+
}),
|
|
21
|
+
template: `
|
|
22
|
+
<div>
|
|
23
|
+
<label
|
|
24
|
+
:for="uuid"
|
|
25
|
+
class="tw-text-h4 tw-block tw-pb-1"
|
|
26
|
+
>
|
|
27
|
+
Street Address
|
|
28
|
+
</label>
|
|
29
|
+
<kv-text-input
|
|
30
|
+
:id="uuid"
|
|
31
|
+
:disabled="disabled"
|
|
32
|
+
:placeholder="placeholder"
|
|
33
|
+
:valid="valid"
|
|
34
|
+
:icon="icon"
|
|
35
|
+
:canClear="canClear"
|
|
36
|
+
v-model="textInputModel"
|
|
37
|
+
@input="onInput"
|
|
38
|
+
style="width: 25rem;"
|
|
39
|
+
/>
|
|
40
|
+
</div>`,
|
|
41
|
+
methods: {
|
|
42
|
+
onInput(e) {
|
|
43
|
+
console.log(e);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const Default = DefaultTemplate.bind({});
|
|
49
|
+
|
|
50
|
+
export const WithoutVModelTemplate = (args, {
|
|
51
|
+
argTypes,
|
|
52
|
+
}) => ({
|
|
53
|
+
props: Object.keys(argTypes),
|
|
54
|
+
components: {
|
|
55
|
+
KvTextInput,
|
|
56
|
+
},
|
|
57
|
+
data: () => ({
|
|
58
|
+
textInputModel: '1640 Riverside Drive',
|
|
59
|
+
}),
|
|
60
|
+
template: `
|
|
61
|
+
<div>
|
|
62
|
+
<label
|
|
63
|
+
for="without-v-model-id"
|
|
64
|
+
class="tw-text-h4 tw-block tw-pb-1"
|
|
65
|
+
>
|
|
66
|
+
Street Address
|
|
67
|
+
</label>
|
|
68
|
+
<kv-text-input
|
|
69
|
+
id="without-v-model-id"
|
|
70
|
+
@input="(val) => textInputModel = val"
|
|
71
|
+
:modelValue="textInputModel"
|
|
72
|
+
style="width: 25rem;"
|
|
73
|
+
/>
|
|
74
|
+
</div>`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Invalid = (args, {
|
|
78
|
+
argTypes,
|
|
79
|
+
}) => ({
|
|
80
|
+
props: Object.keys(argTypes),
|
|
81
|
+
components: {
|
|
82
|
+
KvTextInput,
|
|
83
|
+
},
|
|
84
|
+
data: () => ({
|
|
85
|
+
textInputModel: '',
|
|
86
|
+
}),
|
|
87
|
+
template: `
|
|
88
|
+
<div>
|
|
89
|
+
<label
|
|
90
|
+
for="text-input-error-id"
|
|
91
|
+
class="tw-text-h4 tw-block tw-pb-1"
|
|
92
|
+
>
|
|
93
|
+
Street Address
|
|
94
|
+
</label>
|
|
95
|
+
<kv-text-input
|
|
96
|
+
id="text-input-error-id"
|
|
97
|
+
:valid="false"
|
|
98
|
+
style="width: 25rem;"
|
|
99
|
+
>
|
|
100
|
+
<template #error>Something went wrong. Learn more at this <a href="https://www.example.com">link</a></template>
|
|
101
|
+
</kv-text-input>
|
|
102
|
+
</div>`,
|
|
103
|
+
methods: {
|
|
104
|
+
onInput(e) {
|
|
105
|
+
console.log(e);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const LabelHidden = (args, {
|
|
111
|
+
argTypes,
|
|
112
|
+
}) => ({
|
|
113
|
+
props: Object.keys(argTypes),
|
|
114
|
+
components: {
|
|
115
|
+
KvTextInput,
|
|
116
|
+
},
|
|
117
|
+
template: `
|
|
118
|
+
<div>
|
|
119
|
+
<label
|
|
120
|
+
for="hidden-label-example"
|
|
121
|
+
class="tw-sr-only"
|
|
122
|
+
>
|
|
123
|
+
Street Address
|
|
124
|
+
</label>
|
|
125
|
+
<kv-text-input
|
|
126
|
+
id="hidden-label-example"
|
|
127
|
+
style="width: 25rem;"
|
|
128
|
+
/>
|
|
129
|
+
</div>`,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export const WidthSet = (args, {
|
|
133
|
+
argTypes,
|
|
134
|
+
}) => ({
|
|
135
|
+
props: Object.keys(argTypes),
|
|
136
|
+
components: {
|
|
137
|
+
KvTextInput,
|
|
138
|
+
},
|
|
139
|
+
data: () => ({
|
|
140
|
+
textInputModel: '1640 Riverside Drive',
|
|
141
|
+
}),
|
|
142
|
+
template: `
|
|
143
|
+
<div class="w-full">
|
|
144
|
+
<label
|
|
145
|
+
for="width-set-id"
|
|
146
|
+
class="tw-text-h4 tw-block tw-pb-1"
|
|
147
|
+
>
|
|
148
|
+
Street Address
|
|
149
|
+
</label>
|
|
150
|
+
<kv-text-input
|
|
151
|
+
id="width-set-id"
|
|
152
|
+
v-model="textInputModel"
|
|
153
|
+
class="tw-w-full"
|
|
154
|
+
/>
|
|
155
|
+
</div>`,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export const Disabled = DefaultTemplate.bind({});
|
|
159
|
+
Disabled.args = {
|
|
160
|
+
disabled: true,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const Icon = DefaultTemplate.bind({});
|
|
164
|
+
Icon.args = {
|
|
165
|
+
icon: mdiMagnify,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const canClear = DefaultTemplate.bind({});
|
|
169
|
+
canClear.args = {
|
|
170
|
+
canClear: true,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const PlaceholderText = (args, {
|
|
174
|
+
argTypes,
|
|
175
|
+
}) => ({
|
|
176
|
+
props: Object.keys(argTypes),
|
|
177
|
+
components: {
|
|
178
|
+
KvTextInput,
|
|
179
|
+
},
|
|
180
|
+
template: `
|
|
181
|
+
<div>
|
|
182
|
+
<label
|
|
183
|
+
for="placeholder-example"
|
|
184
|
+
class="tw-text-h4 tw-block tw-pb-1"
|
|
185
|
+
>
|
|
186
|
+
Telephone Number
|
|
187
|
+
</label>
|
|
188
|
+
<kv-text-input
|
|
189
|
+
id="placeholder-example"
|
|
190
|
+
placeholder="(555) 555-5555"
|
|
191
|
+
style="width: 25rem;"
|
|
192
|
+
/>
|
|
193
|
+
</div>`,
|
|
194
|
+
});
|