@fusion.dev/helix-headless 0.202.0 → 0.203.0
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/custom-elements.json
CHANGED
|
@@ -114946,7 +114946,7 @@
|
|
|
114946
114946
|
"name": "handleKeyDown",
|
|
114947
114947
|
"privacy": "private",
|
|
114948
114948
|
"readonly": true,
|
|
114949
|
-
"description": "Down Arrow on the trigger
|
|
114949
|
+
"description": "Down Arrow on the trigger moves focus to the panel's first link or\ncontrol, opening the panel first where it is closed, as Radix's\nnavigation menu does.\n\n**Opening is the half a trigger that is a link needs.** A page may slot\nan anchor as the trigger, so the word in the bar goes to its product's\npage on a press and the panel opens on hover. Enter on that anchor goes\nto the page, which leaves a keyboard the arrow as its way into the panel."
|
|
114950
114950
|
},
|
|
114951
114951
|
{
|
|
114952
114952
|
"kind": "field",
|
|
@@ -219293,6 +219293,6 @@
|
|
|
219293
219293
|
],
|
|
219294
219294
|
"helix": {
|
|
219295
219295
|
"package": "@fusion.dev/helix-headless",
|
|
219296
|
-
"version": "0.
|
|
219296
|
+
"version": "0.203.0"
|
|
219297
219297
|
}
|
|
219298
219298
|
}
|
|
@@ -3,7 +3,7 @@ export type GraphNodeShape = 'circle' | 'diamond' | 'ring' | 'square';
|
|
|
3
3
|
/** How heavily a note is drawn, from the `emphasis` axis. */
|
|
4
4
|
export type GraphNodeEmphasis = 'outlined' | 'solid' | 'subtle';
|
|
5
5
|
/** What a note is drawn as made of, from the `material` axis. */
|
|
6
|
-
export type GraphNodeMaterial = 'frosted' | 'glass';
|
|
6
|
+
export type GraphNodeMaterial = 'frosted' | 'glass' | 'mark';
|
|
7
7
|
/** What a note means, from the `tone` axis, which colors it over its group. */
|
|
8
8
|
export type GraphNodeTone = 'accent' | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning';
|
|
9
9
|
/** One note in a graph. */
|
|
@@ -20,7 +20,7 @@ export interface GraphNode {
|
|
|
20
20
|
emphasis?: GraphNodeEmphasis | undefined;
|
|
21
21
|
/** A kind the note belongs to, such as a tag, which a renderer colors it by. */
|
|
22
22
|
group?: string | undefined;
|
|
23
|
-
/** What it is drawn as made of: `glass` or `
|
|
23
|
+
/** What it is drawn as made of: `glass`, `frosted`, or `mark`. Unset is the renderer's own. */
|
|
24
24
|
material?: GraphNodeMaterial | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* Its shape, which says what kind of note it is at a glance: a person as a
|
|
@@ -224,8 +224,14 @@ export declare class HelixHeadlessMegamenu extends HelixHeadlessMegamenu_base {
|
|
|
224
224
|
*/
|
|
225
225
|
protected readonly keys: KeyboardNavigationController;
|
|
226
226
|
/**
|
|
227
|
-
* Down Arrow on the trigger
|
|
228
|
-
*
|
|
227
|
+
* Down Arrow on the trigger moves focus to the panel's first link or
|
|
228
|
+
* control, opening the panel first where it is closed, as Radix's
|
|
229
|
+
* navigation menu does.
|
|
230
|
+
*
|
|
231
|
+
* **Opening is the half a trigger that is a link needs.** A page may slot
|
|
232
|
+
* an anchor as the trigger, so the word in the bar goes to its product's
|
|
233
|
+
* page on a press and the panel opens on hover. Enter on that anchor goes
|
|
234
|
+
* to the page, which leaves a keyboard the arrow as its way into the panel.
|
|
229
235
|
*/
|
|
230
236
|
private readonly handleKeyDown;
|
|
231
237
|
/** Watches the panel's links for the one that is the page you are on. */
|
|
@@ -39,17 +39,24 @@ let HelixHeadlessMegamenu = class HelixHeadlessMegamenu extends MixinControllerO
|
|
|
39
39
|
wrap: false,
|
|
40
40
|
});
|
|
41
41
|
this.handleKeyDown = (event) => {
|
|
42
|
-
if (event.key !== 'ArrowDown' ||
|
|
42
|
+
if (event.key !== 'ArrowDown' || event.defaultPrevented) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
const trigger = this.trigger;
|
|
46
46
|
if (!event.composedPath().includes(trigger)) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
const enter = () => {
|
|
51
|
+
focusableElements(this)
|
|
52
|
+
.find((element) => element !== trigger && !element.closest('[slot="trigger"]'))
|
|
53
|
+
?.focus();
|
|
54
|
+
};
|
|
55
|
+
if (this.open) {
|
|
56
|
+
enter();
|
|
57
|
+
}
|
|
58
|
+
else if (this.requestOpen(true)) {
|
|
59
|
+
this.updateComplete.then(enter);
|
|
53
60
|
}
|
|
54
61
|
};
|
|
55
62
|
this.handleScroll = () => {
|