@kiva/kv-components 3.109.4 → 4.0.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 (77) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/babel.config.cjs +12 -0
  3. package/dist/components/.storybook/main.js +6 -7
  4. package/dist/components/.storybook/preview.js +9 -17
  5. package/dist/components/KvIntroductionLoanCard.vue +8 -6
  6. package/dist/components/KvSideSheet.vue +2 -2
  7. package/dist/components/stories/KvActivityRow.stories.js +4 -2
  8. package/dist/components/stories/KvBorrowerImage.stories.js +3 -9
  9. package/dist/components/stories/KvButton.stories.js +17 -19
  10. package/dist/components/stories/KvCartModal.stories.js +2 -5
  11. package/dist/components/stories/KvClassicLoanCard.stories.js +3 -25
  12. package/dist/components/stories/KvContentfulImg.stories.js +28 -51
  13. package/dist/components/stories/KvCountdownTimer.stories.js +3 -2
  14. package/dist/components/stories/KvFlag.stories.js +5 -3
  15. package/dist/components/stories/KvIntroductionLoanCard.stories.js +5 -9
  16. package/dist/components/stories/KvLendCta.stories.js +3 -14
  17. package/dist/components/stories/KvLightbox.stories.js +23 -19
  18. package/dist/components/stories/KvLineGraph.stories.js +3 -2
  19. package/dist/components/stories/KvLoadingSpinner.stories.js +10 -12
  20. package/dist/components/stories/KvLoanActivities.stories.js +3 -4
  21. package/dist/components/stories/KvLoanBookmark.stories.js +3 -2
  22. package/dist/components/stories/KvLoanCallouts.stories.js +3 -2
  23. package/dist/components/stories/KvLoanProgressGroup.stories.js +5 -5
  24. package/dist/components/stories/KvLoanTag.stories.js +3 -2
  25. package/dist/components/stories/KvLoanUse.stories.js +3 -9
  26. package/dist/components/stories/KvMap.stories.js +3 -16
  27. package/dist/components/stories/KvMaterialIcon.stories.js +12 -6
  28. package/dist/components/stories/KvPagination.stories.js +3 -7
  29. package/dist/components/stories/KvPieChart.stories.js +3 -3
  30. package/dist/components/stories/KvProgressBar.stories.js +3 -8
  31. package/dist/components/stories/KvSideSheet.stories.js +2 -1
  32. package/dist/components/stories/KvTextLink.stories.js +5 -9
  33. package/dist/components/stories/KvThemeProvider.stories.js +6 -7
  34. package/dist/components/stories/KvToast.stories.js +10 -16
  35. package/dist/components/stories/KvTreeMapChart.stories.js +3 -3
  36. package/dist/components/stories/KvWideLoanCard.stories.js +3 -17
  37. package/dist/components/stories/StyleguidePrimitives.stories.js +104 -105
  38. package/jest.config.cjs +47 -0
  39. package/package.json +24 -27
  40. package/tests/unit/specs/components/KvButton.spec.js +2 -2
  41. package/tests/unit/specs/components/KvTextLink.spec.js +2 -2
  42. package/tests/unit/utils/addVueRouter.js +9 -15
  43. package/vue/.storybook/main.js +6 -7
  44. package/vue/.storybook/preview.js +9 -17
  45. package/vue/KvIntroductionLoanCard.vue +8 -6
  46. package/vue/KvSideSheet.vue +2 -2
  47. package/vue/stories/KvActivityRow.stories.js +4 -2
  48. package/vue/stories/KvBorrowerImage.stories.js +3 -9
  49. package/vue/stories/KvButton.stories.js +17 -19
  50. package/vue/stories/KvCartModal.stories.js +2 -5
  51. package/vue/stories/KvClassicLoanCard.stories.js +3 -25
  52. package/vue/stories/KvContentfulImg.stories.js +28 -51
  53. package/vue/stories/KvCountdownTimer.stories.js +3 -2
  54. package/vue/stories/KvFlag.stories.js +5 -3
  55. package/vue/stories/KvIntroductionLoanCard.stories.js +5 -9
  56. package/vue/stories/KvLendCta.stories.js +3 -14
  57. package/vue/stories/KvLightbox.stories.js +23 -19
  58. package/vue/stories/KvLineGraph.stories.js +3 -2
  59. package/vue/stories/KvLoadingSpinner.stories.js +10 -12
  60. package/vue/stories/KvLoanActivities.stories.js +3 -4
  61. package/vue/stories/KvLoanBookmark.stories.js +3 -2
  62. package/vue/stories/KvLoanCallouts.stories.js +3 -2
  63. package/vue/stories/KvLoanProgressGroup.stories.js +5 -5
  64. package/vue/stories/KvLoanTag.stories.js +3 -2
  65. package/vue/stories/KvLoanUse.stories.js +3 -9
  66. package/vue/stories/KvMap.stories.js +3 -16
  67. package/vue/stories/KvMaterialIcon.stories.js +12 -6
  68. package/vue/stories/KvPagination.stories.js +3 -7
  69. package/vue/stories/KvPieChart.stories.js +3 -3
  70. package/vue/stories/KvProgressBar.stories.js +3 -8
  71. package/vue/stories/KvSideSheet.stories.js +2 -1
  72. package/vue/stories/KvTextLink.stories.js +5 -9
  73. package/vue/stories/KvThemeProvider.stories.js +6 -7
  74. package/vue/stories/KvToast.stories.js +10 -16
  75. package/vue/stories/KvTreeMapChart.stories.js +3 -3
  76. package/vue/stories/KvWideLoanCard.stories.js +3 -17
  77. package/vue/stories/StyleguidePrimitives.stories.js +104 -105
