@charcuterie/ui 4.7.0 → 4.8.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/dist/Menu/Menu.d.ts +66 -5
- package/dist/Menu/Menu.d.ts.map +1 -1
- package/dist/Menu/Menu.js +25 -3
- package/dist/Menu/Menu.js.map +1 -1
- package/dist/Overlay/useAnchoredOverlay.d.ts +17 -2
- package/dist/Overlay/useAnchoredOverlay.d.ts.map +1 -1
- package/dist/Overlay/useAnchoredOverlay.js +30 -8
- package/dist/Overlay/useAnchoredOverlay.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/testing/expectAgentDrivable.d.ts +1 -1
- package/dist/testing/expectAgentDrivable.js +1 -1
- package/package.json +4 -4
- package/src/Menu/Menu.mdx +36 -0
- package/src/Menu/Menu.stories.tsx +99 -1
- package/src/Menu/Menu.test.tsx +120 -0
- package/src/Menu/Menu.tsx +89 -4
- package/src/Overlay/useAnchoredOverlay.ts +53 -10
- package/src/Toast/Toast.mdx +1 -1
- package/src/index.ts +6 -0
- package/src/testing/expectAgentDrivable.ts +1 -1
package/dist/Menu/Menu.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ControlSize } from "@charcuterie/tokens";
|
|
2
2
|
import type { Placement } from "@floating-ui/react";
|
|
3
|
-
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { ReactElement, ReactNode, RefObject } from "react";
|
|
4
|
+
import type { AnchoredOverlayAnchor } from "../Overlay/useAnchoredOverlay.ts";
|
|
4
5
|
export type MenuItem = {
|
|
5
6
|
icon?: ReactNode;
|
|
6
7
|
isDisabled?: boolean;
|
|
@@ -42,7 +43,46 @@ export type MenuGroup = {
|
|
|
42
43
|
* `group` opts in by its `type`.
|
|
43
44
|
*/
|
|
44
45
|
export type MenuEntry = MenuGroup | MenuItem | MenuSeparator;
|
|
45
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The two ways a menu can be summoned, and they are mutually
|
|
48
|
+
* exclusive at the type level rather than by a note nobody reads.
|
|
49
|
+
*
|
|
50
|
+
* **Trigger mode** is the menu button: the control is cloned, it
|
|
51
|
+
* gains `aria-haspopup`/`aria-expanded`, and it **names the
|
|
52
|
+
* panel** through `aria-labelledby` — which is why there is no
|
|
53
|
+
* `label` prop here and why adding one did nothing (see the
|
|
54
|
+
* component's own notes).
|
|
55
|
+
*
|
|
56
|
+
* **Anchor mode** has no trigger at all. It is the context menu:
|
|
57
|
+
* summoned by a gesture over a surface, positioned against an
|
|
58
|
+
* element or a bare point. Nothing names it, so `label` stops
|
|
59
|
+
* being inert and becomes **required** — a `role="menu"` that no
|
|
60
|
+
* `aria-labelledby` reaches is an unnamed menu, and a screen
|
|
61
|
+
* reader announces "menu, 4 items" with no idea what of.
|
|
62
|
+
*/
|
|
63
|
+
type MenuAnchorProps = {
|
|
64
|
+
/**
|
|
65
|
+
* What the panel hangs off: the pressed element, or a virtual
|
|
66
|
+
* element holding the point that was pressed
|
|
67
|
+
* (`AnchoredOverlayAnchor`). Read when the menu becomes
|
|
68
|
+
* visible, so the same ref can be re-aimed before each open.
|
|
69
|
+
*/
|
|
70
|
+
anchorRef: RefObject<AnchoredOverlayAnchor | null>;
|
|
71
|
+
/** Names the panel. Required here; see above. */
|
|
72
|
+
label: string;
|
|
73
|
+
trigger?: never;
|
|
74
|
+
};
|
|
75
|
+
type MenuTriggerProps = {
|
|
76
|
+
anchorRef?: never;
|
|
77
|
+
/**
|
|
78
|
+
* Absent on purpose. The trigger names the panel, and a `label`
|
|
79
|
+
* here would be silently discarded by `aria-labelledby`.
|
|
80
|
+
*/
|
|
81
|
+
label?: never;
|
|
82
|
+
/** The control the menu hangs off. **Cloned, not wrapped.** */
|
|
83
|
+
trigger: ReactElement;
|
|
84
|
+
};
|
|
85
|
+
type MenuBaseProps = {
|
|
46
86
|
className?: string;
|
|
47
87
|
/**
|
|
48
88
|
* Shown when there is no item to show — a `group` with no members
|
|
@@ -70,9 +110,8 @@ export type MenuProps = {
|
|
|
70
110
|
/** Outside press, Escape, and choosing an item all land here. */
|
|
71
111
|
onDismiss: () => void;
|
|
72
112
|
placement?: Placement;
|
|
73
|
-
/** The control the menu hangs off. **Cloned, not wrapped.** */
|
|
74
|
-
trigger: ReactElement;
|
|
75
113
|
};
|
|
114
|
+
export type MenuProps = MenuBaseProps & (MenuAnchorProps | MenuTriggerProps);
|
|
76
115
|
/**
|
|
77
116
|
* A menu is **not** a listbox, and mux-magic's `TypePicker` is the
|
|
78
117
|
* fleet's one attempt at telling them apart — it renders
|
|
@@ -141,6 +180,27 @@ export type MenuProps = {
|
|
|
141
180
|
* note has to be one, `aria-disabled` and out of the roving group:
|
|
142
181
|
* announced as "No actions available, dimmed", focusable by nothing.
|
|
143
182
|
*
|
|
183
|
+
* ### Anchor mode: the same menu, summoned by a gesture
|
|
184
|
+
*
|
|
185
|
+
* A context menu is this component with its trigger taken away.
|
|
186
|
+
* `anchorRef` replaces it — pointing at the pressed element, or at
|
|
187
|
+
* a **virtual** element that is only a rectangle, which is how the
|
|
188
|
+
* panel opens at the finger rather than at the corner of the card
|
|
189
|
+
* underneath. `useLongPress` in `@charcuterie/logic` is the other
|
|
190
|
+
* half; it hands back the point.
|
|
191
|
+
*
|
|
192
|
+
* One thing changes with the trigger gone, and it is the a11y
|
|
193
|
+
* half: nothing names the panel any more, so `label` becomes
|
|
194
|
+
* **required** in this mode and inert in the other. That is the
|
|
195
|
+
* narrowed M3/M4 rule read the other way round — an overlay with
|
|
196
|
+
* no trigger relationship needs its own name, and this is a menu
|
|
197
|
+
* that has none.
|
|
198
|
+
*
|
|
199
|
+
* Dismissal needs no special case. floating-ui's outside-press
|
|
200
|
+
* watches `pointerdown`, and the press that opened a context menu
|
|
201
|
+
* is over before the panel exists, so it cannot close itself on
|
|
202
|
+
* the way in.
|
|
203
|
+
*
|
|
144
204
|
* ### No type-ahead, deliberately
|
|
145
205
|
*
|
|
146
206
|
* The APG lists type-ahead as optional for a menu and required for a
|
|
@@ -149,5 +209,6 @@ export type MenuProps = {
|
|
|
149
209
|
* buffer and a timer in a component that currently has neither, for
|
|
150
210
|
* a menu you can cross in three arrow presses.
|
|
151
211
|
*/
|
|
152
|
-
export declare const Menu: ({ className, emptyState, isVisible, items, itemSize: requestedItemSize, onDismiss, placement, trigger, }: MenuProps) => ReactNode;
|
|
212
|
+
export declare const Menu: ({ anchorRef, className, emptyState, isVisible, items, itemSize: requestedItemSize, label, onDismiss, placement, trigger, }: MenuProps) => ReactNode;
|
|
213
|
+
export {};
|
|
153
214
|
//# sourceMappingURL=Menu.d.ts.map
|
package/dist/Menu/Menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAA;AAKd,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAM7E,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB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CAAC,CAAA;AA0BtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,eAAO,MAAM,IAAI,GAAI,4HAWlB,SAAS,KAAG,SAoPd,CAAA"}
|
package/dist/Menu/Menu.js
CHANGED
|
@@ -89,6 +89,27 @@ const hasAnyItem = (items) => items.some((entry) => isMenuItem(entry) ||
|
|
|
89
89
|
* note has to be one, `aria-disabled` and out of the roving group:
|
|
90
90
|
* announced as "No actions available, dimmed", focusable by nothing.
|
|
91
91
|
*
|
|
92
|
+
* ### Anchor mode: the same menu, summoned by a gesture
|
|
93
|
+
*
|
|
94
|
+
* A context menu is this component with its trigger taken away.
|
|
95
|
+
* `anchorRef` replaces it — pointing at the pressed element, or at
|
|
96
|
+
* a **virtual** element that is only a rectangle, which is how the
|
|
97
|
+
* panel opens at the finger rather than at the corner of the card
|
|
98
|
+
* underneath. `useLongPress` in `@charcuterie/logic` is the other
|
|
99
|
+
* half; it hands back the point.
|
|
100
|
+
*
|
|
101
|
+
* One thing changes with the trigger gone, and it is the a11y
|
|
102
|
+
* half: nothing names the panel any more, so `label` becomes
|
|
103
|
+
* **required** in this mode and inert in the other. That is the
|
|
104
|
+
* narrowed M3/M4 rule read the other way round — an overlay with
|
|
105
|
+
* no trigger relationship needs its own name, and this is a menu
|
|
106
|
+
* that has none.
|
|
107
|
+
*
|
|
108
|
+
* Dismissal needs no special case. floating-ui's outside-press
|
|
109
|
+
* watches `pointerdown`, and the press that opened a context menu
|
|
110
|
+
* is over before the panel exists, so it cannot close itself on
|
|
111
|
+
* the way in.
|
|
112
|
+
*
|
|
92
113
|
* ### No type-ahead, deliberately
|
|
93
114
|
*
|
|
94
115
|
* The APG lists type-ahead as optional for a menu and required for a
|
|
@@ -97,14 +118,15 @@ const hasAnyItem = (items) => items.some((entry) => isMenuItem(entry) ||
|
|
|
97
118
|
* buffer and a timer in a component that currently has neither, for
|
|
98
119
|
* a menu you can cross in three arrow presses.
|
|
99
120
|
*/
|
|
100
|
-
export const Menu = ({ className, emptyState, isVisible, items, itemSize: requestedItemSize = "lg", onDismiss, placement = "bottom-start", trigger, }) => {
|
|
121
|
+
export const Menu = ({ anchorRef, className, emptyState, isVisible, items, itemSize: requestedItemSize = "lg", label, onDismiss, placement = "bottom-start", trigger, }) => {
|
|
101
122
|
const itemSize = usePanelItemSize(requestedItemSize);
|
|
102
123
|
const menuId = useUniqueId();
|
|
103
124
|
const itemElements = useRef(new Map());
|
|
104
125
|
const focus = useRovingFocus();
|
|
105
126
|
const { activeValue, registeredValues, setActiveValue } = focus;
|
|
106
127
|
const [firstValue] = registeredValues;
|
|
107
|
-
const { clonedTrigger, context, floatingStyles, getFloatingProps, setFloating, } = useAnchoredOverlay({
|
|
128
|
+
const { clonedTrigger, context, floatingStyles, getFloatingProps, setFloating, triggerId, } = useAnchoredOverlay({
|
|
129
|
+
anchorRef,
|
|
108
130
|
// A menu had no clamp at all, which was survivable while a row was
|
|
109
131
|
// 32px and is not now: nine `lg` rows are 400px, and on a short
|
|
110
132
|
// window the panel simply ran off the bottom of the screen with no
|
|
@@ -197,7 +219,7 @@ export const Menu = ({ className, emptyState, isVisible, items, itemSize: reques
|
|
|
197
219
|
// Focus is moved by the effect above, to whichever item
|
|
198
220
|
// `RovingFocus` made active. Letting the manager also aim
|
|
199
221
|
// it is two owners for one caret.
|
|
200
|
-
initialFocus: -1, children: _jsx("div", { ...getFloatingProps(), className: toClassName(PANEL_SURFACE_CLASS,
|
|
222
|
+
initialFocus: -1, children: _jsx("div", { ...getFloatingProps(), "aria-label": anchorRef ? label : undefined, "aria-labelledby": anchorRef ? undefined : triggerId, className: toClassName(PANEL_SURFACE_CLASS,
|
|
201
223
|
// The height is clamped to the space the viewport left,
|
|
202
224
|
// written straight onto the element by the `size`
|
|
203
225
|
// middleware; this scrolls inside it.
|
package/dist/Menu/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../src/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAM3B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAA;AAyH7C;;;;GAIG;AACH,MAAM,yBAAyB,GAG3B;IACF,EAAE,EAAE,kCAAkC;IACtC,EAAE,EAAE,kCAAkC;IACtC,EAAE,EAAE,kCAAkC;CACvC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,KAAgB,EAAqB,EAAE,CACzD,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CAAA;AAEnD,MAAM,UAAU,GAAG,CAAC,KAAkB,EAAW,EAAE,CACjD,KAAK,CAAC,IAAI,CACR,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,KAAK,CAAC;IACjB,CAAC,KA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oBAClC,YAAY,EAAE,CAAC,CAAC,YAEhB,iBACM,gBAAgB,EAAE,gBAUV,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,qBAEvC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAEnC,SAAS,EAAE,WAAW,CACpB,mBAAmB;wBACnB,wDAAwD;wBACxD,kDAAkD;wBAClD,sCAAsC;wBACtC,iGAAiG,EACjG,SAAS,CACV,EACD,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;4BACtB,MAAM,QAAQ,GACZ;gCACE,SAAS,EAAE,KAAK,CAAC,IAAI;gCACrB,OAAO,EAAE,KAAK,CAAC,QAAQ;gCACvB,GAAG,EAAE,KAAK,CAAC,IAAI;gCACf,IAAI,EAAE,KAAK,CAAC,KAAK;6BAClB,CAAA;4BAEH,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;4BAEtC,IAAI,OAAO,EAAE,CAAC;gCACZ,oDAAoD;gCACpD,mDAAmD;gCACnD,2CAA2C;gCAC3C,aAAa;gCACb,QAAQ,CAAC,cAAc,EAAE,CAAA;gCAEzB,OAAO,EAAE,CAAA;4BACX,CAAC;wBACH,CAAC,EACD,GAAG,EAAE,WAAW;wBAChB,uDAAuD;wBACvD,oDAAoD;wBACpD,wDAAwD;wBACxD,oDAAoD;wBACpD,UAAU;wBACV,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,cAAc,YAEpB,UAAU,CAAC,KAAK,CAAC;4BAChB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;4BACxB,CAAC,CAAC,YAAY,GACZ,GACe,GACR,CAClB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Placement } from "@floating-ui/react";
|
|
1
|
+
import type { Placement, VirtualElement } from "@floating-ui/react";
|
|
2
2
|
import type { ReactElement, RefObject } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* The floating-ui block every anchored overlay — `Popover`, `Menu`,
|
|
@@ -46,6 +46,18 @@ import type { ReactElement, RefObject } from "react";
|
|
|
46
46
|
* a portalled `Listbox` and (for now) a top-layer `Popover`.
|
|
47
47
|
*/
|
|
48
48
|
export type AnchoredOverlayRole = "dialog" | "listbox" | "menu";
|
|
49
|
+
/**
|
|
50
|
+
* What a panel can hang off in anchor mode: a real element, or a
|
|
51
|
+
* **virtual** one — an object that only knows its own rectangle.
|
|
52
|
+
*
|
|
53
|
+
* The virtual half is what a context menu needs. A menu opened by
|
|
54
|
+
* a press-and-hold belongs at the finger, not at the corner of the
|
|
55
|
+
* card underneath it, and floating-ui positions against a rect
|
|
56
|
+
* without caring where the rect came from. `flip` and `shift` work
|
|
57
|
+
* unchanged, which is the whole reason to express a point this way
|
|
58
|
+
* rather than with `top`/`left` of our own.
|
|
59
|
+
*/
|
|
60
|
+
export type AnchoredOverlayAnchor = HTMLElement | VirtualElement;
|
|
49
61
|
export type UseAnchoredOverlayOptions = {
|
|
50
62
|
/**
|
|
51
63
|
* Anchor the panel to a **pre-existing** element the consumer already
|
|
@@ -54,8 +66,11 @@ export type UseAnchoredOverlayOptions = {
|
|
|
54
66
|
* value and the query) — there is nothing to clone. Supply exactly one
|
|
55
67
|
* of `anchorRef` / `trigger`; with `anchorRef`, `clonedTrigger` is
|
|
56
68
|
* `null`.
|
|
69
|
+
*
|
|
70
|
+
* A **virtual** anchor is allowed here too, which is how a context
|
|
71
|
+
* menu opens at the point that was pressed.
|
|
57
72
|
*/
|
|
58
|
-
anchorRef?: RefObject<
|
|
73
|
+
anchorRef?: RefObject<AnchoredOverlayAnchor | null>;
|
|
59
74
|
/**
|
|
60
75
|
* Both default **on** — Escape and outside-press are what makes an
|
|
61
76
|
* overlay an overlay. Switch one off for the honest exception (a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/useAnchoredOverlay.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useAnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/useAnchoredOverlay.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACf,MAAM,oBAAoB,CAAA;AAY3B,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,SAAS,GACT,MAAM,CAAA;AAEV;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,cAAc,CAAA;AAElB,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAA;IACnD;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,+DAA+D;IAC/D,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,IAAI,EAAE,mBAAmB,CAAA;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAQD,eAAO,MAAM,kBAAkB,GAAI,8MAehC,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;CA4L3B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useClonedChild, useUniqueId, } from "@charcuterie/logic";
|
|
2
2
|
import { autoUpdate, flip, offset, shift, size, useDismiss, useFloating, useInteractions, useRole, } from "@floating-ui/react";
|
|
3
|
-
import { createElement,
|
|
3
|
+
import { createElement, useLayoutEffect } from "react";
|
|
4
4
|
// `useClonedChild` insists on exactly one element, and hooks cannot be
|
|
5
5
|
// called conditionally — so in `anchorRef` mode we still call it, on this
|
|
6
6
|
// throwaway, and discard the result. It is never rendered and never
|
|
@@ -110,16 +110,38 @@ export const useAnchoredOverlay = ({ anchorRef, isEscapeDismissable = true, isHe
|
|
|
110
110
|
const triggerId = triggerOwnId ??
|
|
111
111
|
referenceProps.id ??
|
|
112
112
|
generatedTriggerId;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
/**
|
|
114
|
+
* In anchor mode floating-ui's reference is the consumer's own
|
|
115
|
+
* element, set imperatively — there is no cloned trigger to carry
|
|
116
|
+
* `refs.setReference`.
|
|
117
|
+
*
|
|
118
|
+
* ⚠️ **`isVisible` is a dependency, and leaving it out is a bug
|
|
119
|
+
* that hides.** A `Combobox`'s anchor is mounted before the panel
|
|
120
|
+
* ever opens, so reading the ref once was enough for the one
|
|
121
|
+
* consumer this had; a **context menu** aims its anchor at the
|
|
122
|
+
* point that was just pressed, milliseconds before it opens, and a
|
|
123
|
+
* read that only happened on mount saw `null`. floating-ui with no
|
|
124
|
+
* reference positions at the top-left corner of the viewport —
|
|
125
|
+
* which is the same picture as "the panel is not anchored", and
|
|
126
|
+
* says nothing about why.
|
|
127
|
+
*
|
|
128
|
+
* ⚠️ And it is a **layout** effect. An ordinary effect sets the
|
|
129
|
+
* reference after the browser has already painted the panel at
|
|
130
|
+
* `0, 0`, so the menu flashes in the corner on its way to the
|
|
131
|
+
* finger.
|
|
132
|
+
*
|
|
133
|
+
* ⚠️ The `isVisible` guard is what **keeps** the dependency.
|
|
134
|
+
* Written as a bare re-read it is a dependency the effect never
|
|
135
|
+
* mentions, and `exhaustive-deps --fix` deletes it — which is
|
|
136
|
+
* how the bug came back once, silently, between a green test and
|
|
137
|
+
* a lint pass.
|
|
138
|
+
*/
|
|
139
|
+
useLayoutEffect(() => {
|
|
140
|
+
if (!isAnchored || !isVisible) {
|
|
119
141
|
return;
|
|
120
142
|
}
|
|
121
143
|
refs.setReference(anchorRef.current);
|
|
122
|
-
}, [isAnchored, anchorRef, refs]);
|
|
144
|
+
}, [isAnchored, anchorRef, isVisible, refs]);
|
|
123
145
|
const clonedChild = useClonedChild(trigger ?? PLACEHOLDER_TRIGGER, {
|
|
124
146
|
...referenceProps,
|
|
125
147
|
id: triggerId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnchoredOverlay.js","sourceRoot":"","sources":["../../src/Overlay/useAnchoredOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"useAnchoredOverlay.js","sourceRoot":"","sources":["../../src/Overlay/useAnchoredOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAK3B,OAAO,EACL,UAAU,EACV,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,OAAO,GACR,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AA0ItD,uEAAuE;AACvE,0EAA0E;AAC1E,oEAAoE;AACpE,8DAA8D;AAC9D,MAAM,mBAAmB,GAAG,aAAa,CA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IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,YAAY,GAChB,OAAO,EAAE,KACV,EAAE,EAAE,CAAA;IAEL,MAAM,SAAS,GACb,YAAY;QACX,cAAc,CAAC,EAAyB;QACzC,kBAAkB,CAAA;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9B,OAAM;QACR,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;IACtC,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;IAE5C,MAAM,WAAW,GAAG,cAAc,CAChC,OAAO,IAAI,mBAAmB,EAC9B;QACE,GAAG,cAAc;QACjB,EAAE,EAAE,SAAS;QACb,4DAA4D;QAC5D,gEAAgE;QAChE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;KAClD,CACF,CAAA;IAED,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAA;IAErD,OAAO;QACL,aAAa;QACb,OAAO;QACP,cAAc;QACd,gBAAgB;QAChB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS;KACV,CAAA;AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -150,6 +150,12 @@ export type { NavLayoutMode, NavLayoutState, ResolvedNavLayout, UseNavLayoutOpti
|
|
|
150
150
|
export { useNavLayout } from "./Nav/useNavLayout.ts";
|
|
151
151
|
export type { NavBarItem, NavBarProps, } from "./NavBar/NavBar.tsx";
|
|
152
152
|
export { NavBar } from "./NavBar/NavBar.tsx";
|
|
153
|
+
/**
|
|
154
|
+
* What a `Menu` in anchor mode hangs off: an element, or a virtual
|
|
155
|
+
* one that is only a rectangle. A context menu passes the second,
|
|
156
|
+
* holding the point that was pressed.
|
|
157
|
+
*/
|
|
158
|
+
export type { AnchoredOverlayAnchor } from "./Overlay/useAnchoredOverlay.ts";
|
|
153
159
|
export type { PickerOption, PickerProps, } from "./Picker/Picker.tsx";
|
|
154
160
|
export { Picker } from "./Picker/Picker.tsx";
|
|
155
161
|
export type { PopoverProps } from "./Popover/Popover.tsx";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAC7C,YAAY,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,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O,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAuC,CAAA;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAqC,CAAA"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* mechanical requirement: `getByRole(role, { name })` finds exactly
|
|
7
7
|
* one thing. The fleet fails it comprehensively today —
|
|
8
8
|
* plex-channels' icon buttons are bare glyphs (`↶`, `↷`, `▶`),
|
|
9
|
-
* mux-magic's status pills are `<div>`s with no role,
|
|
9
|
+
* mux-magic's status pills are `<div>`s with no role, lounge-tv has
|
|
10
10
|
* zero `aria-*` attributes — and every one of those failures is
|
|
11
11
|
* invisible in a browser and invisible to axe.
|
|
12
12
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* mechanical requirement: `getByRole(role, { name })` finds exactly
|
|
7
7
|
* one thing. The fleet fails it comprehensively today —
|
|
8
8
|
* plex-channels' icon buttons are bare glyphs (`↶`, `↷`, `▶`),
|
|
9
|
-
* mux-magic's status pills are `<div>`s with no role,
|
|
9
|
+
* mux-magic's status pills are `<div>`s with no role, lounge-tv has
|
|
10
10
|
* zero `aria-*` attributes — and every one of those failures is
|
|
11
11
|
* invisible in a browser and invisible to axe.
|
|
12
12
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcuterie/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "The Charcuterie components. Tokens for look, @charcuterie/logic for state, ARIA that agents can actually drive.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"typecheck": "tsc --noEmit"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@charcuterie/logic": "2.
|
|
57
|
-
"@charcuterie/tokens": "1.10.
|
|
56
|
+
"@charcuterie/logic": "2.4.0",
|
|
57
|
+
"@charcuterie/tokens": "1.10.1",
|
|
58
58
|
"@floating-ui/react": "^0.27.20",
|
|
59
59
|
"@tanstack/react-virtual": "^3.13.12",
|
|
60
60
|
"tailwind-merge": "^3.6.0"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@charcuterie/storybook-config": "0.4.
|
|
97
|
+
"@charcuterie/storybook-config": "0.4.2",
|
|
98
98
|
"@codemirror/commands": "^6",
|
|
99
99
|
"@codemirror/lang-markdown": "^6",
|
|
100
100
|
"@codemirror/language": "^6",
|
package/src/Menu/Menu.mdx
CHANGED
|
@@ -59,6 +59,42 @@ So the rule the other three teach is narrower than it looked:
|
|
|
59
59
|
A menu has one, so the requirement moves to the trigger — which `Button` and `IconButton`
|
|
60
60
|
already enforce.
|
|
61
61
|
|
|
62
|
+
## A context menu is this component with no trigger
|
|
63
|
+
|
|
64
|
+
Press and hold a card on a phone and the menu opens at the finger. That is the same
|
|
65
|
+
component in **anchor mode**: `anchorRef` replaces `trigger`, and the panel hangs off a
|
|
66
|
+
**virtual element** — an object that knows only its own rectangle, which here is the
|
|
67
|
+
zero-sized rect at the point pressed. `flip` and `shift` treat it exactly like a button,
|
|
68
|
+
so a press near the bottom of the window still gets a menu that fits.
|
|
69
|
+
|
|
70
|
+
`useLongPress` in `@charcuterie/logic` is the other half. It watches the pointer, cancels
|
|
71
|
+
on a 10px drift so a scroll that starts on the card is a scroll, and hands back the point.
|
|
72
|
+
Two details in it are not obvious:
|
|
73
|
+
|
|
74
|
+
- **The native `contextmenu` is a second trigger, not only something to suppress.** Chrome
|
|
75
|
+
on Android recognises its own long press at about the same 500ms and fires `pointercancel`
|
|
76
|
+
at the sequence, which clears the timer a beat before it would have run. Whichever arrives
|
|
77
|
+
first fires the callback, once.
|
|
78
|
+
- **Touch and pen only, by default.** A mouse already has a context menu, and the browser's
|
|
79
|
+
own carries "Open link in new tab" and "Copy link address" — taking that over to show four
|
|
80
|
+
app actions is a loss on a desktop and a gain on a phone. Pass `["mouse"]` deliberately,
|
|
81
|
+
for a surface that is not a link.
|
|
82
|
+
|
|
83
|
+
The CSS half belongs to the consumer: `-webkit-touch-callout: none` on the pressed element,
|
|
84
|
+
or iOS shows its link preview sheet over the menu. Safari fires no `contextmenu`, so no
|
|
85
|
+
handler can reach it.
|
|
86
|
+
|
|
87
|
+
**`label` is required here**, and that is the rule above read from the other side. With the
|
|
88
|
+
trigger gone nothing names the panel, so the prop that was inert in trigger mode becomes the
|
|
89
|
+
only name the menu has. The type enforces it: `anchorRef` and `trigger` are mutually
|
|
90
|
+
exclusive, and `label` belongs to exactly one of them.
|
|
91
|
+
|
|
92
|
+
Dismissal needs no special case. floating-ui watches `pointerdown` for an outside press, and
|
|
93
|
+
the press that opened a context menu is over before the panel exists — so it cannot close
|
|
94
|
+
itself on the way in.
|
|
95
|
+
|
|
96
|
+
<Canvas of={MenuStories.ContextMenu} />
|
|
97
|
+
|
|
62
98
|
## One kind, and that is the other half of the `Tabs` argument
|
|
63
99
|
|
|
64
100
|
`Tabs` needed **two** state kinds because a tab is chosen *and* focused, and in `manual`
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
useLongPress,
|
|
3
|
+
useVisibility,
|
|
4
|
+
} from "@charcuterie/logic"
|
|
2
5
|
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
3
6
|
import type { ControlSize } from "@charcuterie/tokens"
|
|
4
7
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
5
8
|
import type { ReactNode } from "react"
|
|
9
|
+
import { useRef } from "react"
|
|
6
10
|
|
|
7
11
|
import {
|
|
8
12
|
controlSizeArgType,
|
|
@@ -18,6 +22,7 @@ import {
|
|
|
18
22
|
SettingsIcon,
|
|
19
23
|
UndoIcon,
|
|
20
24
|
} from "../icons.storyHelpers.tsx"
|
|
25
|
+
import type { AnchoredOverlayAnchor } from "../Overlay/useAnchoredOverlay.ts"
|
|
21
26
|
import { Tooltip } from "../Tooltip/Tooltip.tsx"
|
|
22
27
|
import type { MenuEntry, MenuItem } from "./Menu.tsx"
|
|
23
28
|
import { Menu } from "./Menu.tsx"
|
|
@@ -148,6 +153,65 @@ const TooltipTriggerHarness = ({
|
|
|
148
153
|
)
|
|
149
154
|
}
|
|
150
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Anchor mode — the same menu with its trigger taken away, opened
|
|
158
|
+
* by a gesture over a surface and positioned at the point that was
|
|
159
|
+
* pressed.
|
|
160
|
+
*
|
|
161
|
+
* The anchor is a **virtual element**: an object that knows only
|
|
162
|
+
* its own rectangle, which here is the zero-sized rect at the
|
|
163
|
+
* finger. `flip` and `shift` treat it exactly like a real one, so
|
|
164
|
+
* a press near the bottom of the window still gets a menu that
|
|
165
|
+
* fits.
|
|
166
|
+
*
|
|
167
|
+
* `pointerTypes` includes `mouse` here, which the hook's default
|
|
168
|
+
* deliberately does not: this surface is not a link, so there is
|
|
169
|
+
* no browser menu worth keeping, and a story nobody can open on a
|
|
170
|
+
* desktop demonstrates nothing.
|
|
171
|
+
*/
|
|
172
|
+
const ContextMenuHarness = ({
|
|
173
|
+
surfaceLabel,
|
|
174
|
+
}: {
|
|
175
|
+
surfaceLabel: string
|
|
176
|
+
}): ReactNode => {
|
|
177
|
+
const { hide, isVisible, show } = useVisibility()
|
|
178
|
+
|
|
179
|
+
const anchorRef = useRef<AnchoredOverlayAnchor | null>(
|
|
180
|
+
null,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
const longPressHandlers = useLongPress({
|
|
184
|
+
onLongPress: ({ clientX, clientY }) => {
|
|
185
|
+
anchorRef.current = {
|
|
186
|
+
getBoundingClientRect: () =>
|
|
187
|
+
new DOMRect(clientX, clientY, 0, 0),
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
show()
|
|
191
|
+
},
|
|
192
|
+
pointerTypes: ["mouse", "pen", "touch"],
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<>
|
|
197
|
+
<div
|
|
198
|
+
{...longPressHandlers}
|
|
199
|
+
className="flex h-32 w-64 select-none items-center justify-center rounded-xl border border-border-default bg-surface-raised text-content-secondary text-sm"
|
|
200
|
+
>
|
|
201
|
+
{surfaceLabel}
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<Menu
|
|
205
|
+
anchorRef={anchorRef}
|
|
206
|
+
isVisible={isVisible}
|
|
207
|
+
items={BAY_ACTIONS}
|
|
208
|
+
label={`Actions for ${surfaceLabel}`}
|
|
209
|
+
onDismiss={hide}
|
|
210
|
+
/>
|
|
211
|
+
</>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
151
215
|
const meta = {
|
|
152
216
|
title: "Components/Actions/Menu",
|
|
153
217
|
component: Menu,
|
|
@@ -273,6 +337,40 @@ export const Interactive: Story = {
|
|
|
273
337
|
),
|
|
274
338
|
}
|
|
275
339
|
|
|
340
|
+
/**
|
|
341
|
+
* **A context menu is this component with no trigger.** Press and
|
|
342
|
+
* hold the card — or right-click it, which this story enables on
|
|
343
|
+
* purpose — and the menu opens at the point that was pressed.
|
|
344
|
+
*
|
|
345
|
+
* Two pieces make the gesture. `useLongPress`
|
|
346
|
+
* (`@charcuterie/logic`) watches the pointer and hands back the
|
|
347
|
+
* point; `anchorRef` takes a **virtual element** holding that
|
|
348
|
+
* point, so `flip` and `shift` behave exactly as they do against a
|
|
349
|
+
* button.
|
|
350
|
+
*
|
|
351
|
+
* `label` is **required** in this mode and absent in the other,
|
|
352
|
+
* which is the one thing that changes with the trigger gone:
|
|
353
|
+
* nothing is left to name the panel through `aria-labelledby`.
|
|
354
|
+
*
|
|
355
|
+
* The hold is 500ms and a 10px drift cancels it, so a scroll that
|
|
356
|
+
* starts on the card is a scroll. On Android the browser's own
|
|
357
|
+
* `contextmenu` arrives first and is used as the trigger rather
|
|
358
|
+
* than fought with — see the hook.
|
|
359
|
+
*/
|
|
360
|
+
export const ContextMenu: Story = {
|
|
361
|
+
args: {
|
|
362
|
+
isVisible: false,
|
|
363
|
+
onDismiss: noop,
|
|
364
|
+
trigger: <Button appearance="outline">Actions</Button>,
|
|
365
|
+
},
|
|
366
|
+
parameters: { layout: "padded" },
|
|
367
|
+
render: () => (
|
|
368
|
+
<div className="p-16">
|
|
369
|
+
<ContextMenuHarness surfaceLabel="Press and hold me" />
|
|
370
|
+
</div>
|
|
371
|
+
),
|
|
372
|
+
}
|
|
373
|
+
|
|
276
374
|
/**
|
|
277
375
|
* `items` is a union — a `group` (`role="group"`, named by its
|
|
278
376
|
* label) and a `separator` (`role="separator"`) opt in by their
|
package/src/Menu/Menu.test.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import * as stories from "./Menu.stories.tsx"
|
|
|
16
16
|
const {
|
|
17
17
|
AllStates,
|
|
18
18
|
AllVariants,
|
|
19
|
+
ContextMenu,
|
|
19
20
|
Empty,
|
|
20
21
|
Grouped,
|
|
21
22
|
Interactive,
|
|
@@ -551,3 +552,122 @@ test("a long label wraps rather than pushing the panel off screen", async () =>
|
|
|
551
552
|
await setViewport(DESKTOP)
|
|
552
553
|
}
|
|
553
554
|
})
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Anchor mode, driven with the events a finger produces.
|
|
558
|
+
*
|
|
559
|
+
* `pointerdown` then `contextmenu` is the **Android** sequence —
|
|
560
|
+
* Chrome recognises its own long press and fires `contextmenu`
|
|
561
|
+
* while the finger is still down, which `useLongPress` uses as the
|
|
562
|
+
* trigger rather than fighting. It is also the sequence a test can
|
|
563
|
+
* drive without holding a timer open for half a second.
|
|
564
|
+
*/
|
|
565
|
+
const pressAndHold = async (
|
|
566
|
+
element: HTMLElement,
|
|
567
|
+
{
|
|
568
|
+
clientX,
|
|
569
|
+
clientY,
|
|
570
|
+
}: { clientX: number; clientY: number },
|
|
571
|
+
) => {
|
|
572
|
+
element.dispatchEvent(
|
|
573
|
+
new PointerEvent("pointerdown", {
|
|
574
|
+
bubbles: true,
|
|
575
|
+
clientX,
|
|
576
|
+
clientY,
|
|
577
|
+
pointerType: "touch",
|
|
578
|
+
}),
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
element.dispatchEvent(
|
|
582
|
+
new MouseEvent("contextmenu", {
|
|
583
|
+
bubbles: true,
|
|
584
|
+
cancelable: true,
|
|
585
|
+
clientX,
|
|
586
|
+
clientY,
|
|
587
|
+
}),
|
|
588
|
+
)
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
test("a press and hold opens the menu at the point pressed", async () => {
|
|
592
|
+
const { body, canvas } = await mountStory(ContextMenu)
|
|
593
|
+
|
|
594
|
+
const surface = canvas.getByText("Press and hold me")
|
|
595
|
+
|
|
596
|
+
await pressAndHold(surface, {
|
|
597
|
+
clientX: 220,
|
|
598
|
+
clientY: 180,
|
|
599
|
+
})
|
|
600
|
+
|
|
601
|
+
const menu = await waitFor(() =>
|
|
602
|
+
expectAgentDrivable(body, {
|
|
603
|
+
// Named by its own `label`, because anchor mode has no
|
|
604
|
+
// trigger to borrow a name from. A menu that reaches this
|
|
605
|
+
// assertion through `aria-labelledby` would be pointing at
|
|
606
|
+
// an id that is on no element in the document.
|
|
607
|
+
name: "Actions for Press and hold me",
|
|
608
|
+
role: "menu",
|
|
609
|
+
}),
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
// The virtual anchor is a zero-sized rect at the finger, and the
|
|
613
|
+
// placement is `bottom-start` with a 4px offset — so the panel's
|
|
614
|
+
// own corner lands on the point that was pressed. Anchoring that
|
|
615
|
+
// silently failed would leave it at the top-left of the viewport,
|
|
616
|
+
// which is the failure this measurement exists to catch.
|
|
617
|
+
//
|
|
618
|
+
// `waitFor`, because floating-ui computes the first position in an
|
|
619
|
+
// effect of its own: the panel is in the document a tick before it
|
|
620
|
+
// knows where to be.
|
|
621
|
+
await waitFor(() => {
|
|
622
|
+
const panel = menu.getBoundingClientRect()
|
|
623
|
+
|
|
624
|
+
expect(Math.round(panel.left)).toBe(220)
|
|
625
|
+
|
|
626
|
+
expect(Math.round(panel.top)).toBe(184)
|
|
627
|
+
})
|
|
628
|
+
|
|
629
|
+
await expectNoAxeViolations(menu)
|
|
630
|
+
})
|
|
631
|
+
|
|
632
|
+
test("the press that opened the menu does not also click through", async () => {
|
|
633
|
+
const { body, canvas } = await mountStory(ContextMenu)
|
|
634
|
+
|
|
635
|
+
const surface = canvas.getByText("Press and hold me")
|
|
636
|
+
|
|
637
|
+
await pressAndHold(surface, {
|
|
638
|
+
clientX: 200,
|
|
639
|
+
clientY: 200,
|
|
640
|
+
})
|
|
641
|
+
|
|
642
|
+
await waitFor(() => {
|
|
643
|
+
expect(
|
|
644
|
+
body.queryAllByRole("menuitem").length,
|
|
645
|
+
).toBeGreaterThan(0)
|
|
646
|
+
})
|
|
647
|
+
|
|
648
|
+
// floating-ui watches `pointerdown` for an outside press, and the
|
|
649
|
+
// press that opened this menu was over before the panel existed —
|
|
650
|
+
// so the menu cannot dismiss itself on the way in. The finger
|
|
651
|
+
// lifting is what would prove it.
|
|
652
|
+
surface.dispatchEvent(
|
|
653
|
+
new PointerEvent("pointerup", {
|
|
654
|
+
bubbles: true,
|
|
655
|
+
clientX: 200,
|
|
656
|
+
clientY: 200,
|
|
657
|
+
pointerType: "touch",
|
|
658
|
+
}),
|
|
659
|
+
)
|
|
660
|
+
|
|
661
|
+
surface.dispatchEvent(
|
|
662
|
+
new MouseEvent("click", {
|
|
663
|
+
bubbles: true,
|
|
664
|
+
cancelable: true,
|
|
665
|
+
}),
|
|
666
|
+
)
|
|
667
|
+
|
|
668
|
+
await waitFor(() => {
|
|
669
|
+
expect(
|
|
670
|
+
body.queryAllByRole("menuitem").length,
|
|
671
|
+
).toBeGreaterThan(0)
|
|
672
|
+
})
|
|
673
|
+
})
|
package/src/Menu/Menu.tsx
CHANGED
|
@@ -9,11 +9,16 @@ import {
|
|
|
9
9
|
FloatingFocusManager,
|
|
10
10
|
FloatingPortal,
|
|
11
11
|
} from "@floating-ui/react"
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
ReactElement,
|
|
14
|
+
ReactNode,
|
|
15
|
+
RefObject,
|
|
16
|
+
} from "react"
|
|
13
17
|
import { useEffect, useRef } from "react"
|
|
14
18
|
|
|
15
19
|
import { PANEL_ITEM_SIZE_CLASS } from "../controlStyles.ts"
|
|
16
20
|
import { PANEL_SURFACE_CLASS } from "../Overlay/overlayPanelClass.ts"
|
|
21
|
+
import type { AnchoredOverlayAnchor } from "../Overlay/useAnchoredOverlay.ts"
|
|
17
22
|
import { useAnchoredOverlay } from "../Overlay/useAnchoredOverlay.ts"
|
|
18
23
|
import { usePanelItemSize } from "../Overlay/usePanelItemSize.ts"
|
|
19
24
|
import { toClassName } from "../toClassName.ts"
|
|
@@ -64,7 +69,48 @@ export type MenuGroup = {
|
|
|
64
69
|
*/
|
|
65
70
|
export type MenuEntry = MenuGroup | MenuItem | MenuSeparator
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The two ways a menu can be summoned, and they are mutually
|
|
74
|
+
* exclusive at the type level rather than by a note nobody reads.
|
|
75
|
+
*
|
|
76
|
+
* **Trigger mode** is the menu button: the control is cloned, it
|
|
77
|
+
* gains `aria-haspopup`/`aria-expanded`, and it **names the
|
|
78
|
+
* panel** through `aria-labelledby` — which is why there is no
|
|
79
|
+
* `label` prop here and why adding one did nothing (see the
|
|
80
|
+
* component's own notes).
|
|
81
|
+
*
|
|
82
|
+
* **Anchor mode** has no trigger at all. It is the context menu:
|
|
83
|
+
* summoned by a gesture over a surface, positioned against an
|
|
84
|
+
* element or a bare point. Nothing names it, so `label` stops
|
|
85
|
+
* being inert and becomes **required** — a `role="menu"` that no
|
|
86
|
+
* `aria-labelledby` reaches is an unnamed menu, and a screen
|
|
87
|
+
* reader announces "menu, 4 items" with no idea what of.
|
|
88
|
+
*/
|
|
89
|
+
type MenuAnchorProps = {
|
|
90
|
+
/**
|
|
91
|
+
* What the panel hangs off: the pressed element, or a virtual
|
|
92
|
+
* element holding the point that was pressed
|
|
93
|
+
* (`AnchoredOverlayAnchor`). Read when the menu becomes
|
|
94
|
+
* visible, so the same ref can be re-aimed before each open.
|
|
95
|
+
*/
|
|
96
|
+
anchorRef: RefObject<AnchoredOverlayAnchor | null>
|
|
97
|
+
/** Names the panel. Required here; see above. */
|
|
98
|
+
label: string
|
|
99
|
+
trigger?: never
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
type MenuTriggerProps = {
|
|
103
|
+
anchorRef?: never
|
|
104
|
+
/**
|
|
105
|
+
* Absent on purpose. The trigger names the panel, and a `label`
|
|
106
|
+
* here would be silently discarded by `aria-labelledby`.
|
|
107
|
+
*/
|
|
108
|
+
label?: never
|
|
109
|
+
/** The control the menu hangs off. **Cloned, not wrapped.** */
|
|
110
|
+
trigger: ReactElement
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type MenuBaseProps = {
|
|
68
114
|
className?: string
|
|
69
115
|
/**
|
|
70
116
|
* Shown when there is no item to show — a `group` with no members
|
|
@@ -92,10 +138,11 @@ export type MenuProps = {
|
|
|
92
138
|
/** Outside press, Escape, and choosing an item all land here. */
|
|
93
139
|
onDismiss: () => void
|
|
94
140
|
placement?: Placement
|
|
95
|
-
/** The control the menu hangs off. **Cloned, not wrapped.** */
|
|
96
|
-
trigger: ReactElement
|
|
97
141
|
}
|
|
98
142
|
|
|
143
|
+
export type MenuProps = MenuBaseProps &
|
|
144
|
+
(MenuAnchorProps | MenuTriggerProps)
|
|
145
|
+
|
|
99
146
|
/**
|
|
100
147
|
* A group heading is not a row — it has no height of its own to take
|
|
101
148
|
* — so it borrows only the inline padding, which is the one thing it
|
|
@@ -188,6 +235,27 @@ const hasAnyItem = (items: MenuEntry[]): boolean =>
|
|
|
188
235
|
* note has to be one, `aria-disabled` and out of the roving group:
|
|
189
236
|
* announced as "No actions available, dimmed", focusable by nothing.
|
|
190
237
|
*
|
|
238
|
+
* ### Anchor mode: the same menu, summoned by a gesture
|
|
239
|
+
*
|
|
240
|
+
* A context menu is this component with its trigger taken away.
|
|
241
|
+
* `anchorRef` replaces it — pointing at the pressed element, or at
|
|
242
|
+
* a **virtual** element that is only a rectangle, which is how the
|
|
243
|
+
* panel opens at the finger rather than at the corner of the card
|
|
244
|
+
* underneath. `useLongPress` in `@charcuterie/logic` is the other
|
|
245
|
+
* half; it hands back the point.
|
|
246
|
+
*
|
|
247
|
+
* One thing changes with the trigger gone, and it is the a11y
|
|
248
|
+
* half: nothing names the panel any more, so `label` becomes
|
|
249
|
+
* **required** in this mode and inert in the other. That is the
|
|
250
|
+
* narrowed M3/M4 rule read the other way round — an overlay with
|
|
251
|
+
* no trigger relationship needs its own name, and this is a menu
|
|
252
|
+
* that has none.
|
|
253
|
+
*
|
|
254
|
+
* Dismissal needs no special case. floating-ui's outside-press
|
|
255
|
+
* watches `pointerdown`, and the press that opened a context menu
|
|
256
|
+
* is over before the panel exists, so it cannot close itself on
|
|
257
|
+
* the way in.
|
|
258
|
+
*
|
|
191
259
|
* ### No type-ahead, deliberately
|
|
192
260
|
*
|
|
193
261
|
* The APG lists type-ahead as optional for a menu and required for a
|
|
@@ -197,11 +265,13 @@ const hasAnyItem = (items: MenuEntry[]): boolean =>
|
|
|
197
265
|
* a menu you can cross in three arrow presses.
|
|
198
266
|
*/
|
|
199
267
|
export const Menu = ({
|
|
268
|
+
anchorRef,
|
|
200
269
|
className,
|
|
201
270
|
emptyState,
|
|
202
271
|
isVisible,
|
|
203
272
|
items,
|
|
204
273
|
itemSize: requestedItemSize = "lg",
|
|
274
|
+
label,
|
|
205
275
|
onDismiss,
|
|
206
276
|
placement = "bottom-start",
|
|
207
277
|
trigger,
|
|
@@ -227,7 +297,9 @@ export const Menu = ({
|
|
|
227
297
|
floatingStyles,
|
|
228
298
|
getFloatingProps,
|
|
229
299
|
setFloating,
|
|
300
|
+
triggerId,
|
|
230
301
|
} = useAnchoredOverlay({
|
|
302
|
+
anchorRef,
|
|
231
303
|
// A menu had no clamp at all, which was survivable while a row was
|
|
232
304
|
// 32px and is not now: nine `lg` rows are 400px, and on a short
|
|
233
305
|
// window the panel simply ran off the bottom of the screen with no
|
|
@@ -387,6 +459,19 @@ export const Menu = ({
|
|
|
387
459
|
>
|
|
388
460
|
<div
|
|
389
461
|
{...getFloatingProps()}
|
|
462
|
+
// Anchor mode has no trigger, so `useRole`'s
|
|
463
|
+
// `aria-labelledby` points at an id that is on no
|
|
464
|
+
// element in the document — a dangling reference,
|
|
465
|
+
// which is an **unnamed** menu rather than a
|
|
466
|
+
// wrongly named one. The `label` this mode
|
|
467
|
+
// requires takes over, and the dangling attribute
|
|
468
|
+
// is dropped rather than left beside it: an
|
|
469
|
+
// `aria-labelledby` that resolves to nothing still
|
|
470
|
+
// beats `aria-label` in some engines.
|
|
471
|
+
aria-label={anchorRef ? label : undefined}
|
|
472
|
+
aria-labelledby={
|
|
473
|
+
anchorRef ? undefined : triggerId
|
|
474
|
+
}
|
|
390
475
|
className={toClassName(
|
|
391
476
|
PANEL_SURFACE_CLASS,
|
|
392
477
|
// The height is clamped to the space the viewport left,
|
|
@@ -2,7 +2,10 @@ import {
|
|
|
2
2
|
useClonedChild,
|
|
3
3
|
useUniqueId,
|
|
4
4
|
} from "@charcuterie/logic"
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
Placement,
|
|
7
|
+
VirtualElement,
|
|
8
|
+
} from "@floating-ui/react"
|
|
6
9
|
import {
|
|
7
10
|
autoUpdate,
|
|
8
11
|
flip,
|
|
@@ -15,7 +18,7 @@ import {
|
|
|
15
18
|
useRole,
|
|
16
19
|
} from "@floating-ui/react"
|
|
17
20
|
import type { ReactElement, RefObject } from "react"
|
|
18
|
-
import { createElement,
|
|
21
|
+
import { createElement, useLayoutEffect } from "react"
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* The floating-ui block every anchored overlay — `Popover`, `Menu`,
|
|
@@ -67,6 +70,21 @@ export type AnchoredOverlayRole =
|
|
|
67
70
|
| "listbox"
|
|
68
71
|
| "menu"
|
|
69
72
|
|
|
73
|
+
/**
|
|
74
|
+
* What a panel can hang off in anchor mode: a real element, or a
|
|
75
|
+
* **virtual** one — an object that only knows its own rectangle.
|
|
76
|
+
*
|
|
77
|
+
* The virtual half is what a context menu needs. A menu opened by
|
|
78
|
+
* a press-and-hold belongs at the finger, not at the corner of the
|
|
79
|
+
* card underneath it, and floating-ui positions against a rect
|
|
80
|
+
* without caring where the rect came from. `flip` and `shift` work
|
|
81
|
+
* unchanged, which is the whole reason to express a point this way
|
|
82
|
+
* rather than with `top`/`left` of our own.
|
|
83
|
+
*/
|
|
84
|
+
export type AnchoredOverlayAnchor =
|
|
85
|
+
| HTMLElement
|
|
86
|
+
| VirtualElement
|
|
87
|
+
|
|
70
88
|
export type UseAnchoredOverlayOptions = {
|
|
71
89
|
/**
|
|
72
90
|
* Anchor the panel to a **pre-existing** element the consumer already
|
|
@@ -75,8 +93,11 @@ export type UseAnchoredOverlayOptions = {
|
|
|
75
93
|
* value and the query) — there is nothing to clone. Supply exactly one
|
|
76
94
|
* of `anchorRef` / `trigger`; with `anchorRef`, `clonedTrigger` is
|
|
77
95
|
* `null`.
|
|
96
|
+
*
|
|
97
|
+
* A **virtual** anchor is allowed here too, which is how a context
|
|
98
|
+
* menu opens at the point that was pressed.
|
|
78
99
|
*/
|
|
79
|
-
anchorRef?: RefObject<
|
|
100
|
+
anchorRef?: RefObject<AnchoredOverlayAnchor | null>
|
|
80
101
|
/**
|
|
81
102
|
* Both default **on** — Escape and outside-press are what makes an
|
|
82
103
|
* overlay an overlay. Switch one off for the honest exception (a
|
|
@@ -289,17 +310,39 @@ export const useAnchoredOverlay = ({
|
|
|
289
310
|
(referenceProps.id as string | undefined) ??
|
|
290
311
|
generatedTriggerId
|
|
291
312
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
313
|
+
/**
|
|
314
|
+
* In anchor mode floating-ui's reference is the consumer's own
|
|
315
|
+
* element, set imperatively — there is no cloned trigger to carry
|
|
316
|
+
* `refs.setReference`.
|
|
317
|
+
*
|
|
318
|
+
* ⚠️ **`isVisible` is a dependency, and leaving it out is a bug
|
|
319
|
+
* that hides.** A `Combobox`'s anchor is mounted before the panel
|
|
320
|
+
* ever opens, so reading the ref once was enough for the one
|
|
321
|
+
* consumer this had; a **context menu** aims its anchor at the
|
|
322
|
+
* point that was just pressed, milliseconds before it opens, and a
|
|
323
|
+
* read that only happened on mount saw `null`. floating-ui with no
|
|
324
|
+
* reference positions at the top-left corner of the viewport —
|
|
325
|
+
* which is the same picture as "the panel is not anchored", and
|
|
326
|
+
* says nothing about why.
|
|
327
|
+
*
|
|
328
|
+
* ⚠️ And it is a **layout** effect. An ordinary effect sets the
|
|
329
|
+
* reference after the browser has already painted the panel at
|
|
330
|
+
* `0, 0`, so the menu flashes in the corner on its way to the
|
|
331
|
+
* finger.
|
|
332
|
+
*
|
|
333
|
+
* ⚠️ The `isVisible` guard is what **keeps** the dependency.
|
|
334
|
+
* Written as a bare re-read it is a dependency the effect never
|
|
335
|
+
* mentions, and `exhaustive-deps --fix` deletes it — which is
|
|
336
|
+
* how the bug came back once, silently, between a green test and
|
|
337
|
+
* a lint pass.
|
|
338
|
+
*/
|
|
339
|
+
useLayoutEffect(() => {
|
|
340
|
+
if (!isAnchored || !isVisible) {
|
|
298
341
|
return
|
|
299
342
|
}
|
|
300
343
|
|
|
301
344
|
refs.setReference(anchorRef.current)
|
|
302
|
-
}, [isAnchored, anchorRef, refs])
|
|
345
|
+
}, [isAnchored, anchorRef, isVisible, refs])
|
|
303
346
|
|
|
304
347
|
const clonedChild = useClonedChild(
|
|
305
348
|
trigger ?? PLACEHOLDER_TRIGGER,
|
package/src/Toast/Toast.mdx
CHANGED
|
@@ -9,7 +9,7 @@ import * as ToastStories from "./Toast.stories";
|
|
|
9
9
|
The plan demoted this from P0 with the note *"its duplication evidence was almost entirely
|
|
10
10
|
those two"*, and the M6 survey confirmed it: **the React fleet has no toast at all.**
|
|
11
11
|
mux-magic's only hit is a comment about an undo-toast "rendered elsewhere"; the real ones
|
|
12
|
-
are in plex-channels' and
|
|
12
|
+
are in plex-channels' and study-buddy's vanilla JavaScript.
|
|
13
13
|
|
|
14
14
|
It ships anyway, on Kevin's call, and one thing here is genuinely new — the plan wrote a
|
|
15
15
|
machine down and M2 never built it:
|
package/src/index.ts
CHANGED
|
@@ -334,6 +334,12 @@ export type {
|
|
|
334
334
|
NavBarProps,
|
|
335
335
|
} from "./NavBar/NavBar.tsx"
|
|
336
336
|
export { NavBar } from "./NavBar/NavBar.tsx"
|
|
337
|
+
/**
|
|
338
|
+
* What a `Menu` in anchor mode hangs off: an element, or a virtual
|
|
339
|
+
* one that is only a rectangle. A context menu passes the second,
|
|
340
|
+
* holding the point that was pressed.
|
|
341
|
+
*/
|
|
342
|
+
export type { AnchoredOverlayAnchor } from "./Overlay/useAnchoredOverlay.ts"
|
|
337
343
|
export type {
|
|
338
344
|
PickerOption,
|
|
339
345
|
PickerProps,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* mechanical requirement: `getByRole(role, { name })` finds exactly
|
|
7
7
|
* one thing. The fleet fails it comprehensively today —
|
|
8
8
|
* plex-channels' icon buttons are bare glyphs (`↶`, `↷`, `▶`),
|
|
9
|
-
* mux-magic's status pills are `<div>`s with no role,
|
|
9
|
+
* mux-magic's status pills are `<div>`s with no role, lounge-tv has
|
|
10
10
|
* zero `aria-*` attributes — and every one of those failures is
|
|
11
11
|
* invisible in a browser and invisible to axe.
|
|
12
12
|
*
|