@salesforcedevs/dx-components 1.2.18-lightdom → 1.2.18-lightdom-4

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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/src/modules/dx/banner/banner.css +33 -1
  3. package/src/modules/dx/banner/banner.html +2 -5
  4. package/src/modules/dx/banner/banner.ts +1 -3
  5. package/src/modules/dx/brandThemeProvider/brandThemeProvider.html +1 -1
  6. package/src/modules/dx/brandThemeProvider/brandThemeProvider.ts +4 -4
  7. package/src/modules/dx/button/button.html +5 -5
  8. package/src/modules/dx/button/{button.css → button.scoped.css} +1 -16
  9. package/src/modules/dx/button/button.ts +11 -9
  10. package/src/modules/dx/cardPodcastEpisode/{cardPodcastEpisode.scoped.css → cardPodcastEpisode.css} +4 -0
  11. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +1 -1
  12. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.ts +0 -2
  13. package/src/modules/dx/cardTitle/cardTitle.css +24 -2
  14. package/src/modules/dx/cardTitle/cardTitle.html +4 -4
  15. package/src/modules/dx/cardTitle/cardTitle.ts +0 -1
  16. package/src/modules/dx/dropdown/dropdown.css +6 -12
  17. package/src/modules/dx/dropdown/dropdown.html +3 -2
  18. package/src/modules/dx/dropdown/dropdown.ts +1 -1
  19. package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +8 -8
  20. package/src/modules/dx/header/header.css +0 -10
  21. package/src/modules/dx/header/header.html +1 -1
  22. package/src/modules/dx/header/header.scoped.css +5 -0
  23. package/src/modules/dx/header/header.ts +2 -2
  24. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +147 -2
  25. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.html +5 -6
  26. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +3 -5
  27. package/src/modules/dx/headerNav/{headerNav.scoped.css → headerNav.css} +3 -1
  28. package/src/modules/dx/headerNav/headerNav.html +2 -2
  29. package/src/modules/dx/headerNav/headerNav.ts +0 -2
  30. package/src/modules/dx/headerSearch/headerSearch.css +61 -2
  31. package/src/modules/dx/headerSearch/headerSearch.html +3 -3
  32. package/src/modules/dx/headerSearch/headerSearch.ts +0 -2
  33. package/src/modules/dx/icon/icon.css +4 -1
  34. package/src/modules/dx/icon/icon.html +1 -1
  35. package/src/modules/dx/icon/icon.scoped.css +5 -0
  36. package/src/modules/dx/icon/icon.ts +0 -2
  37. package/src/modules/dx/logo/{logo.scoped.css → logo.css} +3 -0
  38. package/src/modules/dx/logo/logo.html +1 -1
  39. package/src/modules/dx/logo/logo.ts +0 -2
  40. package/src/modules/dx/popover/popover.html +2 -2
  41. package/src/modules/dx/popover/{popover.css → popover.scoped.css} +0 -2
  42. package/src/modules/dx/popover/popover.ts +33 -19
  43. package/src/modules/dx/relativeDateTime/relativeDateTime.html +1 -1
  44. package/src/modules/dx/relativeDateTime/relativeDateTime.ts +0 -1
  45. package/src/modules/dx/skipNavLink/{skipNavLink.scoped.css → skipNavLink.css} +2 -0
  46. package/src/modules/dx/skipNavLink/skipNavLink.html +1 -1
  47. package/src/modules/dx/skipNavLink/skipNavLink.ts +1 -4
  48. package/src/modules/dx/tooltip/microtip.css +105 -101
  49. package/src/modules/dxHelpers/card/card.css +1 -11
  50. package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +2 -2
  51. package/src/modules/dx/banner/banner.scoped.css +0 -28
  52. package/src/modules/dx/cardTitle/cardTitle.scoped.css +0 -25
  53. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.scoped.css +0 -142
  54. package/src/modules/dx/headerSearch/headerSearch.scoped.css +0 -56
  55. package/src/modules/dx/relativeDateTime/relativeDateTime.scoped.css +0 -3
@@ -4,8 +4,6 @@ import { OptionWithNested } from "typings/custom";
4
4
  import { deepmapOptions } from "dxUtils/options";
