@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +29 -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/stories/KvActivityRow.stories.js +4 -2
  7. package/dist/components/stories/KvBorrowerImage.stories.js +3 -9
  8. package/dist/components/stories/KvButton.stories.js +17 -19
  9. package/dist/components/stories/KvCartModal.stories.js +2 -5
  10. package/dist/components/stories/KvClassicLoanCard.stories.js +3 -25
  11. package/dist/components/stories/KvContentfulImg.stories.js +28 -51
  12. package/dist/components/stories/KvCountdownTimer.stories.js +3 -2
  13. package/dist/components/stories/KvFlag.stories.js +5 -3
  14. package/dist/components/stories/KvIntroductionLoanCard.stories.js +5 -9
  15. package/dist/components/stories/KvLendCta.stories.js +3 -14
  16. package/dist/components/stories/KvLightbox.stories.js +23 -19
  17. package/dist/components/stories/KvLineGraph.stories.js +3 -2
  18. package/dist/components/stories/KvLoadingSpinner.stories.js +10 -12
  19. package/dist/components/stories/KvLoanActivities.stories.js +3 -4
  20. package/dist/components/stories/KvLoanBookmark.stories.js +3 -2
  21. package/dist/components/stories/KvLoanCallouts.stories.js +3 -2
  22. package/dist/components/stories/KvLoanProgressGroup.stories.js +5 -5
  23. package/dist/components/stories/KvLoanTag.stories.js +3 -2
  24. package/dist/components/stories/KvLoanUse.stories.js +3 -9
  25. package/dist/components/stories/KvMap.stories.js +3 -16
  26. package/dist/components/stories/KvMaterialIcon.stories.js +12 -6
  27. package/dist/components/stories/KvPagination.stories.js +3 -7
  28. package/dist/components/stories/KvPieChart.stories.js +3 -3
  29. package/dist/components/stories/KvProgressBar.stories.js +3 -8
  30. package/dist/components/stories/KvSideSheet.stories.js +2 -1
  31. package/dist/components/stories/KvTextLink.stories.js +5 -9
  32. package/dist/components/stories/KvThemeProvider.stories.js +6 -7
  33. package/dist/components/stories/KvToast.stories.js +10 -16
  34. package/dist/components/stories/KvTreeMapChart.stories.js +3 -3
  35. package/dist/components/stories/KvWideLoanCard.stories.js +3 -17
  36. package/dist/components/stories/StyleguidePrimitives.stories.js +104 -105
  37. package/jest.config.cjs +47 -0
  38. package/package.json +24 -27
  39. package/tests/unit/specs/components/KvButton.spec.js +2 -2
  40. package/tests/unit/specs/components/KvTextLink.spec.js +2 -2
  41. package/tests/unit/utils/addVueRouter.js +9 -15
  42. package/vue/.storybook/main.js +6 -7
  43. package/vue/.storybook/preview.js +9 -17
  44. package/vue/KvIntroductionLoanCard.vue +8 -6
  45. package/vue/stories/KvActivityRow.stories.js +4 -2
  46. package/vue/stories/KvBorrowerImage.stories.js +3 -9
  47. package/vue/stories/KvButton.stories.js +17 -19
  48. package/vue/stories/KvCartModal.stories.js +2 -5
  49. package/vue/stories/KvClassicLoanCard.stories.js +3 -25
  50. package/vue/stories/KvContentfulImg.stories.js +28 -51
  51. package/vue/stories/KvCountdownTimer.stories.js +3 -2
  52. package/vue/stories/KvFlag.stories.js +5 -3
  53. package/vue/stories/KvIntroductionLoanCard.stories.js +5 -9
  54. package/vue/stories/KvLendCta.stories.js +3 -14
  55. package/vue/stories/KvLightbox.stories.js +23 -19
  56. package/vue/stories/KvLineGraph.stories.js +3 -2
  57. package/vue/stories/KvLoadingSpinner.stories.js +10 -12
  58. package/vue/stories/KvLoanActivities.stories.js +3 -4
  59. package/vue/stories/KvLoanBookmark.stories.js +3 -2
  60. package/vue/stories/KvLoanCallouts.stories.js +3 -2
  61. package/vue/stories/KvLoanProgressGroup.stories.js +5 -5
  62. package/vue/stories/KvLoanTag.stories.js +3 -2
  63. package/vue/stories/KvLoanUse.stories.js +3 -9
  64. package/vue/stories/KvMap.stories.js +3 -16
  65. package/vue/stories/KvMaterialIcon.stories.js +12 -6
  66. package/vue/stories/KvPagination.stories.js +3 -7
  67. package/vue/stories/KvPieChart.stories.js +3 -3
  68. package/vue/stories/KvProgressBar.stories.js +3 -8
  69. package/vue/stories/KvSideSheet.stories.js +2 -1
  70. package/vue/stories/KvTextLink.stories.js +5 -9
  71. package/vue/stories/KvThemeProvider.stories.js +6 -7
  72. package/vue/stories/KvToast.stories.js +10 -16
  73. package/vue/stories/KvTreeMapChart.stories.js +3 -3
  74. package/vue/stories/KvWideLoanCard.stories.js +3 -17
  75. package/vue/stories/StyleguidePrimitives.stories.js +104 -105
