@salesforcedevs/dx-components 1.3.256-canary.2 → 1.3.257

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
@@ -5,7 +5,6 @@
5
5
  { "npm": "@salesforcedevs/docs-components" }
6
6
  ],
7
7
  "expose": [
8
- "dx/agenda",
9
8
  "dx/alert",
10
9
  "dx/audio",
11
10
  "dx/banner",
@@ -15,13 +14,11 @@
15
14
  "dx/buttonToggle",
16
15
  "dx/cardBlogPost",
17
16
  "dx/cardCallout",
18
- "dx/cardClickthrough",
19
17
  "dx/cardContent",
20
18
  "dx/cardDemo",
21
19
  "dx/cardDocs",
22
20
  "dx/cardEvent",
23
21
  "dx/cardExpanded",
24
- "dx/cardGrid",
25
22
  "dx/cardGridDocs",
26
23
  "dx/cardMinimal",
27
24
  "dx/cardNews",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.256-canary.2",
3
+ "version": "1.3.257",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,5 +44,6 @@
44
44
  },
45
45
  "volta": {
46
46
  "node": "16.19.1"
47
- }
47
+ },
48
+ "gitHead": "3359905041d172f74777faa70d48a5d31335020d"
48
49
  }
@@ -9,13 +9,13 @@
9
9
  <div
10
10
  class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
11
  >
12
- <span class="dx-text-label-3" part="label">{label}</span>
12
+ <span class="dx-text-label-3">{label}</span>
13
13
  <dx-card-title
14
14
  title={title}
15
15
  target={target}
16
16
  onclick={handleLinkClick}
17
17
  ></dx-card-title>
18
- <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
18
+ <span class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
19
19
  </div>
20
20
  <div class="dx-card-base_section-vertical dx-card-base_ctas">
21
21
  <slot onslotchange={onSlotChange}></slot>
@@ -13,7 +13,7 @@ a {
13
13
  }
14
14
 
15
15
  footer {
16
- padding-top: var(--dx-c-footer-padding-top, var(--dx-g-spacing-5xl));
16
+ padding-top: var(--dx-g-spacing-5xl);
17
17
  }
18
18
 
