@salesforcedevs/dx-components 0.35.1-sidebar-collapse → 0.40.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/LICENSE ADDED
@@ -0,0 +1,12 @@
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.
package/lwc.config.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "dx/cardPodcastEpisodeProvider",
19
19
  "dx/cardSmall",
20
20
  "dx/cardTrailheadModule",
21
+ "dx/cardTrial",
21
22
  "dx/cardVideoPreview",
22
23
  "dx/checkbox",
23
24
  "dx/checkboxNative",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.35.1-sidebar-collapse",
3
+ "version": "0.40.0",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -25,5 +25,6 @@
25
25
  "@types/classnames": "^2.2.10",
26
26
  "@types/debounce": "^1.2.0",
27
27
  "@types/lodash.get": "^4.4.6"
28
- }
28
+ },
29
+ "gitHead": "a695b88fda2f9ef1ddfbd5c75408293cbf0024c1"
29
30
  }
@@ -0,0 +1,71 @@
1
+ @import "helpers/reset";
2
+ @import "helpers/text";
3
+ @import "helpers/card";
4
+
5
+ .card-trial {
6
+ position: relative;
7
+ display: flex;
8
+ flex-direction: column;
9
+ }
10
+
11
+ .card-trial.has-image {
12
+ padding-bottom: 80px;
13
+ }
14
+
15
+ dx-icon-badge.badge-main {
16
+ --dx-c-icon-badge-icon-size: var(--dx-g-spacing-mlg);
17
+ --dx-c-icon-badge-size: var(--dx-g-spacing-2xl);
18
+
19
+ margin-bottom: var(--dx-g-spacing-md);
20
+ }
21
+
22
+ .label {
23
+ margin-bottom: var(--dx-g-spacing-sm);
24
+ }
25
+
26
+ dx-card-title {
27
+ margin-bottom: var(--dx-g-spacing-xs);
28
+ }
29
+
30
+ .body {
31
+ margin-bottom: var(--dx-g-spacing-sm);
32
+ }
33
+
34
+ .terms {
35
+ font-weight: var(--dx-g-font-bold);
36
+ }
37
+
38
+ dx-hr {
39
+ --dx-c-hr-padding-horizontal: 0;
40
+
41
+ width: 100%;
42
+ }
43
+
44
+ .details {
45
+ display: flex;
46
+ flex-direction: column;
47
+ }
48
+
49
+ .detail {
50
+ display: flex;
51
+ flex-direction: row;
52
+ }
53
+
54
+ .detail:not(:last-of-type) {
55
+ margin-bottom: var(--dx-g-spacing-smd);
56
+ }
57
+
58
+ .detail dx-icon-badge {
59
+ --dx-c-icon-badge-icon-size: 10px;
60
+ --dx-c-icon-badge-size: 18px;
61
+ --dx-c-icon-badge-color: var(--dx-g-blue-vibrant-40);
62
+
63
+ padding-right: var(--dx-g-spacing-sm);
64
+ }
65
+
66
+ img {
67
+ position: absolute;
68
+ bottom: 0;
69
+ right: var(--dx-g-spacing-mlg);
70
+ width: var(--dx-g-spacing-6xl);
71
+ }
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <a class={className} href={href} target={target}>
3
+ <dx-icon-badge
4
+ class="badge-main"
5
+ background-color={badgeBackgroundColor}
6
+ symbol={badgeSymbol}
7
+ sprite={badgeSprite}
8
+ ></dx-icon-badge>
9
+ <span class="label dx-text-label-3">{label}</span>
10
+ <dx-card-title
11
+ href={href}
12
+ target={target}
13
+ title={title}
14
+ ></dx-card-title>
15
+ <p class="body dx-text-body-3 static-font">{body}</p>
16
+ <span class="terms dx-text-body-3 static-font">{terms}</span>
17
+ <dx-hr spacing="md"></dx-hr>
18
+ <ul class="details">
19
+ <template for:each={details} for:item="detail">
20
+ <li class="detail" key={detail}>
21
+ <dx-icon-badge
22
+ background-color={badgeBackgroundColor}
23
+ symbol="check"
24
+ ></dx-icon-badge>
25
+ <span class="detail-text dx-text-body-4">{detail}</span>
26
+ </li>
27
+ </template>
28
+ </ul>
29
+ <img if:true={imgSrc} src={imgSrc} alt="" />
30
+ </a>
31
+ </template>
@@ -0,0 +1,34 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import cx from "classnames";
3
+ import { toJson } from "utils/normalizers";
4
+
5
+ export default class CardTrial extends LightningElement {
6
+ @api badgeBackgroundColor?: string = "indigo-vibrant-90";
7
+ @api badgeSprite?: string = "salesforcebrand";
8
+ @api badgeSymbol!: string;
9
+ @api body!: string;
10
+ @api href!: string;
11
+ @api label!: string;
12
+ @api imgSrc?: string;
13
+ @api target?: string;
14
+ @api terms!: string;
15
+ @api title!: string;
16
+ @api
17
+ get details() {
18
+ return this._details;
19
+ }
20
+ set details(value) {
21
+ this._details = toJson(value);
22
+ }
23
+
24
+ private _details!: string[];
25
+
26
+ private get className() {
27
+ return cx(
28
+ "card-trial",
29
+ "dx-card-base",
30
+ "dx-card-base_section-vertical",
31
+ this.imgSrc && "has-image"
32
+ );
33
+ }
34
+ }
@@ -13,6 +13,7 @@ h2 {
13
13
  font-family: var(--dx-g-font-display);
14
14
  font-size: var(--dx-g-text-sm);
15
15
  color: var(--dx-g-blue-vibrant-20);
16
+ text-transform: uppercase;
16
17
  letter-spacing: 0;
17
18
  line-height: 18px;
18
19
  }
