@salesforcedevs/mrkt-components 0.30.0 → 0.34.0

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
@@ -3,5 +3,12 @@
3
3
  { "dir": "src/modules" },
4
4
  { "npm": "@salesforcedevs/dx-components" }
5
5
  ],
6
- "expose": ["mrkt/subNavBar"]
6
+ "expose": [
7
+ "mrkt/subNavBar",
8
+ "mrkt/ctaSection",
9
+ "mrkt/sectionHeader",
10
+ "mrkt/twoColSection",
11
+ "mrkt/twoColListSection",
12
+ "mrkt/rectangularHeading"
13
+ ]
7
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/mrkt-components",
3
- "version": "0.30.0",
3
+ "version": "0.34.0",
4
4
  "description": "Marketing Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -15,5 +15,5 @@
15
15
  "devDependencies": {
16
16
  "@types/classnames": "^2.2.10"
17
17
  },
18
- "gitHead": "2892ffcc573566253f854054c4186226dd182ef0"
18
+ "gitHead": "3fb8d8f361564473da583dae0a1e90cdeb943601"
19
19
  }
@@ -0,0 +1,85 @@
1
+ @import "helpers/reset";
2
+ @import "helpers/text";
3
+
4
+ .cta-section {
5
+ position: relative;
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ width: 100%;
10
+ padding: var(--dx-g-spacing-3xl) 0 var(--dx-g-spacing-3xl) 0;
11
+ background: white;
12
+ }
13
+
14
+ .cta-section.dark {
15
+ background: var(--dx-g-blue-vibrant-15, #03234d);
16
+ }
17
+
18
+ .cta-section.has-images {
19
+ padding-bottom: var(--dx-g-spacing-4xl);
20
+ }
21
+
22
+ .text-container {
23
+ position: relative;
24
+ display: flex;
25
+ flex-direction: column;
26
+ align-items: center;
27
+ width: 100%;
28
+ padding: 0 var(--dx-g-page-padding-horizontal);
29
+ max-width: 700px;
30
+ text-align: center;
31
+ z-index: 1;
32
+ }
33
+
34
+ h2 {
35
+ padding-bottom: var(--dx-g-spacing-sm);
36
+ }
37
+
38
+ span {
39
+ padding-bottom: var(--dx-g-spacing-lg);
40
+ }
41
+
42
+ .cta-section.dark h2,
43
+ .cta-section.dark span {
44
+ color: white;
45
+ }
46
+
47
+ .img-container {
48
+ position: absolute;
49
+ bottom: 0;
50
+ left: 0;
51
+ width: 100%;
52
+ display: flex;
53
+ flex-direction: row;
54
+ justify-content: space-between;
55
+ }
56
+
57
+ img {
58
+ width: 250px;
59
+ aspect-ratio: 25 / 14;
60
+ }
61
+
62
+ @media (max-width: 1024px) {
63
+ .cta-section.has-images {
64
+ padding-bottom: var(--dx-g-spacing-5xl);
65
+ }
66
+
67
+ img {
68
+ width: 200px;
69
+ }
70
+ }
71
+
72
+ @media (max-width: 768px) {
73
+ .cta-section.has-images {
74
+ padding-bottom: unset;
75
+ }
76
+
77
+ .img-container {
78
+ position: relative;
79
+ padding-top: var(--dx-g-spacing-mlg);
80
+ }
81
+
82
+ img {
83
+ width: 30%;
84
+ }
85
+ }
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div class={className}>
3
+ <div class="text-container">
4
+ <h2 class="dx-text-heading-5">{title}</h2>
5
+ <span if:true={subtitle} class="subtitle dx-text-body-2">
6
+ {subtitle}
7
+ </span>
8
+ <dx-button href={buttonHref}>{buttonText}</dx-button>
9
+ </div>
10
+ <div class="img-container" if:true={hasImages}>
11
+ <img src={imgSrcLeft} alt="" />
12
+ <img src={imgSrcRight} alt="" />
13
+ </div>
14
+ </div>
15
+ </template>
@@ -0,0 +1,24 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import cx from "classnames";
3
+
4
+ export default class CTASection extends LightningElement {
5
+ @api buttonHref: string = "";
6
+ @api buttonText: string = "";
7
+ @api dark: boolean = false;
8
+ @api subtitle: string | null = null;
9
+ @api imgSrcLeft: string | null = null;
10
+ @api imgSrcRight: string | null = null;
11
+ @api title: string = "";
12
+
13
+ private get hasImages(): boolean {
14
+ return !!this.imgSrcLeft && !!this.imgSrcRight;
15
+ }
16
+
17
+ private get className(): string {
18
+ return cx(
19
+ "cta-section",
20
+ this.dark && "dark",
21
+ this.hasImages && "has-images"
22
+ );
23
+ }
24
+ }
@@ -0,0 +1,87 @@
1
+ @import "helpers/reset";
2
+
3
+ :host {
4
+ /* uses a fallback until blue vibrant 15 is setup in dx-css-variables */
5
+ background-color: var(--dx-g-blue-vibrant-15, #03234d);
6
+ display: block;
7
+ font-family: var(--dx-g-font-display);
8
+ overflow: hidden;
9
+ padding: 0 var(--dx-g-page-padding-horizontal);
10
+ position: relative;
11
+ }
12
+
13
+ h1 {
14
+ color: white;
15
+ font-size: var(--dx-g-text-6xl);
16
+ line-height: 88px;
17
+ margin-bottom: var(--dx-g-spacing-lg);
18
+ letter-spacing: -0.018em;
19
+ }
20
+
21
+ img {
22
+ --image-width: 1440px;
23
+
24
+ max-width: none;
25
+ bottom: 0;
26
+ left: 315px;
27
+ width: var(--image-width);
28
+ position: absolute;
29
+ }
30
+
31
+ dx-button,
32
+ h1 {
33
+ position: relative;
34
+ z-index: 1;
35
+ }
36
+
37
+ .heading-content {
38
+ width: 100%;
39
+ position: relative;
40
+ z-index: 1;
41
+ padding: 108px 0;
42
+ }
43
+
44
+ @media screen and (max-width: 1368px) {
45
+ h1 {
46
+ font-size: 56px;
47
+ letter-spacing: -0.012em;
48
+ line-height: 64px;
49
+ }
50
+
51
+ img {
52
+ --image-width: 1146px;
53
+ }
54
+ }
55
+
56
+ @media screen and (max-width: 1124px) {
57
+ .heading-content {
58
+ display: flex;
59
+ flex-direction: column;
60
+ align-items: center;
61
+ text-align: center;
62
+ padding-bottom: 404px;
63
+ }
64
+
65
+ img {
66
+ --image-width: 1520px;
67
+
68
+ bottom: 0;
69
+ left: calc((100% - var(--image-width)) / 2);
70
+ }
71
+ }
72
+
73
+ @media screen and (max-width: 770px) {
74
+ .heading-content {
75
+ padding-bottom: 315px;
76
+ }
77
+
78
+ img {
79
+ --image-width: 880px;
80
+ }
81
+
82
+ h1 {
83
+ font-size: 48px;
84
+ line-height: 56px;
85
+ letter-spacing: -0.01em;
86
+ }
87
+ }
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div class="heading-content">
3
+ <h1>{title}</h1>
4
+ <dx-button href={ctaHref} size="large">{ctaLabel}</dx-button>
5
+ <img src={imgSrc} alt="" />
6
+ </div>
7
+ </template>
@@ -0,0 +1,8 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ export default class RectangularHeading extends LightningElement {
4
+ @api title!: string;
5
+ @api imgSrc!: string;
6
+ @api ctaLabel!: string;
7
+ @api ctaHref!: string;
8
+ }
@@ -0,0 +1,81 @@
1
+ @import "helpers/reset";
2
+ @import "helpers/text";
3
+
4
+ .section-header {
5
+ /* prop should register 76px to dx css vars */
6
+ --padding-top: 76px;
7
+ --icon-size: 76px;
8
+ --icon-padding: 24px;
9
+ --image-offset: 176px;
10
+
11
+ position: relative;
12
+ background: white;
13
+ padding: var(--padding-top) 0 var(--dx-g-spacing-5xl) 0;
14
+ }
15
+
16
+ .section-header.dark {
17
+ background: var(--dx-g-blue-vibrant-15, #03234d);
18
+ }
19
+
20
+ .section-header.light-gradient {
21
+ background: linear-gradient(
22
+ 180deg,
23
+ rgba(238, 244, 255, 1) 42.08%,
24
+ rgba(234, 245, 254, 0) 100%
25
+ );
26
+ }
27
+
28
+ .img-container {
29
+ position: absolute;
30
+ display: flex;
31
+ flex-direction: row;
32
+ justify-content: space-between;
33
+ bottom: calc(100% - var(--image-offset));
34
+ left: 0;
35
+ width: 100%;
36
+ z-index: 0;
37
+ }
38
+
39
+ img {
40
+ aspect-ratio: 412 / 287;
41
+ width: 412px;
42
+ max-width: 50%;
43
+ }
44
+
45
+ .text-container {
46
+ position: relative;
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: center;
50
+ padding: 0 var(--dx-g-page-padding-horizontal);
51
+ z-index: 1;
52
+ text-align: center;
53
+ }
54
+
55
+ .section-header .title,
56
+ .section-header .subtitle {
57
+ max-width: 768px;
58
+ }
59
+
60
+ dx-icon-badge {
61
+ --dx-c-icon-badge-size: var(--icon-size);
62
+ --dx-c-icon-badge-icon-size: var(--dx-g-spacing-xl);
63
+ --dx-c-icon-badge-color: white;
64
+ --dx-c-icon-badge-background-color: var(--dx-g-blue-vibrant-20);
65
+
66
+ margin-bottom: var(--icon-padding);
67
+ }
68
+
69
+ .section-header.has-subtitle .title {
70
+ margin-bottom: var(--dx-g-spacing-xl);
71
+ }
72
+
73
+ .section-header.dark .title,
74
+ .section-header.dark .subtitle {
75
+ color: white;
76
+ }
77
+
78
+ .section-header.dark dx-icon-badge {
79
+ --dx-c-icon-badge-color: var(--dx-g-blue-vibrant-20);
80
+ --dx-c-icon-badge-background-color: white;
81
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div class={className}>
3
+ <div class="text-container">
4
+ <dx-icon-badge
5
+ if:true={hasIcon}
6
+ symbol={iconSymbol}
7
+ ></dx-icon-badge>
8
+ <h2 if:true={title} class="title dx-text-heading-2b">{title}</h2>
9
+ <span if:true={subtitle} class="subtitle dx-text-heading-4b">
10
+ {subtitle}
11
+ </span>
12
+ </div>
13
+ <div class="img-container" if:true={hasImages}>
14
+ <img src={imgSrcLeft} alt="" />
15
+ <img src={imgSrcRight} alt="" />
16
+ </div>
17
+ </div>
18
+ </template>
@@ -0,0 +1,29 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import cx from "classnames";
3
+
4
+ export default class SectionHeader extends LightningElement {
5
+ @api dark: boolean = false;
6
+ @api iconSymbol: string | null = null;
7
+ @api imgSrcLeft: string | null = null;
8
+ @api imgSrcRight: string | null = null;
9
+ @api lightGradient: boolean = false;
10
+ @api subtitle: string | null = null;
11
+ @api title: string | null = null;
12
+
13
+ private get hasImages(): boolean {
14
+ return !!this.imgSrcLeft && !!this.imgSrcRight;
15
+ }
16
+
17
+ private get hasIcon(): boolean {
18
+ return !!this.title && !!this.iconSymbol;
19
+ }
20
+
21
+ private get className(): string {
22
+ return cx(
23
+ "section-header",
24
+ this.dark && "dark",
25
+ this.lightGradient && "light-gradient",
26
+ this.subtitle && "has-subtitle"
27
+ );
28
+ }
29
+ }
@@ -77,7 +77,7 @@ a::after {
77
77
  }
78
78
 
79
79
  a.active::after {
80
- height: 7px;
80
+ height: 5px;
81
81
  }
82
82
 
83
83
  a > dx-icon-badge {
@@ -23,7 +23,7 @@ export default class SubNavBar extends MatchMediaElement {
23
23
  }
24
24
 
25
25
  private _navItems!: OptionWithLink[];
26
- private isVisible?: boolean = true;
26
+ private isVisible: boolean = true;
27
27
  private sectionIntersectionEntryMap:
28
28
  | {
29
29
  [id: string]: IntersectionObserverEntry;
@@ -0,0 +1,53 @@
1
+ @import "helpers/reset";
2
+ @import "helpers/text";
3
+
4
+ .two-col-list-section {
5
+ padding: 56px var(--dx-g-page-padding-horizontal);
6
+ display: flex;
7
+ }
8
+
9
+ .two-col-list-section.dark {
10
+ background: var(--dx-g-blue-vibrant-15, #03234d);
11
+ }
12
+
13
+ .item-grid {
14
+ display: grid;
15
+ grid-template-columns: 1fr 1fr;
16
+ grid-gap: var(--dx-g-spacing-3xl) var(--dx-g-spacing-6xl);
17
+ width: max-content;
18
+ margin: auto;
19
+ }
20
+
21
+ .item {
22
+ width: 100%;
23
+ max-width: 414px;
24
+ display: grid;
25
+ grid-template-areas: "icon title" "icon subtitle";
26
+ grid-template-columns: min-content auto;
27
+ grid-gap: var(--dx-g-spacing-xs) var(--dx-g-spacing-mlg);
28
+ }
29
+
30
+ dx-icon-badge {
31
+ --dx-c-icon-badge-size: 60px;
32
+
33
+ grid-area: icon;
34
+ }
35
+
36
+ .title {
37
+ grid-area: title;
38
+ }
39
+
40
+ .subtitle {
41
+ grid-area: subtitle;
42
+ }
43
+
44
+ .two-col-list-section.dark .title,
45
+ .two-col-list-section.dark .subtitle {
46
+ color: white;
47
+ }
48
+
49
+ @media (max-width: 768px) {
50
+ .item-grid {
51
+ grid-template-columns: 1fr;
52
+ }
53
+ }
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class={className}>
3
+ <div class="item-grid">
4
+ <template for:each={items} for:item="item">
5
+ <div class="item" key={item.title}>
6
+ <dx-icon-badge symbol={item.iconSymbol}></dx-icon-badge>
7
+ <h3 class="title dx-text-heading-4b">{item.title}</h3>
8
+ <span class="subtitle dx-text-body-1">{item.subtitle}</span>
9
+ </div>
10
+ </template>
11
+ </div>
12
+ </div>
13
+ </template>
@@ -0,0 +1,26 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import cx from "classnames";
3
+ import { toJson } from "utils/normalizers";
4
+
5
+ type Item = {
6
+ title: string;
7
+ subtitle: string;
8
+ iconSymbol: string;
9
+ };
10
+
11
+ export default class TwoColListSection extends LightningElement {
12
+ @api dark: boolean = false;
13
+ @api
14
+ get items() {
15
+ return this._items;
16
+ }
17
+ set items(value) {
18
+ this._items = toJson(value);
19
+ }
20
+
21
+ private _items!: Item[];
22
+
23
+ private get className(): string {
24
+ return cx("two-col-list-section", this.dark && "dark");
25
+ }
26
+ }
@@ -0,0 +1,58 @@
1
+ @import "helpers/reset";
2
+ @import "helpers/text";
3
+
4
+ .two-col-section {
5
+ background: var(--dx-g-cloud-blue-vibrant-95);
6
+ padding: 56px var(--dx-g-page-padding-horizontal);
7
+ width: 100%;
8
+ display: flex;
9
+ flex-direction: row;
10
+ justify-content: stretch;
11
+ align-items: center;
12
+ }
13
+
14
+ .two-col-section.dark {
15
+ background: var(--dx-g-blue-vibrant-15, #03234d);
16
+ }
17
+
18
+ img {
19
+ width: 50%;
20
+ max-width: 400px;
21
+ flex-grow: 1;
22
+ margin-right: 116px;
23
+ }
24
+
25
+ .text-container {
26
+ flex-grow: 1;
27
+ }
28
+
29
+ h2 {
30
+ padding-bottom: var(--dx-g-spacing-smd);
31
+ }
32
+
33
+ .two-col-section.dark h2,
34
+ .two-col-section.dark span {
35
+ color: white;
36
+ }
37
+
38
+ @media (max-width: 1024px) {
39
+ img {
40
+ margin-right: var(--dx-g-spacing-2xl);
41
+ }
42
+ }
43
+
44
+ @media (max-width: 768px) {
45
+ .two-col-section {
46
+ flex-direction: column;
47
+ }
48
+
49
+ .text-container {
50
+ width: 100%;
51
+ text-align: center;
52
+ }
53
+
54
+ img {
55
+ width: 100%;
56
+ margin: 0 auto 56px auto;
57
+ }
58
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div class={className}>
3
+ <img src={imgSrc} alt={imgAlt} />
4
+ <div class="text-container">
5
+ <h2 class="dx-text-heading-4">{title}</h2>
6
+ <span class="dx-text-body-1">{subtitle}</span>
7
+ </div>
8
+ </div>
9
+ </template>
@@ -0,0 +1,14 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import cx from "classnames";
3
+
4
+ export default class TwoColSection extends LightningElement {
5
+ @api dark: boolean = false;
6
+ @api subtitle: string = "";
7
+ @api imgAlt: string = "";
8
+ @api imgSrc: string = "";
9
+ @api title: string = "";
10
+
11
+ private get className(): string {
12
+ return cx("two-col-section", this.dark && "dark");
13
+ }
14
+ }