@astryxdesign/core 0.7.9-canary.195fcfd → 0.7.9-canary.20febb3
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/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +2 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +2 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +2 -1
- package/dist/Layer/outsidePress.d.ts +4 -0
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +18 -1
- package/dist/Layer/useBackdropPress.d.ts +8 -0
- package/dist/Layer/useBackdropPress.d.ts.map +1 -1
- package/dist/Layer/useBackdropPress.js +31 -2
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +4 -0
- package/dist/Resizable/resizablePane.d.ts +0 -2
- package/dist/Resizable/resizablePane.d.ts.map +1 -1
- package/dist/Resizable/resizablePane.js +2 -7
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +22 -5
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +0 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +2 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/package.json +4 -4
- package/src/ContextMenu/ContextMenu.tsx +2 -0
- package/src/DateInput/DateInput.tsx +2 -0
- package/src/DateTimeInput/DateTimeInput.tsx +2 -0
- package/src/Layer/outsidePress.ts +18 -1
- package/src/Layer/useBackdropPress.ts +41 -1
- package/src/Layer/useTouchTrigger.ts +4 -0
- package/src/Resizable/resizablePane.ts +4 -13
- package/src/Selector/Selector.tsx +37 -6
- package/src/SideNav/SideNav.tsx +0 -1
- package/src/TabList/Tab.tsx +5 -1
- package/src/Tooltip/useTooltip.tsx +2 -0
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAwCrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;AAgI1C,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAMnD,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,oDAAoD;IACpD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,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E,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,gBAAgB,qBAijBlB;yBAtkBe,WAAW"}
|
|
@@ -48,6 +48,7 @@ import { useLayerInternal } from "../Layer/useLayer.js";
|
|
|
48
48
|
import { LayerDepthProvider } from "../Layer/LayerDepthContext.js";
|
|
49
49
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
50
50
|
import { currentGesture } from "../Layer/gestureCounter.js";
|
|
51
|
+
import { noteOutsideDismissal } from "../Layer/outsidePress.js";
|
|
51
52
|
import { MenuBottomSheetActionList } from "../DropdownMenu/MenuBottomSheetActionList.js";
|
|
52
53
|
import { menuBottomSheetStyles } from "../DropdownMenu/menuBottomSheet.stylex.js";
|
|
53
54
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
@@ -386,6 +387,7 @@ export function ContextMenu({
|
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
389
|
if (menu && !menu.contains(e.target)) {
|
|
390
|
+
noteOutsideDismissal(menu.ownerDocument);
|
|
389
391
|
closeMenu();
|
|
390
392
|
}
|
|
391
393
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EA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,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IAE9D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;AAojBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BA4C9C;yBA5Ce,SAAS"}
|
|
@@ -35,7 +35,7 @@ import { useBusyAnnouncement } from "../hooks/useBusyAnnouncement.js";
|
|
|
35
35
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
36
36
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
37
37
|
import { usePopover } from "../Popover/index.js";
|
|
38
|
-
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, useOutsidePress } from "../Layer/outsidePress.js";
|
|
38
|
+
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, noteOutsideDismissal, useOutsidePress } from "../Layer/outsidePress.js";
|
|
39
39
|
import { NativeDateField } from "./NativeDateField.js";
|
|
40
40
|
import { TouchDateField } from "./TouchDateField.js";
|
|
41
41
|
import { useTooltip } from "../Tooltip/index.js";
|
|
@@ -421,6 +421,7 @@ function PointerDateField({
|
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
423
|
isFocusMovingAwayRef.current = true;
|
|
424
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
424
425
|
popover.hide();
|
|
425
426
|
}, [popover]);
|
|
426
427
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AA6CA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AA6CA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAyBrB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAmB9C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErE,uGAAuG;AACvG,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAE3D,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,4EAA4E;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9D;;;GAGG;AACH,M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,CAAC,CAAC;IAEzD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IAErC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,0BAA0B,CAAC;IAE3C;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IAErD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AA46CD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAgDtD;yBAhDe,aAAa"}
|
|
@@ -31,7 +31,7 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
31
31
|
import { Calendar } from "../Calendar/index.js";
|
|
32
32
|
import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
33
33
|
import { usePopover } from "../Popover/index.js";
|
|
34
|
-
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, useOutsidePress } from "../Layer/outsidePress.js";
|
|
34
|
+
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, noteOutsideDismissal, useOutsidePress } from "../Layer/outsidePress.js";
|
|
35
35
|
import { useTooltip } from "../Tooltip/index.js";
|
|
36
36
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
37
37
|
import { useBusyAnnouncement } from "../hooks/useBusyAnnouncement.js";
|
|
@@ -864,6 +864,7 @@ function PointerDateTimeField({
|
|
|
864
864
|
// elsewhere, or a programmatic focus — would strand the listbox open. Focus landing inside the
|
|
865
865
|
// field or the popup itself is not a leave. Mirrors BaseTypeahead.
|
|
866
866
|
if (timePopover.isOpen && !isFocusInsideOwnedLayer(e.relatedTarget, timeContainerRef.current, timePopover.id)) {
|
|
867
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
867
868
|
timePopover.hide();
|
|
868
869
|
}
|
|
869
870
|
if (timePendingInput === null) {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** Records that a layer in `doc` is closing because a press or focus went outside it. */
|
|
2
|
+
export declare function noteOutsideDismissal(doc: Document): void;
|
|
3
|
+
/** How many layers an outside press has closed in `doc` so far. */
|
|
4
|
+
export declare function outsideDismissalCount(doc: Document): number;
|
|
1
5
|
/**
|
|
2
6
|
* Watch the owner's document for a press outside, until the returned function
|
|
3
7
|
* is called. The caller stops it when its layer hides and when it unmounts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outsidePress.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"outsidePress.d.ts","sourceRoot":"","sources":["../../src/Layer/outsidePress.ts"],"names":[],"mappings":"AA+BA,yFAAyF;AACzF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAExD;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,EACvD,SAAS,EAAE,MAAM,IAAI,GACpB,MAAM,IAAI,CA4BZ;AAED,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,KAAK,EAAE,CACL,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,EACvD,SAAS,EAAE,MAAM,IAAI,KAClB,IAAI,CAAC;IACV,4DAA4D;IAC5D,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,iBAAiB,CAgBnD;AAoCD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAST;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GACd,OAAO,CAKT"}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* @file outsidePress.ts
|
|
7
7
|
* @input Listens for pointerdown, pointerup and pointercancel on a document
|
|
8
8
|
* @output Exports watchOutsidePress and useOutsidePress, which owns one watch
|
|
9
|
-
* for a component: start on show, stop on hide, stop on unmount;
|
|
9
|
+
* for a component: start on show, stop on hide, stop on unmount;
|
|
10
|
+
* noteOutsideDismissal and outsideDismissalCount, a per-document count of
|
|
11
|
+
* layers that an outside press or focus move closed; and the
|
|
10
12
|
* inside tests a text field's owner runs: isPressInsideOwnedLayer for a
|
|
11
13
|
* press, isFocusInsideOwnedLayer for a blur
|
|
12
14
|
* @position Internal to Layer; the outside-press dismissal for a manual
|
|
@@ -22,6 +24,20 @@
|
|
|
22
24
|
*/
|
|
23
25
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
24
26
|
|
|
27
|
+
// A modal host's backdrop press reads this. A press that closed a layer above
|
|
28
|
+
// the host is that layer's, so the host stays open.
|
|
29
|
+
const outsideDismissals = new WeakMap();
|
|
30
|
+
|
|
31
|
+
/** Records that a layer in `doc` is closing because a press or focus went outside it. */
|
|
32
|
+
export function noteOutsideDismissal(doc) {
|
|
33
|
+
outsideDismissals.set(doc, (outsideDismissals.get(doc) ?? 0) + 1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** How many layers an outside press has closed in `doc` so far. */
|
|
37
|
+
export function outsideDismissalCount(doc) {
|
|
38
|
+
return outsideDismissals.get(doc) ?? 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
25
41
|
/**
|
|
26
42
|
* Watch the owner's document for a press outside, until the returned function
|
|
27
43
|
* is called. The caller stops it when its layer hides and when it unmounts.
|
|
@@ -44,6 +60,7 @@ export function watchOutsidePress(owner, isInside, onOutside) {
|
|
|
44
60
|
const wasOutside = startedOutside;
|
|
45
61
|
startedOutside = false;
|
|
46
62
|
if (wasOutside && !isInside(event.composedPath())) {
|
|
63
|
+
noteOutsideDismissal(doc);
|
|
47
64
|
onOutside();
|
|
48
65
|
}
|
|
49
66
|
};
|
|
@@ -19,6 +19,14 @@ export interface BackdropPressHandlers {
|
|
|
19
19
|
* ancestor), so a backdrop press dismisses only when its pointer-down and its
|
|
20
20
|
* pointer-up both landed on the backdrop. A cancelled pointer ends the press.
|
|
21
21
|
*
|
|
22
|
+
* A press that light-dismisses a layer open above the host, such as a menu
|
|
23
|
+
* open in the dialog, is that layer's: the host stays open, and the next
|
|
24
|
+
* backdrop press dismisses it, as a second Escape does. The press is the
|
|
25
|
+
* layer's when it closes one. A `popover="auto"` layer that showed at
|
|
26
|
+
* pointer-down no longer shows at the click, or a layer counted its close
|
|
27
|
+
* with noteOutsideDismissal. A layer that hides for another reason, such as a
|
|
28
|
+
* Tooltip whose trigger lost focus, does not count.
|
|
29
|
+
*
|
|
22
30
|
* The pointer handlers run in the capture phase. A nested layer, such as a
|
|
23
31
|
* popover open in the dialog, stops its presses at its own root, so a
|
|
24
32
|
* bubble-phase handler here does not see them.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBackdropPress.d.ts","sourceRoot":"","sources":["../../src/Layer/useBackdropPress.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,UAAU,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useBackdropPress.d.ts","sourceRoot":"","sources":["../../src/Layer/useBackdropPress.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,UAAU,EAAC,MAAM,OAAO,CAAC;AAG9E,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACjE,kBAAkB,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC/D,sBAAsB,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACnD;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,eAAe,EAAE,MAAM,IAAI,EAC3B,SAAS,EAAE,OAAO,GACjB,qBAAqB,CA6DvB"}
|
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
* @position Shared backdrop-press rule for Dialog and Drawer
|
|
11
11
|
*/
|
|
12
12
|
import { useCallback, useRef } from 'react';
|
|
13
|
+
import { outsideDismissalCount } from "./outsidePress.js";
|
|
14
|
+
function isPopoverShowing(element) {
|
|
15
|
+
try {
|
|
16
|
+
return element.matches(':popover-open');
|
|
17
|
+
} catch {
|
|
18
|
+
// jsdom and pre-Popover browsers do not recognize :popover-open.
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function showingAutoPopovers(host) {
|
|
23
|
+
return Array.from(host.ownerDocument.querySelectorAll('[popover="auto"], [popover=""]')).filter(element => !element.contains(host) && isPopoverShowing(element));
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
/**
|
|
14
27
|
* A press on a modal layer's backdrop targets the <dialog> root itself. A
|
|
15
28
|
* click there is also what the browser sends when a press starts on one side
|
|
@@ -17,6 +30,14 @@ import { useCallback, useRef } from 'react';
|
|
|
17
30
|
* ancestor), so a backdrop press dismisses only when its pointer-down and its
|
|
18
31
|
* pointer-up both landed on the backdrop. A cancelled pointer ends the press.
|
|
19
32
|
*
|
|
33
|
+
* A press that light-dismisses a layer open above the host, such as a menu
|
|
34
|
+
* open in the dialog, is that layer's: the host stays open, and the next
|
|
35
|
+
* backdrop press dismisses it, as a second Escape does. The press is the
|
|
36
|
+
* layer's when it closes one. A `popover="auto"` layer that showed at
|
|
37
|
+
* pointer-down no longer shows at the click, or a layer counted its close
|
|
38
|
+
* with noteOutsideDismissal. A layer that hides for another reason, such as a
|
|
39
|
+
* Tooltip whose trigger lost focus, does not count.
|
|
40
|
+
*
|
|
20
41
|
* The pointer handlers run in the capture phase. A nested layer, such as a
|
|
21
42
|
* popover open in the dialog, stops its presses at its own root, so a
|
|
22
43
|
* bubble-phase handler here does not see them.
|
|
@@ -24,9 +45,14 @@ import { useCallback, useRef } from 'react';
|
|
|
24
45
|
export function useBackdropPress(onBackdropPress, isEnabled) {
|
|
25
46
|
const startedOnBackdropRef = useRef(false);
|
|
26
47
|
const endedOnBackdropRef = useRef(false);
|
|
48
|
+
const autoPopoversRef = useRef([]);
|
|
49
|
+
const dismissalCountRef = useRef(0);
|
|
27
50
|
const onPointerDownCapture = useCallback(event => {
|
|
28
|
-
|
|
51
|
+
const isOnBackdrop = event.target === event.currentTarget;
|
|
52
|
+
startedOnBackdropRef.current = isOnBackdrop;
|
|
29
53
|
endedOnBackdropRef.current = false;
|
|
54
|
+
autoPopoversRef.current = isOnBackdrop ? showingAutoPopovers(event.currentTarget) : [];
|
|
55
|
+
dismissalCountRef.current = outsideDismissalCount(event.currentTarget.ownerDocument);
|
|
30
56
|
}, []);
|
|
31
57
|
const onPointerUpCapture = useCallback(event => {
|
|
32
58
|
endedOnBackdropRef.current = startedOnBackdropRef.current && event.target === event.currentTarget;
|
|
@@ -35,12 +61,15 @@ export function useBackdropPress(onBackdropPress, isEnabled) {
|
|
|
35
61
|
const onPointerCancelCapture = useCallback(() => {
|
|
36
62
|
startedOnBackdropRef.current = false;
|
|
37
63
|
endedOnBackdropRef.current = false;
|
|
64
|
+
autoPopoversRef.current = [];
|
|
38
65
|
}, []);
|
|
39
66
|
const onClick = useCallback(event => {
|
|
40
67
|
const pressWasOnBackdrop = endedOnBackdropRef.current;
|
|
68
|
+
const dismissedALayerAbove = autoPopoversRef.current.some(layer => !isPopoverShowing(layer)) || outsideDismissalCount(event.currentTarget.ownerDocument) !== dismissalCountRef.current;
|
|
41
69
|
startedOnBackdropRef.current = false;
|
|
42
70
|
endedOnBackdropRef.current = false;
|
|
43
|
-
|
|
71
|
+
autoPopoversRef.current = [];
|
|
72
|
+
if (isEnabled && pressWasOnBackdrop && !dismissedALayerAbove && event.target === event.currentTarget) {
|
|
44
73
|
onBackdropPress();
|
|
45
74
|
}
|
|
46
75
|
}, [isEnabled, onBackdropPress]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTouchTrigger.d.ts","sourceRoot":"","sources":["../../src/Layer/useTouchTrigger.ts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} from 'react';
|
|
47
47
|
import { currentGesture } from "./gestureCounter.js";
|
|
48
|
+
import { noteOutsideDismissal } from "./outsidePress.js";
|
|
48
49
|
import { innermostInteractive, matchesInteractiveSelectors } from "../hooks/useClickableContainer.js";
|
|
49
50
|
import { isDisabledControl } from "../utils/pressDisabled.js";
|
|
50
51
|
import { useInteractionModalityTrackingFor } from "../utils/interactionModality.js";
|
|
@@ -306,6 +307,9 @@ onReleaseInLayer) {
|
|
|
306
307
|
}
|
|
307
308
|
}
|
|
308
309
|
disarmOutsideDismiss();
|
|
310
|
+
if (target != null) {
|
|
311
|
+
noteOutsideDismissal(target.ownerDocument ?? document);
|
|
312
|
+
}
|
|
309
313
|
hideRef.current();
|
|
310
314
|
};
|
|
311
315
|
outsideListenerRef.current = handleOutsidePointerEnd;
|
|
@@ -29,8 +29,6 @@ export declare function watchResizablePanes(listener: () => void): () => void;
|
|
|
29
29
|
* The pane a resize handle resizes: the lent LayoutPanel just before it, or
|
|
30
30
|
* just after it when the region is reversed.
|
|
31
31
|
*/
|
|
32
|
-
export declare function resizablePaneBeside(handle: Element, side: 'before' | 'after'): ResizablePane | null;
|
|
33
|
-
/** The lent panel a handle sizes: before it, or after it when reversed. */
|
|
34
32
|
export declare function resizablePaneFor(handle: Element, isReversed: boolean): ResizablePane | null;
|
|
35
33
|
/**
|
|
36
34
|
* Moves a handle's hold from `held` to `next`, and returns `next`. A pane the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizablePane.d.ts","sourceRoot":"","sources":["../../src/Resizable/resizablePane.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3E;AAOD,6EAA6E;AAC7E,wBAAgB,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AI,KAAK,MAAM,IAAI,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC;IACpC,iEAAiE;IACjE,WAAW,IAAI,WAAW,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3C;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAwD3D"}
|
|
@@ -46,14 +46,9 @@ export function watchResizablePanes(listener) {
|
|
|
46
46
|
* The pane a resize handle resizes: the lent LayoutPanel just before it, or
|
|
47
47
|
* just after it when the region is reversed.
|
|
48
48
|
*/
|
|
49
|
-
export function resizablePaneBeside(handle, side) {
|
|
50
|
-
const sibling = side === 'before' ? handle.previousElementSibling : handle.nextElementSibling;
|
|
51
|
-
return sibling == null ? null : lent.get(sibling) ?? null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** The lent panel a handle sizes: before it, or after it when reversed. */
|
|
55
49
|
export function resizablePaneFor(handle, isReversed) {
|
|
56
|
-
|
|
50
|
+
const sibling = isReversed ? handle.nextElementSibling : handle.previousElementSibling;
|
|
51
|
+
return sibling == null ? null : lent.get(sibling) ?? null;
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.d.ts","sourceRoot":"","sources":["../../src/Selector/Selector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAWZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAYpD,OAAO,EAAwB,KAAK,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAoB7E,OAAO,KAAK,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,SAA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AAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IACzE,yBAAyB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AA2J3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,kBAAkB,EACnD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,qBAktCxB;yBAntCe,QAAQ"}
|
|
@@ -372,7 +372,7 @@ const SelectorOptionRow = /*#__PURE__*/memo(function SelectorOptionRow({
|
|
|
372
372
|
"aria-selected": isSelected,
|
|
373
373
|
"aria-disabled": item.disabled,
|
|
374
374
|
onClick: () => onSelect(item),
|
|
375
|
-
onMouseEnter: () => onHover(item, flatIndex),
|
|
375
|
+
onMouseEnter: () => onHover(item, flatIndex, isHighlighted),
|
|
376
376
|
...mergeProps(
|
|
377
377
|
// Stable theme target on the option row itself, mirroring
|
|
378
378
|
// `multi-selector-option`: it carries the row's size and runtime
|
|
@@ -814,12 +814,27 @@ export function Selector(props) {
|
|
|
814
814
|
|
|
815
815
|
// Only after keyboard input does the active option draw the focus ring; a
|
|
816
816
|
// pointer highlight keeps the fill alone, as a focused menu row does.
|
|
817
|
+
// Modality changes only on a key or a press, so a hover alone still reads
|
|
818
|
+
// as keyboard. The option the mouse enters therefore draws no ring until a
|
|
819
|
+
// key moves the highlight again. Entering the option that is already
|
|
820
|
+
// active, as when a key scrolls it under a still mouse, changes nothing.
|
|
821
|
+
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
822
|
+
const keyDownAfterHover = useCallback(e => {
|
|
823
|
+
setHoveredIndex(null);
|
|
824
|
+
comboboxKeyDown(e);
|
|
825
|
+
}, [comboboxKeyDown]);
|
|
826
|
+
const mouseEnterOption = useCallback((item, index, isActive) => {
|
|
827
|
+
if (!isActive) {
|
|
828
|
+
setHoveredIndex(index);
|
|
829
|
+
}
|
|
830
|
+
comboboxItemMouseEnter(item, index);
|
|
831
|
+
}, [comboboxItemMouseEnter]);
|
|
817
832
|
const {
|
|
818
833
|
isKeyboardHighlight: isHighlightFromKeyboard,
|
|
819
834
|
noteHighlightMove,
|
|
820
835
|
onKeyDown,
|
|
821
836
|
onItemMouseEnter
|
|
822
|
-
} = useKeyboardHighlight(triggerModality.readModality,
|
|
837
|
+
} = useKeyboardHighlight(triggerModality.readModality, keyDownAfterHover, mouseEnterOption);
|
|
823
838
|
const onTriggerClick = useCallback(() => {
|
|
824
839
|
comboboxTriggerClick();
|
|
825
840
|
noteHighlightMove();
|
|
@@ -878,7 +893,8 @@ export function Selector(props) {
|
|
|
878
893
|
const index = optionIndexFromRow(row);
|
|
879
894
|
const item = filteredItems[index];
|
|
880
895
|
if (item != null) {
|
|
881
|
-
|
|
896
|
+
// A press is pointer input, even on the active option.
|
|
897
|
+
onItemMouseEnter(item, index, false);
|
|
882
898
|
}
|
|
883
899
|
},
|
|
884
900
|
onActivate: row => {
|
|
@@ -894,6 +910,7 @@ export function Selector(props) {
|
|
|
894
910
|
return;
|
|
895
911
|
}
|
|
896
912
|
noteHighlightMove();
|
|
913
|
+
setHoveredIndex(null);
|
|
897
914
|
// With hasSearch the query input owns typing, so type-to-select is off.
|
|
898
915
|
if (!hasSearch && typeahead.onKeyDown(e)) {
|
|
899
916
|
e.preventDefault();
|
|
@@ -1006,7 +1023,7 @@ export function Selector(props) {
|
|
|
1006
1023
|
flatIndex: flatIndex,
|
|
1007
1024
|
id: getItemId(flatIndex),
|
|
1008
1025
|
isHighlighted: flatIndex === highlightedIndex,
|
|
1009
|
-
isKeyboardHighlighted: flatIndex === highlightedIndex && isHighlightFromKeyboard,
|
|
1026
|
+
isKeyboardHighlighted: flatIndex === highlightedIndex && isHighlightFromKeyboard && flatIndex !== hoveredIndex,
|
|
1010
1027
|
isSelected: item.value === normalizedValue,
|
|
1011
1028
|
size: size,
|
|
1012
1029
|
indicatorPosition: indicatorPosition,
|
|
@@ -1014,7 +1031,7 @@ export function Selector(props) {
|
|
|
1014
1031
|
SelectionMark: SelectionMark,
|
|
1015
1032
|
onSelect: onItemSelect,
|
|
1016
1033
|
onHover: onItemMouseEnter
|
|
1017
|
-
}, item.value), [renderOption, indicatorPosition, highlightedIndex, isHighlightFromKeyboard, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter, SelectionMark]);
|
|
1034
|
+
}, item.value), [renderOption, indicatorPosition, highlightedIndex, isHighlightFromKeyboard, hoveredIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter, SelectionMark]);
|
|
1018
1035
|
|
|
1019
1036
|
// Render all options (handling sections/dividers)
|
|
1020
1037
|
const renderOptions = useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNav.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACrC,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAmUnC,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC1D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,KAAK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ACrB,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,+BA+gBd;yBA9hBe,OAAO"}
|
package/dist/SideNav/SideNav.js
CHANGED
|
@@ -282,8 +282,6 @@ export function SideNav({
|
|
|
282
282
|
onSizeChange: resizableConfig.onWidthChange,
|
|
283
283
|
onCollapseChange: onCollapsedChange
|
|
284
284
|
});
|
|
285
|
-
|
|
286
|
-
// The region that sizes the rail: the caller's, or SideNav's own.
|
|
287
285
|
const region = ownerRegion ?? resizableHook;
|
|
288
286
|
const collapsed = region.isCollapsed;
|
|
289
287
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../src/TabList/Tab.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAYzD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../src/TabList/Tab.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAYzD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AASrD,MAAM,WAAW,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC5D;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AA2KD;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,EAClB,EAAE,EACF,GAAG,EACH,KAAK,EACL,KAAK,EACL,aAAqB,EACrB,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,GAAG,SAAS,EACb,EAAE,QAAQ,qBAuLV;yBAvMe,GAAG"}
|
package/dist/TabList/Tab.js
CHANGED
|
@@ -28,6 +28,7 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
28
28
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
29
29
|
import { mergeProps } from "../utils/index.js";
|
|
30
30
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
31
|
+
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
31
32
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
32
33
|
import { themeProps } from "../utils/themeProps.js";
|
|
33
34
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -216,7 +217,10 @@ export function Tab({
|
|
|
216
217
|
children: displayIcon
|
|
217
218
|
}) : null;
|
|
218
219
|
const sharedProps = {
|
|
219
|
-
|
|
220
|
+
// A disabled tab keeps its tab stop, so the browser still sends it events.
|
|
221
|
+
// It runs no caller handler other than `onFocus` and `onBlur`, as a natively
|
|
222
|
+
// disabled control runs none. `onClick` is guarded in `handleSelect`.
|
|
223
|
+
...withholdCallerHandlers(restProps, isDisabled),
|
|
220
224
|
...pressable,
|
|
221
225
|
...(isLabelHidden ? {
|
|
222
226
|
'aria-label': label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/useTooltip.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA+ClC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,aAAa,EAAE,CACb,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wBAAgB,UAAU,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAqsBtE"}
|
|
@@ -21,6 +21,7 @@ import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
|
21
21
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
22
22
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
23
23
|
import { registerLayerSurface } from "../Layer/layerSurfacePress.js";
|
|
24
|
+
import { noteOutsideDismissal } from "../Layer/outsidePress.js";
|
|
24
25
|
import { useLayerDismissal } from "../Layer/useLayerDismissal.js";
|
|
25
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
26
27
|
import "../theme/tokens.stylex.js";
|
|
@@ -255,6 +256,7 @@ export function useTooltip(options = {}) {
|
|
|
255
256
|
if (trigger?.contains(next) === true || surface?.contains(next) === true) {
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
259
|
+
noteOutsideDismissal(view.document);
|
|
258
260
|
releaseHold();
|
|
259
261
|
}, [isHeldOpen, layerId, releaseHold]);
|
|
260
262
|
const isHoldShown = isHeldState && isLayerOpen && isOpen !== false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTypeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/BaseTypeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseTypeahead.d.ts","sourceRoot":"","sources":["../../src/Typeahead/BaseTypeahead.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAiCnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAgB,cAAc,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAmBzE,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,IAAI,CACxE,SAAS,CAAC,WAAW,CAAC,EACtB,UAAU,CACX;IACC,GAAG,C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IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAE3B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AA8MD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,EA+1CrB,CAAC,CAAC,SAAS,cAAc,EAC5B,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KACzB,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -29,7 +29,7 @@ import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
|
29
29
|
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
30
30
|
import { useHighlightedOptionScroll } from "../hooks/useHighlightedOptionScroll.js";
|
|
31
31
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
32
|
-
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, useOutsidePress } from "../Layer/outsidePress.js";
|
|
32
|
+
import { isFocusInsideOwnedLayer, isPressInsideOwnedLayer, noteOutsideDismissal, useOutsidePress } from "../Layer/outsidePress.js";
|
|
33
33
|
import { isImeKeyEvent } from "../utils/ime.js";
|
|
34
34
|
import { TypeaheadItem } from "./TypeaheadItem.js";
|
|
35
35
|
import { Icon } from "../Icon/index.js";
|
|
@@ -1024,6 +1024,7 @@ export const BaseTypeahead = function BaseTypeahead({
|
|
|
1024
1024
|
if (isFocusInsideOwnedLayer(e.relatedTarget, anchorEl, popover.id)) {
|
|
1025
1025
|
return;
|
|
1026
1026
|
}
|
|
1027
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
1027
1028
|
popover.hide();
|
|
1028
1029
|
}, [popover, anchorRef]);
|
|
1029
1030
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.9-canary.
|
|
3
|
+
"version": "0.7.9-canary.20febb3",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -880,9 +880,9 @@
|
|
|
880
880
|
"react-dom": ">=19.0.0"
|
|
881
881
|
},
|
|
882
882
|
"devDependencies": {
|
|
883
|
-
"@astryxdesign/a11y-spec": "0.7.9-canary.
|
|
884
|
-
"@astryxdesign/cli": "0.7.9-canary.
|
|
885
|
-
"@astryxdesign/interaction-harness": "0.7.9-canary.
|
|
883
|
+
"@astryxdesign/a11y-spec": "0.7.9-canary.20febb3",
|
|
884
|
+
"@astryxdesign/cli": "0.7.9-canary.20febb3",
|
|
885
|
+
"@astryxdesign/interaction-harness": "0.7.9-canary.20febb3",
|
|
886
886
|
"@babel/cli": "^7.29.7",
|
|
887
887
|
"@babel/core": "^7.29.7",
|
|
888
888
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -59,6 +59,7 @@ import {useLayerInternal} from '../Layer/useLayer';
|
|
|
59
59
|
import {LayerDepthProvider} from '../Layer/LayerDepthContext';
|
|
60
60
|
import {useLayerDismissal} from '../Layer/useLayerDismissal';
|
|
61
61
|
import {currentGesture} from '../Layer/gestureCounter';
|
|
62
|
+
import {noteOutsideDismissal} from '../Layer/outsidePress';
|
|
62
63
|
import {MenuBottomSheetActionList} from '../DropdownMenu/MenuBottomSheetActionList';
|
|
63
64
|
import {menuBottomSheetStyles} from '../DropdownMenu/menuBottomSheet.stylex';
|
|
64
65
|
import {renderDropdownItems} from '../DropdownMenu/renderDropdownItems';
|
|
@@ -531,6 +532,7 @@ export function ContextMenu({
|
|
|
531
532
|
return;
|
|
532
533
|
}
|
|
533
534
|
if (menu && !menu.contains(e.target as Node)) {
|
|
535
|
+
noteOutsideDismissal(menu.ownerDocument);
|
|
534
536
|
closeMenu();
|
|
535
537
|
}
|
|
536
538
|
};
|
|
@@ -65,6 +65,7 @@ import {usePopover} from '../Popover';
|
|
|
65
65
|
import {
|
|
66
66
|
isFocusInsideOwnedLayer,
|
|
67
67
|
isPressInsideOwnedLayer,
|
|
68
|
+
noteOutsideDismissal,
|
|
68
69
|
useOutsidePress,
|
|
69
70
|
} from '../Layer/outsidePress';
|
|
70
71
|
import {NativeDateField} from './NativeDateField';
|
|
@@ -818,6 +819,7 @@ function PointerDateField({
|
|
|
818
819
|
return;
|
|
819
820
|
}
|
|
820
821
|
isFocusMovingAwayRef.current = true;
|
|
822
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
821
823
|
popover.hide();
|
|
822
824
|
},
|
|
823
825
|
[popover],
|
|
@@ -67,6 +67,7 @@ import {usePopover} from '../Popover';
|
|
|
67
67
|
import {
|
|
68
68
|
isFocusInsideOwnedLayer,
|
|
69
69
|
isPressInsideOwnedLayer,
|
|
70
|
+
noteOutsideDismissal,
|
|
70
71
|
useOutsidePress,
|
|
71
72
|
} from '../Layer/outsidePress';
|
|
72
73
|
import {useTooltip} from '../Tooltip';
|
|
@@ -1435,6 +1436,7 @@ function PointerDateTimeField({
|
|
|
1435
1436
|
timePopover.id,
|
|
1436
1437
|
)
|
|
1437
1438
|
) {
|
|
1439
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
1438
1440
|
timePopover.hide();
|
|
1439
1441
|
}
|
|
1440
1442
|
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* @file outsidePress.ts
|
|
7
7
|
* @input Listens for pointerdown, pointerup and pointercancel on a document
|
|
8
8
|
* @output Exports watchOutsidePress and useOutsidePress, which owns one watch
|
|
9
|
-
* for a component: start on show, stop on hide, stop on unmount;
|
|
9
|
+
* for a component: start on show, stop on hide, stop on unmount;
|
|
10
|
+
* noteOutsideDismissal and outsideDismissalCount, a per-document count of
|
|
11
|
+
* layers that an outside press or focus move closed; and the
|
|
10
12
|
* inside tests a text field's owner runs: isPressInsideOwnedLayer for a
|
|
11
13
|
* press, isFocusInsideOwnedLayer for a blur
|
|
12
14
|
* @position Internal to Layer; the outside-press dismissal for a manual
|
|
@@ -23,6 +25,20 @@
|
|
|
23
25
|
|
|
24
26
|
import {useCallback, useEffect, useMemo, useRef} from 'react';
|
|
25
27
|
|
|
28
|
+
// A modal host's backdrop press reads this. A press that closed a layer above
|
|
29
|
+
// the host is that layer's, so the host stays open.
|
|
30
|
+
const outsideDismissals = new WeakMap<Document, number>();
|
|
31
|
+
|
|
32
|
+
/** Records that a layer in `doc` is closing because a press or focus went outside it. */
|
|
33
|
+
export function noteOutsideDismissal(doc: Document): void {
|
|
34
|
+
outsideDismissals.set(doc, (outsideDismissals.get(doc) ?? 0) + 1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** How many layers an outside press has closed in `doc` so far. */
|
|
38
|
+
export function outsideDismissalCount(doc: Document): number {
|
|
39
|
+
return outsideDismissals.get(doc) ?? 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
26
42
|
/**
|
|
27
43
|
* Watch the owner's document for a press outside, until the returned function
|
|
28
44
|
* is called. The caller stops it when its layer hides and when it unmounts.
|
|
@@ -49,6 +65,7 @@ export function watchOutsidePress(
|
|
|
49
65
|
const wasOutside = startedOutside;
|
|
50
66
|
startedOutside = false;
|
|
51
67
|
if (wasOutside && !isInside(event.composedPath())) {
|
|
68
|
+
noteOutsideDismissal(doc);
|
|
52
69
|
onOutside();
|
|
53
70
|
}
|
|
54
71
|
};
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {useCallback, useRef, type PointerEvent, type MouseEvent} from 'react';
|
|
14
|
+
import {outsideDismissalCount} from './outsidePress';
|
|
14
15
|
|
|
15
16
|
export interface BackdropPressHandlers {
|
|
16
17
|
onPointerDownCapture: (event: PointerEvent<HTMLElement>) => void;
|
|
@@ -19,6 +20,21 @@ export interface BackdropPressHandlers {
|
|
|
19
20
|
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
function isPopoverShowing(element: Element): boolean {
|
|
24
|
+
try {
|
|
25
|
+
return element.matches(':popover-open');
|
|
26
|
+
} catch {
|
|
27
|
+
// jsdom and pre-Popover browsers do not recognize :popover-open.
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function showingAutoPopovers(host: HTMLElement): ReadonlyArray<Element> {
|
|
33
|
+
return Array.from(
|
|
34
|
+
host.ownerDocument.querySelectorAll('[popover="auto"], [popover=""]'),
|
|
35
|
+
).filter(element => !element.contains(host) && isPopoverShowing(element));
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
/**
|
|
23
39
|
* A press on a modal layer's backdrop targets the <dialog> root itself. A
|
|
24
40
|
* click there is also what the browser sends when a press starts on one side
|
|
@@ -26,6 +42,14 @@ export interface BackdropPressHandlers {
|
|
|
26
42
|
* ancestor), so a backdrop press dismisses only when its pointer-down and its
|
|
27
43
|
* pointer-up both landed on the backdrop. A cancelled pointer ends the press.
|
|
28
44
|
*
|
|
45
|
+
* A press that light-dismisses a layer open above the host, such as a menu
|
|
46
|
+
* open in the dialog, is that layer's: the host stays open, and the next
|
|
47
|
+
* backdrop press dismisses it, as a second Escape does. The press is the
|
|
48
|
+
* layer's when it closes one. A `popover="auto"` layer that showed at
|
|
49
|
+
* pointer-down no longer shows at the click, or a layer counted its close
|
|
50
|
+
* with noteOutsideDismissal. A layer that hides for another reason, such as a
|
|
51
|
+
* Tooltip whose trigger lost focus, does not count.
|
|
52
|
+
*
|
|
29
53
|
* The pointer handlers run in the capture phase. A nested layer, such as a
|
|
30
54
|
* popover open in the dialog, stops its presses at its own root, so a
|
|
31
55
|
* bubble-phase handler here does not see them.
|
|
@@ -36,11 +60,20 @@ export function useBackdropPress(
|
|
|
36
60
|
): BackdropPressHandlers {
|
|
37
61
|
const startedOnBackdropRef = useRef(false);
|
|
38
62
|
const endedOnBackdropRef = useRef(false);
|
|
63
|
+
const autoPopoversRef = useRef<ReadonlyArray<Element>>([]);
|
|
64
|
+
const dismissalCountRef = useRef(0);
|
|
39
65
|
|
|
40
66
|
const onPointerDownCapture = useCallback(
|
|
41
67
|
(event: PointerEvent<HTMLElement>) => {
|
|
42
|
-
|
|
68
|
+
const isOnBackdrop = event.target === event.currentTarget;
|
|
69
|
+
startedOnBackdropRef.current = isOnBackdrop;
|
|
43
70
|
endedOnBackdropRef.current = false;
|
|
71
|
+
autoPopoversRef.current = isOnBackdrop
|
|
72
|
+
? showingAutoPopovers(event.currentTarget)
|
|
73
|
+
: [];
|
|
74
|
+
dismissalCountRef.current = outsideDismissalCount(
|
|
75
|
+
event.currentTarget.ownerDocument,
|
|
76
|
+
);
|
|
44
77
|
},
|
|
45
78
|
[],
|
|
46
79
|
);
|
|
@@ -54,16 +87,23 @@ export function useBackdropPress(
|
|
|
54
87
|
const onPointerCancelCapture = useCallback(() => {
|
|
55
88
|
startedOnBackdropRef.current = false;
|
|
56
89
|
endedOnBackdropRef.current = false;
|
|
90
|
+
autoPopoversRef.current = [];
|
|
57
91
|
}, []);
|
|
58
92
|
|
|
59
93
|
const onClick = useCallback(
|
|
60
94
|
(event: MouseEvent<HTMLElement>) => {
|
|
61
95
|
const pressWasOnBackdrop = endedOnBackdropRef.current;
|
|
96
|
+
const dismissedALayerAbove =
|
|
97
|
+
autoPopoversRef.current.some(layer => !isPopoverShowing(layer)) ||
|
|
98
|
+
outsideDismissalCount(event.currentTarget.ownerDocument) !==
|
|
99
|
+
dismissalCountRef.current;
|
|
62
100
|
startedOnBackdropRef.current = false;
|
|
63
101
|
endedOnBackdropRef.current = false;
|
|
102
|
+
autoPopoversRef.current = [];
|
|
64
103
|
if (
|
|
65
104
|
isEnabled &&
|
|
66
105
|
pressWasOnBackdrop &&
|
|
106
|
+
!dismissedALayerAbove &&
|
|
67
107
|
event.target === event.currentTarget
|
|
68
108
|
) {
|
|
69
109
|
onBackdropPress();
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
type RefObject,
|
|
54
54
|
} from 'react';
|
|
55
55
|
import {currentGesture} from './gestureCounter';
|
|
56
|
+
import {noteOutsideDismissal} from './outsidePress';
|
|
56
57
|
import {
|
|
57
58
|
innermostInteractive,
|
|
58
59
|
matchesInteractiveSelectors,
|
|
@@ -436,6 +437,9 @@ export function useTouchTriggerInternal(
|
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
439
|
disarmOutsideDismiss();
|
|
440
|
+
if (target != null) {
|
|
441
|
+
noteOutsideDismissal(target.ownerDocument ?? document);
|
|
442
|
+
}
|
|
439
443
|
hideRef.current();
|
|
440
444
|
};
|
|
441
445
|
|
|
@@ -56,23 +56,14 @@ export function watchResizablePanes(listener: () => void): () => void {
|
|
|
56
56
|
* The pane a resize handle resizes: the lent LayoutPanel just before it, or
|
|
57
57
|
* just after it when the region is reversed.
|
|
58
58
|
*/
|
|
59
|
-
export function resizablePaneBeside(
|
|
60
|
-
handle: Element,
|
|
61
|
-
side: 'before' | 'after',
|
|
62
|
-
): ResizablePane | null {
|
|
63
|
-
const sibling =
|
|
64
|
-
side === 'before'
|
|
65
|
-
? handle.previousElementSibling
|
|
66
|
-
: handle.nextElementSibling;
|
|
67
|
-
return sibling == null ? null : (lent.get(sibling) ?? null);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** The lent panel a handle sizes: before it, or after it when reversed. */
|
|
71
59
|
export function resizablePaneFor(
|
|
72
60
|
handle: Element,
|
|
73
61
|
isReversed: boolean,
|
|
74
62
|
): ResizablePane | null {
|
|
75
|
-
|
|
63
|
+
const sibling = isReversed
|
|
64
|
+
? handle.nextElementSibling
|
|
65
|
+
: handle.previousElementSibling;
|
|
66
|
+
return sibling == null ? null : (lent.get(sibling) ?? null);
|
|
76
67
|
}
|
|
77
68
|
|
|
78
69
|
/**
|
|
@@ -939,7 +939,12 @@ interface SelectorOptionRowProps {
|
|
|
939
939
|
renderOption: ((option: SelectorOptionData) => ReactNode) | undefined;
|
|
940
940
|
SelectionMark: IndicatorComponent<IndicatorMap['check']>;
|
|
941
941
|
onSelect: (item: SelectorOptionData) => void;
|
|
942
|
-
|
|
942
|
+
/** `isActive`: the option was already the highlighted one when entered. */
|
|
943
|
+
onHover: (
|
|
944
|
+
item: SelectorOptionData,
|
|
945
|
+
flatIndex: number,
|
|
946
|
+
isActive: boolean,
|
|
947
|
+
) => void;
|
|
943
948
|
}
|
|
944
949
|
|
|
945
950
|
/**
|
|
@@ -993,7 +998,7 @@ const SelectorOptionRow = memo(function SelectorOptionRow({
|
|
|
993
998
|
aria-selected={isSelected}
|
|
994
999
|
aria-disabled={item.disabled}
|
|
995
1000
|
onClick={() => onSelect(item)}
|
|
996
|
-
onMouseEnter={() => onHover(item, flatIndex)}
|
|
1001
|
+
onMouseEnter={() => onHover(item, flatIndex, isHighlighted)}
|
|
997
1002
|
{...mergeProps(
|
|
998
1003
|
// Stable theme target on the option row itself, mirroring
|
|
999
1004
|
// `multi-selector-option`: it carries the row's size and runtime
|
|
@@ -1521,6 +1526,27 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1521
1526
|
|
|
1522
1527
|
// Only after keyboard input does the active option draw the focus ring; a
|
|
1523
1528
|
// pointer highlight keeps the fill alone, as a focused menu row does.
|
|
1529
|
+
// Modality changes only on a key or a press, so a hover alone still reads
|
|
1530
|
+
// as keyboard. The option the mouse enters therefore draws no ring until a
|
|
1531
|
+
// key moves the highlight again. Entering the option that is already
|
|
1532
|
+
// active, as when a key scrolls it under a still mouse, changes nothing.
|
|
1533
|
+
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
|
|
1534
|
+
const keyDownAfterHover = useCallback(
|
|
1535
|
+
(e: React.KeyboardEvent) => {
|
|
1536
|
+
setHoveredIndex(null);
|
|
1537
|
+
comboboxKeyDown(e);
|
|
1538
|
+
},
|
|
1539
|
+
[comboboxKeyDown],
|
|
1540
|
+
);
|
|
1541
|
+
const mouseEnterOption = useCallback(
|
|
1542
|
+
(item: SelectorOptionData, index: number, isActive: boolean) => {
|
|
1543
|
+
if (!isActive) {
|
|
1544
|
+
setHoveredIndex(index);
|
|
1545
|
+
}
|
|
1546
|
+
comboboxItemMouseEnter(item, index);
|
|
1547
|
+
},
|
|
1548
|
+
[comboboxItemMouseEnter],
|
|
1549
|
+
);
|
|
1524
1550
|
const {
|
|
1525
1551
|
isKeyboardHighlight: isHighlightFromKeyboard,
|
|
1526
1552
|
noteHighlightMove,
|
|
@@ -1528,8 +1554,8 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1528
1554
|
onItemMouseEnter,
|
|
1529
1555
|
} = useKeyboardHighlight(
|
|
1530
1556
|
triggerModality.readModality,
|
|
1531
|
-
|
|
1532
|
-
|
|
1557
|
+
keyDownAfterHover,
|
|
1558
|
+
mouseEnterOption,
|
|
1533
1559
|
);
|
|
1534
1560
|
const onTriggerClick = useCallback(() => {
|
|
1535
1561
|
comboboxTriggerClick();
|
|
@@ -1595,7 +1621,8 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1595
1621
|
const index = optionIndexFromRow(row);
|
|
1596
1622
|
const item = filteredItems[index];
|
|
1597
1623
|
if (item != null) {
|
|
1598
|
-
|
|
1624
|
+
// A press is pointer input, even on the active option.
|
|
1625
|
+
onItemMouseEnter(item, index, false);
|
|
1599
1626
|
}
|
|
1600
1627
|
},
|
|
1601
1628
|
onActivate: row => {
|
|
@@ -1613,6 +1640,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1613
1640
|
return;
|
|
1614
1641
|
}
|
|
1615
1642
|
noteHighlightMove();
|
|
1643
|
+
setHoveredIndex(null);
|
|
1616
1644
|
// With hasSearch the query input owns typing, so type-to-select is off.
|
|
1617
1645
|
if (!hasSearch && typeahead.onKeyDown(e)) {
|
|
1618
1646
|
e.preventDefault();
|
|
@@ -1770,7 +1798,9 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1770
1798
|
id={getItemId(flatIndex)}
|
|
1771
1799
|
isHighlighted={flatIndex === highlightedIndex}
|
|
1772
1800
|
isKeyboardHighlighted={
|
|
1773
|
-
flatIndex === highlightedIndex &&
|
|
1801
|
+
flatIndex === highlightedIndex &&
|
|
1802
|
+
isHighlightFromKeyboard &&
|
|
1803
|
+
flatIndex !== hoveredIndex
|
|
1774
1804
|
}
|
|
1775
1805
|
isSelected={item.value === normalizedValue}
|
|
1776
1806
|
size={size}
|
|
@@ -1786,6 +1816,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1786
1816
|
indicatorPosition,
|
|
1787
1817
|
highlightedIndex,
|
|
1788
1818
|
isHighlightFromKeyboard,
|
|
1819
|
+
hoveredIndex,
|
|
1789
1820
|
size,
|
|
1790
1821
|
normalizedValue,
|
|
1791
1822
|
getItemId,
|
package/src/SideNav/SideNav.tsx
CHANGED
package/src/TabList/Tab.tsx
CHANGED
|
@@ -39,6 +39,7 @@ import {useLinkComponent} from '../Link/useLinkComponent';
|
|
|
39
39
|
import type {LinkComponentType} from '../Link/types';
|
|
40
40
|
import {mergeProps} from '../utils';
|
|
41
41
|
import {useDevWarning} from '../hooks/useDevWarning';
|
|
42
|
+
import {withholdCallerHandlers} from '../utils/disabledInteraction';
|
|
42
43
|
import {EDGE_COMP_ATTR} from '../Layout/edgeCompensation.stylex';
|
|
43
44
|
import {themeProps} from '../utils/themeProps';
|
|
44
45
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
@@ -362,7 +363,10 @@ export function Tab({
|
|
|
362
363
|
) : null;
|
|
363
364
|
|
|
364
365
|
const sharedProps = {
|
|
365
|
-
|
|
366
|
+
// A disabled tab keeps its tab stop, so the browser still sends it events.
|
|
367
|
+
// It runs no caller handler other than `onFocus` and `onBlur`, as a natively
|
|
368
|
+
// disabled control runs none. `onClick` is guarded in `handleSelect`.
|
|
369
|
+
...withholdCallerHandlers(restProps, isDisabled),
|
|
366
370
|
...pressable,
|
|
367
371
|
...(isLabelHidden ? {'aria-label': label} : {}),
|
|
368
372
|
[EDGE_COMP_ATTR]: '',
|
|
@@ -37,6 +37,7 @@ import {useAnnounceRenderedText} from '../hooks/useAnnounceRenderedText';
|
|
|
37
37
|
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
38
38
|
import {layerAnimations} from '../Layer/layerAnimations.stylex';
|
|
39
39
|
import {registerLayerSurface} from '../Layer/layerSurfacePress';
|
|
40
|
+
import {noteOutsideDismissal} from '../Layer/outsidePress';
|
|
40
41
|
import {useLayerDismissal} from '../Layer/useLayerDismissal';
|
|
41
42
|
import {themeProps} from '../utils/themeProps';
|
|
42
43
|
import {
|
|
@@ -451,6 +452,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
451
452
|
) {
|
|
452
453
|
return;
|
|
453
454
|
}
|
|
455
|
+
noteOutsideDismissal(view.document);
|
|
454
456
|
releaseHold();
|
|
455
457
|
},
|
|
456
458
|
[isHeldOpen, layerId, releaseHold],
|
|
@@ -44,6 +44,7 @@ import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
|
44
44
|
import {
|
|
45
45
|
isFocusInsideOwnedLayer,
|
|
46
46
|
isPressInsideOwnedLayer,
|
|
47
|
+
noteOutsideDismissal,
|
|
47
48
|
useOutsidePress,
|
|
48
49
|
} from '../Layer/outsidePress';
|
|
49
50
|
import {isImeKeyEvent} from '../utils/ime';
|
|
@@ -1473,6 +1474,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
1473
1474
|
if (isFocusInsideOwnedLayer(e.relatedTarget, anchorEl, popover.id)) {
|
|
1474
1475
|
return;
|
|
1475
1476
|
}
|
|
1477
|
+
noteOutsideDismissal(e.currentTarget.ownerDocument);
|
|
1476
1478
|
popover.hide();
|
|
1477
1479
|
},
|
|
1478
1480
|
[popover, anchorRef],
|