@@ -63,14 +63,6 @@ export default class Tree extends LightningElement {
63
63
  if (node) {
64
64
  node.isExpanded = !node.isExpanded;
65
65
  }
66
- const { name, isSelectAction, isExpanded } = event.detail;
67
- this.dispatchEvent(
68
- new CustomEvent("expandcollapse", {
69
- detail: { name, isSelectAction, isExpanded },
70
- composed: true,
71
- bubbles: true
72
- })
73
- );
74
66
  }
75
67
 
76
68
  onRegister(event: CustomEvent<{ key: string; setExpanded: Function }>) {
@@ -62,8 +62,7 @@ export default class TreeItem extends LightningElement {
62
62
  }
63
63
 
64
64
  private onIconClick(event: CustomEvent): void {
65
- const isSelectAction = false;
66
- this.doExpand(isSelectAction);
65
+ this.doExpand();
67
66
  this.sendGtm(event, this.isExpanded ? "expand" : "collapse");
68
67
  }
69
68
 
@@ -73,21 +72,16 @@ export default class TreeItem extends LightningElement {
73
72
  }
74
73
 
75
74
  if (this.hasChildren) {
76
- const isSelectAction = true;
77
- this.doExpand(isSelectAction);
75
+ this.doExpand();
78
76
  }
79
77
 
80
78
  this.sendGtm(event, "click");
81
79
  this.fireEvent("tileselected", { name: this._treeNode.name });
82
80
  }
83
81
 
84
- private doExpand(isSelectAction: boolean): void {
82
+ private doExpand(): void {
85
83
  this.isExpanded = !this.isExpanded;
86
- this.fireEvent("expandcollapse", {
87
- name: this._treeNode.name,
88
- isSelectAction,
89
- isExpanded: this.isExpanded
90
- });
84
+ this.fireEvent("expandcollapse");
91
85
  }
92
86
 
93
87
  private fireEvent(type: string, detail = {}): void {
@@ -233,26 +233,26 @@ a.dx-card-base:hover dx-card-title {
233
233
  -webkit-line-clamp: 3;
234
234
  }
235
235
 
236
- .dx-text-body-2 {
236
+ .dx-text-body-2:not(.static-font) {
237
237
  font-size: var(--dx-g-text-sm);
238
238
  line-height: 20px;
239
239
  }
240
240
 
241
- .dx-text-body-3 {
241
+ .dx-text-body-3:not(.static-font) {
242
242
  font-size: var(--dx-g-text-xs);
243
243
  line-height: 16px;
244
244
  }
245
245
 
246
- .dx-text-heading-3 {
246
+ .dx-text-heading-3:not(.static-font) {
247
247
  font-size: 24px;
248
248
  line-height: 28px;
249
249
  }
250
250
 
251
- .dx-text-heading-5 {
251
+ .dx-text-heading-5:not(.static-font) {
252
252
  font-size: 12px;
253
253
  }
254
254
 
255
- .dx-text-heading-6 {
255
+ .dx-text-heading-6:not(.static-font) {
256
256
  font-size: var(--dx-g-text-sm);
257
257
  }
258
258
  }
@@ -172,6 +172,16 @@
172
172
  text-transform: uppercase;
173
173
  }
174
174
 
175
+ .dx-text-label-4 {
176
+ color: var(--dx-g-text-label-color);
177
+ font-family: var(--dx-g-font-display);
178
+ font-size: var(--dx-g-text-base);
179
+ font-weight: var(--dx-g-font-demi);
180
+ letter-spacing: 0.5%;
181
+ line-height: 20px;
182
+ text-transform: uppercase;
183
+ }
184
+
175
185
  .dx-text-form-error-message {
176
186
  font-family: var(--dx-g-font-sans);
177
187
  color: var(--dx-g-red-vibrant-50);