@@ -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
  });
@@ -6,14 +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: { KvLoanProgressGroup },
12
+ setup() { return { args: { ...templateArgs } }; },
12
13
  template: `
13
14
  <div style="width: 200px">
14
15
  <kv-loan-progress-group
15
- :money-left="moneyLeft"
16
- :progress-percent="progressPercent"
16
+ v-bind="args"
17
17
  />
18
18
  </div>
19
19
  `,
@@ -24,6 +24,6 @@ const story = (args) => {
24
24
 
25
25
  export const Default = story();
26
26
 
27
- export const LowAmount = story({ moneyLeft: 5, progressPercent: 0.9 });
27
+ export const LowAmount = story({ moneyLeft: '5', progressPercent: 0.9 });
28
28
 
29
- export const HighAmount = story({ moneyLeft: 150, progressPercent: 0.5 });
29
+ export const HighAmount = story({ moneyLeft: '150', progressPercent: 0.5 });
@@ -7,15 +7,16 @@ export default {
7
7
  };
8
8
 
9
9
  const story = (args) => {
10
- const template = (_args, { argTypes }) => ({
10
+ const template = (templateArgs, { argTypes }) => ({
11
11
  props: Object.keys(argTypes),
12
12
  components: {
13
13
  KvLoanTag,
14
14
  KvCountdownTimer,
15
15
  },
16
+ setup() { return { args: { ...templateArgs } }; },
16
17
  template: `
17
18
  <kv-loan-tag
18
- :loan="loan"
19
+ v-bind="args"
19
20
  />
20
21
  `,
21
22
  });
@@ -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: { KvLoanUse },
12
+ setup() { return { args: { ...templateArgs } }; },
12
13
  template: `
13
14
  <kv-loan-use
14
- :anonymization-level="anonymizationLevel"
15
- :use="use"
16
- :loan-amount="loanAmount"
17
- :status="status"
18
- :borrower-count="borrowerCount"
19
- :name="name"
20
- :distribution-model="distributionModel"
21
- :why-special="whySpecial"
15
+ v-bind="args"
22
16
  />
23
17
  `,
24
18
  });
@@ -18,26 +18,13 @@ export default {
18
18
  },
19
19
  };
20
20
 
21
- const Template = (args, { argTypes }) => ({
21
+ const Template = (templateArgs, { argTypes }) => ({
22
22
  props: Object.keys(argTypes),
23
23
  components: { KvMap },
24
+ setup() { return { args: { ...templateArgs } }; },
24
25
  template: `<kv-map
25
26
  class="tw-rounded tw-overflow-hidden"
26
- :auto-zoom-delay="autoZoomDelay"
27
- :height="height"
28
- :lat="lat"
29
- :long="long"
30
- :initial-zoom="initialZoom"
31
- :map-id="mapId"
32
- :use-leaflet="useLeaflet"
33
- :width="width"
34
- :zoom-level="zoomLevel"
35
- :advanced-animation="advancedAnimation"
36
- :show-zoom-control="showZoomControl"
37
- :allow-dragging="allowDragging"
38
- :show-labels="showLabels"
39
- :countries-data="countriesData"
40
- :show-fundraising-loans="showFundraisingLoans"
27
+ v-bind="args"
41
28
  />`,
42
29
  });
43
30
 
@@ -49,9 +49,10 @@ Default.args = {
49
49
  icon: mdiCart,
50
50
  };
51
51
 
52
- export const Common = (args, { argTypes }) => ({
52
+ export const Common = (templateArgs, { argTypes }) => ({
53
53
  props: Object.keys(argTypes),
54
54
  components: { KvMaterialIcon },
55
+ setup() { return { args: { ...templateArgs } }; },
55
56
  template: `
56
57
  <div class="tw-flex tw-gap-1">
57
58
  <kv-material-icon
@@ -100,9 +101,10 @@ export const Common = (args, { argTypes }) => ({
100
101
  },
101
102
  });
102
103
 
103
- export const Colored = (args, { argTypes }) => ({
104
+ export const Colored = (templateArgs, { argTypes }) => ({
104
105
  props: Object.keys(argTypes),
105
106
  components: { KvMaterialIcon },
107
+ setup() { return { args: { ...templateArgs } }; },
106
108
  template: `
107
109
  <div>
108
110
  <p class="tw-mb-2">Use text-color to set the icon color</p>
@@ -123,9 +125,10 @@ export const Colored = (args, { argTypes }) => ({
123
125
  },
124
126
  });
125
127
 
126
- export const InlineWithText = (args, { argTypes }) => ({
128
+ export const InlineWithText = (templateArgs, { argTypes }) => ({
127
129
  props: Object.keys(argTypes),
128
130
  components: { KvMaterialIcon },
131
+ setup() { return { args: { ...templateArgs } }; },
129
132
  template: `
130
133
  <a href="#" class="tw-inline-flex">
131
134
  <span class="tw-text-h4">He went thataway</span>
@@ -138,9 +141,10 @@ export const InlineWithText = (args, { argTypes }) => ({
138
141
  },
139
142
  });
140
143
 
141
- export const Sizing = (args, { argTypes }) => ({
144
+ export const Sizing = (templateArgs, { argTypes }) => ({
142
145
  props: Object.keys(argTypes),
143
146
  components: { KvMaterialIcon },
147
+ setup() { return { args: { ...templateArgs } }; },
144
148
  template: `
145
149
  <div>
146
150
  <p class="tw-mb-2">Icons can be sized using any of the standard sizing classes (.tw-w-2, .tw-w-3, .tw-w-full, etc.). By default they are 24 x 24 (.tw-w-3).</p>
@@ -156,9 +160,10 @@ export const Sizing = (args, { argTypes }) => ({
156
160
  },
157
161
  });
158
162
 
159
- export const WithAccessibleText = (args, { argTypes }) => ({
163
+ export const WithAccessibleText = (templateArgs, { argTypes }) => ({
160
164
  props: Object.keys(argTypes),
161
165
  components: { KvMaterialIcon },
166
+ setup() { return { args: { ...templateArgs } }; },
162
167
  template: `
163
168
  <div>
164
169
  <p class="tw-mb-2">If you don't include text and your icon is not decorative, be sure to include screen-reader text</p>
@@ -174,9 +179,10 @@ export const WithAccessibleText = (args, { argTypes }) => ({
174
179
  },
175
180
  });
176
181
 
177
- export const StarsDemo = (args, { argTypes }) => ({
182
+ export const StarsDemo = (templateArgs, { argTypes }) => ({
178
183
  props: Object.keys(argTypes),
179
184
  components: { KvMaterialIcon },
185
+ setup() { return { args: { ...templateArgs } }; },
180
186
  template: `
181
187
  <div class="tw-flex">
182
188
  <button
@@ -6,16 +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: { KvPagination },
12
+ setup() { return { args: { ...templateArgs } }; },
12
13
  template: `<kv-pagination
13
- :limit="limit"
14
- :total="total"
15
- :offset="offset"
16
- :extra-pages="extraPages"
17
- :kv-track-function="kvTrackMock"
18
- :track-event-category="trackEventCategory"
14
+ v-bind="args"
19
15
  />`,
20
16
  methods: {
21
17
  kvTrackMock(
@@ -12,18 +12,18 @@ export default {
12
12
  },
13
13
  };
14
14
 
15
- const Template = (args, {
15
+ const Template = (templateArgs, {
16
16
  argTypes,
17
17
  }) => ({
18
18
  props: Object.keys(argTypes),
19
+ setup() { return { args: { ...templateArgs } }; },
19
20
  components: {
20
21
  KvPieChart,
21
22
  },
22
23
  template: `
23
24
  <div>
24
25
  <kv-pie-chart
25
- :values="values"
26
- :loading="loading"
26
+ v-bind="args"
27
27
  />
28
28
  </div>`,
29
29
  });
@@ -13,18 +13,13 @@ export default {
13
13
  },
14
14
  };
15
15
 
16
- const Template = (args, { argTypes }) => ({
16
+ const Template = (templateArgs, { argTypes }) => ({
17
17
  props: Object.keys(argTypes),
18
18
  components: { KvProgressBar },
19
+ setup() { return { args: { ...templateArgs } }; },
19
20
  template: `
20
21
  <kv-progress-bar
21
- :aria-label="ariaLabel"
22
- :min="min"
23
- :max="max"
24
- :value="value"
25
- :variant="variant"
26
- :bg-variant="bgVariant"
27
-
22
+ v-bind="args"
28
23
  ></kv-progress-bar>`,
29
24
  });
30
25
 
@@ -14,6 +14,7 @@ const Template = (args, {
14
14
  KvSideSheet,
15
15
  KvButton,
16
16
  },
17
+ setup() { return { args }; },
17
18
  template: `
18
19
  <div>
19
20
  <kv-button @click="isVisible = true">Show Side Sheet</kv-button>
@@ -47,4 +48,4 @@ const Template = (args, {
47
48
  },
48
49
  });
49
50
 
50
- export const Default = Template.bind({});
51
+ export const Default = Template.bind({ visible: false });
@@ -11,23 +11,19 @@ export default {
11
11
  },
12
12
  argTypes: {
13
13
  state: {
14
- control: {
15
- type: 'select',
16
- options: ['', 'disabled'],
17
- },
14
+ control: 'select',
15
+ options: ['', 'disabled'],
18
16
  },
19
17
  },
20
18
  };
21
19
 
22
- const Template = (args, { argTypes }) => ({
20
+ const Template = (templateArgs, { argTypes }) => ({
23
21
  props: Object.keys(argTypes),
24
22
  components: { KvTextLink },
23
+ setup() { return { args: { ...templateArgs } }; },
25
24
  template: `
26
25
  <kv-text-link
27
- :state="state"
28
- :href="href"
29
- :to="to"
30
- :icon="icon"
26
+ v-bind="args"
31
27
  @click="onClick"
32
28
  >
33
29
  Find a borrower
@@ -32,15 +32,13 @@ export default {
32
32
  title: 'KvThemeProvider',
33
33
  component: KvThemeProvider,
34
34
  args: {
35
- theme: '',
35
+ theme: {},
36
36
  customTheme: null,
37
37
  },
38
38
  argTypes: {
39
39
  theme: {
40
- control: {
41
- type: 'select',
42
- options: ['', 'dark', 'darkGreen', 'mint'],
43
- },
40
+ control: 'select',
41
+ options: ['', 'dark', 'darkGreen', 'mint'],
44
42
  },
45
43
  },
46
44
  };
@@ -117,7 +115,7 @@ const demoTemplate = `
117
115
  </div>
118
116
  `;
119
117
 
120
- const Template = (args, {
118
+ const Template = (templateArgs, {
121
119
  argTypes,
122
120
  }) => ({
123
121
  props: Object.keys(argTypes),
@@ -128,6 +126,7 @@ const Template = (args, {
128
126
  KvTextLink,
129
127
  KvThemeProvider,
130
128
  },
129
+ setup() { return { args: { ...templateArgs } }; },
131
130
  data() {
132
131
  return {
133
132
  bgVariables: buildTailwindClasses('background'),
@@ -141,7 +140,7 @@ const Template = (args, {
141
140
  };
142
141
  },
143
142
  template: `
144
- <kv-theme-provider :theme="theme">
143
+ <kv-theme-provider v-bind="args">
145
144
  ${demoTemplate}
146
145
  </kv-theme-provider>`,
147
146
  });
@@ -11,30 +11,22 @@ export default {
11
11
  },
12
12
  argTypes: {
13
13
  message: {
14
- control: {
15
- type: 'text',
16
- },
14
+ control: 'text',
17
15
  },
18
16
  type: {
19
17
  options: ['confirmation', 'warning', 'error'],
20
- control: {
21
- type: 'select',
22
- },
18
+ control: 'select',
23
19
  },
24
20
  persist: {
25
- control: {
26
- type: 'boolean',
27
- },
21
+ control: 'boolean',
28
22
  },
29
23
  hideDelay: {
30
- control: {
31
- type: 'number',
32
- },
24
+ control: 'number',
33
25
  },
34
26
  },
35
27
  };
36
28
 
37
- const Template = (args, {
29
+ const Template = (templateArgs, {
38
30
  argTypes,
39
31
  }) => ({
40
32
  props: Object.keys(argTypes),
@@ -42,9 +34,10 @@ const Template = (args, {
42
34
  KvToast,
43
35
  KvButton,
44
36
  },
37
+ setup() { return { args: { ...templateArgs } }; },
45
38
  template: `
46
39
  <div>
47
- <kv-button @click="showToast(message, type, persist, hideDelay)">Show Toast</kv-button>
40
+ <kv-button @click="showToast(message, args.type, persist, hideDelay)">Show Toast</kv-button>
48
41
 
49
42
  <!-- div below is a kludge for storybook docs -->
50
43
  <div class="tw-fixed tw-z-toast tw-inset-0 tw-pointer-events-none">
@@ -80,7 +73,7 @@ persist.args = { persist: true };
80
73
  export const hideDelay = Template.bind({});
81
74
  hideDelay.args = { hideDelay: 10000 };
82
75
 
83
- const KivaLogoTemplate = (args, {
76
+ const KivaLogoTemplate = (templateArgs, {
84
77
  argTypes,
85
78
  }) => ({
86
79
  props: Object.keys(argTypes),
@@ -88,9 +81,10 @@ const KivaLogoTemplate = (args, {
88
81
  KvToast,
89
82
  KvButton,
90
83
  },
84
+ setup() { return { args: { ...templateArgs } }; },
91
85
  template: `
92
86
  <div>
93
- <kv-button @click="showToast(message, type, persist)">Show Toast</kv-button>
87
+ <kv-button @click="showToast(message, args.type, persist)">Show Toast</kv-button>
94
88
 
95
89
  <!-- div below is a kludge for storybook docs -->
96
90
  <div class="tw-fixed tw-z-toast tw-inset-0 tw-pointer-events-none">
@@ -12,18 +12,18 @@ export default {
12
12
  },
13
13
  };
14
14
 
15
- const Template = (args, {
15
+ const Template = (templateArgs, {
16
16
  argTypes,
17
17
  }) => ({
18
18
  props: Object.keys(argTypes),
19
19
  components: {
20
20
  KvTreeMapChart,
21
21
  },
22
+ setup() { return { args: { ...templateArgs } }; },
22
23
  template: `
23
24
  <div>
24
25
  <kv-tree-map-chart
25
- :values="values"
26
- :loading="loading"
26
+ v-bind="args"
27
27
  />
28
28
  </div>`,
29
29
  });