@primer/view-components 0.44.0-rc.2b4579f7 → 0.44.0-rc.385b39ff
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/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -5
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -5
- package/app/components/primer/alpha/action_menu/action_menu_element.js +16 -113
- package/package.json +1 -1
- package/static/arguments.json +68 -167
- package/static/audited_at.json +0 -4
- package/static/constants.json +7 -27
- package/static/info_arch.json +205 -695
- package/static/previews.json +0 -13
- package/static/statuses.json +0 -4
- package/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +0 -17
- package/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +0 -17
- package/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.js +0 -62
package/static/previews.json
CHANGED
@@ -826,19 +826,6 @@
|
|
826
826
|
"color-contrast"
|
827
827
|
]
|
828
828
|
}
|
829
|
-
},
|
830
|
-
{
|
831
|
-
"preview_path": "primer/alpha/action_menu/sub_menus",
|
832
|
-
"name": "sub_menus",
|
833
|
-
"snapshot": "false",
|
834
|
-
"skip_rules": {
|
835
|
-
"wont_fix": [
|
836
|
-
"region"
|
837
|
-
],
|
838
|
-
"will_fix": [
|
839
|
-
"color-contrast"
|
840
|
-
]
|
841
|
-
}
|
842
829
|
}
|
843
830
|
]
|
844
831
|
},
|
package/static/statuses.json
CHANGED
@@ -12,10 +12,6 @@
|
|
12
12
|
"Primer::Alpha::ActionMenu::Heading": "alpha",
|
13
13
|
"Primer::Alpha::ActionMenu::List": "alpha",
|
14
14
|
"Primer::Alpha::ActionMenu::ListWrapper": "alpha",
|
15
|
-
"Primer::Alpha::ActionMenu::Menu": "alpha",
|
16
|
-
"Primer::Alpha::ActionMenu::PrimaryMenu": "alpha",
|
17
|
-
"Primer::Alpha::ActionMenu::SubMenu": "alpha",
|
18
|
-
"Primer::Alpha::ActionMenu::SubMenuItem": "alpha",
|
19
15
|
"Primer::Alpha::AutoComplete": "deprecated",
|
20
16
|
"Primer::Alpha::AutoComplete::Item": "deprecated",
|
21
17
|
"Primer::Alpha::Banner": "alpha",
|
package/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import AnchoredPositionElement from '../../anchored_position';
|
2
|
-
type StackEntry = {
|
3
|
-
element: AnchoredPositionElement;
|
4
|
-
abortController?: AbortController;
|
5
|
-
};
|
6
|
-
export declare class ActionMenuFocusZoneStack {
|
7
|
-
#private;
|
8
|
-
constructor();
|
9
|
-
get current(): StackEntry | undefined;
|
10
|
-
push(next: AnchoredPositionElement, options?: {
|
11
|
-
trapFocus: boolean;
|
12
|
-
}): void;
|
13
|
-
pop(target?: AnchoredPositionElement): void;
|
14
|
-
elementIsMenuItem(element: HTMLElement): boolean;
|
15
|
-
get isEmpty(): boolean;
|
16
|
-
}
|
17
|
-
export {};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import AnchoredPositionElement from '../../anchored_position';
|
2
|
-
type StackEntry = {
|
3
|
-
element: AnchoredPositionElement;
|
4
|
-
abortController?: AbortController;
|
5
|
-
};
|
6
|
-
export declare class ActionMenuFocusZoneStack {
|
7
|
-
#private;
|
8
|
-
constructor();
|
9
|
-
get current(): StackEntry | undefined;
|
10
|
-
push(next: AnchoredPositionElement, options?: {
|
11
|
-
trapFocus: boolean;
|
12
|
-
}): void;
|
13
|
-
pop(target?: AnchoredPositionElement): void;
|
14
|
-
elementIsMenuItem(element: HTMLElement): boolean;
|
15
|
-
get isEmpty(): boolean;
|
16
|
-
}
|
17
|
-
export {};
|
@@ -1,62 +0,0 @@
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
6
|
-
};
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11
|
-
};
|
12
|
-
var _ActionMenuFocusZoneStack_instances, _ActionMenuFocusZoneStack_stack, _ActionMenuFocusZoneStack_setupFocusZone, _ActionMenuFocusZoneStack_validItemRoles_get;
|
13
|
-
import { FocusKeys, focusTrap, focusZone } from '@primer/behaviors';
|
14
|
-
import { ActionMenuElement } from './action_menu_element';
|
15
|
-
export class ActionMenuFocusZoneStack {
|
16
|
-
constructor() {
|
17
|
-
_ActionMenuFocusZoneStack_instances.add(this);
|
18
|
-
_ActionMenuFocusZoneStack_stack.set(this, void 0);
|
19
|
-
__classPrivateFieldSet(this, _ActionMenuFocusZoneStack_stack, [], "f");
|
20
|
-
}
|
21
|
-
get current() {
|
22
|
-
return __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f")[__classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").length - 1];
|
23
|
-
}
|
24
|
-
push(next, options = { trapFocus: true }) {
|
25
|
-
const { trapFocus } = options;
|
26
|
-
__classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").push({ element: next, abortController: __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_instances, "m", _ActionMenuFocusZoneStack_setupFocusZone).call(this, next, trapFocus) });
|
27
|
-
}
|
28
|
-
pop(target) {
|
29
|
-
if (target) {
|
30
|
-
while (__classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").length > 0 && this.current?.element !== target) {
|
31
|
-
const entry = __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").pop();
|
32
|
-
entry?.abortController?.abort();
|
33
|
-
}
|
34
|
-
}
|
35
|
-
const entry = __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").pop();
|
36
|
-
entry?.abortController?.abort();
|
37
|
-
}
|
38
|
-
elementIsMenuItem(element) {
|
39
|
-
return __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_instances, "a", _ActionMenuFocusZoneStack_validItemRoles_get).includes(element.getAttribute('role') || '');
|
40
|
-
}
|
41
|
-
get isEmpty() {
|
42
|
-
return __classPrivateFieldGet(this, _ActionMenuFocusZoneStack_stack, "f").length === 0;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
_ActionMenuFocusZoneStack_stack = new WeakMap(), _ActionMenuFocusZoneStack_instances = new WeakSet(), _ActionMenuFocusZoneStack_setupFocusZone = function _ActionMenuFocusZoneStack_setupFocusZone(containerEl, trapFocus) {
|
46
|
-
const focusZoneAbortController = focusZone(containerEl, {
|
47
|
-
bindKeys: FocusKeys.ArrowVertical | FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd | FocusKeys.Backspace,
|
48
|
-
focusOutBehavior: 'wrap',
|
49
|
-
focusableElementFilter: (element) => {
|
50
|
-
return this.elementIsMenuItem(element) && element.closest('anchored-position') === containerEl;
|
51
|
-
},
|
52
|
-
});
|
53
|
-
if (trapFocus) {
|
54
|
-
const { signal: focusZoneSignal } = focusZoneAbortController;
|
55
|
-
return focusTrap(containerEl, undefined, focusZoneSignal);
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
return focusZoneAbortController;
|
59
|
-
}
|
60
|
-
}, _ActionMenuFocusZoneStack_validItemRoles_get = function _ActionMenuFocusZoneStack_validItemRoles_get() {
|
61
|
-
return ActionMenuElement.validItemRoles;
|
62
|
-
};
|