@salesforcedevs/dx-components 1.3.230-canary.0 → 1.3.231

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
@@ -11,7 +11,6 @@
11
11
  "dx/brandThemeProvider",
12
12
  "dx/breadcrumbs",
13
13
  "dx/button",
14
- "dx/buttonThemeable",
15
14
  "dx/buttonToggle",
16
15
  "dx/cardBlogPost",
17
16
  "dx/cardCallout",
@@ -23,7 +22,6 @@
23
22
  "dx/cardGridDocs",
24
23
  "dx/cardMinimal",
25
24
  "dx/cardNews",
26
- "dx/cardNewsThemeable",
27
25
  "dx/cardPodcastEpisode",
28
26
  "dx/cardSmall",
29
27
  "dx/cardStep",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.230-canary.0",
3
+ "version": "1.3.231",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,6 +44,7 @@
44
44
  display: flex;
45
45
  flex-direction: row;
46
46
  justify-content: flex-start;
47
+ align-items: flext-start;
47
48
  overflow: visible;
48
49
  }
49
50
 
@@ -63,6 +63,9 @@ const resultsTemplatesInnerHtml = `
63
63
  <a
64
64
  href="<%= raw.uri %>"
65
65
  class="dx-result-title"
66
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
67
+ target="_blank"
68
+ <% } %>
66
69
  >
67
70
  <%= title %>
68
71
  <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
@@ -93,6 +96,9 @@ const resultsTemplatesInnerHtml = `
93
96
  <a
94
97
  href="<%= raw.uri %>"
95
98
  class="dx-result-title"
99
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
100
+ target="_blank"
101
+ <% } %>
96
102
  >