@@ -6,19 +6,13 @@ export default {
6
6
  };
7
7
 
8
8
  const story = (args) => {
9
- const template = (_args, { argTypes }) => ({
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
- type: 'select',
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
- type: 'select',
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
- :visible="isVisible"
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 = (_args, { argTypes }) => ({
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
- :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"
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
- type: 'select',
19
- options: ['jpg', 'png', 'webp'],
20
- },
17
+ control: 'select',
18
+ options: ['jpg', 'png', 'webp'],
21
19
  },
22
20
  loading: {
23
- control: {
24
- type: 'select',
25
- options: ['lazy', 'eager'],
26
- },
21
+ control: 'select',
22
+ options: ['lazy', 'eager'],
27
23
  },
28
24
  fit: {
29
- control: {
30
- type: 'select',
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
- type: 'select',
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
- :loading="loading"
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
- :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"
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
- :contentful-src="contentfulSrc"
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
- :loading="loading"
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
- :loading="loading"
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 = (_args, { argTypes }) => ({
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
- :ms-left="msLeft"
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
- <KvFlag v-bind="args" />
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 Sqaure based on the country code
30
+ // SVG Square based on the country code
29
31
  export const SquareInlineSvg = story({ country: 'ME', aspectRatio: '1x1', showName: true });
30
- // SVG Sqaure based on the country code with custom width
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 = (_args, { argTypes }) => ({
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
- :loanId="loanId"
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 = (_args, { argTypes }) => ({
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
- :loan="loan"
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
  `,
@@ -12,10 +12,8 @@ export default {
12
12
  },
13
13
  argTypes: {
14
14
  variant: {
15
- control: {
16
- type: 'select',
17
- options: ['lightbox', 'alert'],
18
- },
15
+ control: 'select',
16
+ options: ['lightbox', 'alert'],
19
17
  },
20
18
  },
21
19
  args: {
@@ -29,6 +27,7 @@ export default {
29
27
  const DefaultTemplate = (args, { argTypes }) => ({
30
28
  props: Object.keys(argTypes),
31
29
  components: { KvLightbox, KvButton },
30
+ setup() { return { args }; },
32
31
  template: `
33
32
  <div>
34
33
  <kv-button @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -36,9 +35,9 @@ const DefaultTemplate = (args, { argTypes }) => ({
36
35
 
37
36
  <kv-lightbox
38
37
  :visible="isLightboxVisible"
39
- :title="title"
40
- :variant="variant"
41
- :prevent-close="preventClose"
38
+ :title="args.title"
39
+ :variant="args.variant"
40
+ :prevent-close="args.preventClose"
42
41
  @lightbox-closed="isLightboxVisible = false"
43
42
  >
44
43
  <p class="tw-mb-2">Lorem ipsum aliquip labore commodo anim elit amet cupidatat do ex ipsum. Consectetur excepteur ea anim velit reprehenderit qui aliquip ullamco aliquip irure dolor ex. Occaecat excepteur enim eu incididunt ut consectetur aliqua magna et. Reprehenderit duis ex excepteur sit et cupidatat cillum cillum adipisicing ut adipisicing minim ad.</p>
@@ -60,6 +59,7 @@ const DefaultTemplate = (args, { argTypes }) => ({
60
59
  const VeryShortTemplate = (args, { argTypes }) => ({
61
60
  props: Object.keys(argTypes),
62
61
  components: { KvLightbox, KvButton },
62
+ setup() { return { args }; },
63
63
  template: `
64
64
  <div>
65
65
  <kv-button @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -67,9 +67,9 @@ const VeryShortTemplate = (args, { argTypes }) => ({
67
67
 
68
68
  <kv-lightbox
69
69
  :visible="isLightboxVisible"
70
- :title="title"
71
- :variant="variant"
72
- :prevent-close="preventClose"
70
+ :title="args.title"
71
+ :variant="args.variant"
72
+ :prevent-close="args.preventClose"
73
73
  @lightbox-closed="isLightboxVisible = false"
74
74
  >
75
75
  <p class="tw-mb-2">The lightbox content is very short.</p>
@@ -90,6 +90,7 @@ const VeryShortTemplate = (args, { argTypes }) => ({
90
90
  const VeryLongTemplate = (args, { argTypes }) => ({
91
91
  props: Object.keys(argTypes),
92
92
  components: { KvLightbox, KvButton },
93
+ setup() { return { args }; },
93
94
  template: `
94
95
  <div>
95
96
  <kv-button @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -97,9 +98,9 @@ const VeryLongTemplate = (args, { argTypes }) => ({
97
98
 
98
99
  <kv-lightbox
99
100
  :visible="isLightboxVisible"
100
- :title="title"
101
- :variant="variant"
102
- :prevent-close="preventClose"
101
+ :title="args.title"
102
+ :variant="args.variant"
103
+ :prevent-close="args.preventClose"
103
104
  @lightbox-closed="isLightboxVisible = false"
104
105
  >
105
106
  <p class="tw-mb-2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem voluptatum quod illum minima alias quae non architecto ipsum sunt repudiandae eius ipsa commodi adipisci nam, magni praesentium error, deleniti impedit!
@@ -129,6 +130,7 @@ const VeryLongTemplate = (args, { argTypes }) => ({
129
130
  const AlertTemplate = (args, { argTypes }) => ({
130
131
  props: Object.keys(argTypes),
131
132
  components: { KvLightbox, KvButton },
133
+ setup() { return { args }; },
132
134
  template: `
133
135
  <div>
134
136
  <kv-button variant="danger" @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -136,9 +138,9 @@ const AlertTemplate = (args, { argTypes }) => ({
136
138
 
137
139
  <kv-lightbox
138
140
  :visible="isLightboxVisible"
139
- :title="title"
140
- :variant="variant"
141
- :prevent-close="preventClose"
141
+ :title="args.title"
142
+ :variant="args.variant"
143
+ :prevent-close="args.preventClose"
142
144
  @lightbox-closed="isLightboxVisible = false"
143
145
  >
144
146
  <p>The credit card will be removed from our data base and will no longer be used for subscriptions or auto-deposit.</p>
@@ -186,6 +188,7 @@ PreventClose.args = {
186
188
  export const CustomHeader = (args, { argTypes }) => ({
187
189
  props: Object.keys(argTypes),
188
190
  components: { KvLightbox, KvButton, KvMaterialIcon },
191
+ setup() { return { args }; },
189
192
  template: `
190
193
  <div>
191
194
  <kv-button @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -226,6 +229,7 @@ export const CustomHeader = (args, { argTypes }) => ({
226
229
  const InformationalTemplate = (args, { argTypes }) => ({
227
230
  props: Object.keys(argTypes),
228
231
  components: { KvLightbox, KvButton },
232
+ setup() { return { args }; },
229
233
  template: `
230
234
  <div>
231
235
  <kv-button @click="isLightboxVisible = true;">Show {{variant}}</kv-button>
@@ -233,9 +237,9 @@ const InformationalTemplate = (args, { argTypes }) => ({
233
237
 
234
238
  <kv-lightbox
235
239
  :visible="isLightboxVisible"
236
- :title="title"
237
- :variant="variant"
238
- :prevent-close="preventClose"
240
+ :title="args.title"
241
+ :variant="args.variant"
242
+ :prevent-close="args.preventClose"
239
243
  @lightbox-closed="isLightboxVisible = false"
240
244
  >
241
245
  <p>Lorem ipsum aliquip labore commodo anim elit amet cupidatat do ex ipsum. Consectetur excepteur ea anim velit reprehenderit qui aliquip ullamco aliquip irure dolor ex. Occaecat excepteur enim eu incididunt ut consectetur aliqua magna et. Reprehenderit duis ex excepteur sit et cupidatat cillum cillum adipisicing ut adipisicing minim ad.</p>
@@ -5,14 +5,15 @@ export default {
5
5
  component: KvLineGraph,
6
6
  };
7
7
 
8
- const Template = (_args, { argTypes }) => ({
8
+ const Template = (templateArgs, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: {
11
11
  KvLineGraph,
12
12
  },
13
+ setup() { return { args: { ...templateArgs } }; },
13
14
  template: `
14
15
  <div style="height: 500px; width: 500px;">
15
- <kv-line-graph :points="points" :axis-label="axisLabel" />
16
+ <kv-line-graph v-bind="args" />
16
17
  </div>
17
18
  `,
18
19
  });
@@ -5,16 +5,12 @@ export default {
5
5
  component: KvLoadingSpinner,
6
6
  argTypes: {
7
7
  size: {
8
- control: {
9
- type: 'select',
10
- options: ['small', 'medium', 'large'],
11
- },
8
+ control: 'select',
9
+ options: ['small', 'medium', 'large'],
12
10
  },
13
11
  color: {
14
- control: {
15
- type: 'select',
16
- options: ['brand', 'white', 'black'],
17
- },
12
+ control: 'select',
13
+ options: ['brand', 'white', 'black'],
18
14
  },
19
15
  },
20
16
  };
@@ -23,10 +19,11 @@ export default {
23
19
  export const SingleLoader = (args, { argTypes }) => ({
24
20
  props: Object.keys(argTypes),
25
21
  components: { KvLoadingSpinner },
22
+ setup() { return { args }; },
26
23
  template: `
27
24
  <kv-loading-spinner
28
- :size="size"
29
- :color="color"
25
+ :size="args.size"
26
+ :color="args.color"
30
27
  />`,
31
28
  });
32
29
 
@@ -34,6 +31,7 @@ export const SingleLoader = (args, { argTypes }) => ({
34
31
  export const AllVariants = (args, { argTypes }) => ({
35
32
  props: Object.keys(argTypes),
36
33
  components: { KvLoadingSpinner },
34
+ setup() { return { args }; },
37
35
  template: `
38
36
  <div>
39
37
  <ul v-for="color in ['brand', 'white', 'black']" :key="color">
@@ -43,8 +41,8 @@ export const AllVariants = (args, { argTypes }) => ({
43
41
  class="tw-mb-2"
44
42
  >
45
43
  <kv-loading-spinner
46
- :size="size"
47
- :color="color"
44
+ :size="args.size"
45
+ :color="args.color"
48
46
  />
49
47
  </li>
50
48
  </ul>
@@ -85,15 +85,14 @@ const combinedActivities = [
85
85
  const kvTrackFunction = () => { };
86
86
 
87
87
  const story = (args) => {
88
- const template = (_args, { argTypes }) => ({
88
+ const template = (templateArgs, { argTypes }) => ({
89
89
  props: Object.keys(argTypes),
90
90
  components: { KvLoanActivities },
91
+ setup() { return { args: { ...templateArgs } }; },
91
92
  template: `
92
93
  <div style="max-width: 400px;">
93
94
  <KvLoanActivities
94
- :loan="loan"
95
- :combined-activities="combinedActivities"
96
- :kv-track-function="kvTrackFunction"
95
+ v-bind="args"
97
96
  />
98
97
  </div>`,
99
98
  });
@@ -6,11 +6,12 @@ export default {
6
6
  };
7
7
 
8
8
  const story = (args) => {
9
- const template = (_args, { argTypes }) => ({
9
+ const template = (templateArgs, { argTypes }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { KvLoanBookmark },
12
+ setup() { return { args: { ...templateArgs } }; },
12
13
  template: `
13
- <kv-loan-bookmark :is-bookmarked="isBookmarked" />
14
+ <kv-loan-bookmark v-bind="args" />
14
15
  `,
15
16
  });
16
17
  template.args = args;
@@ -6,12 +6,13 @@ export default {
6
6
  };
7
7
 
8
8
  const story = (args) => {
9
- const template = (_args, { argTypes }) => ({
9
+ const template = (templateArgs, { argTypes }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { KvLoanCallouts },
12
+ setup() { return { args: { ...templateArgs } }; },
12
13
  template: `
13
14
  <kv-loan-callouts
14
- :callouts="callouts"
15
+ v-bind="args"
15
16
  />
16
17
  `,
17
18
  });