@kiva/kv-components 3.109.4 → 4.0.0
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 +29 -0
- package/babel.config.cjs +12 -0
- package/dist/components/.storybook/main.js +6 -7
- package/dist/components/.storybook/preview.js +9 -17
- package/dist/components/KvIntroductionLoanCard.vue +8 -6
- package/dist/components/stories/KvActivityRow.stories.js +4 -2
- package/dist/components/stories/KvBorrowerImage.stories.js +3 -9
- package/dist/components/stories/KvButton.stories.js +17 -19
- package/dist/components/stories/KvCartModal.stories.js +2 -5
- package/dist/components/stories/KvClassicLoanCard.stories.js +3 -25
- package/dist/components/stories/KvContentfulImg.stories.js +28 -51
- package/dist/components/stories/KvCountdownTimer.stories.js +3 -2
- package/dist/components/stories/KvFlag.stories.js +5 -3
- package/dist/components/stories/KvIntroductionLoanCard.stories.js +5 -9
- package/dist/components/stories/KvLendCta.stories.js +3 -14
- package/dist/components/stories/KvLightbox.stories.js +23 -19
- package/dist/components/stories/KvLineGraph.stories.js +3 -2
- package/dist/components/stories/KvLoadingSpinner.stories.js +10 -12
- package/dist/components/stories/KvLoanActivities.stories.js +3 -4
- package/dist/components/stories/KvLoanBookmark.stories.js +3 -2
- package/dist/components/stories/KvLoanCallouts.stories.js +3 -2
- package/dist/components/stories/KvLoanProgressGroup.stories.js +5 -5
- package/dist/components/stories/KvLoanTag.stories.js +3 -2
- package/dist/components/stories/KvLoanUse.stories.js +3 -9
- package/dist/components/stories/KvMap.stories.js +3 -16
- package/dist/components/stories/KvMaterialIcon.stories.js +12 -6
- package/dist/components/stories/KvPagination.stories.js +3 -7
- package/dist/components/stories/KvPieChart.stories.js +3 -3
- package/dist/components/stories/KvProgressBar.stories.js +3 -8
- package/dist/components/stories/KvSideSheet.stories.js +2 -1
- package/dist/components/stories/KvTextLink.stories.js +5 -9
- package/dist/components/stories/KvThemeProvider.stories.js +6 -7
- package/dist/components/stories/KvToast.stories.js +10 -16
- package/dist/components/stories/KvTreeMapChart.stories.js +3 -3
- package/dist/components/stories/KvWideLoanCard.stories.js +3 -17
- package/dist/components/stories/StyleguidePrimitives.stories.js +104 -105
- package/jest.config.cjs +47 -0
- package/package.json +24 -27
- package/tests/unit/specs/components/KvButton.spec.js +2 -2
- package/tests/unit/specs/components/KvTextLink.spec.js +2 -2
- package/tests/unit/utils/addVueRouter.js +9 -15
- package/vue/.storybook/main.js +6 -7
- package/vue/.storybook/preview.js +9 -17
- package/vue/KvIntroductionLoanCard.vue +8 -6
- package/vue/stories/KvActivityRow.stories.js +4 -2
- package/vue/stories/KvBorrowerImage.stories.js +3 -9
- package/vue/stories/KvButton.stories.js +17 -19
- package/vue/stories/KvCartModal.stories.js +2 -5
- package/vue/stories/KvClassicLoanCard.stories.js +3 -25
- package/vue/stories/KvContentfulImg.stories.js +28 -51
- package/vue/stories/KvCountdownTimer.stories.js +3 -2
- package/vue/stories/KvFlag.stories.js +5 -3
- package/vue/stories/KvIntroductionLoanCard.stories.js +5 -9
- package/vue/stories/KvLendCta.stories.js +3 -14
- package/vue/stories/KvLightbox.stories.js +23 -19
- package/vue/stories/KvLineGraph.stories.js +3 -2
- package/vue/stories/KvLoadingSpinner.stories.js +10 -12
- package/vue/stories/KvLoanActivities.stories.js +3 -4
- package/vue/stories/KvLoanBookmark.stories.js +3 -2
- package/vue/stories/KvLoanCallouts.stories.js +3 -2
- package/vue/stories/KvLoanProgressGroup.stories.js +5 -5
- package/vue/stories/KvLoanTag.stories.js +3 -2
- package/vue/stories/KvLoanUse.stories.js +3 -9
- package/vue/stories/KvMap.stories.js +3 -16
- package/vue/stories/KvMaterialIcon.stories.js +12 -6
- package/vue/stories/KvPagination.stories.js +3 -7
- package/vue/stories/KvPieChart.stories.js +3 -3
- package/vue/stories/KvProgressBar.stories.js +3 -8
- package/vue/stories/KvSideSheet.stories.js +2 -1
- package/vue/stories/KvTextLink.stories.js +5 -9
- package/vue/stories/KvThemeProvider.stories.js +6 -7
- package/vue/stories/KvToast.stories.js +10 -16
- package/vue/stories/KvTreeMapChart.stories.js +3 -3
- package/vue/stories/KvWideLoanCard.stories.js +3 -17
- package/vue/stories/StyleguidePrimitives.stories.js +104 -105
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.0.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.109.4...@kiva/kv-components@4.0.0) (2024-11-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* additional story refactoring for vue3 storybook 8 ([af16665](https://github.com/kiva/kv-ui-elements/commit/af166656eed90ef1a49b23fb9fe5a08308c92cc4))
|
|
12
|
+
* fix more stories for vue3 storybook 8 ([aeb19aa](https://github.com/kiva/kv-ui-elements/commit/aeb19aaec30263ab6524f739492f31441cd663ba))
|
|
13
|
+
* fix more stories for vue3 storybook 8 ([6fa71f7](https://github.com/kiva/kv-ui-elements/commit/6fa71f7c752c2fcfdfdb322264fe1fe846299747))
|
|
14
|
+
* fix primitives story for vue3 storybook 8 ([0c271cf](https://github.com/kiva/kv-ui-elements/commit/0c271cf18c1342179932df74229da3f708644bee))
|
|
15
|
+
* jest imports from [@vueuse](https://github.com/vueuse) ([3465f4e](https://github.com/kiva/kv-ui-elements/commit/3465f4e98f5f86db9c85bac4d1a80d6d18b6eff9))
|
|
16
|
+
* lock storybook package versions ([4e39c6d](https://github.com/kiva/kv-ui-elements/commit/4e39c6dbb9970f8037e0aa099533545e97ab49cd))
|
|
17
|
+
* remove comment ([a3109d0](https://github.com/kiva/kv-ui-elements/commit/a3109d01569171ff004543ef5e7dbee197645674))
|
|
18
|
+
* remove vue 2/3 testing, add test config to kv-components ([cb0ddf2](https://github.com/kiva/kv-ui-elements/commit/cb0ddf23c06de65eea6da48cb24c3b2775ab2216))
|
|
19
|
+
* tests ([e67a114](https://github.com/kiva/kv-ui-elements/commit/e67a114bb821f99a491ca8c5b1a3d93b90464dae))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* update to vue3 and storybook 8 ([51f609d](https://github.com/kiva/kv-ui-elements/commit/51f609df48b3643b90653e44b36d7c9028f08825))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### BREAKING CHANGES
|
|
28
|
+
|
|
29
|
+
* Vue3 is now required
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
6
35
|
## [3.109.4](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.109.3...@kiva/kv-components@3.109.4) (2024-11-26)
|
|
7
36
|
|
|
8
37
|
|
package/babel.config.cjs
ADDED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const config = {
|
|
2
|
+
module.exports = {
|
|
4
3
|
stories: [
|
|
5
4
|
'../stories/Styleguide.stories.js', // show the base styleguide first
|
|
6
5
|
'../stories/**/*.stories.mdx',
|
|
@@ -76,14 +75,14 @@ const config = {
|
|
|
76
75
|
},
|
|
77
76
|
|
|
78
77
|
framework: {
|
|
79
|
-
name:
|
|
78
|
+
name: '@storybook/vue3-webpack5',
|
|
80
79
|
options: {}
|
|
81
80
|
},
|
|
82
|
-
|
|
81
|
+
core: {
|
|
82
|
+
builder: '@storybook/builder-webpack5'
|
|
83
|
+
},
|
|
83
84
|
docs: {
|
|
84
85
|
autodocs: true,
|
|
85
86
|
defaultName: 'Kv Components',
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export default config;
|
|
88
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import './tailwind.css';
|
|
2
|
+
import {
|
|
3
|
+
setup
|
|
4
|
+
} from '@storybook/vue3';
|
|
2
5
|
import { addons } from '@storybook/preview-api';
|
|
3
6
|
import KvThemeProvider from '../KvThemeProvider.vue';
|
|
4
7
|
import { defaultTheme, darkTheme } from '@kiva/kv-tokens/configs/kivaColors.cjs';
|
|
5
|
-
import Vue from 'vue';
|
|
6
|
-
import VueCompositionApi from '@vue/composition-api';
|
|
7
|
-
import VueRouter from 'vue-router';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
setup((app) => {
|
|
10
|
+
// Mock analytics
|
|
11
|
+
app.directive('kv-track-event', () => { });
|
|
12
|
+
});
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const parameters = {
|
|
14
|
+
export const parameters = {
|
|
15
15
|
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
16
16
|
controls: {
|
|
17
17
|
matchers: {
|
|
@@ -31,7 +31,7 @@ const parameters = {
|
|
|
31
31
|
const channel = addons.getChannel();
|
|
32
32
|
|
|
33
33
|
// Wrap all stories with the kv-theme-provider component
|
|
34
|
-
const decorators = [(story) => ({
|
|
34
|
+
export const decorators = [(story) => ({
|
|
35
35
|
components: { story, KvThemeProvider },
|
|
36
36
|
template: '<kv-theme-provider :theme="theme"><story /></kv-theme-provider>',
|
|
37
37
|
data() {
|
|
@@ -50,12 +50,4 @@ const decorators = [(story) => ({
|
|
|
50
50
|
destroyed() {
|
|
51
51
|
channel.off('DARK_MODE', this.setTheme);
|
|
52
52
|
},
|
|
53
|
-
router: new VueRouter(),
|
|
54
53
|
})];
|
|
55
|
-
|
|
56
|
-
const preview = {
|
|
57
|
-
parameters,
|
|
58
|
-
decorators,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default preview;
|
|
@@ -62,12 +62,14 @@
|
|
|
62
62
|
"
|
|
63
63
|
style="padding: 2px 6px;"
|
|
64
64
|
>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
<suspense>
|
|
66
|
+
<kv-flag
|
|
67
|
+
class="tw-ml-0.5 tw-mr-1"
|
|
68
|
+
:country="countryCode"
|
|
69
|
+
width-override="16px"
|
|
70
|
+
hide-border
|
|
71
|
+
/>
|
|
72
|
+
</suspense>
|
|
71
73
|
{{ formattedLocation }}
|
|
72
74
|
</p>
|
|
73
75
|
</div>
|
|
@@ -12,11 +12,13 @@ const activity = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const story = (args) => {
|
|
15
|
-
const template = (
|
|
15
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
16
16
|
props: Object.keys(argTypes),
|
|
17
17
|
components: { KvActivityRow },
|
|
18
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
18
19
|
template: `<KvActivityRow
|
|
19
|
-
|
|
20
|
+
v-bind="args"
|
|
21
|
+
/>`,
|
|
20
22
|
});
|
|
21
23
|
template.args = args;
|
|
22
24
|
return template;
|
|
@@ -6,19 +6,13 @@ export default {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const story = (args) => {
|
|
9
|
-
const template = (
|
|
9
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { KvBorrowerImage },
|
|
12
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
12
13
|
template: `
|
|
13
14
|
<div style="width: 336px;">
|
|
14
|
-
<kv-borrower-image
|
|
15
|
-
:alt="alt"
|
|
16
|
-
:aspect-ratio="aspectRatio"
|
|
17
|
-
:default-image="defaultImage"
|
|
18
|
-
:hash="hash"
|
|
19
|
-
:images="images"
|
|
20
|
-
:photo-path="photoPath"
|
|
21
|
-
/>
|
|
15
|
+
<kv-borrower-image v-bind="args"/>
|
|
22
16
|
</div>
|
|
23
17
|
`,
|
|
24
18
|
});
|
|
@@ -5,17 +5,12 @@ export default {
|
|
|
5
5
|
component: KvButton,
|
|
6
6
|
argTypes: {
|
|
7
7
|
variant: {
|
|
8
|
-
control:
|
|
9
|
-
|
|
10
|
-
options: ['primary', 'secondary', 'link', 'danger', 'ghost', 'caution'],
|
|
11
|
-
},
|
|
8
|
+
control: 'select',
|
|
9
|
+
options: ['primary', 'secondary', 'link', 'danger', 'ghost', 'caution'],
|
|
12
10
|
},
|
|
13
11
|
state: {
|
|
14
|
-
control:
|
|
15
|
-
|
|
16
|
-
options: ['', 'disabled', 'loading'],
|
|
17
|
-
defaultValue: null,
|
|
18
|
-
},
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['', 'disabled', 'loading'],
|
|
19
14
|
},
|
|
20
15
|
},
|
|
21
16
|
};
|
|
@@ -23,12 +18,13 @@ export default {
|
|
|
23
18
|
const Template = (args, { argTypes }) => ({
|
|
24
19
|
props: Object.keys(argTypes),
|
|
25
20
|
components: { KvButton },
|
|
21
|
+
setup() { return { args }; },
|
|
26
22
|
template: `
|
|
27
23
|
<kv-button
|
|
28
|
-
:variant="variant"
|
|
29
|
-
:state="state"
|
|
30
|
-
:to="to"
|
|
31
|
-
:href="href"
|
|
24
|
+
:variant="args.variant"
|
|
25
|
+
:state="args.state"
|
|
26
|
+
:to="args.to"
|
|
27
|
+
:href="args.href"
|
|
32
28
|
@click="onClick"
|
|
33
29
|
>
|
|
34
30
|
Find a borrower
|
|
@@ -41,6 +37,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
41
37
|
const VariantTemplate = (args, { argTypes }) => ({
|
|
42
38
|
props: Object.keys(argTypes),
|
|
43
39
|
components: { KvButton },
|
|
40
|
+
setup() { return { args }; },
|
|
44
41
|
template: `
|
|
45
42
|
<ul>
|
|
46
43
|
<li
|
|
@@ -50,9 +47,9 @@ const VariantTemplate = (args, { argTypes }) => ({
|
|
|
50
47
|
>
|
|
51
48
|
<kv-button
|
|
52
49
|
:variant="variant"
|
|
53
|
-
:state="state"
|
|
54
|
-
:to="to"
|
|
55
|
-
:href="href"
|
|
50
|
+
:state="args.state"
|
|
51
|
+
:to="args.to"
|
|
52
|
+
:href="args.href"
|
|
56
53
|
>
|
|
57
54
|
Find a borrower
|
|
58
55
|
</kv-button>
|
|
@@ -119,6 +116,7 @@ WithHref.args = {
|
|
|
119
116
|
export const FullWidth = (args, { argTypes }) => ({
|
|
120
117
|
props: Object.keys(argTypes),
|
|
121
118
|
components: { KvButton },
|
|
119
|
+
setup() { return { args }; },
|
|
122
120
|
template: `
|
|
123
121
|
<ul>
|
|
124
122
|
<li
|
|
@@ -129,9 +127,9 @@ export const FullWidth = (args, { argTypes }) => ({
|
|
|
129
127
|
<kv-button
|
|
130
128
|
class="tw-w-full"
|
|
131
129
|
:variant="variant"
|
|
132
|
-
:state="state"
|
|
133
|
-
:to="to"
|
|
134
|
-
:href="href"
|
|
130
|
+
:state="args.state"
|
|
131
|
+
:to="args.to"
|
|
132
|
+
:href="args.href"
|
|
135
133
|
@click="onClick"
|
|
136
134
|
>
|
|
137
135
|
Find a borrower
|
|
@@ -25,17 +25,14 @@ export default {
|
|
|
25
25
|
const DefaultTemplate = (args, { argTypes }) => ({
|
|
26
26
|
props: Object.keys(argTypes),
|
|
27
27
|
components: { KvCartModal, KvButton },
|
|
28
|
+
setup() { return { args }; },
|
|
28
29
|
template: `
|
|
29
30
|
<div>
|
|
30
31
|
<kv-button @click="isVisible = true;">Show cart modal</kv-button>
|
|
31
32
|
<p>The lightbox is visible: {{isVisible}}</p>
|
|
32
33
|
|
|
33
34
|
<kv-cart-modal
|
|
34
|
-
|
|
35
|
-
:prevent-close="preventClose"
|
|
36
|
-
:added-loan="addedLoan"
|
|
37
|
-
:photo-path="photoPath"
|
|
38
|
-
:basket-count="basketCount"
|
|
35
|
+
v-bind="args"
|
|
39
36
|
@cart-modal-closed="isVisible = false"
|
|
40
37
|
>
|
|
41
38
|
</kv-cart-modal>
|
|
@@ -6,36 +6,14 @@ export default {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const story = (args) => {
|
|
9
|
-
const template = (
|
|
9
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { KvClassicLoanCard },
|
|
12
|
+
setup() { return { args: templateArgs }; },
|
|
12
13
|
template: `
|
|
13
14
|
<div style="width: 600px;">
|
|
14
15
|
<kv-classic-loan-card
|
|
15
|
-
|
|
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"
|
|
16
|
+
v-bind="args"
|
|
39
17
|
@show-loan-details="showLoanDetails"
|
|
40
18
|
/>
|
|
41
19
|
</div>
|
|
@@ -14,28 +14,20 @@ export default {
|
|
|
14
14
|
},
|
|
15
15
|
argTypes: {
|
|
16
16
|
fallbackFormat: {
|
|
17
|
-
control:
|
|
18
|
-
|
|
19
|
-
options: ['jpg', 'png', 'webp'],
|
|
20
|
-
},
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: ['jpg', 'png', 'webp'],
|
|
21
19
|
},
|
|
22
20
|
loading: {
|
|
23
|
-
control:
|
|
24
|
-
|
|
25
|
-
options: ['lazy', 'eager'],
|
|
26
|
-
},
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['lazy', 'eager'],
|
|
27
23
|
},
|
|
28
24
|
fit: {
|
|
29
|
-
control:
|
|
30
|
-
|
|
31
|
-
options: ['pad', 'fill', 'scale', 'crop', 'thumb'],
|
|
32
|
-
},
|
|
25
|
+
control: 'select',
|
|
26
|
+
options: ['pad', 'fill', 'scale', 'crop', 'thumb'],
|
|
33
27
|
},
|
|
34
28
|
focus: {
|
|
35
|
-
control:
|
|
36
|
-
|
|
37
|
-
options: ['center', 'top', 'right', 'left', 'bottom', 'top_right', 'top_left', 'bottom_right', 'bottom_left', 'face', 'faces'],
|
|
38
|
-
},
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['center', 'top', 'right', 'left', 'bottom', 'top_right', 'top_left', 'bottom_right', 'bottom_left', 'face', 'faces'],
|
|
39
31
|
},
|
|
40
32
|
},
|
|
41
33
|
};
|
|
@@ -45,35 +37,31 @@ export const Default = (args, { argTypes }) => ({
|
|
|
45
37
|
components: {
|
|
46
38
|
KvContentfulImg,
|
|
47
39
|
},
|
|
40
|
+
setup() { return { args }; },
|
|
48
41
|
template: `
|
|
49
42
|
<kv-contentful-img
|
|
50
|
-
:contentful-src="contentfulSrc"
|
|
51
|
-
:fallback-format="fallbackFormat"
|
|
52
|
-
:width="width"
|
|
53
|
-
:height="height"
|
|
54
43
|
alt="Descriptive alt text"
|
|
55
|
-
|
|
56
|
-
:fit="fit"
|
|
57
|
-
:focus="focus"
|
|
44
|
+
v-bind="args"
|
|
58
45
|
/>
|
|
59
46
|
`,
|
|
60
47
|
});
|
|
61
48
|
|
|
49
|
+
Default.args = {
|
|
50
|
+
fit: 'fill',
|
|
51
|
+
focus: 'face',
|
|
52
|
+
sourceSizes: [],
|
|
53
|
+
contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7mY5ZujL9UfbluRkVkHgkX/5ec83a74e7c1dc387f3fa35af34f5243/mg-hppromo-1-wxga-retina.jpg',
|
|
54
|
+
};
|
|
55
|
+
|
|
62
56
|
export const ResponsiveImageSet = (args, { argTypes }) => ({
|
|
63
57
|
props: Object.keys(argTypes),
|
|
64
58
|
components: {
|
|
65
59
|
KvContentfulImg,
|
|
66
60
|
},
|
|
61
|
+
setup() { return { args }; },
|
|
67
62
|
template: `
|
|
68
63
|
<kv-contentful-img
|
|
69
|
-
|
|
70
|
-
:fallback-format="fallbackFormat"
|
|
71
|
-
:alt="alt"
|
|
72
|
-
:loading="loading"
|
|
73
|
-
:height="540"
|
|
74
|
-
:source-sizes="sourceSizes"
|
|
75
|
-
:fit="fit"
|
|
76
|
-
:focus="focus"
|
|
64
|
+
v-bind="args"
|
|
77
65
|
/>
|
|
78
66
|
`,
|
|
79
67
|
});
|
|
@@ -116,14 +104,10 @@ export const AdaptiveImageSet = (args, { argTypes }) => ({
|
|
|
116
104
|
components: {
|
|
117
105
|
KvContentfulImg,
|
|
118
106
|
},
|
|
107
|
+
setup() { return { args }; },
|
|
119
108
|
template: `
|
|
120
109
|
<kv-contentful-img
|
|
121
|
-
|
|
122
|
-
:fallback-format="fallbackFormat"
|
|
123
|
-
:alt="alt"
|
|
124
|
-
:loading="loading"
|
|
125
|
-
:height="540"
|
|
126
|
-
:source-sizes="sourceSizes"
|
|
110
|
+
v-bind="args"
|
|
127
111
|
/>
|
|
128
112
|
`,
|
|
129
113
|
});
|
|
@@ -156,35 +140,27 @@ export const WithCaption = (args, { argTypes }) => ({
|
|
|
156
140
|
components: {
|
|
157
141
|
KvContentfulImg,
|
|
158
142
|
},
|
|
143
|
+
setup() { return { args }; },
|
|
159
144
|
template: `
|
|
160
145
|
<kv-contentful-img
|
|
161
|
-
:contentful-src="contentfulSrc"
|
|
162
|
-
:fallback-format="fallbackFormat"
|
|
163
|
-
:width="width"
|
|
164
|
-
:height="height"
|
|
165
146
|
alt="^ A descriptive caption"
|
|
166
|
-
|
|
167
|
-
:fit="fit"
|
|
168
|
-
:focus="focus"
|
|
147
|
+
v-bind="args"
|
|
169
148
|
/>
|
|
170
149
|
`,
|
|
171
150
|
});
|
|
172
151
|
|
|
152
|
+
WithCaption.args = AdaptiveImageSet.args;
|
|
153
|
+
|
|
173
154
|
export const GiantImage = (args, { argTypes }) => ({
|
|
174
155
|
props: Object.keys(argTypes),
|
|
175
156
|
components: {
|
|
176
157
|
KvContentfulImg,
|
|
177
158
|
},
|
|
159
|
+
setup() { return { args }; },
|
|
178
160
|
template: `
|
|
179
161
|
<kv-contentful-img
|
|
180
|
-
:contentful-src="contentfulSrc"
|
|
181
|
-
:fallback-format="fallbackFormat"
|
|
182
|
-
:width="width"
|
|
183
|
-
:height="height"
|
|
184
162
|
alt="Descriptive alt text"
|
|
185
|
-
|
|
186
|
-
:fit="fit"
|
|
187
|
-
:focus="focus"
|
|
163
|
+
v-bind="args"
|
|
188
164
|
/>
|
|
189
165
|
`,
|
|
190
166
|
});
|
|
@@ -193,4 +169,5 @@ GiantImage.args = {
|
|
|
193
169
|
contentfulSrc: 'https://images.ctfassets.net/j0p9a6ql0rn7/7dVINOyAxRaXM8p6aq7p5s/9213f63ff10dec57c5f740c056afe8a8/gradient-hero-bg__1_.jpg',
|
|
194
170
|
width: 4000,
|
|
195
171
|
height: 2000,
|
|
172
|
+
sourceSizes: [],
|
|
196
173
|
};
|
|
@@ -6,14 +6,15 @@ export default {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const story = (args) => {
|
|
9
|
-
const template = (
|
|
9
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
11
12
|
components: {
|
|
12
13
|
KvCountdownTimer,
|
|
13
14
|
},
|
|
14
15
|
template: `
|
|
15
16
|
<kv-countdown-timer
|
|
16
|
-
|
|
17
|
+
v-bind="args"
|
|
17
18
|
/>
|
|
18
19
|
`,
|
|
19
20
|
});
|
|
@@ -12,7 +12,9 @@ const story = (args) => {
|
|
|
12
12
|
setup() { return { args: templateArgs }; },
|
|
13
13
|
template: `
|
|
14
14
|
<div style="width: 100px; height: 100px;">
|
|
15
|
-
<
|
|
15
|
+
<suspense>
|
|
16
|
+
<KvFlag v-bind="args" />
|
|
17
|
+
</suspense>
|
|
16
18
|
</div>
|
|
17
19
|
`,
|
|
18
20
|
});
|
|
@@ -25,9 +27,9 @@ export const InlineSvg = story({ country: 'TO' });
|
|
|
25
27
|
// SVG based on the country code with custom width
|
|
26
28
|
export const InlineSvgCustomWidth = story({ country: 'DE', widthOverride: '40px' });
|
|
27
29
|
|
|
28
|
-
// SVG
|
|
30
|
+
// SVG Square based on the country code
|
|
29
31
|
export const SquareInlineSvg = story({ country: 'ME', aspectRatio: '1x1', showName: true });
|
|
30
|
-
// SVG
|
|
32
|
+
// SVG Square based on the country code with custom width
|
|
31
33
|
export const SquareInlineSvgCustomWidth = story({
|
|
32
34
|
country: 'SA',
|
|
33
35
|
inlineSvg: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import KvIntroductionLoanCard from '../KvIntroductionLoanCard.vue';
|
|
2
|
+
import KvFlag from '../KvFlag.vue';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'KvIntroductionLoanCard',
|
|
@@ -6,19 +7,14 @@ export default {
|
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
const story = (args) => {
|
|
9
|
-
const template = (
|
|
10
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
11
|
props: Object.keys(argTypes),
|
|
11
|
-
components: { KvIntroductionLoanCard },
|
|
12
|
+
components: { KvIntroductionLoanCard, KvFlag },
|
|
13
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
12
14
|
template: `
|
|
13
15
|
<div style="width: 600px;">
|
|
14
16
|
<kv-introduction-loan-card
|
|
15
|
-
|
|
16
|
-
:loan="loan"
|
|
17
|
-
:category-page-name="categoryPageName"
|
|
18
|
-
:custom-callouts="customCallouts"
|
|
19
|
-
:kv-track-function="kvTrackFunction"
|
|
20
|
-
:photo-path="photoPath"
|
|
21
|
-
:is-visitor="isVisitor"
|
|
17
|
+
v-bind="args"
|
|
22
18
|
@show-loan-details="showLoanDetails"
|
|
23
19
|
/>
|
|
24
20
|
</div>
|
|
@@ -6,25 +6,14 @@ export default {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const story = (args) => {
|
|
9
|
-
const template = (
|
|
9
|
+
const template = (templateArgs, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { KvLendCta },
|
|
12
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
12
13
|
template: `
|
|
13
14
|
<div style="width: 300px;">
|
|
14
15
|
<kv-lend-cta
|
|
15
|
-
|
|
16
|
-
:basket-items="basketItems"
|
|
17
|
-
:is-loading="isLoading"
|
|
18
|
-
:is-adding="isAdding"
|
|
19
|
-
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
20
|
-
:five-dollars-selected="fiveDollarsSelected"
|
|
21
|
-
:kv-track-function="kvTrackFunction"
|
|
22
|
-
:show-view-loan="showViewLoan"
|
|
23
|
-
:custom-loan-details="customLoanDetails"
|
|
24
|
-
:enable-huge-amount="enableHugeAmount"
|
|
25
|
-
:is-visitor="isVisitor"
|
|
26
|
-
:secondary-button-handler="secondaryButtonHandler"
|
|
27
|
-
:external-links="externalLinks"
|
|
16
|
+
v-bind="args"
|
|
28
17
|
/>
|
|
29
18
|
</div>
|
|
30
19
|
`,
|