@salesforcedevs/dx-components 0.0.0-alpha.0 → 0.0.0-alpha.3
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 +2 -0
- package/package.json +1 -1
- package/src/modules/dx/cardTrial/cardTrial.css +7 -59
- package/src/modules/dx/cardTrial/cardTrial.html +105 -115
- package/src/modules/dx/cardTrial/cardTrial.ts +27 -24
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.css +141 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.html +72 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.ts +67 -0
- package/src/modules/dx/modal/modal.css +6 -37
- package/src/modules/dx/modal/modal.html +1 -12
- package/src/modules/dx/modal/modal.ts +1 -20
package/lwc.config.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"dx/cardSmall",
|
|
20
20
|
"dx/cardTrailheadModule",
|
|
21
21
|
"dx/cardTrial",
|
|
22
|
+
"dx/cardTrialExpanded",
|
|
22
23
|
"dx/cardVideoPreview",
|
|
23
24
|
"dx/checkbox",
|
|
24
25
|
"dx/checkboxGroup",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"dx/imageAndLabel",
|
|
47
48
|
"dx/input",
|
|
48
49
|
"dx/logo",
|
|
50
|
+
"dx/modal",
|
|
49
51
|
"dx/modalDrawer",
|
|
50
52
|
"dx/pagination",
|
|
51
53
|
"dx/podcastHost",
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.card-trial.has-image {
|
|
12
|
-
padding-bottom:
|
|
12
|
+
padding-bottom: 90px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
dx-icon-badge.badge-main {
|
|
@@ -21,6 +21,7 @@ dx-icon-badge.badge-main {
|
|
|
21
21
|
|
|
22
22
|
.label {
|
|
23
23
|
color: var(--dx-g-gray-30);
|
|
24
|
+
margin-top: 5px;
|
|
24
25
|
margin-bottom: var(--dx-g-spacing-md);
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -28,17 +29,13 @@ dx-card-title {
|
|
|
28
29
|
margin-bottom: var(--dx-g-spacing-xs);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
.body {
|
|
32
|
-
margin-bottom: var(--dx-g-spacing-sm);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
32
|
.terms {
|
|
33
|
+
margin-top: var(--dx-g-spacing-md);
|
|
36
34
|
font-weight: var(--dx-g-font-bold);
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
dx-hr {
|
|
40
38
|
--dx-c-hr-padding-horizontal: 0;
|
|
41
|
-
|
|
42
39
|
width: 100%;
|
|
43
40
|
}
|
|
44
41
|
|
|
@@ -47,6 +44,10 @@ dx-hr {
|
|
|
47
44
|
flex-direction: column;
|
|
48
45
|
}
|
|
49
46
|
|
|
47
|
+
.details_top-margin {
|
|
48
|
+
margin-top: var(--dx-g-spacing-lg);
|
|
49
|
+
}
|
|
50
|
+
|
|
50
51
|
.detail {
|
|
51
52
|
display: flex;
|
|
52
53
|
flex-direction: row;
|
|
@@ -68,7 +69,6 @@ img {
|
|
|
68
69
|
position: absolute;
|
|
69
70
|
bottom: 0;
|
|
70
71
|
right: var(--dx-g-spacing-mlg);
|
|
71
|
-
width: var(--dx-g-spacing-6xl);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
dx-button {
|
|
@@ -124,55 +124,3 @@ dx-button {
|
|
|
124
124
|
margin-top: 15px;
|
|
125
125
|
width: 100%;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
.button-details {
|
|
129
|
-
margin-top: 25px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.clickable {
|
|
133
|
-
cursor: pointer;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.two-col-container {
|
|
137
|
-
display: flex;
|
|
138
|
-
max-width: 976px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.col-one {
|
|
142
|
-
padding: var(--dx-g-spacing-mlg);
|
|
143
|
-
flex: 0 0 388px;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.col-two {
|
|
147
|
-
background-color: var(--dx-g-indigo-vibrant-15);
|
|
148
|
-
padding: var(--dx-g-spacing-2xl);
|
|
149
|
-
flex: 1;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.col-two dx-card-title {
|
|
153
|
-
--dx-c-card-title-color: white;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.col-two-title {
|
|
157
|
-
font-family: var(--dx-g-font-display);
|
|
158
|
-
font-size: var(--dx-g-text-base);
|
|
159
|
-
font-weight: var(--dx-g-font-demi);
|
|
160
|
-
margin-top: var(--dx-g-spacing-mlg);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.col-two-subtitle {
|
|
164
|
-
font-family: var(--dx-g-font-sans);
|
|
165
|
-
font-size: var(--dx-g-text-sm);
|
|
166
|
-
font-weight: var(--dx-g-font-normal);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.col-two-title,
|
|
170
|
-
.col-two-subtitle {
|
|
171
|
-
color: white;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
@media screen and (max-width: 768px) {
|
|
175
|
-
.two-col-container {
|
|
176
|
-
flex-direction: column;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
@@ -1,124 +1,114 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<dx-modal
|
|
3
|
+
if:true={hasTwoButtons}
|
|
4
|
+
open={_modalOpen}
|
|
5
|
+
ontogglemodal={toggleModal}
|
|
6
|
+
>
|
|
7
|
+
<dx-card-trial-expanded
|
|
8
|
+
badge-background-color={badgeBackgroundColor}
|
|
9
|
+
badge-sprite={badgeSprite}
|
|
10
|
+
badge-symbol={badgeSymbol}
|
|
11
|
+
body={body}
|
|
12
|
+
button-cta={buttonOneCta}
|
|
13
|
+
button-href={buttonOneHref}
|
|
14
|
+
button-icon={buttonOneIcon}
|
|
15
|
+
button-icon-size={buttonOneIconSize}
|
|
16
|
+
details={details}
|
|
17
|
+
href={href}
|
|
18
|
+
label={label}
|
|
19
|
+
col-two-title={modalTitle}
|
|
20
|
+
col-two-details={modalDetails}
|
|
21
|
+
target={target}
|
|
22
|
+
terms={terms}
|
|
23
|
+
title={title}
|
|
24
|
+
ontogglemodal={toggleModal}
|
|
25
|
+
></dx-card-trial-expanded>
|
|
26
|
+
</dx-modal>
|
|
27
|
+
<div class="recommended-container" if:true={recommended}>
|
|
28
|
+
<span class="recommended-label">Recommended</span>
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
class={className}
|
|
32
|
+
role={ariaRole}
|
|
33
|
+
href={href}
|
|
34
|
+
target={target}
|
|
35
|
+
onclick={handleClick}
|
|
36
|
+
>
|
|
37
|
+
<template if:true={topText}>
|
|
38
|
+
<span class="top-text dx-text-body-4">{topText}</span>
|
|
39
|
+
<dx-hr spacing="md"></dx-hr>
|
|
40
|
+
</template>
|
|
41
|
+
<div class="badge-container">
|
|
42
|
+
<dx-icon-badge
|
|
43
|
+
class="badge-main"
|
|
44
|
+
background-color={badgeBackgroundColor}
|
|
45
|
+
symbol={badgeSymbol}
|
|
46
|
+
sprite={badgeSprite}
|
|
47
|
+
></dx-icon-badge>
|
|
48
|
+
<dx-type-badge
|
|
49
|
+
if:true={typeBadgeValue}
|
|
50
|
+
value={typeBadgeValue}
|
|
51
|
+
color={typeBadgeColor}
|
|
52
|
+
size={typeBadgeSize}
|
|
53
|
+
type={typeBadgeType}
|
|
54
|
+
></dx-type-badge>
|
|
5
55
|
</div>
|
|
6
|
-
<
|
|
7
|
-
class={className}
|
|
8
|
-
role={ariaRole}
|
|
56
|
+
<dx-card-title
|
|
9
57
|
href={href}
|
|
10
58
|
target={target}
|
|
11
|
-
|
|
59
|
+
title={title}
|
|
60
|
+
></dx-card-title>
|
|
61
|
+
<span class="label dx-text-body-3">{label}</span>
|
|
62
|
+
<p class="body dx-text-body-2 static-font">{body}</p>
|
|
63
|
+
<span class="terms dx-text-body-3 static-font">{terms}</span>
|
|
64
|
+
<dx-hr if:false={hasButtons} spacing="lg"></dx-hr>
|
|
65
|
+
<dx-button
|
|
66
|
+
if:true={hasOneButton}
|
|
67
|
+
class="button-one"
|
|
68
|
+
size="large"
|
|
69
|
+
href={buttonOneHref}
|
|
70
|
+
variant="primary"
|
|
71
|
+
font="sans"
|
|
72
|
+
icon-symbol={buttonOneIcon}
|
|
73
|
+
icon-size={buttonOneIconSize}
|
|
12
74
|
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<p class="body dx-text-body-3 static-font">{body}</p>
|
|
39
|
-
<span class="terms dx-text-body-3 static-font">{terms}</span>
|
|
40
|
-
<template if:false={hasButtons}>
|
|
41
|
-
<dx-hr spacing="md"></dx-hr>
|
|
42
|
-
<ul class="details">
|
|
43
|
-
<template for:each={details} for:item="detail">
|
|
44
|
-
<li class="detail" key={detail}>
|
|
45
|
-
<dx-icon-badge
|
|
46
|
-
background-color={badgeBackgroundColor}
|
|
47
|
-
symbol="check"
|
|
48
|
-
></dx-icon-badge>
|
|
49
|
-
<span class="detail-text dx-text-body-4">
|
|
50
|
-
{detail}
|
|
51
|
-
</span>
|
|
52
|
-
</li>
|
|
53
|
-
</template>
|
|
54
|
-
</ul>
|
|
55
|
-
</template>
|
|
56
|
-
<template if:true={hasOneButton}>
|
|
57
|
-
<dx-button
|
|
58
|
-
class="button-one"
|
|
59
|
-
size="large"
|
|
60
|
-
href={buttonOneHref}
|
|
61
|
-
variant="primary"
|
|
62
|
-
font="sans"
|
|
63
|
-
icon-symbol={buttonOneIcon}
|
|
64
|
-
icon-size={buttonOneIconSize}
|
|
65
|
-
>
|
|
66
|
-
{buttonOneCta}
|
|
67
|
-
</dx-button>
|
|
68
|
-
<ul class="details button-details" if:true={hasDetails}>
|
|
69
|
-
<template for:each={details} for:item="detail">
|
|
70
|
-
<li class="detail" key={detail}>
|
|
71
|
-
<dx-icon-badge
|
|
72
|
-
background-color={badgeBackgroundColor}
|
|
73
|
-
symbol="check"
|
|
74
|
-
></dx-icon-badge>
|
|
75
|
-
<span class="detail-text dx-text-body-4">
|
|
76
|
-
{detail}
|
|
77
|
-
</span>
|
|
78
|
-
</li>
|
|
79
|
-
</template>
|
|
80
|
-
</ul>
|
|
81
|
-
</template>
|
|
82
|
-
<template if:true={hasTwoButtons}>
|
|
83
|
-
<div class="button-container">
|
|
84
|
-
<dx-button
|
|
85
|
-
class="button-one"
|
|
86
|
-
size="large"
|
|
87
|
-
href={buttonOneHref}
|
|
88
|
-
variant="primary"
|
|
89
|
-
font="sans"
|
|
90
|
-
icon-symbol={buttonOneIcon}
|
|
91
|
-
icon-size={buttonOneIconSize}
|
|
92
|
-
>
|
|
93
|
-
{buttonOneCta}
|
|
94
|
-
</dx-button>
|
|
95
|
-
<dx-button
|
|
96
|
-
class="button-two"
|
|
97
|
-
size="large"
|
|
98
|
-
href={buttonTwoHref}
|
|
99
|
-
variant="secondary"
|
|
100
|
-
font="sans"
|
|
101
|
-
icon-symbol={buttonTwoIcon}
|
|
102
|
-
icon-size={buttonTwoIconSize}
|
|
103
|
-
>
|
|
104
|
-
{buttonTwoCta}
|
|
105
|
-
</dx-button>
|
|
106
|
-
</div>
|
|
107
|
-
</template>
|
|
108
|
-
<img if:true={imgSrc} src={imgSrc} alt="" />
|
|
75
|
+
{buttonOneCta}
|
|
76
|
+
</dx-button>
|
|
77
|
+
<div if:true={hasTwoButtons} class="button-container">
|
|
78
|
+
<dx-button
|
|
79
|
+
class="button-one"
|
|
80
|
+
size="large"
|
|
81
|
+
href={buttonOneHref}
|
|
82
|
+
variant="primary"
|
|
83
|
+
font="sans"
|
|
84
|
+
icon-symbol={buttonOneIcon}
|
|
85
|
+
icon-size={buttonOneIconSize}
|
|
86
|
+
>
|
|
87
|
+
{buttonOneCta}
|
|
88
|
+
</dx-button>
|
|
89
|
+
<dx-button
|
|
90
|
+
class="button-two"
|
|
91
|
+
size="large"
|
|
92
|
+
onclick={toggleModal}
|
|
93
|
+
variant="secondary"
|
|
94
|
+
font="sans"
|
|
95
|
+
icon-symbol={buttonTwoIcon}
|
|
96
|
+
icon-size={buttonTwoIconSize}
|
|
97
|
+
>
|
|
98
|
+
{buttonTwoCta}
|
|
99
|
+
</dx-button>
|
|
109
100
|
</div>
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<p class="col-two-subtitle">{twoColDetail.subtitle}</p>
|
|
120
|
-
</div>
|
|
101
|
+
<ul class={detailsClassName} if:true={hasDetails}>
|
|
102
|
+
<template for:each={details} for:item="detail">
|
|
103
|
+
<li class="detail" key={detail}>
|
|
104
|
+
<dx-icon-badge
|
|
105
|
+
background-color={badgeBackgroundColor}
|
|
106
|
+
symbol="check"
|
|
107
|
+
></dx-icon-badge>
|
|
108
|
+
<span class="detail-text dx-text-body-4">{detail}</span>
|
|
109
|
+
</li>
|
|
121
110
|
</template>
|
|
122
|
-
</
|
|
111
|
+
</ul>
|
|
112
|
+
<img if:true={imgSrc} src={imgSrc} alt="" />
|
|
123
113
|
</div>
|
|
124
114
|
</template>
|
|
@@ -10,11 +10,11 @@ export default class CardTrial extends LightningElement {
|
|
|
10
10
|
@api buttonOneCta?: string;
|
|
11
11
|
@api buttonOneHref?: string;
|
|
12
12
|
@api buttonOneIcon?: string;
|
|
13
|
-
@api buttonOneIconSize?: string;
|
|
13
|
+
@api buttonOneIconSize?: string = "large";
|
|
14
14
|
@api buttonTwoCta?: string;
|
|
15
15
|
@api buttonTwoHref?: string;
|
|
16
16
|
@api buttonTwoIcon?: string;
|
|
17
|
-
@api buttonTwoIconSize?: string;
|
|
17
|
+
@api buttonTwoIconSize?: string = "large";
|
|
18
18
|
@api href!: string;
|
|
19
19
|
@api imgSrc?: string;
|
|
20
20
|
@api label!: string;
|
|
@@ -23,13 +23,16 @@ export default class CardTrial extends LightningElement {
|
|
|
23
23
|
@api terms!: string;
|
|
24
24
|
@api title!: string;
|
|
25
25
|
@api topText?: string;
|
|
26
|
+
@api modalTitle?: string;
|
|
27
|
+
|
|
26
28
|
@api twoColTitle?: string;
|
|
27
29
|
@api twoColTarget?: string;
|
|
28
30
|
@api twoColHref!: string;
|
|
29
31
|
@api typeBadgeValue?: string;
|
|
30
|
-
@api typeBadgeColor?: string;
|
|
31
|
-
@api typeBadgeSize?: string;
|
|
32
|
-
@api typeBadgeType?: string;
|
|
32
|
+
@api typeBadgeColor?: string = "default";
|
|
33
|
+
@api typeBadgeSize?: string = "default";
|
|
34
|
+
@api typeBadgeType?: string = "content-type";
|
|
35
|
+
|
|
33
36
|
@api
|
|
34
37
|
get details() {
|
|
35
38
|
return this._details;
|
|
@@ -39,11 +42,11 @@ export default class CardTrial extends LightningElement {
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
@api
|
|
42
|
-
get
|
|
43
|
-
return this.
|
|
45
|
+
get modalDetails() {
|
|
46
|
+
return this._modalDetails;
|
|
44
47
|
}
|
|
45
|
-
set
|
|
46
|
-
this.
|
|
48
|
+
set modalDetails(value) {
|
|
49
|
+
this._modalDetails = toJson(value);
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
get hasDetails() {
|
|
@@ -51,15 +54,15 @@ export default class CardTrial extends LightningElement {
|
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
get hasOneButton() {
|
|
54
|
-
return this.buttonOneCta && !this.buttonTwoCta;
|
|
57
|
+
return !!(this.buttonOneCta && !this.buttonTwoCta);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
get hasTwoButtons() {
|
|
58
|
-
return this.buttonOneCta && this.buttonTwoCta;
|
|
61
|
+
return !!(this.buttonOneCta && this.buttonTwoCta);
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
get hasButtons() {
|
|
62
|
-
return this.
|
|
65
|
+
return !!(this.buttonOneCta || this.buttonTwoCta);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
get ariaRole() {
|
|
@@ -67,31 +70,31 @@ export default class CardTrial extends LightningElement {
|
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
private _details!: string[];
|
|
70
|
-
private
|
|
73
|
+
private _modalDetails!: [{ title: string; subtitle: string }];
|
|
74
|
+
private _modalOpen = false;
|
|
71
75
|
|
|
72
76
|
private get className() {
|
|
73
77
|
return cx(
|
|
74
78
|
"card-trial",
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.twoColTitle && "col-one",
|
|
79
|
+
"dx-card-base",
|
|
80
|
+
"dx-card-base_section-vertical",
|
|
78
81
|
this.imgSrc && "has-image",
|
|
79
|
-
this.recommended && "recommended-border"
|
|
80
|
-
!this.hasButtons && "clickable"
|
|
82
|
+
this.recommended && "recommended-border"
|
|
81
83
|
);
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
private get
|
|
85
|
-
return cx(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
private get detailsClassName() {
|
|
87
|
+
return cx("details", this.hasButtons && "details_top-margin");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private toggleModal() {
|
|
91
|
+
this._modalOpen = !this._modalOpen;
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
private handleClick() {
|
|
92
95
|
// card is clickable only if it doesn't contain buttons (for accessibility reasons)
|
|
93
96
|
if (!this.hasButtons) {
|
|
94
|
-
window.location
|
|
97
|
+
window.location.assign(this.href);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.container {
|
|
9
|
+
max-width: 976px;
|
|
10
|
+
margin: 0 var(--dx-g-spacing-lg);
|
|
11
|
+
overflow: auto;
|
|
12
|
+
max-height: 100vh;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.content-container {
|
|
16
|
+
display: flex;
|
|
17
|
+
border-radius: var(--dx-g-spacing-md);
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
pointer-events: all;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.badge-main {
|
|
23
|
+
--dx-c-icon-badge-icon-size: var(--dx-g-spacing-mlg);
|
|
24
|
+
--dx-c-icon-badge-size: var(--dx-g-spacing-2xl);
|
|
25
|
+
|
|
26
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.title-main {
|
|
30
|
+
margin-bottom: var(--dx-g-spacing-xs);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.button-cta {
|
|
34
|
+
--dx-c-button-font-size: var(--dx-g-text-base);
|
|
35
|
+
--dx-c-button-font-weight: var(--dx-g-font-bold);
|
|
36
|
+
margin-top: 15px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.button-container {
|
|
41
|
+
margin-bottom: var(--dx-g-spacing-smd);
|
|
42
|
+
position: sticky;
|
|
43
|
+
top: -1px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.is-sticky {
|
|
47
|
+
background-color: var(--dx-g-gray-95);
|
|
48
|
+
border-bottom: 1px solid var(--dx-g-gray-80);
|
|
49
|
+
margin-bottom: 0;
|
|
50
|
+
padding: 10px 10px 10px 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.button-close {
|
|
54
|
+
--dx-c-button-background-color: white;
|
|
55
|
+
margin-left: auto;
|
|
56
|
+
pointer-events: all;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.label {
|
|
60
|
+
color: var(--dx-g-gray-30);
|
|
61
|
+
margin-top: 5px;
|
|
62
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.terms {
|
|
66
|
+
margin-top: var(--dx-g-spacing-md);
|
|
67
|
+
font-weight: var(--dx-g-font-bold);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.label,
|
|
71
|
+
.terms,
|
|
72
|
+
dx-button {
|
|
73
|
+
display: block;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.details {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
margin-top: var(--dx-g-spacing-lg);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.detail {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.detail:not(:last-of-type) {
|
|
88
|
+
margin-bottom: var(--dx-g-spacing-smd);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.badge-detail {
|
|
92
|
+
--dx-c-icon-badge-icon-size: 10px;
|
|
93
|
+
--dx-c-icon-badge-size: 18px;
|
|
94
|
+
--dx-c-icon-badge-color: var(--dx-g-blue-vibrant-40);
|
|
95
|
+
|
|
96
|
+
padding-right: var(--dx-g-spacing-sm);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.col-one {
|
|
100
|
+
background-color: white;
|
|
101
|
+
padding: var(--dx-g-spacing-mlg);
|
|
102
|
+
flex: 0 0 388px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.col-two {
|
|
106
|
+
background-color: var(--dx-g-indigo-vibrant-15);
|
|
107
|
+
padding: var(--dx-g-spacing-2xl);
|
|
108
|
+
flex: 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.title-secondary {
|
|
112
|
+
--dx-c-card-title-color: white;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.col-two-detail-title {
|
|
116
|
+
font-family: var(--dx-g-font-display);
|
|
117
|
+
font-size: var(--dx-g-text-base);
|
|
118
|
+
font-weight: var(--dx-g-font-demi);
|
|
119
|
+
margin-top: var(--dx-g-spacing-mlg);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.col-two-detail-subtitle {
|
|
123
|
+
font-family: var(--dx-g-font-sans);
|
|
124
|
+
font-size: var(--dx-g-text-sm);
|
|
125
|
+
font-weight: var(--dx-g-font-normal);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.col-two-detail-title,
|
|
129
|
+
.col-two-detail-subtitle {
|
|
130
|
+
color: white;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@media screen and (max-width: 768px) {
|
|
134
|
+
.container {
|
|
135
|
+
max-width: 550px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.content-container {
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="button-container">
|
|
4
|
+
<dx-button
|
|
5
|
+
class="button-close"
|
|
6
|
+
variant="secondary"
|
|
7
|
+
icon-symbol="close"
|
|
8
|
+
onclick={handleModalClose}
|
|
9
|
+
>
|
|
10
|
+
Close
|
|
11
|
+
</dx-button>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="content-container">
|
|
14
|
+
<div class="col-one">
|
|
15
|
+
<dx-icon-badge
|
|
16
|
+
class="badge-main"
|
|
17
|
+
background-color={badgeBackgroundColor}
|
|
18
|
+
symbol={badgeSymbol}
|
|
19
|
+
sprite={badgeSprite}
|
|
20
|
+
></dx-icon-badge>
|
|
21
|
+
<dx-card-title
|
|
22
|
+
class="title-main"
|
|
23
|
+
href={href}
|
|
24
|
+
target={target}
|
|
25
|
+
title={title}
|
|
26
|
+
></dx-card-title>
|
|
27
|
+
<span class="label dx-text-body-3">{label}</span>
|
|
28
|
+
<p class="body dx-text-body-2 static-font">{body}</p>
|
|
29
|
+
<span class="terms dx-text-body-3 static-font">{terms}</span>
|
|
30
|
+
<dx-button
|
|
31
|
+
class="button-cta"
|
|
32
|
+
size="large"
|
|
33
|
+
href={href}
|
|
34
|
+
variant="primary"
|
|
35
|
+
font="sans"
|
|
36
|
+
icon-symbol={buttonIcon}
|
|
37
|
+
icon-size={buttonIconSize}
|
|
38
|
+
>
|
|
39
|
+
{buttonCta}
|
|
40
|
+
</dx-button>
|
|
41
|
+
<ul class="details">
|
|
42
|
+
<template for:each={details} for:item="item">
|
|
43
|
+
<li class="detail" key={item}>
|
|
44
|
+
<dx-icon-badge
|
|
45
|
+
class="badge-detail"
|
|
46
|
+
background-color={badgeBackgroundColor}
|
|
47
|
+
symbol="check"
|
|
48
|
+
></dx-icon-badge>
|
|
49
|
+
<span class="detail-text dx-text-body-4">
|
|
50
|
+
{item}
|
|
51
|
+
</span>
|
|
52
|
+
</li>
|
|
53
|
+
</template>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="col-two">
|
|
57
|
+
<dx-card-title
|
|
58
|
+
class="title-secondary"
|
|
59
|
+
title={colTwoTitle}
|
|
60
|
+
></dx-card-title>
|
|
61
|
+
<template for:each={colTwoDetails} for:item="colTwoItem">
|
|
62
|
+
<div key={colTwoItem.title}>
|
|
63
|
+
<p class="col-two-detail-title">{colTwoItem.title}</p>
|
|
64
|
+
<p class="col-two-detail-subtitle">
|
|
65
|
+
{colTwoItem.subtitle}
|
|
66
|
+
</p>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { toJson } from "dxUtils/normalizers";
|
|
3
|
+
|
|
4
|
+
export default class CardTrial extends LightningElement {
|
|
5
|
+
@api badgeBackgroundColor?: string = "indigo-vibrant-90";
|
|
6
|
+
@api badgeSprite?: string = "salesforcebrand";
|
|
7
|
+
@api badgeSymbol!: string;
|
|
8
|
+
@api body!: string;
|
|
9
|
+
@api buttonCta?: string;
|
|
10
|
+
@api buttonHref?: string;
|
|
11
|
+
@api buttonIcon?: string;
|
|
12
|
+
@api buttonIconSize?: string = "large";
|
|
13
|
+
@api colTwoTitle!: string;
|
|
14
|
+
@api href!: string;
|
|
15
|
+
@api label!: string;
|
|
16
|
+
@api target?: string;
|
|
17
|
+
@api terms!: string;
|
|
18
|
+
@api title!: string;
|
|
19
|
+
|
|
20
|
+
@api
|
|
21
|
+
get details() {
|
|
22
|
+
return this._details;
|
|
23
|
+
}
|
|
24
|
+
set details(value) {
|
|
25
|
+
this._details = toJson(value);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@api
|
|
29
|
+
get colTwoDetails() {
|
|
30
|
+
return this._colTwoDetails;
|
|
31
|
+
}
|
|
32
|
+
set colTwoDetails(value) {
|
|
33
|
+
this._colTwoDetails = toJson(value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private _details!: [{ title: string; subtitle: string }];
|
|
37
|
+
private _colTwoDetails!: string[];
|
|
38
|
+
private stickyCloseObserver!: IntersectionObserver;
|
|
39
|
+
|
|
40
|
+
renderedCallback(): void {
|
|
41
|
+
this.observeStickyClose();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
disconnectedCallback(): void {
|
|
45
|
+
this.stickyCloseObserver.disconnect();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private observeStickyClose() {
|
|
49
|
+
const el = this.template.querySelector(".button-container");
|
|
50
|
+
if (el && !this.stickyCloseObserver) {
|
|
51
|
+
this.stickyCloseObserver = new IntersectionObserver(
|
|
52
|
+
([e]) => {
|
|
53
|
+
e.target.classList.toggle(
|
|
54
|
+
"is-sticky",
|
|
55
|
+
e.intersectionRatio < 1
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
{ threshold: [1] }
|
|
59
|
+
);
|
|
60
|
+
this.stickyCloseObserver.observe(el);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private handleModalClose() {
|
|
65
|
+
this.dispatchEvent(new CustomEvent("togglemodal"));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -2,38 +2,21 @@
|
|
|
2
2
|
--dx-c-modal-drawer-z-index: 5000;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
dx-button {
|
|
6
|
-
display: block;
|
|
7
|
-
margin-bottom: var(--dx-g-spacing-smd);
|
|
8
|
-
margin: 10px 10px 10px auto;
|
|
9
|
-
--dx-c-button-background-color: white;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
dx-button,
|
|
13
|
-
slot {
|
|
14
|
-
pointer-events: all;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
5
|
.modal-drawer_container {
|
|
18
6
|
display: none;
|
|
19
7
|
}
|
|
20
8
|
|
|
21
|
-
.modal-wrapper {
|
|
22
|
-
display: grid;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
margin: 0 var(--dx-g-spacing-mlg);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
9
|
.modal-drawer_container.modal-drawer_active {
|
|
10
|
+
position: fixed;
|
|
11
|
+
top: 50%;
|
|
12
|
+
left: 50%;
|
|
13
|
+
transform: translate(-50%, -50%);
|
|
28
14
|
display: grid;
|
|
29
15
|
justify-content: center;
|
|
30
16
|
align-items: center;
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
17
|
z-index: var(--dx-c-modal-drawer-z-index);
|
|
35
|
-
height:
|
|
36
|
-
width:
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
37
20
|
pointer-events: none;
|
|
38
21
|
}
|
|
39
22
|
|
|
@@ -49,17 +32,3 @@ slot {
|
|
|
49
32
|
width: 100%;
|
|
50
33
|
z-index: calc(var(--dx-c-modal-drawer-z-index) - 1);
|
|
51
34
|
}
|
|
52
|
-
|
|
53
|
-
.sticky {
|
|
54
|
-
background-color: var(--dx-g-gray-95);
|
|
55
|
-
border-bottom: 1px solid var(--dx-g-gray-80);
|
|
56
|
-
position: sticky;
|
|
57
|
-
top: 0;
|
|
58
|
-
z-index: 1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@media screen and (max-width: 768px) {
|
|
62
|
-
.modal-wrapper {
|
|
63
|
-
max-width: 550px;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class={containerClass}>
|
|
3
|
-
<
|
|
4
|
-
<div class="button-container">
|
|
5
|
-
<dx-button
|
|
6
|
-
variant="secondary"
|
|
7
|
-
icon-symbol="close"
|
|
8
|
-
onclick={handleCloseModal}
|
|
9
|
-
>
|
|
10
|
-
Close
|
|
11
|
-
</dx-button>
|
|
12
|
-
</div>
|
|
13
|
-
<slot></slot>
|
|
14
|
-
</div>
|
|
3
|
+
<slot></slot>
|
|
15
4
|
</div>
|
|
16
5
|
<div
|
|
17
6
|
if:true={open}
|
|
@@ -22,25 +22,6 @@ export default class Modal extends LightningElement {
|
|
|
22
22
|
|
|
23
23
|
handleCloseModal() {
|
|
24
24
|
this._open = !this._open;
|
|
25
|
-
this.dispatchEvent(new CustomEvent("
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private handleScroll = () => {
|
|
29
|
-
const buttonContainer =
|
|
30
|
-
this.template.querySelector(".button-container")!;
|
|
31
|
-
|
|
32
|
-
if (window.scrollY >= buttonContainer.clientHeight / 2) {
|
|
33
|
-
buttonContainer.classList.add("sticky");
|
|
34
|
-
} else {
|
|
35
|
-
buttonContainer.classList.remove("sticky");
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
renderedCallback() {
|
|
40
|
-
window.addEventListener("scroll", this.handleScroll);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
disconnectedCallback(): void {
|
|
44
|
-
window.removeEventListener("scroll", this.handleScroll);
|
|
25
|
+
this.dispatchEvent(new CustomEvent("togglemodal"));
|
|
45
26
|
}
|
|
46
27
|
}
|