@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.
- package/CHANGELOG.md +40 -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/KvSideSheet.vue +2 -2
- 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/KvSideSheet.vue +2 -2
- 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
|
@@ -6,28 +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: { KvWideLoanCard },
|
|
12
|
+
setup() { return { args: { ...templateArgs } }; },
|
|
12
13
|
template: `
|
|
13
14
|
<div style="max-width: 800px;">
|
|
14
15
|
<kv-wide-loan-card
|
|
15
|
-
|
|
16
|
-
:loan="loan"
|
|
17
|
-
:custom-loan-details="customLoanDetails"
|
|
18
|
-
:show-tags="showTags"
|
|
19
|
-
:category-page-name="categoryPageName"
|
|
20
|
-
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
21
|
-
:five-dollars-selected="fiveDollarsSelected"
|
|
22
|
-
:is-adding="isAdding"
|
|
23
|
-
:is-visitor="isVisitor"
|
|
24
|
-
:basket-items="basketItems"
|
|
25
|
-
:is-bookmarked="isBookmarked"
|
|
26
|
-
:kv-track-function="kvTrackFunction"
|
|
27
|
-
:photo-path="photoPath"
|
|
28
|
-
:show-view-loan="showViewLoan"
|
|
29
|
-
:custom-callouts="customCallouts"
|
|
30
|
-
:enable-huge-amount="enableHugeAmount"
|
|
16
|
+
v-bind="args"
|
|
31
17
|
/>
|
|
32
18
|
</div>
|
|
33
19
|
`,
|
|
@@ -12,7 +12,6 @@ const { headerNumberCase, kebabCase, removeObjectProperty } = require('../../uti
|
|
|
12
12
|
|
|
13
13
|
const config = resolveConfig(tailwindConfig);
|
|
14
14
|
const { theme } = config;
|
|
15
|
-
|
|
16
15
|
function buildValuesFromThemeObj(initialObj) {
|
|
17
16
|
const arr = [];
|
|
18
17
|
const iterate = (obj, prefix = '') => {
|
|
@@ -33,7 +32,7 @@ export default {
|
|
|
33
32
|
title: 'Base Styling/Primitives',
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
export const Primitives = (
|
|
35
|
+
export const Primitives = (templateArgs, { argTypes }) => ({
|
|
37
36
|
props: Object.keys(argTypes),
|
|
38
37
|
components: {
|
|
39
38
|
KvGrid,
|
|
@@ -43,6 +42,7 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
43
42
|
KvTabPanel,
|
|
44
43
|
KvToast,
|
|
45
44
|
},
|
|
45
|
+
setup() { return { theme, args: { ...templateArgs } }; },
|
|
46
46
|
template: `
|
|
47
47
|
<kv-page-container>
|
|
48
48
|
<h1 class="tw-mt-4">Primitives</h1>
|
|
@@ -59,27 +59,27 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
59
59
|
as="ul"
|
|
60
60
|
class="tw-grid-cols-3 md:tw-grid-cols-4 lg:tw-grid-cols-5"
|
|
61
61
|
>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:key="buildClassName('bg', color[0])"
|
|
66
|
-
>
|
|
67
|
-
<button
|
|
68
|
-
class="tw-flex tw-flex-col tw-h-full tw-w-full tw-text-left tw-border tw-rounded tw-p-1.5 tw-border-tertiary tw-font-book hover:tw-text-action-highlight"
|
|
69
|
-
@click="copy(buildClassName('tw-bg', color[0]))"
|
|
62
|
+
<template v-for="color in backgroundColor" :key="buildClassName('bg', color[0])">
|
|
63
|
+
<li
|
|
64
|
+
v-if="!isStaticColor(color)"
|
|
70
65
|
>
|
|
71
|
-
<
|
|
72
|
-
class="tw-w-full tw-
|
|
73
|
-
|
|
74
|
-
:class="buildClassName('tw-bg', color[0])"
|
|
66
|
+
<button
|
|
67
|
+
class="tw-flex tw-flex-col tw-h-full tw-w-full tw-text-left tw-border tw-rounded tw-p-1.5 tw-border-tertiary tw-font-book hover:tw-text-action-highlight"
|
|
68
|
+
@click="copy(buildClassName('tw-bg', color[0]))"
|
|
75
69
|
>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
<div
|
|
71
|
+
class="tw-w-full tw-h-0 tw-block tw-mb-1"
|
|
72
|
+
style="padding-bottom: 100%;"
|
|
73
|
+
:class="buildClassName('tw-bg', color[0])"
|
|
74
|
+
>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="tw-w-full">
|
|
77
|
+
.{{buildClassName('tw-bg', color[0])}}
|
|
78
|
+
<br><small class="tw-text-tertiary">var({{buildClassName('--bg', color[0])}})</small>
|
|
79
|
+
</div>
|
|
80
|
+
</button>
|
|
81
|
+
</li>
|
|
82
|
+
</template>
|
|
83
83
|
</kv-grid>
|
|
84
84
|
</kv-tab-panel>
|
|
85
85
|
<kv-tab-panel id="bg_static">
|
|
@@ -87,27 +87,27 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
87
87
|
as="ul"
|
|
88
88
|
class="tw-grid-cols-3 md:tw-grid-cols-4 lg:tw-grid-cols-5"
|
|
89
89
|
>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
:key="buildClassName('bg', color[0])"
|
|
94
|
-
>
|
|
95
|
-
<button
|
|
96
|
-
class="tw-flex tw-flex-col tw-h-full tw-w-full tw-text-left tw-border tw-rounded tw-p-1.5 tw-border-tertiary tw-font-book hover:tw-text-action-highlight"
|
|
97
|
-
@click="copy(buildClassName('tw-bg', color[0]))"
|
|
90
|
+
<template v-for="color in backgroundColor" :key="buildClassName('bg', color[0])">
|
|
91
|
+
<li
|
|
92
|
+
v-if="isStaticColor(color)"
|
|
98
93
|
>
|
|
99
|
-
<
|
|
100
|
-
class="tw-w-full tw-
|
|
101
|
-
|
|
102
|
-
:class="buildClassName('tw-bg', color[0])"
|
|
94
|
+
<button
|
|
95
|
+
class="tw-flex tw-flex-col tw-h-full tw-w-full tw-text-left tw-border tw-rounded tw-p-1.5 tw-border-tertiary tw-font-book hover:tw-text-action-highlight"
|
|
96
|
+
@click="copy(buildClassName('tw-bg', color[0]))"
|
|
103
97
|
>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
<div
|
|
99
|
+
class="tw-w-full tw-h-0 tw-block tw-mb-1"
|
|
100
|
+
style="padding-bottom: 100%;"
|
|
101
|
+
:class="buildClassName('tw-bg', color[0])"
|
|
102
|
+
>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="tw-w-full">
|
|
105
|
+
.{{buildClassName('tw-bg', color[0])}}
|
|
106
|
+
<br><small class="tw-text-tertiary">{{color[1]}}</small>
|
|
107
|
+
</div>
|
|
108
|
+
</button>
|
|
109
|
+
</li>
|
|
110
|
+
</template>
|
|
111
111
|
</kv-grid>
|
|
112
112
|
</kv-tab-panel>
|
|
113
113
|
</template>
|
|
@@ -125,44 +125,44 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
125
125
|
<kv-tab-panel id="text_themable">
|
|
126
126
|
<table>
|
|
127
127
|
<tbody>
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</
|
|
143
|
-
</
|
|
128
|
+
<template v-for="color in textColor" :key="buildClassName('text-color', color[0])">
|
|
129
|
+
<tr
|
|
130
|
+
v-if="!isStaticColor(color)"
|
|
131
|
+
>
|
|
132
|
+
<td class="tw-py-1 tw-min-w-[300px]">
|
|
133
|
+
<button
|
|
134
|
+
class="hover:tw-text-action-highlight"
|
|
135
|
+
:class="buildClassName('tw-text', color[0])"
|
|
136
|
+
@click="copy(buildClassName('tw-text', color[0]))"
|
|
137
|
+
>.{{buildClassName('tw-text', color[0])}}</button>
|
|
138
|
+
</td>
|
|
139
|
+
<td>
|
|
140
|
+
<small class="tw-text-tertiary">var({{buildClassName('--text', color[0])}})</small>
|
|
141
|
+
</td>
|
|
142
|
+
</tr>
|
|
143
|
+
</template>
|
|
144
144
|
</tbody>
|
|
145
145
|
</table>
|
|
146
146
|
</kv-tab-panel>
|
|
147
147
|
<kv-tab-panel id="text_static">
|
|
148
148
|
<table>
|
|
149
149
|
<tbody>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
</
|
|
165
|
-
</
|
|
150
|
+
<template v-for="color in textColor" :key="buildClassName('text-color', color[0])">
|
|
151
|
+
<tr
|
|
152
|
+
v-if="isStaticColor(color)"
|
|
153
|
+
>
|
|
154
|
+
<td class="tw-py-1 tw-min-w-[300px]">
|
|
155
|
+
<button
|
|
156
|
+
class="hover:tw-text-action-highlight"
|
|
157
|
+
:class="buildClassName('tw-text', color[0])"
|
|
158
|
+
@click="copy(buildClassName('tw-text', color[0]))"
|
|
159
|
+
>.{{buildClassName('tw-text', color[0])}}</button>
|
|
160
|
+
</td>
|
|
161
|
+
<td>
|
|
162
|
+
<small class="tw-text-tertiary">var({{buildClassName('--text', color[0])}})</small>
|
|
163
|
+
</td>
|
|
164
|
+
</tr>
|
|
165
|
+
</template>
|
|
166
166
|
</tbody>
|
|
167
167
|
</table>
|
|
168
168
|
</kv-tab-panel>
|
|
@@ -181,44 +181,44 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
181
181
|
<kv-tab-panel id="border_themable">
|
|
182
182
|
<table>
|
|
183
183
|
<tbody>
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</
|
|
199
|
-
</
|
|
184
|
+
<template v-for="color in borderColor" :key="buildClassName('border-color', color[0])">
|
|
185
|
+
<tr
|
|
186
|
+
v-if="!isStaticColor(color)"
|
|
187
|
+
>
|
|
188
|
+
<td class="tw-py-2 tw-min-w-[300px]">
|
|
189
|
+
<button
|
|
190
|
+
class="tw-ring-4 hover:tw-text-action-highlight"
|
|
191
|
+
:class="buildClassName('tw-ring', color[0])"
|
|
192
|
+
@click="copy(buildClassName('tw-border', color[0]))"
|
|
193
|
+
>.{{buildClassName('tw-border', color[0])}}</button>
|
|
194
|
+
</td>
|
|
195
|
+
<td>
|
|
196
|
+
<small class="tw-text-tertiary">var({{buildClassName('--border', color[0])}})</small>
|
|
197
|
+
</td>
|
|
198
|
+
</tr>
|
|
199
|
+
</template>
|
|
200
200
|
</tbody>
|
|
201
201
|
</table>
|
|
202
202
|
</kv-tab-panel>
|
|
203
203
|
<kv-tab-panel id="border_static">
|
|
204
204
|
<table>
|
|
205
205
|
<tbody>
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</
|
|
221
|
-
</
|
|
206
|
+
<template v-for="color in borderColor" :key="buildClassName('border-color', color[0])">
|
|
207
|
+
<tr
|
|
208
|
+
v-if="isStaticColor(color)"
|
|
209
|
+
>
|
|
210
|
+
<td class="tw-py-2 tw-min-w-[300px]">
|
|
211
|
+
<button
|
|
212
|
+
class="tw-ring-4 hover:tw-text-action-highlight"
|
|
213
|
+
:class="buildClassName('tw-ring', color[0])"
|
|
214
|
+
@click="copy(buildClassName('tw-border', color[0]))"
|
|
215
|
+
>.{{buildClassName('tw-border', color[0])}}</button>
|
|
216
|
+
</td>
|
|
217
|
+
<td>
|
|
218
|
+
<small class="tw-text-tertiary">var({{buildClassName('--border', color[0])}})</small>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
</template>
|
|
222
222
|
</tbody>
|
|
223
223
|
</table>
|
|
224
224
|
</kv-tab-panel>
|
|
@@ -437,7 +437,6 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
437
437
|
</li>
|
|
438
438
|
</ul>
|
|
439
439
|
</section>
|
|
440
|
-
|
|
441
440
|
<!-- Toast -->
|
|
442
441
|
<div class="tw-fixed tw-inset-0 tw-z-toast tw-pointer-events-none">
|
|
443
442
|
<div class="tw-fixed tw-left-0 tw-right-0 tw-top-2 tw-pointer-events-auto">
|
package/jest.config.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* For a detailed explanation regarding each configuration property, visit:
|
|
3
|
+
* https://jestjs.io/docs/configuration
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
testMatch: ['**/unit/specs/**/*.spec.js'],
|
|
8
|
+
|
|
9
|
+
// Automatically clear mock calls and instances between every test
|
|
10
|
+
clearMocks: true,
|
|
11
|
+
|
|
12
|
+
// Indicates whether the coverage information should be collected while executing the test
|
|
13
|
+
collectCoverage: false,
|
|
14
|
+
|
|
15
|
+
// The directory where Jest should output its coverage files
|
|
16
|
+
// coverageDirectory: 'coverage',
|
|
17
|
+
|
|
18
|
+
// Indicates which provider should be used to instrument code for coverage
|
|
19
|
+
// coverageProvider: 'v8',
|
|
20
|
+
|
|
21
|
+
// An array of file extensions your modules use
|
|
22
|
+
moduleFileExtensions: [
|
|
23
|
+
'js',
|
|
24
|
+
'json',
|
|
25
|
+
'mjs',
|
|
26
|
+
'vue',
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
// The test environment that will be used for testing
|
|
30
|
+
testEnvironment: 'jsdom',
|
|
31
|
+
|
|
32
|
+
// A map from regular expressions to paths to transformers
|
|
33
|
+
transform: {
|
|
34
|
+
'^.+\\.vue$': '@vue/vue3-jest',
|
|
35
|
+
'^.+\\.js$': 'babel-jest',
|
|
36
|
+
'^.+\\.mjs$': 'babel-jest',
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
transformIgnorePatterns: [
|
|
40
|
+
'node_modules/(?!@vueuse)/',
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
// Files to be executed after the test environment is setup but before tests are run
|
|
44
|
+
setupFilesAfterEnv: [
|
|
45
|
+
'./tests/unit/jest-setup.js',
|
|
46
|
+
],
|
|
47
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,20 +13,23 @@
|
|
|
13
13
|
"@babel/preset-env": "^7.24.8",
|
|
14
14
|
"@babel/preset-react": "^7.24.7",
|
|
15
15
|
"@babel/preset-typescript": "^7.24.7",
|
|
16
|
-
"@storybook/addon-a11y": "
|
|
17
|
-
"@storybook/addon-
|
|
18
|
-
"@storybook/addon-
|
|
19
|
-
"@storybook/addon-
|
|
20
|
-
"@storybook/addon-
|
|
21
|
-
"@storybook/addon-
|
|
22
|
-
"@storybook/
|
|
23
|
-
"@storybook/
|
|
24
|
-
"@storybook/
|
|
16
|
+
"@storybook/addon-a11y": "8.0.9",
|
|
17
|
+
"@storybook/addon-essentials": "8.0.9",
|
|
18
|
+
"@storybook/addon-links": "8.0.9",
|
|
19
|
+
"@storybook/addon-storysource": "8.0.9",
|
|
20
|
+
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
21
|
+
"@storybook/addon-viewport": "8.0.9",
|
|
22
|
+
"@storybook/builder-webpack5": "8.0.9",
|
|
23
|
+
"@storybook/core-common": "8.0.9",
|
|
24
|
+
"@storybook/theming": "8.0.9",
|
|
25
|
+
"@storybook/vue3": "8.0.9",
|
|
26
|
+
"@storybook/vue3-webpack5": "8.0.9",
|
|
25
27
|
"@testing-library/dom": "^8.1.0",
|
|
26
28
|
"@testing-library/jest-dom": "^5.16.2",
|
|
27
29
|
"@testing-library/user-event": "^13.2.1",
|
|
28
|
-
"@testing-library/vue": "^
|
|
29
|
-
"@vue/
|
|
30
|
+
"@testing-library/vue": "^8.1.0",
|
|
31
|
+
"@vue/reactivity": "3.2.37",
|
|
32
|
+
"@vue/vue3-jest": "^27.0.0-alpha.4",
|
|
30
33
|
"autoprefixer": "^10.4.2",
|
|
31
34
|
"babel-core": "^7.0.0-bridge.0",
|
|
32
35
|
"babel-jest": "^27.0.6",
|
|
@@ -44,26 +47,26 @@
|
|
|
44
47
|
"postcss-loader": "^7.0.0",
|
|
45
48
|
"react": "^16.8.0",
|
|
46
49
|
"react-dom": "^16.8.0",
|
|
47
|
-
"storybook": "
|
|
50
|
+
"storybook": "8.0.9",
|
|
48
51
|
"style-loader": "^3.3.4",
|
|
49
52
|
"tailwindcss": "^3.4.3",
|
|
50
53
|
"tsup": "^6.7.0",
|
|
51
|
-
"vue": "2.
|
|
54
|
+
"vue": "^3.2.37",
|
|
52
55
|
"vue-loader": "^15.9.6",
|
|
53
|
-
"vue-router": "^
|
|
56
|
+
"vue-router": "^4.5.0",
|
|
54
57
|
"vue-template-compiler": "2.6.14"
|
|
55
58
|
},
|
|
56
59
|
"scripts": {
|
|
57
|
-
"storybook": "
|
|
58
|
-
"build-storybook": "
|
|
60
|
+
"storybook": "storybook dev -p 6006 -c vue/.storybook",
|
|
61
|
+
"build-storybook": "storybook build -c vue/.storybook",
|
|
59
62
|
"lint": "eslint --ext .js,.vue ./",
|
|
60
|
-
"test": "npm run lint",
|
|
63
|
+
"test": "npm run lint && jest",
|
|
61
64
|
"build": "tsup utils/*.js --outDir dist/utils --format cjs,esm --clean && cp -R vue/ dist/components/ && cp -R data/ dist/data/"
|
|
62
65
|
},
|
|
63
66
|
"dependencies": {
|
|
64
67
|
"@kiva/kv-tokens": "^2.16.0",
|
|
65
68
|
"@mdi/js": "^7.4.47",
|
|
66
|
-
"@vueuse/integrations": "^
|
|
69
|
+
"@vueuse/integrations": "^9.13.0",
|
|
67
70
|
"aria-hidden": "^1.1.3",
|
|
68
71
|
"change-case": "^4.1.2",
|
|
69
72
|
"date-fns": "^2.30.0",
|
|
@@ -91,13 +94,7 @@
|
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
96
|
"peerDependencies": {
|
|
94
|
-
"
|
|
95
|
-
"vue": "^2.6.0 || >=3.0.0"
|
|
97
|
+
"vue": ">=3.0.0"
|
|
96
98
|
},
|
|
97
|
-
"
|
|
98
|
-
"@vue/composition-api": {
|
|
99
|
-
"optional": true
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"gitHead": "780d1cf9352ec18c2d7378fe3f3562f660a6e522"
|
|
99
|
+
"gitHead": "9d9cec88ece98da0599515d3f4172fb12c4b5770"
|
|
103
100
|
}
|
|
@@ -28,7 +28,7 @@ describe('Default Button', () => {
|
|
|
28
28
|
props: { to: '/home' },
|
|
29
29
|
});
|
|
30
30
|
const anchorEl = getByRole('link', { name: 'Test Button' });
|
|
31
|
-
expect(anchorEl.href).toEqual('http://localhost
|
|
31
|
+
expect(anchorEl.href).toEqual('http://localhost/home');
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('renders as an anchor tag when passed a route object', () => {
|
|
@@ -43,7 +43,7 @@ describe('Default Button', () => {
|
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
45
|
const anchorEl = getByRole('link', { name: 'Test Button' });
|
|
46
|
-
expect(anchorEl.href).toEqual('http://localhost
|
|
46
|
+
expect(anchorEl.href).toEqual('http://localhost/test-route-with-query?param1=a');
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
it('shows a ripple animation when clicked', async () => {
|
|
@@ -27,7 +27,7 @@ describe('Default Button', () => {
|
|
|
27
27
|
props: { to: '/home' },
|
|
28
28
|
});
|
|
29
29
|
const anchorEl = getByRole('link', { name: 'Test Text Link' });
|
|
30
|
-
expect(anchorEl.href).toEqual('http://localhost
|
|
30
|
+
expect(anchorEl.href).toEqual('http://localhost/home');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
it('renders as an anchor tag when passed a route object', () => {
|
|
@@ -42,7 +42,7 @@ describe('Default Button', () => {
|
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
const anchorEl = getByRole('link', { name: 'Test Text Link' });
|
|
45
|
-
expect(anchorEl.href).toEqual('http://localhost
|
|
45
|
+
expect(anchorEl.href).toEqual('http://localhost/test-route-with-query?param1=a');
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
it('has no automated accessibility violations', async () => {
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import {
|
|
3
|
-
import * as VueRouter from 'vue-router';
|
|
2
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
3
|
|
|
5
4
|
export default function addVueRouter(testingLibraryOptions, vueRouterOptions) {
|
|
6
5
|
const opts = { ...testingLibraryOptions };
|
|
7
6
|
|
|
8
|
-
if
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
opts.global.plugins = opts.global.plugins ?? [];
|
|
7
|
+
// create opts.global.plugins array if it does not exist
|
|
8
|
+
opts.global = opts.global ?? {};
|
|
9
|
+
opts.global.plugins = opts.global.plugins ?? [];
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} else {
|
|
19
|
-
const VueRouterDefault = VueRouter.default;
|
|
20
|
-
opts.routes = new VueRouterDefault(vueRouterOptions);
|
|
21
|
-
}
|
|
11
|
+
// add Vue Router to plugins array
|
|
12
|
+
opts.global.plugins.push(createRouter(vueRouterOptions ?? {
|
|
13
|
+
history: createWebHistory(),
|
|
14
|
+
routes: [{ path: '/:path(.*)', component: {} }],
|
|
15
|
+
}));
|
|
22
16
|
|
|
23
17
|
return opts;
|
|
24
18
|
}
|
package/vue/.storybook/main.js
CHANGED
|
@@ -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>
|
package/vue/KvSideSheet.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="visible"
|
|
4
|
-
class="tw-hidden lg:tw-block tw-
|
|
5
|
-
tw-bg-black tw-transition-all tw-duration-150 tw-z-modal
|
|
4
|
+
class="tw-hidden lg:tw-block tw-absolute tw-inset-0
|
|
5
|
+
tw-bg-black tw-transition-all tw-duration-150 tw-z-modal"
|
|
6
6
|
:class="{
|
|
7
7
|
'tw-bg-opacity-0 tw-delay-300': !open,
|
|
8
8
|
'tw-bg-opacity-low': open,
|
|
@@ -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;
|