97
103
  <% if (title) { %>
98
104
  <%= title %>
@@ -1,138 +0,0 @@
1
- @import "dxHelpers/reset";
2
-
3
- :host {
4
- width: min-content;
5
- font-size: inherit;
6
-
7
- --dx-c-button-justify-content: center;
8
- --dx-c-button-opacity: 1;
9
- --dx-c-button-font-size: var(--dx-g-text-sm);
10
- --dx-c-button-font-weight: var(--dx-g-font-normal);
11
- --dx-c-button-display: flex;
12
- }
13
-
14
- .button {
15
- background-color: var(--dx-button-themeable-background-color);
16
- border: 1px solid var(--dx-button-themeable-border-color);
17
- color: var(--dx-button-themeable-text-color);
18
- opacity: var(--dx-c-button-opacity);
19
- width: inherit;
20
- display: var(--dx-c-button-display);
21
- align-items: center;
22
- justify-content: var(--dx-c-button-justify-content);
23
- user-select: none;
24
- white-space: nowrap;
25
- font-size: var(--dx-c-button-font-size);
26
- transition: var(--dx-g-transition-hue-1x);
27
- padding: var(--dx-c-button-vertical-spacing, 0)
28
- var(--dx-c-button-horizontal-spacing, var(--dx-g-spacing-md));
29
- border-radius: var(--dx-g-spacing-xs);
30
- font-weight: var(--dx-c-button-font-weight);
31
- }
32
-
33
- .button:focus {
34
- opacity: 1;
35
- }
36
-
37
- .button:focus:not(:focus-visible) {
38
- outline: none;
39
- }
40
-
41
- .button:hover,
42
- :host([aria-expanded="true"]) .button {
43
- background-color: var(--dx-button-themeable-background-hover-color);
44
- border-color: var(--dx-button-themeable-border-hover-color);
45
- color: var(--dx-button-themeable-text-hover-color);
46
- }
47
-
48
- .button.variant_inline-inherit {
49
- font-size: inherit;
50
- text-transform: inherit;
51
- user-select: inherit;
52
- white-space: normal;
53
- }
54
-
55
- .button dx-icon {
56
- display: inline;
57
- vertical-align: var(--dx-c-button-icon-vertical-align, unset);
58
- }
59
-
60
- .button.variant_inline dx-icon,
61
- .button.variant_inline-inherit dx-icon {
62
- display: inline-block;
63
- }
64
-
65
- .button > span {
66
- font-family: inherit;
67
- font-size: inherit;
68
- font-weight: inherit;
69
- vertical-align: var(--dx-c-button-span-vertical-align, unset);
70
- }
71
-
72
- .button:not(.variant_inline-inherit).font-display {
73
- font-family: var(--dx-g-font-display);
74
- }
75
-
76
- .button.font-sans {
77
- font-family: var(--dx-g-font-sans);
78
- }
79
-
80
- .button.icon-right:not(.slot-empty) > *:nth-child(2) {
81
- margin-left: var(--dx-g-spacing-sm);
82
- }
83
-
84
- .button.icon-left:not(.slot-empty) > *:nth-child(2) {
85
- margin-right: var(--dx-g-spacing-sm);
86
- }
87
-
88
- .button.style-icon.slot-empty {
89
- padding: 0;
90
- }
91
-
92
- .icon-right {
93
- flex-direction: row;
94
- }
95
-
96
- .icon-left {
97
- flex-direction: row-reverse;
98
- }
99
-
100
- /* sizes */
101
-
102
- .button.size-large {
103
- height: var(--dx-g-spacing-3xl);
104
- }
105
-
106
- .button.size-large.style-icon.slot-empty {
107
- width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-3xl));
108
- }
109
-
110
- .button.size-small {
111
- height: var(--dx-g-spacing-xl);
112
- }
113
-
114
- .button.size-small.style-icon.slot-empty {
115
- width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-xl));
116
- }
117
-
118
- .button.size-hero {
119
- font-size: var(--dx-g-text-lg);
120
- height: 52px;
121
- }
122
-
123
- .button.size-hero.style-icon.slot-empty {
124
- width: var(--dx-c-slot-empty-width, 52px);
125
- }
126
-
127
- /* inline */
128
- .button.variant_inline,
129
- .button.variant_inline-inherit {
130
- display: inline;
131
- padding: 0;
132
- height: unset; /* please leave this here, actually is having an effect */
133
- width: unset; /* please leave this here, actually is having an effect */
134
- }
135
-
136
- .button.state-disabled {
137
- pointer-events: none;
138
- }
@@ -1,43 +0,0 @@
1
- <template>
2
- <button
3
- if:false={href}
4
- class={className}
5
- disabled={disabled}
6
- type={type}
7
- aria-label={ariaLabel}
8
- part="container"
9
- >
10
- <span if:false={loading}>
11
- <slot onslotchange={onSlotChange}></slot>
12
- </span>
13
- <dx-icon
14
- if:true={showIcon}
15
- sprite={iconSprite}
16
- size={iconSize}
17
- symbol={iconSymbol}
18
- ></dx-icon>
19
- <span class="temp-loading-message" if:true={loading}>Loading...</span>
20
- </button>
21
- <a
22
- if:true={href}
23
- href={href}
24
- target={target}
25
- rel={rel}
26
- class={className}
27
- disabled={disabled}
28
- download={download}
29
- aria-label={ariaLabel}
30
- part="container"
31
- >
32
- <span if:false={loading}>
33
- <slot onslotchange={onSlotChange}></slot>
34
- </span>
35
- <dx-icon
36
- if:true={showIcon}
37
- sprite={iconSprite}
38
- size={iconSize}
39
- symbol={iconSymbol}
40
- ></dx-icon>
41
- <span class="temp-loading-message" if:true={loading}>Loading...</span>
42
- </a>
43
- </template>
@@ -1,82 +0,0 @@
1
- import { LightningElement, api } from "lwc";
2
- import cx from "classnames";
3
- import {
4
- ButtonTarget,
5
- ButtonVariant,
6
- ButtonSize,
7
- IconSprite,
8
- IconSize,
9
- IconSymbol,
10
- LightningSlotElement
11
- } from "typings/custom";
12
-
13
- export default class ButtonThemeable extends LightningElement {
14
- private _didSetFormAttribute = false;
15
- @api ariaLabel: string = "";
16
- @api disabled: boolean | null = null;
17
- @api iconSize?: IconSize = "small";
18
- @api iconSprite?: IconSprite = "utility";
19
- @api iconSymbol?: IconSymbol;
20
- @api iconPosition?: "right" | "left" = "right";
21
- @api loading: boolean = false;
22
- @api size: ButtonSize = "small";
23
- @api variant: ButtonVariant = "primary";
24
- @api font: "display" | "sans" = "display";
25
- @api form: string | undefined;
26
- @api name?: string;
27
- @api value?: any;
28
-
29
- // button props
30
- @api type: "submit" | "reset" | "button" = "button";
31
-
32
- // link props
33
- @api href: string | null = null;
34
- @api download: string | null = null;
35
- @api target: ButtonTarget = null;
36
- @api rel: string | null = null;
37
-
38
- @api focus() {
39
- const button = this.template.querySelector(".button");
40
- if (button) {
41
- button.focus();
42
- }
43
- }
44
-
45
- private isSlotEmpty: boolean = true;
46
-
47
- private get showIcon(): boolean {
48
- return !!this.iconSymbol && !this.loading;
49
- }
50
-
51
- private get className(): string {
52
- return cx(
53
- "button",
54
- this.disabled && "state-disabled",
55
- `variant_${this.variant}`,
56
- this.loading && "state-loading",
57
- `size-${this.size}`,
58
- !!this.iconSymbol && "style-icon",
59
- this.isSlotEmpty && "slot-empty",
60
- `font-${this.font}`,
61
- this.iconPosition === "right" ? "icon-right" : "icon-left"
62
- );
63
- }
64
-
65
- renderedCallback() {
66
- if (
67
- !this.href &&
68
- typeof this.form !== "undefined" &&
69
- !this._didSetFormAttribute
70
- ) {
71
- this._didSetFormAttribute = true;
72
- this.template
73
- .querySelector("button")
74
- ?.setAttribute("form", this.form);
75
- }
76
- }
77
-
78
- private onSlotChange(e: LightningSlotElement) {
79
- const slot = e.target;
80
- this.isSlotEmpty = slot.assignedElements().length !== 0;
81
- }
82
- }
@@ -1,203 +0,0 @@
1
- @import "dxHelpers/reset";
2
- @import "dxHelpers/text";
3
- @import "dxHelpers/card";
4
-
5
- :host {
6
- --dx-c-feature-img-padding-top: 0;
7
- --dx-c-feature-img-padding-right: 0;
8
- --dx-c-feature-img-padding-left: 0;
9
- --dx-c-feature-img-padding-bottom: 0;
10
- --dx-card-news-themeable-background-color: var(
11
- --dx-g-background-color-tertiary,
12
- var(--dx-g-indigo-vibrant-40)
13
- );
14
- --dx-card-news-themeable-text-color: var(
15
- --dx-g-body-text-color-tertiary,
16
- white
17
- );
18
- --dx-button-themeable-background-color: var(
19
- --dx-g-button-background-color-tertiary,
20
- transparent
21
- );
22
- --dx-button-themeable-text-color: var(
23
- --dx-g-button-text-color-tertiary,
24
- white
25
- );
26
- --dx-button-themeable-background-hover-color: var(
27
- --dx-g-button-background-color-hover-tertiary,
28
- var(--dx-button-themeable-background-color)
29
- );
30
- --dx-button-themeable-text-hover-color: var(
31
- --dx-g-button-text-color-hover-tertiary,
32
- var(--dx-button-themeable-text-color)
33
- );
34
- --dx-button-themeable-border-color: var(
35
- --dx-g-button-border-color-tertiary,
36
- var(--dx-button-themeable-background-color)
37
- );
38
- --dx-button-themeable-border-hover-color: var(
39
- --dx-g-button-border-color-hover-tertiary,
40
- var(--dx-button-themeable-background-hover-color)
41
- );
42
- }
43
-
44
- .dx-card-base.dx-card-news {
45
- background-color: var(--dx-card-news-themeable-background-color);
46
- color: var(--dx-card-news-themeable-text-color);
47
- position: relative;
48
- display: flex;
49
- align-items: stretch;
50
- flex-direction: column;
51
- justify-content: flex-start;
52
- box-shadow: var(--dx-g-box-shadow-sm);
53
- }
54
-
55
- .text {
56
- flex-grow: 1;
57
- padding: var(--dx-g-card-padding) 24px 0 20px;
58
- z-index: 1;
59
- }
60
-
61
- .dx-text-display-4 {
62
- margin: 4px 0;
63
- color: var(--dx-card-news-themeable-text-color, inherit);
64
- }
65
-
66
- p {
67
- font-size: 16px;
68
- letter-spacing: 0.15px;
69
- line-height: 24px;
70
- }
71
-
72
- .cta {
73
- margin: 16px 0;
74
- }
75
-
76
- img {
77
- display: none;
78
- margin: 0;
79
- }
80
-
81
- .dx-card-size-large .dx-text-display-4 {
82
- font-size: 30px;
83
- letter-spacing: 0.3px;
84
- line-height: 40px;
85
- margin: 4px 0 10px;
86
- }
87
-
88
- .dx-card-size-large p {
89
- letter-spacing: 0.2px;
90
- }
91
-
92
- .dx-card-size-large .cta {
93
- margin: var(--dx-g-spacing-lg) 0;
94
- }
95
-
96
- .dx-card-size-large img {
97
- display: block;
98
- }
99
-
100
- @media screen and (min-width: 1024px) {
101
- .text {
102
- padding: var(--dx-g-spacing-lg);
103
- }
104
-
105
- .dx-card-news {
106
- position: relative;
107
- min-height: 380px;
108
- display: flex;
109
- align-items: stretch;
110
- justify-content: flex-start;
111
- box-shadow: var(--dx-g-box-shadow-sm);
112
- }
113
-
114
- .dx-text-display-4 {
115
- letter-spacing: 0.1px;
116
- }
117
-
118
- img,
119
- .text {
120
- display: block;
121
- }
122
-
123
- .dx-card-news.dx-card-news-img-placement-top {
124
- flex-direction: column-reverse;
125
- }
126
-
127
- .dx-card-news.dx-card-news-img-placement-bottom {
128
- flex-direction: column;
129
- }
130
-
131
- .dx-card-news.dx-card-news-img-placement-right .text {
132
- max-width: 50%;
133
- }
134
-
135
- .dx-card-news.dx-card-news-img-placement-right .text.large {
136
- max-width: 75%;
137
- }
138
-
139
- /* Pushed to the right, centered vertically */
140
- .dx-card-news.dx-card-news-img-placement-right img {
141
- position: absolute;
142
- width: 100%;
143
- right: 0;
144
- max-width: 50%;
145
- }
146
-
147
- .dx-card-size-normal .dx-text-display-4 {
148
- font-size: var(--dx-g-text-xl);
149
- line-height: 28px;
150
- }
151
-
152
- .dx-card-size-normal p {
153
- letter-spacing: 0.2px;
154
- margin: 12px 0 0;
155
- }
156
-
157
- .dx-card-size-normal .cta {
158
- margin: 14px 0 -2px;
159
- }
160
-
161
- .dx-card-size-large .dx-text-display-4 {
162
- font-size: var(--dx-g-text-2xl);
163
- line-height: 40px;
164
- letter-spacing: 0.6px;
165
- margin: 10px 0 0;
166
- }
167
-
168
- .dx-card-size-large p {
169
- font-size: 20px;
170
- line-height: 32px;
171
- margin: 10px 0 0;
172
- letter-spacing: 0.72px;
173
- }
174
-
175
- .dx-card-size-large .cta {
176
- margin: 24px 0 0;
177
- }
178
-
179
- .dx-card-news-img-vertical-align-middle {
180
- top: 50%;
181
- transform: translate(0, -50%);
182
- }
183
-
184
- .dx-card-news-img-vertical-align-bottom {
185
- bottom: 0;
186
- }
187
-
188
- .dx-card-news-img-vertical-align-top {
189
- top: 0;
190
- }
191
-
192
- .dx-card-news-img-placement-right img.dx-card-news-img-small,
193
- .dx-card-news-img-small {
194
- max-width: 25%;
195
- }
196
- }
197
-
198
- .dx-card-news-img-padding {
199
- padding: var(--dx-c-feature-img-padding-top)
200
- var(--dx-c-feature-img-padding-right)
201
- var(--dx-c-feature-img-padding-bottom)
202
- var(--dx-c-feature-img-padding-left);
203
- }
@@ -1,42 +0,0 @@
1
- <template>
2
- <a
3
- class={className}
4
- href={href}
5
- target={target}
6
- onclick={trackClick}
7
- part="container"
8
- >
9
- <div class={textContainerClassName}>
10
- <h3 class="dx-text-display-4">
11
- <dx-formatted-rich-text value={title}></dx-formatted-rich-text>
12
- </h3>
13
- <p>{body}</p>
14
- <div class="cta" onclick={toggleTheme}>
15
- <dx-button-themeable if:true={hasLargeButton} size="large">
16
- {buttonText}
17
- </dx-button-themeable>
18
-
19
- <dx-button-themeable
20
- class="inline-button"
21
- if:false={hasLargeButton}
22
- variant="inline"
23
- icon-symbol="forward"
24
- >
25
- {buttonText}
26
- </dx-button-themeable>
27
- </div>
28
- </div>
29
-
30
- <img
31
- if:true={imgSrc}
32
- alt={imgAlt}
33
- aria-label={imgAlt}
34
- role="img"
35
- src={imgSrc}
36
- class={imgClassName}
37
- style={imgStyle}
38
- part="image"
39
- loading="lazy"
40
- />
41
- </a>
42
- </template>
@@ -1,76 +0,0 @@
1
- import { LightningElement, api } from "lwc";
2
- import cx from "classnames";
3
- import {
4
- CardNewsButtonType,
5
- CardNewsImagePlacement,
6
- CardNewsImageVerticalAlignment,
7
- CardNewsSize,
8
- CardNewsTextContainerSize
9
- } from "typings/custom";
10
- import { track } from "dxUtils/analytics";
11
-
12
- export default class CardNewsThemeable extends LightningElement {
13
- @api title!: string;
14
- @api body!: string;
15
- @api buttonText?: string = "";
16
- @api buttonType!: CardNewsButtonType;
17
- @api size?: CardNewsSize = "normal";
18
- @api href!: string;
19
- @api imgAlt?: string = "";
20
- @api imgSrc?: string | null = null;
21
- @api imgPlacement?: CardNewsImagePlacement = "top";
22
- @api imgVerticalAlign?: CardNewsImageVerticalAlignment | null = null;
23
- @api target?: string | null = null;
24
- @api textContainerWidth?: CardNewsTextContainerSize = "small";
25
-
26
- private get className(): string {
27
- return cx(
28
- "dx-card-news",
29
- "dx-card-base",
30
- `dx-card-size-${this.size}`,
31
- this.imgSrc && `dx-card-news-img-placement-${this.imgPlacement}`
32
- );
33
- }
34
-
35
- private get hasLargeButton(): boolean {
36
- return this.buttonType === "large";
37
- }
38
-
39
- private get textContainerClassName(): string {
40
- return cx("text", this.textContainerWidth);
41
- }
42
-
43
- private get imgClassName(): string {
44
- return cx(
45
- this.imgVerticalAlign &&
46
- `dx-card-news-img-vertical-align-${this.imgVerticalAlign}`,
47
- this.textContainerWidth === "large" && `dx-card-news-img-small`,
48
- `dx-card-news-img-padding`
49
- );
50
- }
51
-
52
- private trackClick(e: Event) {
53
- const payload = {
54
- click_text: this.buttonText,
55
- click_url: this.href.includes("http")
56
- ? this.href
57
- : `${window.location.origin}${this.href}`,
58
- element_title: this.title,
59
- element_type: "link",
60
- content_category: "cta"
61
- };
62
- track(e.currentTarget!, "custEv_ctaLinkClick", payload);
63
- track(e.currentTarget!, "custEv_linkClick", payload);
64
- }
65
-
66
- private toggleTheme(event: Event) {
67
- event.preventDefault();
68
- event.stopPropagation();
69
- const root = document.querySelector(":root");
70
- if (root?.classList.contains("dark")) {
71
- root.classList.remove("dark");
72
- } else {
73
- root?.classList.add("dark");
74
- }
75
- }
76
- }