@salesforcedevs/dx-components 1.40.5-final-alpha1 → 1.40.5-final-alpha2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.40.5-final-alpha1",
3
+ "version": "1.40.5-final-alpha2",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -16,6 +16,7 @@
16
16
  display: flex;
17
17
  align-items: center;
18
18
  min-width: 0;
19
+ position: relative;
19
20
  }
20
21
 
21
22
  .tree-item-row dx-tree-tile {
@@ -29,6 +30,19 @@
29
30
  overflow: visible;
30
31
  }
31
32
 
33
+ /* Keyboard focus on the link. The tile sets data-focus-visible only then,
34
+ so a click does not ring. The next Tab clears it and focuses the picker. */
35
+ .tree-item-row:has(dx-tree-tile[data-focus-visible])::after {
36
+ content: "";
37
+ position: absolute;
38
+ z-index: 1;
39
+ inset: 0 var(--dx-g-spacing-lg) 0
40
+ var(--dx-g-global-header-padding-horizontal);
41
+ border-radius: var(--dx-g-spacing-2xs);
42
+ outline: var(--dx-g-spacing-2xs) solid var(--dx-g-blue-vibrant-40);
43
+ pointer-events: none;
44
+ }
45
+
32
46
  .tree-item-row-selected {
33
47
  background: var(--dx-g-cloud-blue-vibrant-95);
34
48
  box-shadow: inset var(--dx-g-spacing-xs) 0 0 0 var(--dx-g-blue-vibrant-40);
@@ -70,6 +70,15 @@
70
70
  padding-right: var(--dx-g-spacing-xs);
71
71
  }
72
72
 
73
+ /* Undo the shared focus inset. The row draws the ring around link and picker. */
74
+ .sidebar-item.tile-with-version-picker:focus-visible {
75
+ margin: 0;
76
+ padding-right: var(--dx-g-spacing-xs);
77
+ padding-left: var(--dx-g-global-header-padding-horizontal);
78
+ border-radius: 0;
79
+ outline: none;
80
+ }
81
+
73
82
  .tile-with-children .tile-label {
74
83
  order: 2;
75
84
  }
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <a href={href} class={tileClass} target={target} aria-label={linkAriaLabel}>
2
+ <a
3
+ href={href}
4
+ class={tileClass}
5
+ target={target}
6
+ aria-label={linkAriaLabel}
7
+ onfocus={onLinkFocus}
8
+ onblur={onLinkBlur}
9
+ >
3
10
  <div class="flex indentation" role="heading" aria-level={tileAriaLevel}>
4
11
  <div class="flex tile-expand-icon tile-icon" if:true={showArrow}>
5
12
  <dx-icon
@@ -119,4 +119,18 @@ export default class TreeTile extends LightningElement {
119
119
  event.stopPropagation();
120
120
  this.dispatchEvent(new CustomEvent("iconclick"));
121
121
  }
122
+
123
+ /* :focus-visible does not cross this shadow root, so the row reads it here. */
124
+ private onLinkFocus(event: FocusEvent) {
125
+ const link = event.currentTarget as HTMLElement;
126
+ if (this.hasVersionPicker && link.matches(":focus-visible")) {
127
+ this.setAttribute("data-focus-visible", "");
128
+ return;
129
+ }
130
+ this.removeAttribute("data-focus-visible");
131
+ }
132
+
133
+ private onLinkBlur() {
134
+ this.removeAttribute("data-focus-visible");
135
+ }
122
136
  }