5
5
 
6
6
  export default class HeaderMobileNavMenu extends LightningElement {
7
- static renderMode = 'light';
8
-
9
7
  @api open: boolean = false;
10
8
  @api value: string | null = null;
11
9
  @api pathname: string | null = null;
@@ -64,7 +62,7 @@ export default class HeaderMobileNavMenu extends LightningElement {
64
62
 
65
63
  renderedCallback() {
66
64
  if (!this.navElement) {
67
- this.navElement = this.querySelector("nav");
65
+ this.navElement = this.template.querySelector("nav");
68
66
  }
69
67
  if (this.open && !this.wasOpen && this.value) {
70
68
  this.scrollToAccordianSection();
@@ -75,10 +73,10 @@ export default class HeaderMobileNavMenu extends LightningElement {
75
73
  }
76
74
 
77
75
  private scrollToAccordianSection() {
78
- const element = this.querySelector(
76
+ const element = this.template.querySelector(
79
77
  `li[data-id="${this.value}"]`
80
78
  );
81
- const container = this.querySelector(".nav-menu");
79
+ const container = this.template.querySelector(".nav-menu");
82
80
  if (element && container) {
83
81
  container.scrollTop = element.offsetTop - 8;
84
82
  }
@@ -1,3 +1,5 @@
1
+ @import "dxHelpers/reset";
2
+
1
3
  a {
2
4
  text-decoration: none;
3
5
  }
@@ -22,7 +24,7 @@ nav {
22
24
  .nav-list-item-nav-menu {
23
25
  display: flex;
24
26
  }
25
-
27
+
26
28
  dx-dropdown {
27
29
  display: none;
28
30
  }
@@ -1,7 +1,7 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <nav role="navigation" aria-label={ariaLabel}>
3
3
  <ul class="nav-list">
4
- <template for:each={navItems} for:item="navItem" lwc:render-mode='light'>
4
+ <template for:each={navItems} for:item="navItem">
5
5
  <li key={navItem.id}>
6
6
  <dx-tab
7
7
  if:false={navItem.options}
@@ -1,8 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { TabVariant, OptionWithNested } from "typings/custom";
3
3
  export default class HeaderNav extends LightningElement {
4
- static renderMode = 'light';
5
-
6
4
  @api pathname: string | null = null;
7
5
  @api variant: TabVariant = "default";
8
6
  @api ariaLabel: string = "Primary Navigation";
@@ -1,3 +1,62 @@
1
- dx-header-search {
1
+ @import "dxHelpers/reset";
2
+
3
+ /* DESKTOP */
4
+
5
+ :host {
2
6
  --toggle-width: var(--dx-g-spacing-5xl);
3
- }
7
+ }
8
+
9
+ .desktop_search-container {
10
+ position: relative;
11
+ display: flex;
12
+ height: var(--dx-g-spacing-xl);
13
+ font-size: var(--dx-g-text-sm);
14
+ font-family: var(--dx-g-font-sans);
15
+ color: var(--dx-g-gray-50);
16
+ }
17
+
18
+ .desktop_search-container dx-input {
19
+ --dx-c-input-width: calc(
20
+ var(--dx-c-header-search-width) - var(--toggle-width)
21
+ );
22
+ }
23
+
24
+ /* MOBILE */
25
+
26
+ .mobile_search-button {
27
+ position: relative;
28
+ z-index: 3;
29
+ }
30
+
31
+ .mobile_search-dropdown {
32
+ --dx-c-popover-border-radius: 0;
33
+ --dx-c-popover-border: none;
34
+ }
35
+
36
+ .mobile_search-input {
37
+ position: absolute;
38
+ top: 0;
39
+ left: 0;
40
+ height: 100%;
41
+ width: 100%;
42
+ transition: var(--dx-g-transition-hue-1x);
43
+ opacity: 0;
44
+ pointer-events: none;
45
+
46
+ --dx-c-input-border: none;
47
+ --dx-c-input-border-radius: 0;
48
+ --dx-c-input-border-active: none;
49
+ --dx-c-input-icon-color: var(--dx-g-blue-vibrant-20);
50
+ --dx-c-input-padding: 0 var(--dx-g-spacing-4xl) 0 var(--dx-g-spacing-md);
51
+ --dx-c-input-background: var(--dx-g-brand-current-color-background-2);
52
+ --dx-c-input-background-active: var(
53
+ --dx-g-brand-current-color-background-2
54
+ );
55
+ --dx-c-input-height: 100% !important;
56
+ --dx-c-input-width: 100%;
57
+ }
58
+
59
+ .mobile_search-input.state-open {
60
+ opacity: 1;
61
+ pointer-events: auto;
62
+ }
@@ -1,7 +1,7 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <div class={className} role="search" aria-label="Records Search">
3
3
  <!-- MOBILE -->
4
- <template if:true={mobile} lwc:render-mode='light'>
4
+ <template if:true={mobile}>
5
5
  <dx-dropdown
6
6
  aria-label="Record Type"
7
7
  class="mobile_search-dropdown"
@@ -37,7 +37,7 @@
37
37
  </template>
38
38
 
39
39
  <!-- DESKTOP -->
40
- <template if:false={mobile} lwc:render-mode='light'>
40
+ <template if:false={mobile}>
41
41
  <dx-dropdown
42
42
  options={suggestions}
43
43
  open={isDropdownOpen}
@@ -12,8 +12,6 @@ import {
12
12
  const baseSearchHref = `/search`;
13
13
 
14
14
  export default class HeaderSearch extends LightningElement {
15
- static renderMode = 'light';
16
-
17
15
  @api mobile!: boolean;
18
16
  @api coveoOrganizationId!: string;
19
17
  @api coveoPublicAccessToken!: string;
@@ -1,5 +1,8 @@
1
- dx-icon {
1
+ @import "dxHelpers/reset";
2
+
3
+ :host {
2
4
  display: block;
5
+
3
6
  --dx-c-icon-color: currentColor;
4
7
  }
5
8
 
@@ -1,4 +1,4 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <svg
3
3
  aria-hidden="true"
4
4
  style={style}
@@ -0,0 +1,5 @@
1
+ :host {
2
+ display: block;
3
+
4
+ --dx-c-icon-color: currentColor;
5
+ }
@@ -14,8 +14,6 @@ const sizeMap = {
14
14
  };
15
15
 
16
16
  export default class Icon extends LightningElement {
17
- static renderMode = 'light';
18
-
19
17
  @api sprite: IconSprite = "utility";
20
18
  @api size: IconSize = "small";
21
19
  @api symbol!: IconSymbol;
@@ -1,3 +1,6 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
1
4
  :host {
2
5
  --dx-c-logo-label-color: var(--dx-g-blue-vibrant-20);
3
6
 
@@ -1,4 +1,4 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <a href={href} class="logo-link">
3
3
  <img src={imgSrc} alt={imgAlt} />
4
4
  <span class="dx-text-heading-7">{label}</span>
@@ -1,8 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
 
3
3
  export default class Logo extends LightningElement {
4
- static renderMode = 'light';
5
-
6
4
  @api href: string = "/";
7
5
  @api imgSrc: string = "/assets/svg/salesforce-cloud.svg";
8
6
  @api imgAlt: string = "Salesforce log";
@@ -1,5 +1,5 @@
1
- <template>
2
- <slot name="control" onslotchange={onSlotChange}></slot>
1
+ <template lwc:render-mode="light">
2
+ <slot name="control"></slot>
3
3
  <div class={containerClassName}>
4
4
  <div
5
5
  class={className}
@@ -1,5 +1,3 @@
1
- @import "dxHelpers/reset";
2
-
3
1
  :host {
4
2
  --popover-border-radius: var(
5
3
  --dx-c-popover-border-radius,
@@ -1,9 +1,5 @@
1
1
  import { LightningElement, api } from "lwc";
2
- import {
3
- LightningSlotElement,
4
- PopoverRequestCloseType,
5
- PopperPlacement
6
- } from "typings/custom";
2
+ import { PopoverRequestCloseType, PopperPlacement } from "typings/custom";
7
3
 
8
4
  import { computePosition, flip, size, shift } from "@floating-ui/dom";
9
5
  import cx from "classnames";
@@ -23,6 +19,8 @@ const isEventOutsideElements = (
23
19
  );
24
20
 
25
21
  export default class Popover extends LightningElement {
22
+ static renderMode = "light";
23
+
26
24
  @api ariaLabel: string | null = null;
27
25
  @api offset?: "small" | "medium";
28
26
  @api pagePadding?: number = 16; // padding between dropdown and the edge of the page
@@ -118,8 +116,10 @@ export default class Popover extends LightningElement {
118
116
 
119
117
  renderedCallback() {
120
118
  if (!this.popover) {
121
- this.popover = this.template.querySelector(".popover-container");
119
+ this.popover = this.querySelector(".popover-container");
122
120
  }
121
+
122
+ this.doWeirdControlStuff();
123
123
  }
124
124
 
125
125
  // GETTERS
@@ -127,6 +127,7 @@ export default class Popover extends LightningElement {
127
127
  private get className() {
128
128
  return cx(
129
129
  "popover",
130
+ "popover-content",
130
131
  this.offset && `popover-offset-${this.offset}`,
131
132
  this.small && "popover-small",
132
133
  this.width && "popover-overridewidth",
@@ -232,23 +233,36 @@ export default class Popover extends LightningElement {
232
233
  this.openPopover();
233
234
  };
234
235
 
235
- private onSlotChange(e: LightningSlotElement) {
236
- const slot = e.target;
237
- const elements = slot.assignedElements();
238
- const slotted = elements.length === 0 ? null : elements[0];
239
- // allows dropdown/select to compose popover
240
- const control =
241
- slotted.tagName === "SLOT" ? slotted.firstChild : slotted;
242
- const onboardControl =
243
- (!this.control || (control && !control.isSameNode(this.control))) &&
244
- control;
245
- if (onboardControl) {
236
+ // private onSlotChange(e: LightningSlotElement) {
237
+ // const slot = e.target;
238
+ // const elements = slot.assignedElements();
239
+ // const slotted = elements.length === 0 ? null : elements[0];
240
+ // // allows dropdown/select to compose popover
241
+ // const control =
242
+ // slotted.tagName === "SLOT" ? slotted.firstChild : slotted;
243
+ // const onboardControl =
244
+ // (!this.control || (control && !control.isSameNode(this.control))) &&
245
+ // control;
246
+ // if (onboardControl) {
247
+ // control.setAttribute("aria-haspopup", "true");
248
+ // control.style.cursor = this.openOnHover ? "default" : "cursor";
249
+ // this.control = control;
250
+ // this.addControlListeners();
251
+ // this.setPosition();
252
+ // }
253
+ // }
254
+
255
+ private doWeirdControlStuff() {
256
+ const control = this.querySelector('[slot="control"]');
257
+
258
+ if (control) {
246
259
  control.setAttribute("aria-haspopup", "true");
247
260
  control.style.cursor = this.openOnHover ? "default" : "cursor";
248
261
  this.control = control;
249
- this.addControlListeners();
250
- this.setPosition();
251
262
  }
263
+
264
+ this.addControlListeners();
265
+ this.setPosition();
252
266
  }
253
267
 
254
268
  private onKeyDown(e: KeyboardEvent): void {
@@ -1,3 +1,3 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <time title={original}>{value}</time>
3
3
  </template>
@@ -1,7 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
 
3
3
  export default class RelativeDateTime extends LightningElement {
4
- static renderMode = 'light';
5
4
  @api messageWhenHoursPast: String = "";
6
5
  @api messageWhenDaysPast: String = "";
7
6
  @api messageWhenWeeksPast: String = "";
@@ -1,3 +1,5 @@
1
+ @import "dxHelpers/text";
2
+
1
3
  a {
2
4
  left: 0;
3
5
  top: 0;
@@ -1,3 +1,3 @@
1
- <template lwc:render-mode='light'>
1
+ <template>
2
2
  <a class="dx-text-button-light" href="#maincontent">Skip Navigation</a>
3
3
  </template>
@@ -1,6 +1,3 @@
1
1
  import { LightningElement } from "lwc";
2
2
 
3
- export default class SkipNavLink extends LightningElement {
4
- static renderMode = 'light';
5
-
6
- }
3
+ export default class SkipNavLink extends LightningElement {}