@salesforcedevs/mrkt-components 0.41.0 → 0.53.5-alpha

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",
3
+ "version": "0.53.5-alpha",
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": "363477b8997dcd990c2d668b03ee0142334d7815"
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;
@@ -36,7 +38,7 @@ img {
36
38
 
37
39
  max-width: none;
38
40
  bottom: 0;
39
- left: 15%;
41
+ left: 25%;
40
42
  width: var(--image-width);
41
43
  position: absolute;
42
44
  }
@@ -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;
@@ -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
  }
@@ -31,19 +41,26 @@
31
41
  }
32
42
 
33
43
  .img-container {
34
- position: absolute;
35
44
  display: flex;
36
45
  flex-direction: row;
37
46
  justify-content: space-between;
38
- bottom: calc(100% - var(--image-offset));
39
- left: 0;
40
47
  width: 100%;
48
+ }
49
+
50
+ .section-header:not(.overlap-images) .img-container {
51
+ margin-bottom: var(--image-inset);
52
+ }
53
+
54
+ .section-header.overlap-images .img-container {
55
+ position: absolute;
56
+ bottom: calc(100% - var(--image-bottom));
57
+ left: 0;
41
58
  z-index: 0;
42
59
  }
43
60
 
44
61
  img {
45
- aspect-ratio: 412 / 287;
46
- width: 412px;
62
+ aspect-ratio: var(--image-aspect-ratio);
63
+ width: 350px;
47
64
  max-width: 50%;
48
65
  }
49
66
 
@@ -72,7 +89,7 @@ dx-icon-badge {
72
89
  }
73
90
 
74
91
  .section-header.has-subtitle .title {
75
- margin-bottom: var(--dx-g-spacing-lg);
92
+ margin-bottom: var(--dx-g-spacing-md);
76
93
  }
77
94
 
78
95
  .section-header.dark .title,
@@ -86,6 +103,10 @@ dx-icon-badge {
86
103
  }
87
104
 
88
105
  @media (max-width: 768px) {
106
+ :host {
107
+ --image-width: 50vw;
108
+ }
109
+
89
110
  .section-header .title {
90
111
  font-size: var(--dx-g-text-2xl);
91
112
  letter-spacing: -0.4px;
@@ -98,3 +119,9 @@ dx-icon-badge {
98
119
  line-height: 28px;
99
120
  }
100
121
  }
122
+
123
+ @media (max-width: 360px) {
124
+ :host {
125
+ --overlap-padding-top: var(--mrkt-c-section-header-padding-top);
126
+ }
127
+ }
@@ -1,18 +1,18 @@
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}
6
10
  symbol={iconSymbol}
7
11
  ></dx-icon-badge>
8
12
  <h2 if:true={title} class="title dx-text-heading-2b">{title}</h2>
9
- <span if:true={subtitle} class="subtitle dx-text-heading-4">
13
+ <span if:true={subtitle} class="subtitle dx-text-body-1">
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 {
@@ -63,6 +65,7 @@ a {
63
65
  display: flex;
64
66
  align-items: center;
65
67
  justify-content: center;
68
+ white-space: nowrap;
66
69
  }
67
70
 
68
71
  a::after {
@@ -77,11 +80,12 @@ a::after {
77
80
  }
78
81
 
79
82
  a.active::after {
80
- height: 5px;
83
+ height: 4px;
81
84
  }
82
85
 
83
86
  a > dx-icon-badge {
84
- --dx-c-icon-badge-size: 40px;
87
+ --dx-c-icon-badge-size: 30px;
88
+ --dx-c-icon-badge-icon-size: 17px;
85
89
  --dx-c-icon-badge-background-color: var(--dx-g-blue-vibrant-20);
86
90
  --dx-c-icon-badge-transition: var(--dx-g-transition-hue-1x);
87
91
 
@@ -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,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 href={buttonHref}>{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>
@@ -6,6 +6,7 @@ export default class TdxSection extends LightningElement {
6
6
  @api body!: string;
7
7
  @api info!: string;
8
8
  @api buttonLabel!: string;
9
+ @api buttonHref!: string;
9
10
  @api imgSrc!: string;
10
11
  @api imgAlt!: string;
11
12
  }
@@ -31,8 +31,11 @@
31
31
  width: 100%;
32
32
  max-width: 414px;
33
33
  display: grid;
34
- grid-template-areas: "icon title" "icon subtitle";
34
+ grid-template-areas:
35
+ "icon title"
36
+ "icon subtitle";
35
37
  grid-template-columns: min-content auto;
38
+ grid-template-rows: min-content;
36
39
  grid-gap: var(--dx-g-spacing-xs) var(--dx-g-spacing-mlg);
37
40
  }
38
41
 
@@ -3,9 +3,14 @@
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
- <span class="subtitle dx-text-body-1">{item.subtitle}</span>
13
+ <span class="subtitle dx-text-body-2">{item.subtitle}</span>
9
14
  </div>
10
15
  </template>
11
16
  </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 {
@@ -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 {
@@ -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>
@@ -5,6 +5,9 @@
5
5
  flex-direction: column;
6
6
  align-items: center;
7
7
  position: relative;
8
+ overflow: hidden;
9
+ padding: 0 var(--dx-g-page-padding-horizontal) 20px
10
+ var(--dx-g-page-padding-horizontal);
8
11
  }
9
12
 
10
13
  .swoop-container {
@@ -36,7 +39,7 @@
36
39
 
37
40
  .video {
38
41
  box-shadow: var(--dx-g-box-shadow-md);
39
- width: 70%;
42
+ width: 74%;
40
43
  border-radius: 16px;
41
44
  overflow: hidden;
42
45
  }
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.