@salesforcedevs/mrkt-components 0.41.0-alpha.7 → 0.41.0-alpha.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/mrkt-components",
3
- "version": "0.41.0-alpha.7",
3
+ "version": "0.41.0-alpha.8",
4
4
  "description": "Marketing Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -23,7 +23,7 @@
23
23
  z-index: 2;
24
24
  }
25
25
 
26
- .title {
26
+ h1 {
27
27
  color: var(--dx-g-text-heading-color);
28
28
  font-size: var(--dx-g-text-5xl);
29
29
  font-family: var(--dx-g-font-display);
@@ -44,7 +44,7 @@ img {
44
44
  }
45
45
 
46
46
  dx-button,
47
- .title {
47
+ h1 {
48
48
  position: relative;
49
49
  z-index: 3;
50
50
  }
@@ -64,7 +64,7 @@ dx-button,
64
64
  }
65
65
 
66
66
  @media screen and (max-width: 1368px) {
67
- .title {
67
+ h1 {
68
68
  font-size: 56px;
69
69
  letter-spacing: -0.012em;
70
70
  line-height: 64px;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class={className}>
3
3
  <div class="fade"></div>
4
- <h1 class="title">
4
+ <h1>
5
5
  <slot>Default Title</slot>
6
6
  </h1>
7
7
  <dx-button href={ctaHref} size="large">{ctaLabel}</dx-button>
@@ -6,6 +6,7 @@ import { toJson } from "utils/normalizers";
6
6
 
7
7
  export default class SubNavBar extends MatchMediaElement {
8
8
  @api subscribeHref!: string;
9
+ @api containerQuery: string = "body";
9
10
 
10
11
  @api
11
12
  get navItems() {
@@ -31,6 +32,10 @@ export default class SubNavBar extends MatchMediaElement {
31
32
  | {} = {};
32
33
  private sectionsObserver!: IntersectionObserver;
33
34
 
35
+ private get containerElement(): HTMLElement {
36
+ return document.querySelector(this.containerQuery) as HTMLElement;
37
+ }
38
+
34
39
  private get className(): string {
35
40
  return cx("subnav", !this.isVisible && "hide");
36
41
  }
@@ -66,13 +71,13 @@ export default class SubNavBar extends MatchMediaElement {
66
71
  super.connectedCallback();
67
72
  this.observeSectionIntersections();
68
73
  this.onPageScroll();
69
- window.addEventListener("scroll", this.onPageScroll);
74
+ this.containerElement.addEventListener("scroll", this.onPageScroll);
70
75
  }
71
76
 
72
77
  disconnectedCallback(): void {
73
78
  super.disconnectedCallback();
74
79
  this.sectionsObserver.disconnect();
75
- window.removeEventListener("scroll", this.onPageScroll);
80
+ this.containerElement.removeEventListener("scroll", this.onPageScroll);
76
81
  }
77
82
 
78
83
  private onPageScroll = () => {
@@ -106,7 +111,7 @@ export default class SubNavBar extends MatchMediaElement {
106
111
  }
107
112
 
108
113
  private scrollToTop() {
109
- window.scroll({
114
+ this.containerElement.scroll({
110
115
  top: 0,
111
116
  left: 0,
112
117
  behavior: "smooth"