@salesforcedevs/dx-components 1.3.358-alpha4 → 1.3.359

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.358-alpha4",
3
+ "version": "1.3.359",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -45,5 +45,6 @@
45
45
  },
46
46
  "volta": {
47
47
  "node": "18.18.0"
48
- }
48
+ },
49
+ "gitHead": "fee5f7da5e1d4e1bef384c743d5da8f7b4c7632f"
49
50
  }
@@ -29,6 +29,11 @@
29
29
  var(--image-radius);
30
30
  }
31
31
 
32
+ .container-layout {
33
+ padding: var(--dx-c-featured-content-header-padding-vertical)
34
+ var(--dx-c-featured-content-header-padding-horizontal);
35
+ }
36
+
32
37
  .container {
33
38
  --image-radius: var(--dx-g-spacing-smd);
34
39
 
@@ -38,26 +43,22 @@
38
43
  /* actual spacing between bottom of graphic and rest of page content */
39
44
  --bottom-spacing: var(--dx-g-spacing-4xl);
40
45
  --item-spacing: var(--dx-g-spacing-xl);
41
- --swoop-height: var(--dx-c-featured-content-header-swoop-height);
42
46
  --swoop-z-index: 11;
43
47
  --label-color: var(--dx-themed-featured-content-header-text-color);
44
48
 
45
49
  position: relative;
46
- }
47
-
48
- .container-layout {
49
- padding: var(--dx-c-featured-content-header-padding-vertical)
50
- var(--dx-c-featured-content-header-padding-horizontal);
51
- }
52
-
53
- .container,
54
- .container-layout {
55
50
  background-image: var(--dx-themed-featured-content-header-background-swoop);
56
- background-size: cover;
51
+ background-size: 100% 100%;
57
52
  background-repeat: no-repeat;
58
53
  background-position: center;
59
54
  }
60
55
 
56
+ .container.variant_intense {
57
+ background-image: var(
58
+ --dx-themed-featured-content-header-background-swoop-intense
59
+ );
60
+ }
61
+
61
62
  /* LAYOUTS */
62
63
 
63
64
  .img-placement_inline .container-layout {
@@ -372,26 +373,22 @@ dx-image-and-label {
372
373
  );
373
374
  }
374
375
 
