@kiva/kv-components 2.0.0 → 3.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/{.eslintrc.js → .eslintrc.cjs} +1 -1
- package/CHANGELOG.md +45 -0
- package/__mocks__/ResizeObserver.js +13 -0
- package/package.json +23 -10
- package/{postcss.config.js → postcss.config.cjs} +2 -2
- package/{tailwind.config.js → tailwind.config.cjs} +3 -3
- package/tests/unit/jest-setup.js +5 -0
- package/tests/unit/specs/components/KvButton.spec.js +14 -25
- package/tests/unit/specs/components/KvCarousel.spec.js +11 -0
- package/tests/unit/specs/components/KvCheckbox.spec.js +73 -14
- package/tests/unit/specs/components/KvLightbox.spec.js +14 -0
- package/tests/unit/specs/components/KvProgressBar.spec.js +11 -0
- package/tests/unit/specs/components/KvRadio.spec.js +94 -5
- package/tests/unit/specs/components/KvSelect.spec.js +113 -0
- package/tests/unit/specs/components/KvSwitch.spec.js +92 -33
- package/tests/unit/specs/components/KvTabPanel.spec.js +11 -0
- package/tests/unit/specs/components/KvTabs.spec.js +99 -0
- package/tests/unit/specs/components/KvTextInput.spec.js +86 -9
- package/tests/unit/specs/components/KvTextLink.spec.js +16 -24
- package/tests/unit/specs/components/KvToast.spec.js +11 -0
- package/tests/unit/utils/addVueRouter.js +24 -0
- package/utils/attrs.js +62 -0
- package/utils/{themeUtils.js → themeUtils.cjs} +0 -0
- package/vue/.storybook/{main.js → main.cjs} +13 -5
- package/vue/.storybook/preview.js +6 -1
- package/vue/KvButton.vue +80 -53
- package/vue/KvCarousel.vue +142 -106
- package/vue/KvCheckbox.vue +86 -60
- package/vue/KvContentfulImg.vue +45 -34
- package/vue/KvLightbox.vue +108 -69
- package/vue/KvProgressBar.vue +33 -19
- package/vue/KvRadio.vue +72 -41
- package/vue/KvSelect.vue +46 -20
- package/vue/KvSwitch.vue +55 -33
- package/vue/KvTab.vue +49 -21
- package/vue/KvTabPanel.vue +26 -6
- package/vue/KvTabs.vue +70 -53
- package/vue/KvTextInput.vue +71 -48
- package/vue/KvTextLink.vue +42 -20
- package/vue/KvThemeProvider.vue +1 -1
- package/vue/KvToast.vue +53 -37
- package/vue/stories/KvCheckbox.stories.js +5 -5
- package/vue/stories/KvSwitch.stories.js +2 -2
- package/vue/stories/KvTabs.stories.js +8 -8
- package/vue/stories/KvTextInput.stories.js +1 -1
- package/vue/stories/KvThemeProvider.stories.js +1 -1
- package/vue/stories/KvToast.stories.js +3 -2
- package/vue/stories/StyleguidePrimitives.stories.js +9 -9
- package/.babelrc +0 -16
- package/jest.config.js +0 -36
package/vue/KvTextInput.vue
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="tw-inline-flex"
|
|
4
|
+
:class="classes"
|
|
5
|
+
:style="styles"
|
|
6
|
+
>
|
|
3
7
|
<div
|
|
4
8
|
class="tw-relative tw-w-full "
|
|
5
9
|
:class="{ 'tw-opacity-low': disabled }"
|
|
@@ -29,10 +33,10 @@
|
|
|
29
33
|
}"
|
|
30
34
|
:placeholder="placeholder"
|
|
31
35
|
:disabled="disabled"
|
|
32
|
-
v-bind="
|
|
33
|
-
:value="
|
|
34
|
-
@input="onInput"
|
|
36
|
+
v-bind="inputAttrs"
|
|
37
|
+
:value="modelValue"
|
|
35
38
|
v-on="inputListeners"
|
|
39
|
+
@input="onInput"
|
|
36
40
|
>
|
|
37
41
|
<!-- eslint-enable max-len -->
|
|
38
42
|
<kv-material-icon
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
tw-pointer-events-none tw-text-danger"
|
|
48
52
|
/>
|
|
49
53
|
<button
|
|
50
|
-
v-
|
|
54
|
+
v-show="canClear && valid && !!inputText"
|
|
51
55
|
type="button"
|
|
52
56
|
class="tw-absolute tw-top-1.5 tw-right-1.5"
|
|
53
57
|
@click="clearInput"
|
|
@@ -70,9 +74,18 @@
|
|
|
70
74
|
</template>
|
|
71
75
|
|
|
72
76
|
<script>
|
|
77
|
+
import {
|
|
78
|
+
ref,
|
|
79
|
+
toRefs,
|
|
80
|
+
} from 'vue-demi';
|
|
73
81
|
import { mdiAlertCircleOutline, mdiClose } from '@mdi/js';
|
|
74
82
|
import KvMaterialIcon from './KvMaterialIcon.vue';
|
|
83
|
+
import { useAttrs } from '../utils/attrs';
|
|
75
84
|
|
|
85
|
+
const emits = [
|
|
86
|
+
'input',
|
|
87
|
+
'update:modelValue',
|
|
88
|
+
];
|
|
76
89
|
/* eslint-disable max-len */
|
|
77
90
|
|
|
78
91
|
/**
|
|
@@ -98,8 +111,8 @@ export default {
|
|
|
98
111
|
inheritAttrs: false,
|
|
99
112
|
// v-model will update when a different value is input
|
|
100
113
|
model: {
|
|
101
|
-
prop: '
|
|
102
|
-
event: '
|
|
114
|
+
prop: 'modelValue',
|
|
115
|
+
event: 'update:modelValue',
|
|
103
116
|
},
|
|
104
117
|
props: {
|
|
105
118
|
/**
|
|
@@ -115,9 +128,9 @@ export default {
|
|
|
115
128
|
* <kv-text-input :value="streetAddress" @input="(val) => streetAddress = val" />
|
|
116
129
|
* ```
|
|
117
130
|
* */
|
|
118
|
-
|
|
131
|
+
modelValue: {
|
|
119
132
|
type: [String, Number, Boolean],
|
|
120
|
-
default:
|
|
133
|
+
default: '',
|
|
121
134
|
},
|
|
122
135
|
/**
|
|
123
136
|
* Text that appears in the form control when it has no value set
|
|
@@ -173,51 +186,61 @@ export default {
|
|
|
173
186
|
default: false,
|
|
174
187
|
},
|
|
175
188
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
};
|
|
182
|
-
},
|
|
183
|
-
computed: {
|
|
184
|
-
inputListeners() {
|
|
185
|
-
return {
|
|
186
|
-
// Pass through any listeners from the parent to the input element, like blur, focus, etc.
|
|
187
|
-
// https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components
|
|
188
|
-
...this.$listeners,
|
|
189
|
-
// ...except for the listener to the 'input' event which is emitted by this component
|
|
190
|
-
input: () => {},
|
|
191
|
-
};
|
|
192
|
-
},
|
|
189
|
+
emits,
|
|
190
|
+
setup(props, context) {
|
|
191
|
+
const { emit } = context;
|
|
192
|
+
const {
|
|
193
|
+
modelValue,
|
|
194
|
+
} = toRefs(props);
|
|
193
195
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
const textInputRef = ref(null);
|
|
197
|
+
const inputText = ref(modelValue.value);
|
|
198
|
+
|
|
199
|
+
const {
|
|
200
|
+
classes,
|
|
201
|
+
styles,
|
|
202
|
+
inputAttrs,
|
|
203
|
+
inputListeners,
|
|
204
|
+
} = useAttrs(context, emits);
|
|
205
|
+
|
|
206
|
+
const onInput = (event) => {
|
|
202
207
|
/**
|
|
203
208
|
* The value that is currently in the input
|
|
204
209
|
* @event input
|
|
205
210
|
* @type {Event}
|
|
206
211
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
212
|
+
inputText.value = event.target.value;
|
|
213
|
+
emit('input', event.target.value);
|
|
214
|
+
emit('update:modelValue', event.target.value);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const focus = () => {
|
|
218
|
+
textInputRef.value.focus();
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const blur = () => {
|
|
222
|
+
textInputRef.value.blur();
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const clearInput = () => {
|
|
226
|
+
inputText.value = '';
|
|
227
|
+
emit('input', '');
|
|
228
|
+
emit('update:modelValue', '');
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
mdiAlertCircleOutline,
|
|
233
|
+
mdiClose,
|
|
234
|
+
onInput,
|
|
235
|
+
focus,
|
|
236
|
+
blur,
|
|
237
|
+
clearInput,
|
|
238
|
+
inputText,
|
|
239
|
+
classes,
|
|
240
|
+
styles,
|
|
241
|
+
inputAttrs,
|
|
242
|
+
inputListeners,
|
|
243
|
+
};
|
|
221
244
|
},
|
|
222
245
|
};
|
|
223
246
|
</script>
|
package/vue/KvTextLink.vue
CHANGED
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script>
|
|
28
|
+
import {
|
|
29
|
+
computed,
|
|
30
|
+
onMounted,
|
|
31
|
+
ref,
|
|
32
|
+
toRefs,
|
|
33
|
+
watch,
|
|
34
|
+
} from 'vue-demi';
|
|
28
35
|
import KvMaterialIcon from './KvMaterialIcon.vue';
|
|
29
36
|
|
|
30
37
|
/**
|
|
@@ -73,26 +80,31 @@ export default {
|
|
|
73
80
|
},
|
|
74
81
|
},
|
|
75
82
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
emits: [
|
|
84
|
+
'click',
|
|
85
|
+
],
|
|
86
|
+
setup(props, { emit }) {
|
|
87
|
+
const {
|
|
88
|
+
to,
|
|
89
|
+
href,
|
|
90
|
+
} = toRefs(props);
|
|
91
|
+
|
|
92
|
+
const buttonRef = ref(null);
|
|
93
|
+
|
|
94
|
+
const tag = computed(() => {
|
|
95
|
+
if (to.value) {
|
|
79
96
|
return 'router-link';
|
|
80
97
|
}
|
|
81
|
-
if (
|
|
98
|
+
if (href.value) {
|
|
82
99
|
return 'a';
|
|
83
100
|
}
|
|
84
101
|
return 'button';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
mounted() {
|
|
89
|
-
this.setHref();
|
|
90
|
-
},
|
|
91
|
-
methods: {
|
|
92
|
-
onClick(event) {
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const onClick = (event) => {
|
|
93
105
|
// emit a vue event and prevent native event
|
|
94
106
|
// so we don't have to write @click.native in our templates
|
|
95
|
-
if (
|
|
107
|
+
if (tag.value === 'button') {
|
|
96
108
|
event.preventDefault();
|
|
97
109
|
/**
|
|
98
110
|
* Fired when the button is clicked
|
|
@@ -100,17 +112,27 @@ export default {
|
|
|
100
112
|
* @event click
|
|
101
113
|
* @param {Event}
|
|
102
114
|
*/
|
|
103
|
-
|
|
115
|
+
emit('click', event);
|
|
104
116
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const setHref = () => {
|
|
107
120
|
// if the component is a router-link, router-link will set the href
|
|
108
121
|
// if the href is passed as a prop, use that instead
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
buttonRef.href = this.href;
|
|
122
|
+
if (href.value) {
|
|
123
|
+
buttonRef.value.href = href.value;
|
|
112
124
|
}
|
|
113
|
-
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
watch(href, () => setHref());
|
|
128
|
+
onMounted(() => setHref());
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
tag,
|
|
132
|
+
onClick,
|
|
133
|
+
buttonRef,
|
|
134
|
+
setHref,
|
|
135
|
+
};
|
|
114
136
|
},
|
|
115
137
|
};
|
|
116
138
|
</script>
|
package/vue/KvThemeProvider.vue
CHANGED
package/vue/KvToast.vue
CHANGED
|
@@ -86,7 +86,10 @@
|
|
|
86
86
|
</template>
|
|
87
87
|
|
|
88
88
|
<script>
|
|
89
|
-
|
|
89
|
+
import {
|
|
90
|
+
ref,
|
|
91
|
+
computed,
|
|
92
|
+
} from 'vue-demi';
|
|
90
93
|
import {
|
|
91
94
|
mdiClose, mdiAlertCircle, mdiAlert, mdiCheckCircle,
|
|
92
95
|
} from '@mdi/js';
|
|
@@ -116,62 +119,75 @@ export default {
|
|
|
116
119
|
KvMaterialIcon,
|
|
117
120
|
KvPageContainer,
|
|
118
121
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (this.messageType === 'warning') {
|
|
122
|
+
emits: [
|
|
123
|
+
'close',
|
|
124
|
+
],
|
|
125
|
+
setup(props, { emit }) {
|
|
126
|
+
const isVisible = ref(false);
|
|
127
|
+
const message = ref('');
|
|
128
|
+
const messageType = ref('confirmation'); // 'error', 'info', 'confirmation'
|
|
129
|
+
const persist = ref(false);
|
|
130
|
+
const timeout = ref(null);
|
|
131
|
+
|
|
132
|
+
const icon = computed(() => {
|
|
133
|
+
if (messageType.value === 'warning') {
|
|
132
134
|
return mdiAlert;
|
|
133
135
|
}
|
|
134
|
-
if (
|
|
136
|
+
if (messageType.value === 'error') {
|
|
135
137
|
return mdiAlertCircle;
|
|
136
138
|
}
|
|
137
139
|
return mdiCheckCircle;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const msToDisplayToast = computed(() => {
|
|
140
143
|
const MINIMUM_MS = 5000;
|
|
141
144
|
const MS_PER_CHARACTER = 100;
|
|
142
145
|
|
|
143
146
|
// create an empty span to get the character count without HTML
|
|
144
147
|
const span = document.createElement('span');
|
|
145
|
-
span.innerHTML =
|
|
148
|
+
span.innerHTML = message.value;
|
|
146
149
|
const characterCount = span.innerText.length;
|
|
147
150
|
|
|
148
151
|
const characterMs = MS_PER_CHARACTER * characterCount;
|
|
149
152
|
return Math.max(characterMs, MINIMUM_MS);
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
methods: {
|
|
153
|
-
show(message, type, persist) {
|
|
154
|
-
this.isVisible = true;
|
|
155
|
-
this.message = typeof message === 'string' ? message : '';
|
|
156
|
-
this.messageType = typeof type === 'string' ? type : '';
|
|
157
|
-
this.persist = Boolean(persist);
|
|
153
|
+
});
|
|
158
154
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, this.msToDisplayToast);
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
close() {
|
|
166
|
-
this.isVisible = false;
|
|
167
|
-
clearTimeout(this.timeout);
|
|
155
|
+
const close = () => {
|
|
156
|
+
isVisible.value = false;
|
|
157
|
+
clearTimeout(timeout.value);
|
|
168
158
|
|
|
169
159
|
/**
|
|
170
160
|
* Indicates the toast has closed by a user or after timeout
|
|
171
161
|
* @event close
|
|
172
162
|
*/
|
|
173
|
-
|
|
174
|
-
}
|
|
163
|
+
emit('close');
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const show = (messageInput, type, persistInput) => {
|
|
167
|
+
isVisible.value = true;
|
|
168
|
+
message.value = typeof messageInput === 'string' ? messageInput : '';
|
|
169
|
+
messageType.value = typeof type === 'string' ? type : '';
|
|
170
|
+
persist.value = Boolean(persistInput);
|
|
171
|
+
|
|
172
|
+
if (!persist.value) {
|
|
173
|
+
timeout.value = setTimeout(() => {
|
|
174
|
+
close();
|
|
175
|
+
}, msToDisplayToast.value);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
mdiClose,
|
|
181
|
+
isVisible,
|
|
182
|
+
message,
|
|
183
|
+
messageType,
|
|
184
|
+
persist,
|
|
185
|
+
timeout,
|
|
186
|
+
icon,
|
|
187
|
+
msToDisplayToast,
|
|
188
|
+
close,
|
|
189
|
+
show,
|
|
190
|
+
};
|
|
175
191
|
},
|
|
176
192
|
};
|
|
177
193
|
</script>
|
|
@@ -67,7 +67,7 @@ export const WithoutVModel = (args, {
|
|
|
67
67
|
template: `
|
|
68
68
|
<div>
|
|
69
69
|
<kv-checkbox
|
|
70
|
-
:
|
|
70
|
+
:modelValue="checkboxExampleModel"
|
|
71
71
|
@change="(val) => checkboxExampleModel = val"
|
|
72
72
|
:disabled="disabled"
|
|
73
73
|
>
|
|
@@ -92,26 +92,26 @@ export const Multiple = (args, {
|
|
|
92
92
|
template: `
|
|
93
93
|
<div class="tw-flex tw-flex-col tw-gap-2">
|
|
94
94
|
<kv-checkbox
|
|
95
|
-
:
|
|
95
|
+
:modelValue="checkboxExampleModel1"
|
|
96
96
|
@change="(val) => checkboxExampleModel1 = val"
|
|
97
97
|
>
|
|
98
98
|
One is checked: {{checkboxExampleModel1}}
|
|
99
99
|
</kv-checkbox>
|
|
100
100
|
<kv-checkbox
|
|
101
|
-
:
|
|
101
|
+
:modelValue="checkboxExampleModel2"
|
|
102
102
|
@change="(val) => checkboxExampleModel2 = val"
|
|
103
103
|
:disabled="true"
|
|
104
104
|
>
|
|
105
105
|
Two is checked: {{checkboxExampleModel2}}
|
|
106
106
|
</kv-checkbox>
|
|
107
107
|
<kv-checkbox
|
|
108
|
-
:
|
|
108
|
+
:modelValue="checkboxExampleModel3"
|
|
109
109
|
@change="(val) => checkboxExampleModel3 = val"
|
|
110
110
|
>
|
|
111
111
|
Three is checked: {{checkboxExampleModel3}}
|
|
112
112
|
</kv-checkbox>
|
|
113
113
|
<kv-checkbox
|
|
114
|
-
:
|
|
114
|
+
:modelValue="checkboxExampleModel4"
|
|
115
115
|
@change="(val) => checkboxExampleModel4 = val"
|
|
116
116
|
>
|
|
117
117
|
Four is long lorem ipsum nulla duis velit occaecat consectetur pariatur enim eu nostrud. <a href="https://placeholder.com">Irure et cupidatat</a> veniam sit enim proident exercitation ut Lorem do. Commodo ad veniam commodo est amet pariatur: {{checkboxExampleModel4}}
|
|
@@ -56,8 +56,8 @@ export const WithoutVModel = (args, {
|
|
|
56
56
|
template: `
|
|
57
57
|
<div>
|
|
58
58
|
<kv-switch
|
|
59
|
-
:
|
|
60
|
-
@
|
|
59
|
+
:modelValue="switchExampleModel"
|
|
60
|
+
@update:modelValue="(val) => switchExampleModel = val"
|
|
61
61
|
:disabled="disabled"
|
|
62
62
|
>
|
|
63
63
|
Switch is switched: {{switchExampleModel}}
|
|
@@ -12,10 +12,10 @@ export const DefaultTemplate = () => ({
|
|
|
12
12
|
template: `
|
|
13
13
|
<kv-tabs @tab-changed="handleTabChanged">
|
|
14
14
|
<template #tabNav>
|
|
15
|
-
<kv-tab
|
|
16
|
-
<kv-tab
|
|
17
|
-
<kv-tab
|
|
18
|
-
<kv-tab
|
|
15
|
+
<kv-tab forPanel="demo-1-first">First</kv-tab>
|
|
16
|
+
<kv-tab forPanel="demo-1-second">Second</kv-tab>
|
|
17
|
+
<kv-tab forPanel="demo-1-third">Third</kv-tab>
|
|
18
|
+
<kv-tab forPanel="demo-1-forth">Forth is longer</kv-tab>
|
|
19
19
|
</template>
|
|
20
20
|
<template #tabPanels>
|
|
21
21
|
<kv-tab-panel id="demo-1-first"><p>First Panel</p></kv-tab-panel>
|
|
@@ -37,10 +37,10 @@ export const InitialTabSelection = () => ({
|
|
|
37
37
|
template: `
|
|
38
38
|
<kv-tabs @tab-changed="handleTabChanged">
|
|
39
39
|
<template #tabNav>
|
|
40
|
-
<kv-tab
|
|
41
|
-
<kv-tab
|
|
42
|
-
<kv-tab
|
|
43
|
-
<kv-tab
|
|
40
|
+
<kv-tab forPanel="demo-2-first">First tab name</kv-tab>
|
|
41
|
+
<kv-tab forPanel="demo-2-second" :selected="true">Second is initially selected</kv-tab>
|
|
42
|
+
<kv-tab forPanel="demo-2-third">Third tab name</kv-tab>
|
|
43
|
+
<kv-tab forPanel="demo-2-forth">Forth tab name is quite long</kv-tab>
|
|
44
44
|
</template>
|
|
45
45
|
<template #tabPanels>
|
|
46
46
|
<kv-tab-panel id="demo-2-first"><p>First Panel</p></kv-tab-panel>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import primitives from '@kiva/kv-tokens/primitives.json';
|
|
2
2
|
import {
|
|
3
3
|
defaultTheme, darkTheme, darkGreenTheme, mintTheme,
|
|
4
|
-
} from '@kiva/kv-tokens/configs/kivaColors';
|
|
4
|
+
} from '@kiva/kv-tokens/configs/kivaColors.cjs';
|
|
5
5
|
import KvButton from '../KvButton.vue';
|
|
6
6
|
import KvGrid from '../KvGrid.vue';
|
|
7
7
|
import KvPageContainer from '../KvPageContainer.vue';
|
|
@@ -49,8 +49,9 @@ const Template = (args, {
|
|
|
49
49
|
</div>
|
|
50
50
|
</div>`,
|
|
51
51
|
methods: {
|
|
52
|
-
showToast(
|
|
53
|
-
this.$refs.toastRef
|
|
52
|
+
showToast(messageInput, type, persistInput) {
|
|
53
|
+
console.log(this.$refs.toastRef);
|
|
54
|
+
this.$refs.toastRef.show(messageInput, type, persistInput);
|
|
54
55
|
},
|
|
55
56
|
onClose() {
|
|
56
57
|
console.log('toast closed');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import resolveConfig from 'tailwindcss/resolveConfig'; // eslint-disable-line import/no-extraneous-dependencies
|
|
2
|
-
import tailwindConfig from '@kiva/kv-tokens/configs/tailwind.config';
|
|
3
|
-
import { textStyles } from '@kiva/kv-tokens/configs/kivaTypography';
|
|
2
|
+
import tailwindConfig from '@kiva/kv-tokens/configs/tailwind.config.cjs';
|
|
3
|
+
import { textStyles } from '@kiva/kv-tokens/configs/kivaTypography.cjs';
|
|
4
4
|
import KvGrid from '../KvGrid.vue';
|
|
5
5
|
import KvPageContainer from '../KvPageContainer.vue';
|
|
6
6
|
import KvTab from '../KvTab.vue';
|
|
@@ -8,7 +8,7 @@ import KvTabs from '../KvTabs.vue';
|
|
|
8
8
|
import KvTabPanel from '../KvTabPanel.vue';
|
|
9
9
|
import KvToast from '../KvToast.vue';
|
|
10
10
|
|
|
11
|
-
const { headerNumberCase, kebabCase, removeObjectProperty } = require('../../utils/themeUtils');
|
|
11
|
+
const { headerNumberCase, kebabCase, removeObjectProperty } = require('../../utils/themeUtils.cjs');
|
|
12
12
|
|
|
13
13
|
const config = resolveConfig(tailwindConfig);
|
|
14
14
|
const { theme } = config;
|
|
@@ -50,8 +50,8 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
50
50
|
<h2 class="tw-mb-4">Background Colors</h2>
|
|
51
51
|
<kv-tabs>
|
|
52
52
|
<template #tabNav>
|
|
53
|
-
<kv-tab for="bg_themable">Themable</kv-tab>
|
|
54
|
-
<kv-tab for="bg_static">Static</kv-tab>
|
|
53
|
+
<kv-tab for-panel="bg_themable">Themable</kv-tab>
|
|
54
|
+
<kv-tab for-panel="bg_static">Static</kv-tab>
|
|
55
55
|
</template>
|
|
56
56
|
<template #tabPanels>
|
|
57
57
|
<kv-tab-panel id="bg_themable">
|
|
@@ -118,8 +118,8 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
118
118
|
<h2 class="tw-mb-4">Text Colors</h2>
|
|
119
119
|
<kv-tabs>
|
|
120
120
|
<template #tabNav>
|
|
121
|
-
<kv-tab for="text_themable">Themable</kv-tab>
|
|
122
|
-
<kv-tab for="text_static">Static</kv-tab>
|
|
121
|
+
<kv-tab for-panel="text_themable">Themable</kv-tab>
|
|
122
|
+
<kv-tab for-panel="text_static">Static</kv-tab>
|
|
123
123
|
</template>
|
|
124
124
|
<template #tabPanels>
|
|
125
125
|
<kv-tab-panel id="text_themable">
|
|
@@ -174,8 +174,8 @@ export const Primitives = (args, { argTypes }) => ({
|
|
|
174
174
|
<h2 class="tw-mb-4">Border/Ring Colors</h2>
|
|
175
175
|
<kv-tabs>
|
|
176
176
|
<template #tabNav>
|
|
177
|
-
<kv-tab for="border_themable">Themable</kv-tab>
|
|
178
|
-
<kv-tab for="border_static">Static</kv-tab>
|
|
177
|
+
<kv-tab for-panel="border_themable">Themable</kv-tab>
|
|
178
|
+
<kv-tab for-panel="border_static">Static</kv-tab>
|
|
179
179
|
</template>
|
|
180
180
|
<template #tabPanels>
|
|
181
181
|
<kv-tab-panel id="border_themable">
|
package/.babelrc
DELETED
package/jest.config.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
'vue',
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
// The test environment that will be used for testing
|
|
29
|
-
testEnvironment: 'jsdom',
|
|
30
|
-
|
|
31
|
-
// A map from regular expressions to paths to transformers
|
|
32
|
-
transform: {
|
|
33
|
-
'^.+\\.vue$': 'vue-jest',
|
|
34
|
-
'^.+\\.js$': 'babel-jest',
|
|
35
|
-
},
|
|
36
|
-
};
|