@kiva/kv-components 3.87.3 → 3.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/package.json +3 -3
- package/vue/KvContentfulImg.vue +26 -10
- package/vue/KvThemeProvider.vue +38 -0
- package/vue/stories/KvThemeProvider.stories.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.88.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.87.4...@kiva/kv-components@3.88.0) (2024-07-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* adjust underline after review ([979d47c](https://github.com/kiva/kv-ui-elements/commit/979d47c6a96c22f4e49b799e57dba412e39e15db))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* brush-stroke underline for headings mvp MP-348 ([6211527](https://github.com/kiva/kv-ui-elements/commit/621152741bd537da6026984569a7775767a2c3ec))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.87.4](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.87.3...@kiva/kv-components@3.87.4) (2024-07-17)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* increase quality setting for small contentful images ([9a75d76](https://github.com/kiva/kv-ui-elements/commit/9a75d76837240dc7f07cd04097575677bd7cbdac))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [3.87.3](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.87.2...@kiva/kv-components@3.87.3) (2024-07-16)
|
|
7
34
|
|
|
8
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.88.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"build": "echo No build needed for @kiva/kv-components."
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@kiva/kv-tokens": "^2.
|
|
62
|
+
"@kiva/kv-tokens": "^2.13.0",
|
|
63
63
|
"@mdi/js": "^5.9.55",
|
|
64
64
|
"@vueuse/integrations": "^7.6.0",
|
|
65
65
|
"aria-hidden": "^1.1.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"optional": true
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "d23ee2a3e2e76af14e08d58028252fe9fe26d864"
|
|
85
85
|
}
|
package/vue/KvContentfulImg.vue
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
:width="image.width ? image.width : null"
|
|
19
19
|
:height="image.height ? image.height : null"
|
|
20
20
|
:srcset="`
|
|
21
|
-
${buildUrl(image, 2)}&fit=${fit}&f=${focus}&fm=webp&q
|
|
22
|
-
${buildUrl(image)}&fit=${fit}&f=${focus}&fm=webp&q
|
|
21
|
+
${buildUrl(image, 2)}&fit=${fit}&f=${focus}&fm=webp&q=${setQuality(image.width, '2x')} 2x,
|
|
22
|
+
${buildUrl(image)}&fit=${fit}&f=${focus}&fm=webp&q=${setQuality(image.width, '1x')} 1x`"
|
|
23
23
|
>
|
|
24
24
|
<!-- browser doesn't support webp -->
|
|
25
|
+
<!-- eslint-disable max-len -->
|
|
25
26
|
<source
|
|
26
27
|
v-for="(image, index) in sourceSizes"
|
|
27
28
|
:key="'fallback-image'+index"
|
|
@@ -29,17 +30,20 @@
|
|
|
29
30
|
:width="image.width ? image.width : null"
|
|
30
31
|
:height="image.height ? image.height : null"
|
|
31
32
|
:srcset="`
|
|
32
|
-
${buildUrl(image, 2)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
33
|
-
${buildUrl(image)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
33
|
+
${buildUrl(image, 2)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(image.width, '2x')} 2x,
|
|
34
|
+
${buildUrl(image)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(image.width, '1x')} 1x`"
|
|
34
35
|
>
|
|
36
|
+
<!-- eslint-enable max-len -->
|
|
35
37
|
<!-- browser doesn't support picture element -->
|
|
38
|
+
<!-- eslint-disable max-len -->
|
|
36
39
|
<img
|
|
37
40
|
class="tw-max-w-full tw-max-h-full"
|
|
38
41
|
style="width: inherit; height: inherit; object-fit: inherit;"
|
|
39
|
-
:src="`${buildUrl(width, height)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
42
|
+
:src="`${buildUrl(width, height)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(width, '1x')}`"
|
|
40
43
|
:alt="caption || alt"
|
|
41
44
|
:loading="loading"
|
|
42
45
|
>
|
|
46
|
+
<!-- eslint-enable max-len -->
|
|
43
47
|
</template>
|
|
44
48
|
|
|
45
49
|
<!-- Single image -->
|
|
@@ -48,17 +52,17 @@
|
|
|
48
52
|
<source
|
|
49
53
|
type="image/webp"
|
|
50
54
|
:srcset="`
|
|
51
|
-
${buildUrl(null, 2)}&fit=${fit}&f=${focus}&fm=webp&q
|
|
52
|
-
${buildUrl()}&fit=${fit}&f=${focus}&fm=webp&q
|
|
55
|
+
${buildUrl(null, 2)}&fit=${fit}&f=${focus}&fm=webp&q=${setQuality(width, '2x')} 2x,
|
|
56
|
+
${buildUrl()}&fit=${fit}&f=${focus}&fm=webp&q=${setQuality(width, '1x')} 1x`"
|
|
53
57
|
>
|
|
54
58
|
<!-- browser doesn't support webp or browser doesn't support picture element -->
|
|
55
59
|
<img
|
|
56
60
|
class="tw-max-w-full tw-max-h-full"
|
|
57
61
|
style="width: inherit; height: inherit; object-fit: inherit;"
|
|
58
62
|
:srcset="`
|
|
59
|
-
${buildUrl(null, 2)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
60
|
-
${buildUrl()}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
61
|
-
:src="`${buildUrl()}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q
|
|
63
|
+
${buildUrl(null, 2)}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(width, '2x')} 2x,
|
|
64
|
+
${buildUrl()}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(width, '1x')} 1x`"
|
|
65
|
+
:src="`${buildUrl()}&fit=${fit}&f=${focus}&fm=${fallbackFormat}&q=${setQuality(width, '1x')}`"
|
|
62
66
|
:width="width ? width : null"
|
|
63
67
|
:height="height ? height : null"
|
|
64
68
|
:alt="caption || alt"
|
|
@@ -241,6 +245,17 @@ export default {
|
|
|
241
245
|
return src;
|
|
242
246
|
};
|
|
243
247
|
|
|
248
|
+
const setQuality = (imgWidth, imgScale) => {
|
|
249
|
+
if (imgScale === '2x') {
|
|
250
|
+
return 65;
|
|
251
|
+
}
|
|
252
|
+
// Smaller images show a marked degradation at 80 quality so we bump it up to 95
|
|
253
|
+
if (imgWidth && parseInt(imgWidth, 10) < 200) {
|
|
254
|
+
return 95;
|
|
255
|
+
}
|
|
256
|
+
return 80;
|
|
257
|
+
};
|
|
258
|
+
|
|
244
259
|
const caption = computed(() => {
|
|
245
260
|
if (alt.value && alt.value.charAt(0) === '^') {
|
|
246
261
|
return alt.value.slice(1).trim();
|
|
@@ -251,6 +266,7 @@ export default {
|
|
|
251
266
|
return {
|
|
252
267
|
buildUrl,
|
|
253
268
|
caption,
|
|
269
|
+
setQuality,
|
|
254
270
|
};
|
|
255
271
|
},
|
|
256
272
|
};
|
package/vue/KvThemeProvider.vue
CHANGED
|
@@ -65,6 +65,8 @@ export default {
|
|
|
65
65
|
* --border-action-highlight: '255, 255, 255',
|
|
66
66
|
* --border-danger: '255, 255, 255',
|
|
67
67
|
* --border-danger-highlight: '255, 255, 255',
|
|
68
|
+
*
|
|
69
|
+
* --heading-underline-primary: url('/heading-underline.svg#FFFFFF'),
|
|
68
70
|
* }
|
|
69
71
|
* ```
|
|
70
72
|
*
|
|
@@ -76,3 +78,39 @@ export default {
|
|
|
76
78
|
},
|
|
77
79
|
};
|
|
78
80
|
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="postcss">
|
|
83
|
+
/* heading underline styling, intentionally not scoped */
|
|
84
|
+
.tw-text-jumbo u,
|
|
85
|
+
.tw-text-h1 u,
|
|
86
|
+
.tw-text-h2 u,
|
|
87
|
+
h1 u,
|
|
88
|
+
h2 u {
|
|
89
|
+
text-decoration: none;
|
|
90
|
+
box-decoration-break: clone;
|
|
91
|
+
background-image: var(--heading-underline-primary);
|
|
92
|
+
background-repeat: no-repeat;
|
|
93
|
+
background-position: left bottom;
|
|
94
|
+
}
|
|
95
|
+
.tw-text-jumbo u {
|
|
96
|
+
background-size: 100% 0.75rem;
|
|
97
|
+
padding-bottom: 0.375rem;
|
|
98
|
+
}
|
|
99
|
+
.tw-text-h1 u,
|
|
100
|
+
h1 u {
|
|
101
|
+
background-size: 100% 0.75rem;
|
|
102
|
+
padding-bottom: 0.375rem;
|
|
103
|
+
}
|
|
104
|
+
.tw-text-h2 u,
|
|
105
|
+
h2 u {
|
|
106
|
+
background-size: 100% 0.375rem;
|
|
107
|
+
padding-bottom: 0.125rem;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@screen lg {
|
|
111
|
+
.tw-text-jumbo u {
|
|
112
|
+
background-size: 100% 1rem;
|
|
113
|
+
padding-bottom: 0.375rem;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -47,6 +47,9 @@ const demoTemplate = `
|
|
|
47
47
|
<span>{{textVariable}}</span>
|
|
48
48
|
<span class="tw-text-opacity-low" :class="textVariable">text-opacity-low</span>
|
|
49
49
|
</p>
|
|
50
|
+
<h1 class="tw-text-jumbo tw-mb-2">Jumbo: The quick <u>brown fox</u> jumped <u>over the lazy dog</u></h1>
|
|
51
|
+
<h1 class="tw-mb-2">H1: The quick <u>brown fox</u> jumped <u>over the lazy dog</u></h1>
|
|
52
|
+
<h2 class="tw-mb-2">H2: The quick <u>brown fox</u> jumped <u>over the lazy dog</u></h2>
|
|
50
53
|
<p>Body text: Voluptate culpa qui excepteur irure ad. Culpa commodo aliquip irure sunt do. Irure incididunt consequat reprehenderit ipsum mollit esse. Ex veniam nulla consequat deserunt fugiat est do in do sint sint ex.</p>
|
|
51
54
|
</section>
|
|
52
55
|
<kv-grid as="section" class="tw-grid-cols-2 tw-p-4 tw-gap-2" style="background-color: gray;">
|