@salesforcedevs/dx-components 1.3.26 → 1.3.31

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
@@ -52,6 +52,7 @@
52
52
  "dx/input",
53
53
  "dx/interactiveImage",
54
54
  "dx/logo",
55
+ "dx/mainContentHeader",
55
56
  "dx/modal",
56
57
  "dx/metadataBadge",
57
58
  "dx/modalDrawer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.26",
3
+ "version": "1.3.31",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -38,5 +38,5 @@
38
38
  "eventsourcemock": "^2.0.0",
39
39
  "luxon": "^3.1.0"
40
40
  },
41
- "gitHead": "31be8a973c75cec3678c6ec7308fb6099b29d055"
41
+ "gitHead": "ba2b0b5eae88123861d953a9c1ebc80a5b3bbe22"
42
42
  }
@@ -0,0 +1,90 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
4
+ .container {
5
+ display: flex;
6
+ flex-direction: row;
7
+ padding: 0 var(--dx-g-page-padding-horizontal);
8
+ overflow: hidden;
9
+ }
10
+
11
+ .container > * {
12
+ width: 50%;
13
+ }
14
+
15
+ .text-container {
16
+ display: flex;
17
+ flex-direction: column;
18
+ justify-content: center;
19
+ align-items: flex-start;
20
+ padding: var(--dx-g-spacing-lg) 0;
21
+ min-height: 460px;
22
+ text-align: left;
23
+ background-position: center;
24
+ background-size: cover;
25
+ background-repeat: no-repeat;
26
+ }
27
+
28
+ .image-container {
29
+ display: flex;
30
+ flex-direction: row;
31
+ justify-content: flex-start;
32
+ overflow: visible;
33
+ }
34
+
35
+ img {
36
+ width: 100%;
37
+ }
38
+
39
+ img.desktop {
40
+ height: fit-content;
41
+ min-width: 876px;
42
+ margin-left: var(--dx-g-spacing-lg);
43
+ }
44
+
45
+ img.mobile {
46
+ display: none;
47
+ min-width: 1024px;
48
+ }
49
+
50
+ .text-container > *:not(:last-child) {
51
+ margin-bottom: var(--dx-g-spacing-smd);
52
+ }
53
+
54
+ dx-button {
55
+ margin-top: var(--dx-g-spacing-smd);
56
+ }
57
+
58
+ @media screen and (max-width: 1024px) {
59
+ .container {
60
+ flex-direction: column;
61
+ }
62
+
63
+ .container > * {
64
+ width: 100%;
65
+ }
66
+
67
+ .text-container {
68
+ align-items: center;
69
+ text-align: center;
70
+ padding-top: var(--dx-g-spacing-4xl);
71
+ padding-bottom: 0;
72
+ min-height: unset;
73
+ }
74
+
75
+ .text-container > * {
76
+ max-width: 700px;
77
+ }
78
+
79
+ .image-container {
80
+ justify-content: center;
81
+ }
82
+
83
+ img.desktop {
84
+ display: none;
85
+ }
86
+
87
+ img.mobile {
88
+ display: block;
89
+ }
90
+ }
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div class="container">
3
+ <div class="text-container" style={style}>
4
+ <h1 class="heading dx-text-heading-2">{title}</h1>
5
+ <span class="body dx-text-body-1">{body}</span>
6
+ <span class="subtitle dx-text-heading-4b">{subtitle}</span>
7
+ <dx-button href={ctaHref} target={ctaTarget} size="hero">
8
+ {ctaLabel}
9
+ </dx-button>
10
+ </div>
11
+ <div class="image-container">
12
+ <img class="desktop" src={imgSrc} />
13
+ <img class="mobile" src={imgSrcMobile} />
14
+ </div>
15
+ </div>
16
+ </template>
@@ -0,0 +1,26 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import { track } from "dxUtils/analytics";
3
+
4
+ export default class MainContentHeader extends LightningElement {
5
+ @api title!: string;
6
+ @api subtitle!: string;
7
+ @api body!: string;
8
+ @api ctaLabel!: string;
9
+ @api ctaHref!: string;
10
+ @api imgSrc!: string;
11
+ @api imgSrcMobile!: string;
12
+ @api ctaTarget?: string | null = null;
13
+
14
+ private onCtaClick(e: Event) {
15
+ if (e.currentTarget) {
16
+ track(e.currentTarget, "custEv_ctaButtonClick", {
17
+ clickText: this.ctaLabel,
18
+ itemTitle: this.title,
19
+ clickUrl: this.ctaHref,
20
+ elementType: "button",
21
+ destinationType: "internal",
22
+ ctaClick: true
23
+ });
24
+ }
25
+ }
26
+ }
@@ -9,6 +9,8 @@
9
9
  --dx-c-section-padding-top: var(--dx-c-section-padding-vertical);
10
10
  --dx-c-section-padding-bottom: var(--dx-c-section-padding-vertical);
11
11
  --dx-c-section-heading-margin-bottom: var(--dx-g-spacing-2xl);
12
+ --dx-c-section-cta-color: var(--dx-g-blue-vibrant-50);
13
+ --dx-c-section-cta-inline-hover-color: var(--dx-g-blue-vibrant-30);
12
14
  }
13
15
 
14
16
  .section {
@@ -86,6 +88,13 @@
86
88
  z-index: 50;
87
89
  }
88
90
 
91
+ .cta {
92
+ --dx-c-button-primary-color: var(--dx-c-section-cta-color);
93
+ --dx-c-button-inline-color-hover: var(
94
+ --dx-c-section-cta-inline-hover-color
95
+ );
96
+ }
97
+
89
98
  /* sections with a swoop and center alignment should not left align as it encroaches on the graphic */
90
99
  .section.align-center.graphic-top .text {
91
100
  text-align: center;
@@ -32,6 +32,16 @@
32
32
  <span class="subtitle dx-text-body-1" if:true={subtitle}>
33
33
  {subtitle}
34
34
  </span>
35
+ <dx-button
36
+ class="cta"
37
+ if:true={ctaLabel}
38
+ href={ctaHref}
39
+ variant={ctaBtnVariant}
40
+ icon-symbol={ctaBtnSymbol}
41
+ target={ctaBtnTarget}
42
+ >
43
+ {ctaLabel}
44
+ </dx-button>
35
45
  </div>
36
46
  <div part="content" class="content">
37
47
  <slot></slot>
@@ -10,6 +10,11 @@ export default class Section extends LightningElement {
10
10
  @api subtitle?: string;
11
11
  @api textAlign: "center" | "left" = "left";
12
12
  @api title?: string;
13
+ @api ctaLabel?: string;
14
+ @api ctaHref?: string;
15
+ @api ctaBtnVariant?: string;
16
+ @api ctaBtnSymbol?: string;
17
+ @api ctaBtnTarget?: string = "_self";
13
18
  @api topGraphic: boolean = false;
14
19
  @api graphicOverlap: boolean = false;
15
20
  @api bottomGraphic: boolean = false;