@salesforcedevs/mrkt-components 0.41.0-alpha.1 → 0.41.0-alpha.12

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.1",
3
+ "version": "0.41.0-alpha.12",
4
4
  "description": "Marketing Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -35,7 +35,7 @@
35
35
  align-items: center;
36
36
  width: 100%;
37
37
  text-align: center;
38
- z-index: 1;
38
+ z-index: 3;
39
39
  padding: 0 var(--dx-g-page-padding-horizontal);
40
40
  }
41
41
 
@@ -65,7 +65,7 @@ span {
65
65
  display: flex;
66
66
  flex-direction: row;
67
67
  justify-content: space-between;
68
- z-index: 100;
68
+ z-index: 2;
69
69
  }
70
70
 
71
71
  img {
@@ -26,6 +26,7 @@
26
26
  h1 {
27
27
  color: var(--dx-g-text-heading-color);
28
28
  font-size: var(--dx-g-text-5xl);
29
+ font-family: var(--dx-g-font-display);
29
30
  font-weight: bold;
30
31
  line-height: 60px;
31
32
  margin-bottom: var(--dx-g-spacing-lg);
@@ -37,7 +38,7 @@ img {
37
38
 
38
39
  max-width: none;
39
40
  bottom: 0;
40
- left: 15%;
41
+ left: 25%;
41
42
  width: var(--image-width);
42
43
  position: absolute;
43
44
  }
@@ -2,12 +2,18 @@
2
2
  @import "helpers/text";
3
3
 
4
4
  :host {
5
- /* prop should register 76px to dx css vars */
6
- --padding-top: 76px;
5
+ --image-aspect-ratio: 1.43554006969;
6
+ --image-width: 350px;
7
+ --image-height: calc(var(--image-width) / var(--image-aspect-ratio));
8
+ --image-overlap: 44px;
9
+ --image-bottom: calc(var(--image-height) - var(--image-overlap));
10
+ --image-inset: calc(-1 * var(--dx-g-spacing-md));
11
+ --overlap-padding-top: calc(
12
+ var(--image-height) - var(--image-overlap) + var(--image-inset)
13
+ );
7
14
  --icon-size: 50px;
8
15
  --icon-padding: 24px;
9
- --image-offset: 90px;
10
- --mrkt-c-section-header-padding-top: var(--padding-top);
16
+ --mrkt-c-section-header-padding-top: 76px;
11
17
  --mrkt-c-section-header-padding-bottom: var(--dx-g-spacing-5xl);
12
18
  }
13
19
 
@@ -18,6 +24,10 @@
18
24
  var(--mrkt-c-section-header-padding-bottom) 0;
19
25
  }
20
26
 
27
+ .section-header.section-header.overlap-images {
28
+ padding-top: var(--overlap-padding-top);
29
+ }
30
+
21
31
  .section-header.dark {
22
32
  background: var(--dx-g-blue-vibrant-15, #03234d);
23
33
  }
@@ -38,19 +48,19 @@
38
48
  }
39
49
 
40
50
  .section-header:not(.overlap-images) .img-container {
41
- margin-bottom: calc(-1 * var(--dx-g-spacing-md));
51
+ margin-bottom: var(--image-inset);
42
52
  }
43
53
 
44
54
  .section-header.overlap-images .img-container {
45
55
  position: absolute;
46
- bottom: calc(100% - var(--image-offset));
56
+ bottom: calc(100% - var(--image-bottom));
47
57
  left: 0;
48
58
  z-index: 0;
49
59
  }
50
60
 
51
61
  img {
52
- aspect-ratio: 412 / 287;
53
- width: 412px;
62
+ aspect-ratio: var(--image-aspect-ratio);
63
+ width: 350px;
54
64
  max-width: 50%;
55
65
  }
56
66
 
@@ -79,7 +89,7 @@ dx-icon-badge {
79
89
  }
80
90
 
81
91
  .section-header.has-subtitle .title {
82
- margin-bottom: var(--dx-g-spacing-lg);
92
+ margin-bottom: var(--dx-g-spacing-md);
83
93
  }
84
94
 
85
95
  .section-header.dark .title,
@@ -93,6 +103,10 @@ dx-icon-badge {
93
103
  }
94
104
 
95
105
  @media (max-width: 768px) {
106
+ :host {
107
+ --image-width: 50vw;
108
+ }
109
+
96
110
  .section-header .title {
97
111
  font-size: var(--dx-g-text-2xl);
98
112
  letter-spacing: -0.4px;
@@ -105,3 +119,9 @@ dx-icon-badge {
105
119
  line-height: 28px;
106
120
  }
107
121
  }
122
+
123
+ @media (max-width: 360px) {
124
+ :host {
125
+ --overlap-padding-top: var(--mrkt-c-section-header-padding-top);
126
+ }
127
+ }
@@ -10,7 +10,7 @@
10
10
  symbol={iconSymbol}
11
11
  ></dx-icon-badge>
12
12
  <h2 if:true={title} class="title dx-text-heading-2b">{title}</h2>
13
- <span if:true={subtitle} class="subtitle dx-text-heading-4">
13
+ <span if:true={subtitle} class="subtitle dx-text-body-1">
14
14
  {subtitle}
15
15
  </span>
16
16
  </div>
@@ -79,11 +79,12 @@ a::after {
79
79
  }
80
80
 
81
81
  a.active::after {
82
- height: 5px;
82
+ height: 4px;
83
83
  }
84
84
 
85
85
  a > dx-icon-badge {
86
- --dx-c-icon-badge-size: 40px;
86
+ --dx-c-icon-badge-size: 30px;
87
+ --dx-c-icon-badge-icon-size: 17px;
87
88
  --dx-c-icon-badge-background-color: var(--dx-g-blue-vibrant-20);
88
89
  --dx-c-icon-badge-transition: var(--dx-g-transition-hue-1x);
89
90
 
@@ -6,6 +6,8 @@ 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";
10
+ @api showAtId?: string;
9
11
 
10
12
  @api
11
13
  get navItems() {
@@ -31,6 +33,15 @@ export default class SubNavBar extends MatchMediaElement {
31
33
  | {} = {};
32
34
  private sectionsObserver!: IntersectionObserver;
33
35
 
36
+ private get containerElement(): HTMLElement {
37
+ return document.querySelector(this.containerQuery) as HTMLElement;
38
+ }
39
+
40
+ private get showAtElement(): HTMLElement {
41
+ const id = this.showAtId || this.hashIds[0];
42
+ return document.getElementById(id) as HTMLElement;
43
+ }
44
+
34
45
  private get className(): string {
35
46
  return cx("subnav", !this.isVisible && "hide");
36
47
  }
@@ -66,19 +77,18 @@ export default class SubNavBar extends MatchMediaElement {
66
77
  super.connectedCallback();
67
78
  this.observeSectionIntersections();
68
79
  this.onPageScroll();
69
- window.addEventListener("scroll", this.onPageScroll);
80
+ this.containerElement?.addEventListener("scroll", this.onPageScroll);
70
81
  }
71
82
 
72
83
  disconnectedCallback(): void {
73
84
  super.disconnectedCallback();
74
85
  this.sectionsObserver.disconnect();
75
- window.removeEventListener("scroll", this.onPageScroll);
86
+ this.containerElement?.removeEventListener("scroll", this.onPageScroll);
76
87
  }
77
88
 
78
89
  private onPageScroll = () => {
79
- const firstSection = document.getElementById(this.hashIds[0]);
80
- if (firstSection) {
81
- this.isVisible = firstSection.getBoundingClientRect().y <= 1;
90
+ if (this.showAtElement) {
91
+ this.isVisible = this.showAtElement.getBoundingClientRect().y <= 1;
82
92
  }
83
93
  };
84
94
 
@@ -106,7 +116,7 @@ export default class SubNavBar extends MatchMediaElement {
106
116
  }
107
117
 
108
118
  private scrollToTop() {
109
- window.scroll({
119
+ this.containerElement.scroll({
110
120
  top: 0,
111
121
  left: 0,
112
122
  behavior: "smooth"
@@ -3,76 +3,56 @@
3
3
 
4
4
  :host {
5
5
  --dx-g-text-heading-color: white;
6
+ --padding-top: 54px;
7
+ --padding-bottom: 74px;
6
8
  }
7
9
 
8
10
  .container {
9
11
  background-color: var(--dx-g-indigo-vibrant-20);
10
12
  display: flex;
11
- justify-content: center;
12
- margin: 108px auto 0 auto;
13
+ justify-content: space-between;
14
+ padding: 0 var(--dx-g-page-padding-horizontal);
15
+ margin-top: 120px;
13
16
  }
14
17
 
15
18
  .content {
16
- padding-left: var(--dx-g-page-padding-horizontal);
17
- width: 70%;
18
- }
19
-
20
- .content-subtitle,
21
- .content-info {
22
- font-family: var(--dx-g-font-display);
23
- }
24
-
25
- .content-subtitle,
26
- .content-body,
27
- .content-info {
28
- color: white;
29
- }
30
-
31
- .content-title {
32
- margin-top: 54px;
33
- }
34
-
35
- .content-subtitle {
36
- font-size: 32px;
37
- letter-spacing: -0.4%;
38
- line-height: 40px;
39
- margin-top: 6px;
19
+ flex-grow: 1;
20
+ margin: var(--padding-top) 0 var(--padding-bottom) 0;
40
21
  }
41
22
 
42
23
  .content-body {
24
+ color: white;
43
25
  font-family: var(--dx-g-font-sans);
44
- font-size: var(--dx-g-text-lg);
45
- letter-spacing: 0.12%;
46
- line-height: 30px;
26
+ font-size: var(--dx-g-text-base);
47
27
  margin-top: var(--dx-g-spacing-smd);
48
- max-width: 565px;
49
28
  }
50
29
 
51
30
  .content-info {
52
- font-size: var(--dx-g-text-xl);
53
- letter-spacing: 0.4%;
54
- line-height: 32px;
55
31
  margin-top: 30px;
56
32
  margin-bottom: var(--dx-g-spacing-lg);
57
33
  }
58
34
 
59
35
  .image-container {
60
- height: 430px;
36
+ width: 550px;
37
+ flex-shrink: 0;
38
+ position: relative;
61
39
  }
62
40
 
63
41
  img {
64
- position: relative;
65
- top: -80px;
66
- right: 15px;
42
+ position: absolute;
43
+ right: 0;
44
+ bottom: 0;
67
45
  }
68
46
 
69
- .content-button {
70
- margin-bottom: 40px;
71
- }
47
+ @media screen and (max-width: 1024px) {
48
+ :host {
49
+ --padding-top: 38px;
50
+ --padding-bottom: 72px;
51
+ }
72
52
 
73
- @media screen and (max-width: 900px) {
74
53
  .container {
75
54
  align-items: center;
55
+ margin-top: 0;
76
56
  }
77
57
 
78
58
  .content {
@@ -82,40 +62,21 @@ img {
82
62
 
83
63
  .content-title {
84
64
  font-size: var(--dx-g-text-3xl);
85
- margin-top: 39px;
86
- }
87
-
88
- .content-subtitle {
89
- font-size: var(--dx-g-text-lg);
90
- line-height: 28px;
91
- }
92
-
93
- .content-body {
94
- font-size: var(--dx-g-text-sm);
95
- line-height: 20px;
96
- }
97
-
98
- .content-info {
99
- font-size: var(--dx-g-text-base);
100
- line-height: 24px;
101
65
  }
102
66
 
103
67
  .image-container {
104
68
  height: unset;
69
+ padding: var(--dx-g-spacing-sm) 0;
70
+ width: 400px;
105
71
  }
106
72
 
107
73
  img {
108
74
  position: relative;
109
- top: 15px;
110
- right: 25px;
111
- }
112
-
113
- .content-button {
114
- margin-bottom: 52px;
75
+ margin: 0 auto;
115
76
  }
116
77
  }
117
78
 
118
- @media screen and (max-width: 600px) {
79
+ @media screen and (max-width: 768px) {
119
80
  .container {
120
81
  flex-direction: column-reverse;
121
82
  text-align: center;
@@ -123,38 +84,32 @@ img {
123
84
  }
124
85
 
125
86
  .content {
126
- margin-left: 0;
87
+ display: flex;
88
+ flex-direction: column;
89
+ justify-content: center;
90
+ align-items: center;
91
+ margin-top: 0;
127
92
  }
128
93
 
129
94
  .content-title {
130
95
  font-size: var(--dx-g-text-3xl);
131
96
  }
132
97
 
133
- .content-subtitle {
134
- font-size: var(--dx-g-text-lg);
135
- line-height: 28px;
136
- margin-top: 0;
137
- }
138
-
139
98
  .content-info {
140
99
  margin-top: var(--dx-g-spacing-lg);
141
100
  }
142
101
 
143
102
  .image-container {
144
- height: 140px;
103
+ height: 212px;
104
+ width: 100%;
105
+ max-width: 381px;
106
+ padding: unset;
145
107
  }
146
108
 
147
109
  img {
148
- position: relative;
149
- top: -170px;
110
+ position: absolute;
111
+ bottom: 0;
150
112
  right: 0;
151
- width: 381px;
152
- height: 383px;
153
- }
154
-
155
- .content-button {
156
- display: flex;
157
- justify-content: center;
158
- margin-bottom: 63px;
113
+ width: 100%;
159
114
  }
160
115
  }
@@ -2,15 +2,13 @@
2
2
  <div class="container">
3
3
  <div class="content">
4
4
  <h3 class="content-title dx-text-heading-2b">{title}</h3>
5
- <h4 class="content-subtitle">{subtitle}</h4>
5
+ <h4 class="dx-text-heading-4">{subtitle}</h4>
6
6
  <p class="content-body">{body}</p>
7
- <p class="content-info">{info}</p>
8
- <div class="content-button">
9
- <dx-button>{buttonLabel}</dx-button>
10
- </div>
7
+ <p class="content-info dx-text-heading-6">{info}</p>
8
+ <dx-button>{buttonLabel}</dx-button>
11
9
  </div>
12
- <dix class="image-container">
10
+ <div class="image-container">
13
11
  <img src={imgSrc} alt={imgAlt} />
14
- </dix>
12
+ </div>
15
13
  </div>
16
14
  </template>
@@ -23,13 +23,13 @@
23
23
  .item-grid {
24
24
  display: grid;
25
25
  grid-template-columns: 1fr 1fr;
26
- grid-gap: var(--dx-g-spacing-3xl) var(--dx-g-spacing-6xl);
26
+ grid-gap: var(--dx-g-spacing-3xl);
27
27
  margin: auto;
28
28
  }
29
29
 
30
30
  .item {
31
31
  width: 100%;
32
- max-width: 414px;
32
+ max-width: 680px;
33
33
  display: grid;
34
34
  grid-template-areas: "icon title" "icon subtitle";
35
35
  grid-template-columns: min-content auto;
@@ -81,7 +81,7 @@ img {
81
81
 
82
82
  @media (max-width: 1024px) {
83
83
  :host {
84
- --padding-vertical: var(--dx-g-spacing-md);
84
+ --padding-vertical: var(--dx-g-spacing-3xl);
85
85
  }
86
86
 
87
87
  .title {
@@ -112,10 +112,6 @@ img {
112
112
  }
113
113
 
114
114
  @media (max-width: 768px) {
115
- :host {
116
- --padding-vertical: 72px;
117
- }
118
-
119
115
  .two-col-panel-section {
120
116
  display: flex;
121
117
  flex-direction: column;
@@ -28,7 +28,7 @@ img {
28
28
  width: 50%;
29
29
  max-width: 400px;
30
30
  flex-grow: 1;
31
- margin-right: 116px;
31
+ margin-right: 60px;
32
32
  }
33
33
 
34
34
  .text-container {
@@ -6,7 +6,8 @@
6
6
  align-items: center;
7
7
  position: relative;
8
8
  overflow: hidden;
9
- padding-bottom: 20px;
9
+ padding: 0 var(--dx-g-page-padding-horizontal) 20px
10
+ var(--dx-g-page-padding-horizontal);
10
11
  }
11
12
 
12
13
  .swoop-container {
@@ -38,7 +39,7 @@
38
39
 
39
40
  .video {
40
41
  box-shadow: var(--dx-g-box-shadow-md);
41
- width: 70%;
42
+ width: 74%;
42
43
  border-radius: 16px;
43
44
  overflow: hidden;
44
45
  }