@salesforcedevs/mrkt-components 0.40.0 → 0.41.0-alpha.10

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/lwc.config.json CHANGED
@@ -13,6 +13,7 @@
13
13
  "mrkt/twoColListSection",
14
14
  "mrkt/twoColPanelSection",
15
15
  "mrkt/rectangularHeading",
16
+ "mrkt/videoPlayerSection",
16
17
  "mrkt/tdxSection"
17
18
  ]
18
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/mrkt-components",
3
- "version": "0.40.0",
3
+ "version": "0.41.0-alpha.10",
4
4
  "description": "Marketing Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -14,6 +14,5 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/classnames": "^2.2.10"
17
- },
18
- "gitHead": "a695b88fda2f9ef1ddfbd5c75408293cbf0024c1"
17
+ }
19
18
  }
@@ -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
 
@@ -59,12 +59,13 @@ span {
59
59
 
60
60
  .img-container {
61
61
  position: absolute;
62
- bottom: 0;
62
+ bottom: -35px;
63
63
  left: 0;
64
64
  width: 100%;
65
65
  display: flex;
66
66
  flex-direction: row;
67
67
  justify-content: space-between;
68
+ z-index: 2;
68
69
  }
69
70
 
70
71
  img {
@@ -77,6 +78,10 @@ img {
77
78
  --mrkt-c-cta-section-padding-bottom: var(--dx-g-spacing-5xl);
78
79
  }
79
80
 
81
+ .img-container {
82
+ bottom: -28px;
83
+ }
84
+
80
85
  img {
81
86
  width: 200px;
82
87
  }
@@ -91,8 +96,4 @@ img {
91
96
  position: relative;
92
97
  padding-top: var(--dx-g-spacing-mlg);
93
98
  }
94
-
95
- img {
96
- width: 30%;
97
- }
98
99
  }
@@ -26,6 +26,8 @@
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);
30
+ font-weight: bold;
29
31
  line-height: 60px;
30
32
  margin-bottom: var(--dx-g-spacing-lg);
31
33
  letter-spacing: -0.018em;
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div class={className}>
3
3
  <div class="fade"></div>
4
- <h1>{title}</h1>
4
+ <h1>
5
+ <slot>Default Title</slot>
6
+ </h1>
5
7
  <dx-button href={ctaHref} size="large">{ctaLabel}</dx-button>
6
8
  <img src={imgSrc} alt="" />
7
9
  </div>
@@ -3,7 +3,6 @@ import cx from "classnames";
3
3
 
4
4
  export default class RectangularHeading extends LightningElement {
5
5
  @api dark!: boolean;
6
- @api title!: string;
7
6
  @api imgSrc!: string;
8
7
  @api imgSrcMobile?: string;
9
8
  @api ctaLabel!: string;
@@ -31,13 +31,20 @@
31
31
  }
32
32
 
33
33
  .img-container {
34
- position: absolute;
35
34
  display: flex;
36
35
  flex-direction: row;
37
36
  justify-content: space-between;
37
+ width: 100%;
38
+ }
39
+
40
+ .section-header:not(.overlap-images) .img-container {
41
+ margin-bottom: calc(-1 * var(--dx-g-spacing-md));
42
+ }
43
+
44
+ .section-header.overlap-images .img-container {
45
+ position: absolute;
38
46
  bottom: calc(100% - var(--image-offset));
39
47
  left: 0;
40
- width: 100%;
41
48
  z-index: 0;
42
49
  }
43
50
 
@@ -1,5 +1,9 @@
1
1
  <template>
2
2
  <div class={className}>
3
+ <div class="img-container" if:true={hasImages}>
4
+ <img src={imgSrcLeft} alt="" />
5
+ <img src={imgSrcRight} alt="" />
6
+ </div>
3
7
  <div class="text-container">
4
8
  <dx-icon-badge
5
9
  if:true={hasIcon}
@@ -10,9 +14,5 @@
10
14
  {subtitle}
11
15
  </span>
12
16
  </div>
13
- <div class="img-container" if:true={hasImages}>
14
- <img src={imgSrcLeft} alt="" />
15
- <img src={imgSrcRight} alt="" />
16
- </div>
17
17
  </div>
18
18
  </template>
@@ -6,6 +6,7 @@ export default class SectionHeader extends LightningElement {
6
6
  @api iconSymbol?: string;
7
7
  @api imgSrcLeft?: string;
8
8
  @api imgSrcRight?: string;
9
+ @api overlapImages?: boolean = false;
9
10
  @api lightGradient?: boolean;
10
11
  @api subtitle?: string;
11
12
  @api title?: string;
@@ -23,7 +24,8 @@ export default class SectionHeader extends LightningElement {
23
24
  "section-header",
24
25
  this.dark && "dark",
25
26
  this.lightGradient && "light-gradient",
26
- this.subtitle && "has-subtitle"
27
+ this.subtitle && "has-subtitle",
28
+ this.overlapImages && "overlap-images"
27
29
  );
28
30
  }
29
31
  }
@@ -29,6 +29,8 @@
29
29
  align-items: center;
30
30
  justify-content: space-between;
