@energysage/es-ds-components 5.5.6 → 5.6.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 +22 -0
- package/app/components/es-mobile-nav-content.vue +10 -0
- package/app/components/es-mobile-nav-link.vue +1 -3
- package/app/components/es-mobile-sub-nav.vue +1 -6
- package/app/components/es-nav-cta-card.vue +33 -13
- package/app/components/es-sticky-bar.vue +20 -0
- package/app/utils/sticky-bar.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.6.1](https://github.com/EnergySage/es-ds/compare/es-ds-components-v5.6.0...es-ds-components-v5.6.1) (2026-06-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* arrow and hover fixes for EsNavCtaCard ([#1766](https://github.com/EnergySage/es-ds/issues/1766)) ([bd65830](https://github.com/EnergySage/es-ds/commit/bd658300c5404520d838545efaa377268ce8e6f2))
|
|
9
|
+
* EsMobileNav highlighted item color and back/close button feedback ([#1767](https://github.com/EnergySage/es-ds/issues/1767)) ([291c334](https://github.com/EnergySage/es-ds/commit/291c3348bcffd10f0757f6858490badcdc1d1429))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* devDependencies
|
|
16
|
+
* @energysage/es-ds-styles bumped from ^3.5.7 to ^3.5.8
|
|
17
|
+
|
|
18
|
+
## [5.6.0](https://github.com/EnergySage/es-ds/compare/es-ds-components-v5.5.6...es-ds-components-v5.6.0) (2026-06-01)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* sticky bar now coordinates with other fixed position elements ([#1764](https://github.com/EnergySage/es-ds/issues/1764)) ([3d250de](https://github.com/EnergySage/es-ds/commit/3d250de895097cce81ca1c624ef0306229ebcf97))
|
|
24
|
+
|
|
3
25
|
## [5.5.6](https://github.com/EnergySage/es-ds/compare/es-ds-components-v5.5.5...es-ds-components-v5.5.6) (2026-05-29)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -239,6 +239,11 @@ provide('isElementWithinMenu', isElementWithinMenu);
|
|
|
239
239
|
transform: translateY(-50%);
|
|
240
240
|
top: 50%;
|
|
241
241
|
|
|
242
|
+
/* give feedback on tap/click press down */
|
|
243
|
+
&:active {
|
|
244
|
+
transform: translateY(calc(-50% + 1px));
|
|
245
|
+
}
|
|
246
|
+
|
|
242
247
|
svg {
|
|
243
248
|
height: 20px !important;
|
|
244
249
|
width: 20px !important;
|
|
@@ -250,6 +255,11 @@ provide('isElementWithinMenu', isElementWithinMenu);
|
|
|
250
255
|
transform: translateY(-50%);
|
|
251
256
|
top: 50%;
|
|
252
257
|
|
|
258
|
+
/* give feedback on tap/click press down */
|
|
259
|
+
&:active {
|
|
260
|
+
transform: translateY(calc(-50% + 1px));
|
|
261
|
+
}
|
|
262
|
+
|
|
253
263
|
svg {
|
|
254
264
|
height: 20px !important;
|
|
255
265
|
width: 20px !important;
|
|
@@ -215,14 +215,9 @@ $transition-duration: 100ms;
|
|
|
215
215
|
|
|
216
216
|
&[data-state='open'] {
|
|
217
217
|
border-bottom-color: transparent;
|
|
218
|
-
color: variables.$white;
|
|
219
218
|
|
|
220
219
|
& > span {
|
|
221
|
-
background-color: variables.$
|
|
222
|
-
|
|
223
|
-
& > svg {
|
|
224
|
-
color: variables.$white;
|
|
225
|
-
}
|
|
220
|
+
background-color: variables.$blue-100;
|
|
226
221
|
}
|
|
227
222
|
}
|
|
228
223
|
}
|
|
@@ -5,10 +5,17 @@ interface Props {
|
|
|
5
5
|
subtitle?: string;
|
|
6
6
|
target?: string;
|
|
7
7
|
}
|
|
8
|
-
withDefaults(defineProps<Props>(), {
|
|
8
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
9
9
|
subtitle: '',
|
|
10
10
|
target: '_self',
|
|
11
11
|
});
|
|
12
|
+
|
|
13
|
+
const headingPartOne = computed(() => {
|
|
14
|
+
const arr = props.heading.split(' ');
|
|
15
|
+
arr.pop();
|
|
16
|
+
return arr.join(' ');
|
|
17
|
+
});
|
|
18
|
+
const headingPartTwo = computed(() => props.heading.split(' ').pop());
|
|
12
19
|
</script>
|
|
13
20
|
|
|
14
21
|
<template>
|
|
@@ -28,11 +35,14 @@ withDefaults(defineProps<Props>(), {
|
|
|
28
35
|
</div>
|
|
29
36
|
</div>
|
|
30
37
|
<div>
|
|
31
|
-
<p class="
|
|
32
|
-
{{
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
<p class="font-weight-bold mb-0 text-blue-600">
|
|
39
|
+
{{ headingPartOne }}
|
|
40
|
+
<span class="text-nowrap">
|
|
41
|
+
{{ headingPartTwo }}
|
|
42
|
+
<icon-arrow-right
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
class="es-nav-cta-card-arrow flex-shrink-0 position-relative" />
|
|
45
|
+
</span>
|
|
36
46
|
</p>
|
|
37
47
|
<p
|
|
38
48
|
v-if="subtitle"
|
|
@@ -50,6 +60,12 @@ withDefaults(defineProps<Props>(), {
|
|
|
50
60
|
.es-nav-cta-card {
|
|
51
61
|
border-width: 1px;
|
|
52
62
|
|
|
63
|
+
/* override EsCard active state */
|
|
64
|
+
&:active {
|
|
65
|
+
border-color: variables.$blue-600;
|
|
66
|
+
box-shadow: 0 0 0 1px variables.$blue-600;
|
|
67
|
+
}
|
|
68
|
+
|
|
53
69
|
/* only apply a hover state if the device supports mouse hover */
|
|
54
70
|
@media (hover) {
|
|
55
71
|
&:hover {
|
|
@@ -63,12 +79,22 @@ withDefaults(defineProps<Props>(), {
|
|
|
63
79
|
}
|
|
64
80
|
}
|
|
65
81
|
|
|
82
|
+
/* move the arrow slightly to the right on hover */
|
|
66
83
|
.es-nav-cta-card-arrow {
|
|
67
|
-
|
|
84
|
+
transform: translateX(0.25rem);
|
|
68
85
|
}
|
|
69
86
|
}
|
|
70
87
|
}
|
|
71
88
|
|
|
89
|
+
&-arrow {
|
|
90
|
+
/* vertically center the icon relative to the text */
|
|
91
|
+
top: -2px;
|
|
92
|
+
|
|
93
|
+
@media not (prefers-reduced-motion) {
|
|
94
|
+
transition: variables.$transition-base;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
72
98
|
&-icon {
|
|
73
99
|
/* you cannot animate radial gradient backgrounds, so apply it to a pseudo element and fade it in on hover */
|
|
74
100
|
&::after {
|
|
@@ -103,11 +129,5 @@ withDefaults(defineProps<Props>(), {
|
|
|
103
129
|
transition: variables.$transition-base;
|
|
104
130
|
}
|
|
105
131
|
}
|
|
106
|
-
|
|
107
|
-
&-arrow {
|
|
108
|
-
@media not (prefers-reduced-motion) {
|
|
109
|
-
transition: variables.$transition-base;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
132
|
}
|
|
113
133
|
</style>
|
|
@@ -77,9 +77,15 @@ function updateVisibility() {
|
|
|
77
77
|
if (currentScrollY <= 0) {
|
|
78
78
|
// back at the very top: switch to absolute so bar scrolls away naturally on next scroll down
|
|
79
79
|
barState.value = 'absolute';
|
|
80
|
+
|
|
81
|
+
// emit event notifying other fixed position elements of the change
|
|
82
|
+
emitter.emit(ES_STICKY_BAR_FIXED_HIDE_EVENT_NAME);
|
|
80
83
|
} else if (barState.value === 'absolute' && currentScrollY >= barHeight.value) {
|
|
81
84
|
// bar has scrolled fully off screen: reposition to fixed-hidden while invisible
|
|
82
85
|
hideWithoutAnimation();
|
|
86
|
+
|
|
87
|
+
// emit event notifying other fixed position elements of the change
|
|
88
|
+
emitter.emit(ES_STICKY_BAR_FIXED_HIDE_EVENT_NAME);
|
|
83
89
|
} else if (
|
|
84
90
|
barState.value === 'fixed-hidden' &&
|
|
85
91
|
scrollDirection < 0 &&
|
|
@@ -87,6 +93,9 @@ function updateVisibility() {
|
|
|
87
93
|
) {
|
|
88
94
|
// scrolling up far enough: slide bar into view
|
|
89
95
|
barState.value = 'fixed-visible';
|
|
96
|
+
|
|
97
|
+
// emit event notifying other fixed position elements of the change
|
|
98
|
+
emitter.emit(ES_STICKY_BAR_FIXED_SHOW_EVENT_NAME);
|
|
90
99
|
} else if (
|
|
91
100
|
barState.value === 'fixed-visible' &&
|
|
92
101
|
scrollDirection > 0 &&
|
|
@@ -94,6 +103,9 @@ function updateVisibility() {
|
|
|
94
103
|
) {
|
|
95
104
|
// scrolling down far enough: slide bar off screen
|
|
96
105
|
barState.value = 'fixed-hidden';
|
|
106
|
+
|
|
107
|
+
// emit event notifying other fixed position elements of the change
|
|
108
|
+
emitter.emit(ES_STICKY_BAR_FIXED_HIDE_EVENT_NAME);
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
lastScrollY = currentScrollY;
|
|
@@ -129,6 +141,12 @@ const onMenuBarClose = () => {
|
|
|
129
141
|
}
|
|
130
142
|
};
|
|
131
143
|
|
|
144
|
+
// expose barHeight to other fixed position elements via a CSS variable on <html> so they can
|
|
145
|
+
// position themselves relative to the bar
|
|
146
|
+
watch(barHeight, (height) => {
|
|
147
|
+
document.documentElement.style.setProperty('--es-sticky-bar-height', `${height}px`);
|
|
148
|
+
});
|
|
149
|
+
|
|
132
150
|
onMounted(() => {
|
|
133
151
|
// measure height before switching position so the placeholder matches exactly
|
|
134
152
|
barHeight.value = bar.value?.offsetHeight ?? 0;
|
|
@@ -154,6 +172,8 @@ onMounted(() => {
|
|
|
154
172
|
onUnmounted(() => {
|
|
155
173
|
window.removeEventListener('scroll', onScroll);
|
|
156
174
|
|
|
175
|
+
document.documentElement.style.removeProperty('--es-sticky-bar-height');
|
|
176
|
+
|
|
157
177
|
emitter.off(ES_MENU_BAR_OPEN_EVENT_NAME, onMenuBarOpen);
|
|
158
178
|
emitter.off(ES_MENU_BAR_CLOSE_EVENT_NAME, onMenuBarClose);
|
|
159
179
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@energysage/es-ds-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "An EnergySage Vue component library",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@energysage/es-ds-styles": "^3.5.
|
|
32
|
+
"@energysage/es-ds-styles": "^3.5.8",
|
|
33
33
|
"@nuxt/eslint": "^1.14.0",
|
|
34
34
|
"@nuxtjs/google-fonts": "^3.2.0",
|
|
35
35
|
"@phosphor-icons/vue": "^2.2.1",
|