19
19
  footer.signup-variant-large-signup {
@@ -74,10 +74,6 @@ footer.signup-variant-no-signup {
74
74
  height: 504px;
75
75
  }
76
76
 
77
- .content-container_top_large_no_signup {
78
- height: 33vw;
79
- }
80
-
81
77
  .subscription {
82
78
  position: relative;
83
79
  z-index: 1;
@@ -282,7 +278,7 @@ footer.signup-variant-no-signup {
282
278
  }
283
279
 
284
280
  @media screen and (min-width: 1400px) {
285
- .content-container_top_large:not(.content-container_top_large_no_signup) {
281
+ .content-container_top_large {
286
282
  /* takes into account the background assets' h:w ratio */
287
283
  height: 38vw;
288
284
  }
@@ -305,20 +301,11 @@ footer.signup-variant-no-signup {
305
301
  background-size: 122.92%;
306
302
  }
307
303
 
308
- .content-container_top_large_no_signup .graphic-large {
309
- background-size: 101%;
310
- }
311
-
312
304
  .content-container_top_large {
313
305
  height: 464px;
314
306
  padding-top: var(--dx-g-spacing-2xl);
315
307
  }
316
308
 
317
- .content-container_top_large_no_signup {
318
- height: 38vw;
319
- padding-top: 0;
320
- }
321
-
322
309
  .subscription h3 {
323
310
  font-size: 24px;
324
311
  line-height: 28px;
@@ -393,10 +380,6 @@ footer.signup-variant-no-signup {
393
380
  padding-bottom: 140px;
394
381
  }
395
382
 
396
- .content-container_top_large_no_signup {
397
- height: 44vw;
398
- }
399
-
400
383
  .graphic-mountains {
401
384
  display: none;
402
385
  }
@@ -33,13 +33,6 @@
33
33
  </dx-button>
34
34
  </div>
35
35
  </div>
36
- <div
37
- if:true={showLargeNoSignup}
38
- class={largeNoSignupClassName}
39
- >
40
- <div class="graphic graphic-large" alt=""></div>
41
- <slot name="custom-content" onslotchange={onSlotChange}></slot>
42
- </div>
43
36
  <div
44
37
  if:true={showContainerMiddle}
45
38
  class="content-container content-container_middle"
@@ -1,10 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
- import {
4
- FooterVariant,
5
- LightningSlotElement,
6
- OptionWithLink
7
- } from "typings/custom";
3
+ import { FooterVariant, OptionWithLink } from "typings/custom";
8
4
  import { toJson } from "dxUtils/normalizers";
9
5
  import {
10
6
  defaultGeneralLinks,
@@ -13,7 +9,6 @@ import {
13
9
  intellectualHref
14
10
  } from "./links";
15
11
  import { track } from "dxUtils/analytics";
16
- import { isSlotEmpty } from "dxUtils/slot";
17
12
 
18
13
  export default class Footer extends LightningElement {
19
14
  @api locale: string | null = null;
@@ -39,7 +34,6 @@ export default class Footer extends LightningElement {
39
34
  private _locales: OptionWithLink[] | null = null;
40
35
  private _variant: FooterVariant = "small-signup";
41
36
  private intellectualHref = intellectualHref;
42
- private isSlotEmpty = true;
43
37
  private socialLinks = socialLinks;
44
38
  private termsLinks = termsLinks;
45
39
  private signupPath = "/newsletter";
@@ -70,10 +64,6 @@ export default class Footer extends LightningElement {
70
64
  return this.variant === "small-signup";
71
65
  }
72
66
 
73
- get showLargeNoSignup() {
74
- return this.variant === "large-no-signup";
75
- }
76
-
77
67
  get hasLocales() {
78
68
  return this.locale && this.locales;
79
69
  }
@@ -104,31 +94,17 @@ export default class Footer extends LightningElement {
104
94
  return cx(`signup-variant-${this.variant}`);
105
95
  }
106
96
 
107
- get largeNoSignupClassName() {
108
- return cx(
109
- "content-container",
110
- "content-container_top_large",
111
- "content-container_top_large_no_signup",
112
- !this.isSlotEmpty && "custom-content"
113
- );
114
- }
115
-
116
97
  private onLocaleChange(e: CustomEvent) {
117
98
  this.dispatchEvent(
118
99
  new CustomEvent("localechange", { detail: e.detail })
119
100
  );
120
101
  }
121
102
 
122
- private onSlotChange(e: LightningSlotElement): void {
123
- this.isSlotEmpty = isSlotEmpty(e);
124
- }
125
-
126
103
  private isFooterVariant(value: string): value is FooterVariant {
127
104
  return [
128
105
  "no-signup",
129
106
  "small-signup",
130
107
  "large-signup",
131
- "large-no-signup",
132
108
  "terms-only"
133
109
  ].includes(value);
134
110
  }
@@ -92,13 +92,20 @@ const resultsTemplatesInnerHtml = `
92
92
  <% } %>
93
93
  <% } %>
94
94
  </div>
95
- <a
96
- href="<%= raw.uri %>"
97
- class="dx-result-title CoveoResultLink"
98
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
99
- target="_blank"
100
- <% } %>
101
- >
95
+ <% if (raw.content_type === "community posts") { %>
96
+ <a
97
+ class="dx-result-title CoveoResultLink"
98
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
99
+ >
100
+ <% } else { %>
101
+ <a
102
+ href="<%= raw.uri %>"
103
+ class="dx-result-title CoveoResultLink"
104
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
105
+ target="_blank"
106
+ <% } %>
107
+ >
108
+ <% } %>
102
109
  <%= title %>
103
110
  <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
104
111
  <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
@@ -135,13 +142,20 @@ const resultsTemplatesInnerHtml = `
135
142
  <% } %>
136
143
  <% } %>
137
144
  </div>
138
- <a
139
- href="<%= raw.uri %>"
140
- class="dx-result-title CoveoResultLink"
141
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
142
- target="_blank"
145
+ <% if (raw.content_type === "community posts") { %>
146
+ <a
147
+ class="dx-result-title CoveoResultLink"
148
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
149
+ >
150
+ <% } else { %>
151
+ <a
152
+ href="<%= raw.uri %>"
153
+ class="dx-result-title CoveoResultLink"
154
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
155
+ target="_blank"
156
+ <% } %>
157
+ >
143
158
  <% } %>
144
- >
145
159
  <% if (title) { %>
146
160
  <%= title %>
147
161
  <% } else { %>
@@ -1,7 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { LightningSlotElement } from "typings/custom";
3
3
  import debounce from "debounce";
4
- import { isSlotEmpty } from "dxUtils/slot";
5
4
  const MOBILE_SIZE = 640;
6
5
  const getInputSize = () =>
7
6
  (window.innerWidth ||
@@ -31,7 +30,8 @@ export default class SectionSignup extends LightningElement {
31
30
  }
32
31
 
33
32
  private onSlotChange(e: LightningSlotElement) {
34
- this.isSlotEmpty = isSlotEmpty(e);
33
+ // @ts-ignore
34
+ this.isSlotEmpty = e.target.assignedElements().length === 0;
35
35
  }
36
36
 
37
37
  private _updateSize = () => {
@@ -1,97 +0,0 @@
1
- @import "dxHelpers/reset";
2
- @import "dxHelpers/text";
3
-
4
- ul {
5
- list-style: none;
6
- }
7
-
8
- .container {
9
- max-width: 840px;
10
- margin: 0 auto;
11
- }
12
-
13
- .detail-list-title {
14
- text-align: center;
15
- margin-bottom: 60px;
16
- }
17
-
18
- .detail-list-content-container {
19
- position: relative;
20
- }
21
-
22
- .detail-list-content {
23
- background-color: white;
24
- border-color: rgb(229, 229, 229);
25
- border-style: solid;
26
- border-width: 1px;
27
- border-radius: 16px;
28
- padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-2xl);
29
- }
30
-
31
- .detail-list-item {
32
- align-items: center;
33
- display: flex;
34
- gap: var(--dx-g-spacing-xl);
35
- padding: var(--dx-g-spacing-xl) 0;
36
- }
37
-
38
- .detail-list-item:not(:last-child) {
39
- border-bottom: 1px solid var(--dx-g-gray-95);
40
- }
41
-
42
- .detail-list-item-title {
43
- flex: 1;
44
- }
45
-
46
- .detail-list-item .detail-list-item-detail {
47
- color: var(--dx-g-blue-vibrant-20);
48
- display: inline-block;
49
- font-weight: 700;
50
- width: 25%;
51
- }
52
-
53
- .detail-list-item-detail-right {
54
- text-align: right;
55
- }
56
-
57
- .flourish-container {
58
- position: absolute;
59
- bottom: 10px;
60
- right: 0;
61
- width: var(--dx-c-flourish-width, unset);
62
- }
63
-
64
- @media (max-width: 915px) {
65
- .flourish-container {
66
- display: none;
67
- }
68
- }
69
-
70
- @media (max-width: 600px) {
71
- .detail-list-content {
72
- padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-mlg);
73
- }
74
-
75
- .detail-list-item {
76
- gap: var(--dx-g-spacing-md);
77
- }
78
-
79
- .detail-list-item-detail {
80
- width: 30%;
81
- }
82
-
83
- .detail-list-item-title {
84
- font-size: var(--dx-g-text-base);
85
- line-height: 20px;
86
- }
87
- }
88
-
89
- @media (max-width: 430px) {
90
- .detail-list-item-detail {
91
- font-size: var(--dx-g-text-xs);
92
- }
93
-
94
- .detail-list-item-title {
95
- font-size: var(--dx-g-text-sm);
96
- }
97
- }
@@ -1,31 +0,0 @@
1
- <template>
2
- <div class="container">
3
- <h2 class="detail-list-title dx-text-display-4">{title}</h2>
4
- <div class="detail-list-content-container">
5
- <ul class="detail-list-content" part="content">
6
- <template for:each={items} for:item="item">
7
- <li class="detail-list-item" key={item.title}>
8
- <span
9
- lwc:if={item.leftDetail}
10
- class="detail-list-item-detail detail-list-item-detail-left dx-text-body-3"
11
- >
12
- {item.leftDetail}
13
- </span>
14
- <span class="detail-list-item-title dx-text-display-7">
15
- {item.title}
16
- </span>
17
- <span
18
- lwc:if={item.rightDetail}
19
- class="detail-list-item-detail detail-list-item-detail-right dx-text-body-3"
20
- >
21
- {item.rightDetail}
22
- </span>
23
- </li>
24
- </template>
25
- </ul>
26
- <div lwc:if={flourish} class="flourish-container">
27
- <img src={flourish} />
28
- </div>
29
- </div>
30
- </div>
31
- </template>
@@ -1,25 +0,0 @@
1
- import { toJson } from "dxUtils/normalizers";
2
- import { api, LightningElement } from "lwc";
3
-
4
- export interface AgendaItem {
5
- body?: string;
6
- isInitiallyOpen?: boolean;
7
- leftDetail?: string;
8
- rightDetail?: string;
9
- title: string;
10
- }
11
-
12
- export default class Agenda extends LightningElement {
13
- @api title: string = "Agenda";
14
- @api flourish?: string;
15
-
16
- @api
17
- get items() {
18
- return this._items;
19
- }
20
- set items(value: any) {
21
- this._items = toJson(value);
22
- }
23
-
24
- private _items: AgendaItem[] = [];
25
- }
@@ -1,69 +0,0 @@
1
- @import "dxHelpers/reset";
2
- @import "dxHelpers/text";
3
- @import "dxHelpers/card";
4
-
5
- :host {
6
- --dx-c-heading-max-lines: 4;
7
- --dx-c-card-grid-max-width: 60px;
8
- }
9
-
10
- .card {
11
- display: flex;
12
- flex-direction: column;
13
- }
14
-
15
- .not-clickable {
16
- cursor: default;
17
- }
18
-
19
- .image {
20
- width: 100%;
21
- height: 160px;
22
- }
23
-
24
- .control {
25
- border-radius: 50%;
26
- background-color: var(--dx-g-cloud-blue-vibrant-95);
27
- color: var(--dx-g-blue-vibrant-40);
28
- width: 48px;
29
- height: 48px;
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- position: absolute;
34
- bottom: 32px;
35
- right: 20px;
36
- }
37
-
38
- /* text section */
39
-
40
- .card_section-text {
41
- grid-area: text;
42
- flex-grow: 1;
43
- position: relative;
44
- }
45
-
46
- .dx-text-display-8 dx-button {
47
- margin-left: var(--dx-g-spacing-xs);
48
- }
49
-
50
- .dx-text-display-6 {
51
- position: relative;
52
- -webkit-line-clamp: var(--dx-c-heading-max-lines);
53
- -webkit-box-orient: vertical;
54
- display: box;
55
- overflow: hidden;
56
- }
57
-
58
- .dx-text-display-6 dx-icon {
59
- display: inline-block;
60
- transform: translateY(-3px);
61
- }
62
-
63
- /* mobile responsiveness */
64
-
65
- @media screen and (max-width: 1024px) {
66
- .has-image:not(.show-mobile-image) .image {
67
- display: none;
68
- }
69
- }
@@ -1,18 +0,0 @@
1
- <template>
2
- <a href={href} class={className} target={target} onclick={handleCardClick}>
3
- <img
4
- if:true={imgSrc}
5
- alt={imgAlt}
6
- src={imgSrc}
7
- class="image dx-card-base_image"
8
- />
9
- <div
10
- class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
- >
12
- <span class="dx-text-label-3" part="label">{label}</span>
13
- <dx-card-title title={title} target={target} onclick={handleLinkClick}></dx-card-title>
14
- <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
15
- <span lwc:if={href} class="control"><dx-icon size="medium" symbol="forward"></dx-icon></span>
16
- </div>
17
- </a>
18
- </template>
@@ -1,61 +0,0 @@
1
- import { LightningElement, api } from "lwc";
2
- import cx from "classnames";
3
- import { track } from "dxUtils/analytics";
4
-
5
- export default class CardClickthrough extends LightningElement {
6
- @api body!: string;
7
- @api href?: string;
8
- @api imgAlt?: string = "";
9
- @api imgSrc?: string | null = null;
10
- @api label!: string;
11
- @api title!: string;
12
- @api target?: string | null = null;
13
- @api showMobileImg?: boolean = false;
14
-
15
- private get className(): string {
16
- return cx(
17
- "card",
18
- "dx-card-base",
19
- this.imgSrc && "has-image",
20
- this.showMobileImg && "show-mobile-image",
21
- !this.href && "not-clickable" // for "coming soon" cards
22
- );
23
- }
24
-
25
- handleCardClick(evt: Event) {
26
- if (!this.href) {
27
- evt.preventDefault();
28
- return;
29
- }
30
- }
31
-
32
- private handleLinkClick(event: PointerEvent) {
33
- if (!this.href) {
34
- return;
35
- }
36
- const payloadCardInfo = {
37
- click_text: this.title,
38
- element_title: this.title,
39
- click_url: this.href,
40
- element_type: "link",
41
- content_category: "cta"
42
- };
43
- track(event.currentTarget!, "custEv_cardClick", payloadCardInfo);
44
- track(event.currentTarget!, "custEv_linkClick", payloadCardInfo);
45
- }
46
-
47
- private handleTextClick(event: PointerEvent) {
48
- if (!this.href) {
49
- return;
50
- }
51
- const payloadCardTextInfo = {
52
- click_text: this.body,
53
- element_title: this.title,
54
- click_url: `${window.location.origin}${this.href}`,
55
- element_type: "tile",
56
- content_category: "cta"
57
- };
58
- track(event.currentTarget!, "custEv_ctaTile", payloadCardTextInfo);
59
- track(event.currentTarget!, "custEv_linkClick", payloadCardTextInfo);
60
- }
61
- }
@@ -1,5 +0,0 @@
1
- @media screen and (max-width: 1024px) {
2
- dx-card-docs {
3
- --dx-c-body-max-lines: 3;
4
- }
5
- }
@@ -1,18 +0,0 @@
1
- <template>
2
- <dx-grid columns={numColumns}>
3
- <template for:each={cards} for:item="card">
4
- <dx-card-clickthrough
5
- key={card.title}
6
- body={card.body}
7
- href={card.href}
8
- img-alt={card.imgAlt}
9
- img-src={card.imgSrc}
10
- label={card.label}
11
- title={card.title}
12
- target={card.target}
13
- show-mobile-img={card.showMobileImg}
14
- >
15
- </dx-card-clickthrough>
16
- </template>
17
- </dx-grid>
18
- </template>
@@ -1,19 +0,0 @@
1
- import { api, LightningElement } from "lwc";
2
- import Grid from "dx/grid";
3
- import { DocsCard } from "typings/custom";
4
- import { toJson } from "dxUtils/normalizers";
5
-
6
- export default class CardGrid extends LightningElement {
7
- // DocsCard[] with _optional_ href
8
- private _cards: ({ href?: string } & Omit<DocsCard, "href">)[] = [];
9
-
10
- @api
11
- get cards() {
12
- return this._cards;
13
- }
14
- set cards(value: any) {
15
- this._cards = toJson(value);
16
- }
17
-
18
- @api numColumns: Grid["columns"] = "three";
19
- }