375
- .container.link-hovered.variant_dark .title-link {
376
+ .container.link-hovered.variant_intense .title-link {
376
377
  color: var(
377
378
  --dx-themed-featured-content-header-title-link-intense-hover-color
378
379
  );
379
380
  }
380
381
 
381
- .variant_dark {
382
+ .variant_intense {
382
383
  --label-color: var(--dx-themed-featured-content-header-intense-label-color);
383
-
384
- background-image: var(
385
- --dx-themed-featured-content-header-background-swoop-intense
386
- );
387
384
  }
388
385
 
389
- .variant_dark dx-image-and-label {
386
+ .variant_intense dx-image-and-label {
390
387
  --dx-c-image-and-label-text-color: white;
391
388
  }
392
389
 
393
- .variant_dark .title,
394
- .variant_dark .body {
390
+ .variant_intense .title,
391
+ .variant_intense .body {
395
392
  color: white;
396
393
  }
397
394
 
@@ -408,10 +405,6 @@ dx-image-and-label {
408
405
  }
409
406
 
410
407
  @media screen and (max-width: 1024px) {
411
- div.container {
412
- background-size: center;
413
- }
414
-
415
408
  .container {
416
409
  --vertical-padding: 80px;
417
410
  --bottom-spacing: var(--dx-g-spacing-2xl);
@@ -71,7 +71,7 @@ export default class FeaturedContentHeader extends LightningElement {
71
71
  return cx(
72
72
  "container",
73
73
  this.imgSrc && `img-placement_${this.imgPlacement}`,
74
- this.dark && "variant_dark",
74
+ this.dark && "variant_intense",
75
75
  this.isLinkHovered && "link-hovered",
76
76
  !this.isSlotEmpty && "has-slotted",
77
77
  this.backgroundImgId && `custom-bg-${this.backgroundImgId}`
@@ -58,6 +58,14 @@ a:hover {
58
58
  --dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-40);
59
59
  }
60
60
 
61
+ .helmet.variant_intense {
62
+ background-color: var(--dx-g-blue-vibrant-40);
63
+
64
+ --dx-c-home-link-color: white;
65
+ --dx-c-breadcrumb-color: var(--dx-g-blue-vibrant-90);
66
+ --dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-80);
67
+ }
68
+
61
69
  .helmet.variant_light {
62
70
  background-color: var(--dx-g-cloud-blue-vibrant-95);
63
71
 
@@ -3,9 +3,13 @@ import { throttle } from "throttle-debounce";
3
3
  import { track } from "dxUtils/analytics";
4
4
 
5
5
  const RESTORE_SCROLL_EVENT_NAME = "restore-scroll";
6
+ const SCROLL_EVENT_NAME = "scroll";
7
+ const GLOBAL_NAV_TOGGLE_EVENT_NAME = "toggle_global_nav";
8
+
6
9
  const LOAD_TIME_SCROLL_RESTORE_DELAY = 750;
7
10
  const REDUNDANT_INSTANCE_ERROR_MESSAGE =
8
11
  "Multiple <dx-scroll-manager>s detected, this should never be the case.";
12
+ const HTML_ELEMENT = document.querySelector("html");
9
13
 
10
14
  declare module globalThis {
11
15
  let singletonScrollManagerRendered: boolean;
@@ -91,26 +95,33 @@ export default class ScrollManager extends LightningElement {
91
95
  if (!globalThis.singletonScrollManagerConnected) {
92
96
  globalThis.singletonScrollManagerConnected = true;
93
97
  window.addEventListener(RESTORE_SCROLL_EVENT_NAME, restoreScroll);
94
- window.addEventListener("scroll", this.onWindowScroll);
98
+ window.addEventListener(SCROLL_EVENT_NAME, this.onWindowScroll);
99
+ /*
100
+ this global nav emits this event when it is shown or hidden
101
+ their full logic for when this occurs can be found here
102
+ https://github.com/sfdc-www/hgf-www/blob/main/packages/lwc-components/src/modules/hgf/c360nav/c360nav.ts#L1316
103
+ */
104
+ window.addEventListener(
105
+ GLOBAL_NAV_TOGGLE_EVENT_NAME,
106
+ this.onGlobalNavToggle
107
+ );
95
108
  } else {
96
109
  console.error(REDUNDANT_INSTANCE_ERROR_MESSAGE);
97
110
  }
98
111
  }
99
112
 
100
113
  onWindowScroll = () => {
101
- const html = document.querySelector("html");
102
- if (html) {
103
- html.setAttribute(
104
- "style",
105
- `--dx-g-global-header-nav-row-count: ${
106
- html.scrollTop >= 73 ? 1 : 2
107
- }`
108
- );
109
- }
110
-
111
114
  this.updateScrollState();
112
115
  };
113
116
 
117
+ onGlobalNavToggle = (event: Event) => {
118
+ const isGlobalNavShowing: boolean = (event as CustomEvent).detail;
119
+ HTML_ELEMENT?.setAttribute(
120
+ "style",
121
+ `--dx-g-global-header-nav-row-count: ${isGlobalNavShowing ? 2 : 1}`
122
+ );
123
+ };
124
+
114
125
  sendGtmScrollThresholdEvent(threshold: "25" | "50" | "75" | "100") {
115
126
  track(document.body, "custEv_scroll", {
116
127
  scrollDepth: threshold
@@ -192,6 +203,10 @@ export default class ScrollManager extends LightningElement {
192
203
 
193
204
  disconnectedCallback(): void {
194
205
  window.removeEventListener(RESTORE_SCROLL_EVENT_NAME, restoreScroll);
195
- window.removeEventListener("scroll", this.onWindowScroll);
206
+ window.removeEventListener(SCROLL_EVENT_NAME, this.onWindowScroll);
207
+ window.removeEventListener(
208
+ GLOBAL_NAV_TOGGLE_EVENT_NAME,
209
+ this.onGlobalNavToggle
210
+ );
196
211
  }
197
212
  }