31
31
  animation: slide 0.3s cubic-bezier(0.3, 0.73, 0.3, 0.74) forwards;
32
+ z-index: 100000;
33
+ box-shadow: 0 5px 10px 0 rgb(0 0 0 / 10%);
32
34
  }
33
35
 
34
36
  .subnav.hide {
@@ -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() {
@@ -23,7 +25,7 @@ export default class SubNavBar extends MatchMediaElement {
23
25
  }
24
26
 
25
27
  private _navItems!: OptionWithLink[];
26
- private isVisible: boolean = true;
28
+ private isVisible: boolean = false;
27
29
  private sectionIntersectionEntryMap:
28
30
  | {
29
31
  [id: string]: IntersectionObserverEntry;
@@ -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,18 +3,21 @@
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%;
19
+ flex-grow: 1;
20
+ margin: var(--padding-top) 0 var(--padding-bottom) 0;
18
21
  }
19
22
 
20
23
  .content-subtitle,
@@ -28,10 +31,6 @@
28
31
  color: white;
29
32
  }
30
33
 
31
- .content-title {
32
- margin-top: 54px;
33
- }
34
-
35
34
  .content-subtitle {
36
35
  font-size: 32px;
37
36
  letter-spacing: -0.4%;
@@ -45,7 +44,6 @@
45
44
  letter-spacing: 0.12%;
46
45
  line-height: 30px;
47
46
  margin-top: var(--dx-g-spacing-smd);
48
- max-width: 565px;
49
47
  }
50
48
 
51
49
  .content-info {
@@ -57,22 +55,26 @@
57
55
  }
58
56
 
59
57
  .image-container {
60
- height: 430px;
58
+ width: 594px;
59
+ flex-shrink: 0;
60
+ position: relative;
61
61
  }
62
62
 
63
63
  img {
64
- position: relative;
65
- top: -80px;
66
- right: 15px;
64
+ position: absolute;
65
+ right: 0;
66
+ bottom: 0;
67
67
  }
68
68
 
69
- .content-button {
70
- margin-bottom: 40px;
71
- }
69
+ @media screen and (max-width: 1024px) {
70
+ :host {
71
+ --padding-top: 38px;
72
+ --padding-bottom: 52px;
73
+ }
72
74
 
73
- @media screen and (max-width: 900px) {
74
75
  .container {
75
76
  align-items: center;
77
+ margin-top: 0;
76
78
  }
77
79
 
78
80
  .content {
@@ -82,7 +84,6 @@ img {
82
84
 
83
85
  .content-title {
84
86
  font-size: var(--dx-g-text-3xl);
85
- margin-top: 39px;
86
87
  }
87
88
 
88
89
  .content-subtitle {
@@ -101,21 +102,18 @@ img {
101
102
  }
102
103
 
103
104
  .image-container {
105
+ flex-shrink: unset;
104
106
  height: unset;
107
+ padding: var(--dx-g-spacing-sm) 0;
105
108
  }
106
109
 
107
110
  img {
108
111
  position: relative;
109
- top: 15px;
110
- right: 25px;
111
- }
112
-
113
- .content-button {
114
- margin-bottom: 52px;
112
+ margin: 0 auto;
115
113
  }
116
114
  }
117
115
 
118
- @media screen and (max-width: 600px) {
116
+ @media screen and (max-width: 768px) {
119
117
  .container {
120
118
  flex-direction: column-reverse;
121
119
  text-align: center;
@@ -123,7 +121,11 @@ img {
123
121
  }
124
122
 
125
123
  .content {
126
- margin-left: 0;
124
+ display: flex;
125
+ flex-direction: column;
126
+ justify-content: center;
127
+ align-items: center;
128
+ margin-top: 0;
127
129
  }
128
130
 
129
131
  .content-title {
@@ -141,20 +143,16 @@ img {
141
143
  }
142
144
 
143
145
  .image-container {
144
- height: 140px;
146
+ height: 212px;
147
+ width: 100%;
148
+ max-width: 381px;
149
+ padding: unset;
145
150
  }
146
151
 
147
152
  img {
148
- position: relative;
149
- top: -170px;
153
+ position: absolute;
154
+ bottom: 0;
150
155
  right: 0;
151
- width: 381px;
152
- height: 383px;
153
- }
154
-
155
- .content-button {
156
- display: flex;
157
- justify-content: center;
158
- margin-bottom: 63px;
156
+ width: 100%;
159
157
  }
160
158
  }
@@ -5,12 +5,10 @@
5
5
  <h4 class="content-subtitle">{subtitle}</h4>
6
6
  <p class="content-body">{body}</p>
7
7
  <p class="content-info">{info}</p>
8
- <div class="content-button">
9
- <dx-button>{buttonLabel}</dx-button>
10
- </div>
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>
@@ -13,6 +13,7 @@
13
13
  var(--mrkt-c-two-col-list-section-padding-bottom)
14
14
  var(--dx-g-page-padding-horizontal);
15
15
  display: flex;
16
+ width: 100%;
16
17
  }
17
18
 
18
19
  .two-col-list-section.dark {
@@ -23,7 +24,6 @@
23
24
  display: grid;
24
25
  grid-template-columns: 1fr 1fr;
25
26
  grid-gap: var(--dx-g-spacing-3xl) var(--dx-g-spacing-6xl);
26
- width: max-content;
27
27
  margin: auto;
28
28
  }
29
29
 
@@ -33,6 +33,7 @@
33
33
  display: grid;
34
34
  grid-template-areas: "icon title" "icon subtitle";
35
35
  grid-template-columns: min-content auto;
36
+ grid-template-rows: min-content auto;
36
37
  grid-gap: var(--dx-g-spacing-xs) var(--dx-g-spacing-mlg);
37
38
  }
38
39
 
@@ -3,7 +3,12 @@
3
3
  <div class="item-grid">
4
4
  <template for:each={items} for:item="item">
5
5
  <div class="item" key={item.title}>
6
- <dx-icon-badge symbol={item.iconSymbol}></dx-icon-badge>
6
+ <dx-icon-badge
7
+ symbol={item.iconSymbol}
8
+ sprite={item.iconSprite}
9
+ color={item.iconColor}
10
+ background-color={item.iconBackgroundColor}
11
+ ></dx-icon-badge>
7
12
  <h3 class="title dx-text-heading-4b">{item.title}</h3>
8
13
  <span class="subtitle dx-text-body-1">{item.subtitle}</span>
9
14
  </div>
@@ -6,6 +6,9 @@ type Item = {
6
6
  title: string;
7
7
  subtitle: string;
8
8
  iconSymbol: string;
9
+ iconSprite: string;
10
+ iconColor: string;
11
+ iconBackgroundColor: string;
9
12
  };
10
13
 
11
14
  export default class TwoColListSection extends LightningElement {
@@ -3,7 +3,7 @@
3
3
  <img src={imgSrc} alt={imgAlt} />
4
4
  <div class="text-container">
5
5
  <h2 class="dx-text-heading-4">{title}</h2>
6
- <span class="dx-text-body-1">{subtitle}</span>
6
+ <span class="dx-text-body-2">{subtitle}</span>
7
7
  </div>
8
8
  </div>
9
9
  </template>
@@ -0,0 +1,76 @@
1
+ @import "helpers/reset";
2
+
3
+ .container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ position: relative;
8
+ overflow: hidden;
9
+ padding: 0 var(--dx-g-page-padding-horizontal) 20px
10
+ var(--dx-g-page-padding-horizontal);
11
+ }
12
+
13
+ .swoop-container {
14
+ width: 100%;
15
+ height: 100%;
16
+ position: absolute;
17
+ bottom: 50%;
18
+ }
19
+
20
+ .swoop-background {
21
+ background-color: var(--dx-g-cloud-blue-vibrant-95);
22
+ width: 100%;
23
+ height: 100%;
24
+ }
25
+
26
+ .swoop {
27
+ width: 100%;
28
+ }
29
+
30
+ .section-title {
31
+ margin-top: var(--dx-g-spacing-xl);
32
+ margin-bottom: var(--dx-g-spacing-xl);
33
+ color: var(--dx-g-text-heading-color);
34
+ font-family: var(--dx-g-font-display);
35
+ font-size: var(--dx-g-text-4xl);
36
+ letter-spacing: -0.6px;
37
+ line-height: 56px;
38
+ }
39
+
40
+ .video {
41
+ box-shadow: var(--dx-g-box-shadow-md);
42
+ width: 74%;
43
+ border-radius: 16px;
44
+ overflow: hidden;
45
+ }
46
+
47
+ .section-title,
48
+ .video {
49
+ z-index: 1;
50
+ }
51
+
52
+ @media screen and (max-width: 768px) {
53
+ .section-title {
54
+ margin-top: var(--dx-g-spacing-mlg);
55
+ margin-bottom: var(--dx-g-spacing-mlg);
56
+ font-size: var(--dx-g-text-3xl);
57
+ }
58
+
59
+ .video {
60
+ width: 90%;
61
+ }
62
+ }
63
+
64
+ @media screen and (max-width: 360px) {
65
+ .section-title {
66
+ font-size: 32px;
67
+ }
68
+
69
+ .swoop-container {
70
+ bottom: 0;
71
+ }
72
+
73
+ .swoop-background {
74
+ height: 120%;
75
+ }
76
+ }
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <div class="container">
3
+ <div class="swoop-container">
4
+ <div class="swoop-background"></div>
5
+ <svg
6
+ class="swoop"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 1368 94"
9
+ fill="none"
10
+ >
11
+ <path
12
+ d="M1368 0C1110 130 278 118 0 0H1368Z"
13
+ fill="#EAF5FE"
14
+ ></path>
15
+ </svg>
16
+ </div>
17
+ <h2 class="section-title">{title}</h2>
18
+ <div class="video">
19
+ <dx-vimeo-player video-id={videoId}></dx-vimeo-player>
20
+ </div>
21
+ </div>
22
+ </template>
@@ -0,0 +1,6 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ export default class VideoPlayerSection extends LightningElement {
4
+ @api title!: string;
5
+ @api videoId!: number;
6
+ }
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.