@astryxdesign/core 0.7.1 → 0.7.2-canary.07f97c6
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/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +38 -14
- package/dist/Drawer/Drawer.d.ts +191 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -0
- package/dist/Drawer/Drawer.js +382 -0
- package/dist/Drawer/DrawerHeader.d.ts +85 -0
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -0
- package/dist/Drawer/DrawerHeader.js +134 -0
- package/dist/Drawer/index.d.ts +11 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.js +11 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts +42 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -0
- package/dist/Drawer/useDrawerDialogPresence.js +236 -0
- package/dist/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +4 -4
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -2
- package/dist/Layer/layerViewportInset.stylex.d.ts +6 -2
- package/dist/Layer/layerViewportInset.stylex.d.ts.map +1 -1
- package/dist/Layer/layerViewportInset.stylex.js +6 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +13 -7
- package/dist/Layer/useLayerDismissal.d.ts +1 -1
- package/dist/Layer/useLayerDismissal.js +1 -1
- package/dist/Layout/container.stylex.d.ts +5 -5
- package/dist/Layout/container.stylex.js +4 -4
- package/dist/Markdown/plugins/frontmatter.d.ts.map +1 -1
- package/dist/Markdown/plugins/frontmatter.js +7 -3
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -8
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +100 -2
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -1
- package/dist/Pagination/Pagination.d.ts +8 -5
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +21 -8
- package/dist/Popover/Popover.js +2 -2
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +6 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -1
- package/dist/TabList/TabMenu.d.ts +2 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +6 -3
- package/dist/Text/useTruncation.d.ts +7 -5
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +16 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +11 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -0
- package/dist/astryx.css +21 -10
- package/dist/hooks/useEntryAnimation.d.ts +2 -1
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +14 -12
- package/dist/hooks/useIsHydrating.d.ts +6 -0
- package/dist/hooks/useIsHydrating.d.ts.map +1 -0
- package/dist/hooks/useIsHydrating.js +30 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +112 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +112 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +0 -3
- package/dist/utils/focusOutline.stylex.d.ts +4 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +4 -0
- package/dist/utils/sharedMutationObserver.d.ts +21 -0
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -0
- package/dist/utils/sharedMutationObserver.js +69 -0
- package/locales/en.json +444 -0
- package/locales/pseudo.json +333 -0
- package/package.json +9 -4
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.test.tsx +155 -9
- package/src/Button/Button.tsx +39 -16
- package/src/Button/__tests__/Button.a11y.known-failures.ts +1 -62
- package/src/Button/__tests__/Button.a11y.states.ts +0 -10
- package/src/Drawer/Drawer.doc.mjs +472 -0
- package/src/Drawer/Drawer.spec.md +357 -0
- package/src/Drawer/Drawer.test.tsx +1300 -0
- package/src/Drawer/Drawer.tsx +613 -0
- package/src/Drawer/DrawerDirection.test.tsx +127 -0
- package/src/Drawer/DrawerHeader.doc.mjs +293 -0
- package/src/Drawer/DrawerHeader.test.tsx +102 -0
- package/src/Drawer/DrawerHeader.tsx +235 -0
- package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +401 -0
- package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +297 -0
- package/src/Drawer/index.ts +13 -0
- package/src/Drawer/useDrawerDialogPresence.ts +284 -0
- package/src/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +2 -2
- package/src/HoverCard/HoverCard.test.tsx +58 -0
- package/src/HoverCard/useHoverCard.tsx +10 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/IconButton/IconButton.test.tsx +3 -1
- package/src/Layer/layerViewportInset.source-build.test.mjs +90 -0
- package/src/Layer/layerViewportInset.stylex.ts +6 -2
- package/src/Layer/layerViewportInset.test.ts +1 -0
- package/src/Layer/useLayer.tsx +24 -13
- package/src/Layer/useLayerDismissal.ts +1 -1
- package/src/Layout/container.stylex.ts +6 -6
- package/src/List/ListItem.doc.mjs +8 -5
- package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
- package/src/Markdown/plugins/frontmatter.ts +7 -3
- package/src/MultiSelector/MultiSelector.test.tsx +159 -0
- package/src/MultiSelector/MultiSelector.tsx +40 -7
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +112 -2
- package/src/MultiSelector/hooks.ts +3 -1
- package/src/MultiSelector/useMultiCombobox.doc.mjs +267 -0
- package/src/Pagination/Pagination.doc.mjs +7 -7
- package/src/Pagination/Pagination.spec.md +9 -9
- package/src/Pagination/Pagination.test.tsx +242 -0
- package/src/Pagination/Pagination.tsx +27 -11
- package/src/Popover/Popover.test.tsx +2 -2
- package/src/Popover/Popover.tsx +4 -4
- package/src/PowerSearch/PowerSearch.test.tsx +85 -0
- package/src/PowerSearch/PowerSearch.tsx +2 -2
- package/src/Selector/hooks.ts +6 -2
- package/src/Selector/useCombobox.doc.mjs +237 -0
- package/src/Switch/Switch.test.tsx +49 -0
- package/src/Switch/Switch.tsx +11 -0
- package/src/TabList/TabList.test.tsx +67 -0
- package/src/TabList/TabMenu.doc.mjs +4 -3
- package/src/TabList/TabMenu.tsx +7 -4
- package/src/Text/useTruncation.test.tsx +69 -0
- package/src/Text/useTruncation.ts +16 -5
- package/src/Tokenizer/Tokenizer.test.tsx +54 -1
- package/src/Tooltip/Tooltip.test.tsx +31 -0
- package/src/Tooltip/useTooltip.test.tsx +13 -0
- package/src/Tooltip/useTooltip.tsx +11 -0
- package/src/Typeahead/BaseTypeahead.tsx +26 -0
- package/src/Typeahead/Typeahead.test.tsx +260 -2
- package/src/hooks/useEntryAnimation.doc.mjs +4 -4
- package/src/hooks/useEntryAnimation.ssr.test.tsx +143 -0
- package/src/hooks/useEntryAnimation.ts +15 -16
- package/src/hooks/useIsHydrating.test.tsx +70 -0
- package/src/hooks/useIsHydrating.ts +31 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +8 -0
- package/src/i18n/InternationalizationProvider.spec.md +252 -0
- package/src/i18n/__tests__/InternationalizationProvider.test.tsx +128 -0
- package/src/i18n/generated-locales/en.generated.ts +121 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +121 -0
- package/src/i18n/useTranslator.test.tsx +37 -0
- package/src/index.ts +1 -0
- package/src/theme/derivedVarRegistry.test.ts +0 -3
- package/src/theme/derivedVarRegistry.ts +0 -3
- package/src/utils/focusOutline.stylex.ts +4 -0
- package/src/utils/sharedMutationObserver.test.ts +53 -0
- package/src/utils/sharedMutationObserver.ts +78 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrawerDialogPresence.d.ts","sourceRoot":"","sources":["../../src/Drawer/useDrawerDialogPresence.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAaf,KAAK,8BAA8B,GAAG;IACpC,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;AAuDF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,GACd,EAAE,8BAA8B,GAAG,IAAI,CAoEvC"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file useDrawerDialogPresence.ts
|
|
7
|
+
* @input Controlled open state, modal mode, dialog ref, and rendered-state setter
|
|
8
|
+
* @output Coordinates native top-layer presence, exit timing, focus restoration, and unmount cleanup
|
|
9
|
+
* @position Drawer-internal hook; consumed only by Drawer.tsx
|
|
10
|
+
*
|
|
11
|
+
* The drawer has two independent notions of presence:
|
|
12
|
+
* - React's rendered state keeps the panel visible for its CSS exit.
|
|
13
|
+
* - Native `showModal()` or `showPopover()` state keeps it in the browser top
|
|
14
|
+
* layer.
|
|
15
|
+
*
|
|
16
|
+
* Their close ordering is a browser-visible invariant: the panel must finish
|
|
17
|
+
* its exit, then leave the active native host and hide in the same task. If the
|
|
18
|
+
* hide lands a frame later, a transformed ancestor becomes the containing block
|
|
19
|
+
* for the now-non-top-layer `position: fixed` panel and it paints back inside
|
|
20
|
+
* the page for one frame.
|
|
21
|
+
*
|
|
22
|
+
* SYNC: When modified, update:
|
|
23
|
+
* - /packages/core/src/Drawer/Drawer.test.tsx
|
|
24
|
+
* - /.github/scripts/modal-close-visibility.js
|
|
25
|
+
*/
|
|
26
|
+
import { useEffect, useRef } from 'react';
|
|
27
|
+
import { flushSync } from 'react-dom';
|
|
28
|
+
|
|
29
|
+
/** Slack past the computed transition before the backstop gives up waiting. */
|
|
30
|
+
const EXIT_BACKSTOP_BUFFER_MS = 50;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Hold used when the transition duration cannot be read — an unresolved
|
|
34
|
+
* `var()` outside a real browser. Picking a fixed number would otherwise make
|
|
35
|
+
* an assumption about the consumer's theme.
|
|
36
|
+
*/
|
|
37
|
+
const EXIT_FALLBACK_MS = 250;
|
|
38
|
+
function isPopoverOpen(dialog) {
|
|
39
|
+
try {
|
|
40
|
+
return dialog.matches(':popover-open');
|
|
41
|
+
} catch {
|
|
42
|
+
// jsdom and pre-Popover browsers do not recognize :popover-open.
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function isDrawerHostOpen(dialog, isModal) {
|
|
47
|
+
return isModal ? dialog.open : isPopoverOpen(dialog) || dialog.open;
|
|
48
|
+
}
|
|
49
|
+
function showDrawerHost(dialog, isModal) {
|
|
50
|
+
if (isModal) {
|
|
51
|
+
dialog.showModal();
|
|
52
|
+
} else if (typeof dialog.showPopover === 'function') {
|
|
53
|
+
dialog.showPopover();
|
|
54
|
+
} else {
|
|
55
|
+
// Reduced fallback for browsers below the Popover API support floor.
|
|
56
|
+
dialog.show();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function dispatchDialogClose(dialog) {
|
|
60
|
+
const EventConstructor = dialog.ownerDocument.defaultView?.Event ?? Event;
|
|
61
|
+
dialog.dispatchEvent(new EventConstructor('close'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Leaves the active native host. Returns whether the caller owes a synthetic
|
|
66
|
+
* `close` dispatch: `dialog.close()` used to power the non-modal path, and
|
|
67
|
+
* consumers observe its native `close` event through refs/onClose. Popover
|
|
68
|
+
* dismissal has no equivalent event, so that public DOM contract is preserved
|
|
69
|
+
* explicitly — but by the caller, not here. Native `close` is queued as a
|
|
70
|
+
* task, so a consumer's listener always ran after this hook's own focus
|
|
71
|
+
* restore; the synthetic event must keep that ordering (and fire exactly once
|
|
72
|
+
* per exit, including the unmount path).
|
|
73
|
+
*/
|
|
74
|
+
function hideDrawerHost(dialog, isModal) {
|
|
75
|
+
if (!isModal && typeof dialog.hidePopover === 'function') {
|
|
76
|
+
dialog.hidePopover();
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
if (dialog.open) {
|
|
80
|
+
dialog.close();
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Coordinates the native dialog and React-rendered presence for Drawer.
|
|
87
|
+
*
|
|
88
|
+
* Opening captures the trigger, enters the modal-dialog or manual-popover host,
|
|
89
|
+
* and honours the component's `data-autofocus` contract. Closing waits for the
|
|
90
|
+
* actual transform transition (with a computed-duration backstop), then leaves
|
|
91
|
+
* the native host and synchronously hides the panel before the browser can paint
|
|
92
|
+
* it outside the top layer, restores focus to the captured trigger, and only
|
|
93
|
+
* then dispatches the popover host's synthetic `close`. Unmount cleanup closes
|
|
94
|
+
* a host left open by React Activity or a removed subtree.
|
|
95
|
+
*/
|
|
96
|
+
export function useDrawerDialogPresence({
|
|
97
|
+
dialogRef,
|
|
98
|
+
isOpen,
|
|
99
|
+
isModal,
|
|
100
|
+
setIsRendered
|
|
101
|
+
}) {
|
|
102
|
+
// Element focused when the drawer opened — restored on close.
|
|
103
|
+
const triggerElementRef = useRef(null);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
const dialog = dialogRef.current;
|
|
106
|
+
if (!dialog) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (isOpen) {
|
|
110
|
+
if (!isDrawerHostOpen(dialog, isModal)) {
|
|
111
|
+
triggerElementRef.current = document.activeElement;
|
|
112
|
+
showDrawerHost(dialog, isModal);
|
|
113
|
+
// React's autoFocus calls .focus() during commit, before the native host
|
|
114
|
+
// is visible, so it silently fails — honour data-autofocus instead (same
|
|
115
|
+
// contract as Dialog).
|
|
116
|
+
dialog.querySelector('[data-autofocus]')?.focus();
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!isDrawerHostOpen(dialog, isModal)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
return waitForDrawerExit(dialog, () => {
|
|
124
|
+
const owesCloseEvent = hideDrawerHost(dialog, isModal);
|
|
125
|
+
// flushSync, not a plain setState: React's default scheduling can land
|
|
126
|
+
// the commit after the next paint, and that one frame is exactly the
|
|
127
|
+
// bug — the panel paints outside the top layer. Both happen in this
|
|
128
|
+
// task, so the browser never gets to paint between them.
|
|
129
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the panel must stop painting in the task the native host closes
|
|
130
|
+
flushSync(() => {
|
|
131
|
+
setIsRendered(false);
|
|
132
|
+
});
|
|
133
|
+
// Return focus after leaving the native host: a modal dialog makes the
|
|
134
|
+
// rest of the document inert, so focusing earlier silently fails.
|
|
135
|
+
triggerElementRef.current?.focus();
|
|
136
|
+
triggerElementRef.current = null;
|
|
137
|
+
// The synthetic popover close fires after the focus restore above,
|
|
138
|
+
// mirroring the task-queued native event: a consumer close listener
|
|
139
|
+
// that retargets focus (master-detail row switching) gets the last word.
|
|
140
|
+
if (owesCloseEvent) {
|
|
141
|
+
dispatchDialogClose(dialog);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}, [dialogRef, isModal, isOpen, setIsRendered]);
|
|
145
|
+
|
|
146
|
+
// Leave the active native host on unmount. When the drawer is mounted inside
|
|
147
|
+
// an <Activity> that flips to mode="hidden", React runs effect cleanups (with
|
|
148
|
+
// stale isOpen) instead of re-running the effect with isOpen=false. Leaving
|
|
149
|
+
// the host active would strand the top-layer surface and skip the next open.
|
|
150
|
+
// This is deliberately separate from the open/close effect: putting it in
|
|
151
|
+
// that cleanup would cut off every delayed slide-out.
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const dialog = dialogRef.current;
|
|
154
|
+
return () => {
|
|
155
|
+
if (dialog && isDrawerHostOpen(dialog, isModal)) {
|
|
156
|
+
if (hideDrawerHost(dialog, isModal)) {
|
|
157
|
+
// No focus restore on this path — the drawer is being torn down, so
|
|
158
|
+
// the owed synthetic close fires immediately (still exactly once).
|
|
159
|
+
dispatchDialogClose(dialog);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}, [dialogRef, isModal]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wait for the panel's transform transition, with a computed-duration
|
|
168
|
+
* backstop. Mirrors BottomSheetPanel.waitForTransition: the native event is
|
|
169
|
+
* authoritative, and the timeout only prevents a lost event from stranding an
|
|
170
|
+
* open dialog.
|
|
171
|
+
*/
|
|
172
|
+
function waitForDrawerExit(element, complete) {
|
|
173
|
+
let done = false;
|
|
174
|
+
let timer = null;
|
|
175
|
+
const finish = () => {
|
|
176
|
+
if (done) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
done = true;
|
|
180
|
+
if (timer != null) {
|
|
181
|
+
clearTimeout(timer);
|
|
182
|
+
}
|
|
183
|
+
element.removeEventListener('transitionend', handleTransitionEnd);
|
|
184
|
+
element.removeEventListener('transitioncancel', handleTransitionEnd);
|
|
185
|
+
complete();
|
|
186
|
+
};
|
|
187
|
+
const handleTransitionEnd = event => {
|
|
188
|
+
if (event.target === element && event.propertyName === 'transform') {
|
|
189
|
+
finish();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
element.addEventListener('transitionend', handleTransitionEnd);
|
|
193
|
+
element.addEventListener('transitioncancel', handleTransitionEnd);
|
|
194
|
+
const transitionMs = readTransformTransitionMs(element);
|
|
195
|
+
timer = setTimeout(finish, (transitionMs ?? EXIT_FALLBACK_MS) + EXIT_BACKSTOP_BUFFER_MS);
|
|
196
|
+
return () => {
|
|
197
|
+
done = true;
|
|
198
|
+
if (timer != null) {
|
|
199
|
+
clearTimeout(timer);
|
|
200
|
+
}
|
|
201
|
+
element.removeEventListener('transitionend', handleTransitionEnd);
|
|
202
|
+
element.removeEventListener('transitioncancel', handleTransitionEnd);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Read the transform transition's duration + delay from computed CSS. */
|
|
207
|
+
function readTransformTransitionMs(element) {
|
|
208
|
+
const computed = window.getComputedStyle(element);
|
|
209
|
+
const properties = computed.transitionProperty.split(',').map(value => value.trim());
|
|
210
|
+
const durations = parseTimes(computed.transitionDuration);
|
|
211
|
+
const delays = parseTimes(computed.transitionDelay);
|
|
212
|
+
if (properties.length === 0 || durations.length === 0 || delays.length === 0 || durations.includes(null) || delays.includes(null)) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
return properties.reduce((longest, property, index) => {
|
|
216
|
+
if (property !== 'transform' && property !== 'all') {
|
|
217
|
+
return longest;
|
|
218
|
+
}
|
|
219
|
+
const duration = durations[index % durations.length];
|
|
220
|
+
const delay = delays[index % delays.length];
|
|
221
|
+
return Math.max(longest, (duration ?? 0) + (delay ?? 0));
|
|
222
|
+
}, 0);
|
|
223
|
+
}
|
|
224
|
+
function parseTimes(value) {
|
|
225
|
+
return value.split(',').map(part => {
|
|
226
|
+
const trimmed = part.trim();
|
|
227
|
+
const time = Number.parseFloat(trimmed);
|
|
228
|
+
if (!Number.isFinite(time)) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
if (trimmed.endsWith('ms')) {
|
|
232
|
+
return time;
|
|
233
|
+
}
|
|
234
|
+
return trimmed.endsWith('s') ? time * 1000 : null;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -659,16 +659,16 @@ export function DropdownMenuSubMenu(props) {
|
|
|
659
659
|
...menuPress.menuProps,
|
|
660
660
|
...mergeProps(themeProps('dropdown-menu'), {
|
|
661
661
|
0: {
|
|
662
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
662
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261"
|
|
663
663
|
},
|
|
664
664
|
2: {
|
|
665
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
665
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e xish69e"
|
|
666
666
|
},
|
|
667
667
|
1: {
|
|
668
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
668
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o x1j4r261 x1odjw0f x6ikm8r xish69e"
|
|
669
669
|
},
|
|
670
670
|
3: {
|
|
671
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85
|
|
671
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xc0b1yq x1uh1i8a x1fcsqxe xgory14 x9epnlk x1n97fys x1prclbq x1i5ehqx x1hc1fzr x19991ni xuedmi6 xlr8y92 xpdipgo x87ps6o xge0x1e x1odjw0f x6ikm8r xish69e"
|
|
672
672
|
}
|
|
673
673
|
}[!!hasOverflow << 1 | !!hasOverflow << 0]),
|
|
674
674
|
children: nestedContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;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;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAE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CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAyc5E"}
|
|
@@ -145,6 +145,14 @@ export function useHoverCard(options = {}) {
|
|
|
145
145
|
isHoveringContentRef.current = false;
|
|
146
146
|
hideLayer();
|
|
147
147
|
}, [clearTimeouts, hideLayer]);
|
|
148
|
+
|
|
149
|
+
// The imperative hide. A card closed while the pointer rests on it unmounts
|
|
150
|
+
// without a mouseleave, so the content-hover latch is cleared here; left set,
|
|
151
|
+
// it would keep the trigger's next hover-open from closing on leave.
|
|
152
|
+
const hide = useCallback(() => {
|
|
153
|
+
isHoveringContentRef.current = false;
|
|
154
|
+
hideLayer();
|
|
155
|
+
}, [hideLayer]);
|
|
148
156
|
const {
|
|
149
157
|
isTouchPointerRef,
|
|
150
158
|
isTouchInteraction,
|
|
@@ -291,7 +299,7 @@ export function useHoverCard(options = {}) {
|
|
|
291
299
|
// clear it.
|
|
292
300
|
const card = typeof document === 'undefined' ? null : document.getElementById(layerId);
|
|
293
301
|
const hadFocus = card?.contains(document.activeElement) ?? false;
|
|
294
|
-
|
|
302
|
+
hide();
|
|
295
303
|
if (hadFocus) {
|
|
296
304
|
isEscapeDismissingRef.current = true;
|
|
297
305
|
triggerRef.current?.focus();
|
|
@@ -448,6 +456,6 @@ export function useHoverCard(options = {}) {
|
|
|
448
456
|
isOpen: isLayerOpen,
|
|
449
457
|
renderHoverCard,
|
|
450
458
|
show: showLayer,
|
|
451
|
-
hide
|
|
459
|
+
hide
|
|
452
460
|
};
|
|
453
461
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
3
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
4
|
-
* `stylex.firstThatWorks(cap
|
|
3
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
4
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
5
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
6
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
7
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
8
|
+
* inlined, so every engine would take the fallback.
|
|
5
9
|
*/
|
|
6
10
|
export declare const layerViewportInset: {
|
|
7
11
|
/** Gutter from the block-start viewport edge. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA
|
|
1
|
+
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;IAC7B,iDAAiD;;IAEjD,+CAA+C;;IAE/C,+CAA+C;;IAE/C,gFAAgF;;;;;;IAMhF,iFAAiF;;;IAGjF,gFAAgF;;;CAGhF,CAAC"}
|
|
@@ -54,8 +54,12 @@ const GUTTER_BLOCK = `calc(max(${SPACING}, env(safe-area-inset-top, 0px), env(sa
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
57
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
58
|
-
* `stylex.firstThatWorks(cap
|
|
57
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
58
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
59
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
60
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
61
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
62
|
+
* inlined, so every engine would take the fallback.
|
|
59
63
|
*/
|
|
60
64
|
export const layerViewportInset = {
|
|
61
65
|
gutterBlockStart: "calc(max(var(--spacing-4), env(safe-area-inset-top, 0px)) + var(--astryx-layer-inset-block-start, 0px))",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAyHnD;;GAEG;AACH,UAAU,kBAAkB;IAC1B,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAEjE;;GAEG;AACH,MAAM,MA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CAAC;AAC3E,KAAK,wBAAwB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAwHvE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,cAAwB,EACnC,SAAS,GAAE,cAAyB,GACnC,MAAM,CAiBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,cAAc,EACzB,cAAc,EAAE,OAAO,GACtB,KAAK,CAAC,aAAa,CAQrB;AA4BD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,OAAO,GACd,kBAAkB,CAoCpB;AAgqBD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;AAC3E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;AAWvE,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,GAC3B,0BAA0B,CAAC;AAC9B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,wBAAwB,CAAC"}
|
package/dist/Layer/useLayer.js
CHANGED
|
@@ -104,24 +104,24 @@ const styles = {
|
|
|
104
104
|
},
|
|
105
105
|
viewportFit: {
|
|
106
106
|
kB7OPa: "x9f619",
|
|
107
|
-
ks0D6T: "
|
|
108
|
-
kskxy: "
|
|
107
|
+
ks0D6T: "xc0b1yq",
|
|
108
|
+
kskxy: "x3v4n1",
|
|
109
109
|
$$css: true
|
|
110
110
|
},
|
|
111
111
|
gutterInlineEnd: {
|
|
112
|
-
k71WvV: "
|
|
112
|
+
k71WvV: "x144kxal",
|
|
113
113
|
$$css: true
|
|
114
114
|
},
|
|
115
115
|
gutterInlineStart: {
|
|
116
|
-
keTefX: "
|
|
116
|
+
keTefX: "xpdk1p0",
|
|
117
117
|
$$css: true
|
|
118
118
|
},
|
|
119
119
|
gutterBlockEnd: {
|
|
120
|
-
k1K539: "
|
|
120
|
+
k1K539: "x3z50q0",
|
|
121
121
|
$$css: true
|
|
122
122
|
},
|
|
123
123
|
gutterBlockStart: {
|
|
124
|
-
keoZOQ: "
|
|
124
|
+
keoZOQ: "x1j6tnbc",
|
|
125
125
|
$$css: true
|
|
126
126
|
}
|
|
127
127
|
};
|
|
@@ -464,8 +464,14 @@ function useLayerImplementation(options) {
|
|
|
464
464
|
// hosted away from its trigger then still takes its sequential focus
|
|
465
465
|
// order (and its popover nesting) from the trigger rather than from
|
|
466
466
|
// its own DOM position. Browsers without the option ignore it.
|
|
467
|
+
// `source` is declared as an `HTMLElement`. A caller-rendered icon
|
|
468
|
+
// trigger is an `SVGElement`, whose dictionary conversion throws
|
|
469
|
+
// before the popover opens. Omitting the option for it still anchors
|
|
470
|
+
// the layer, because positioning reads the anchor-name pair, and only
|
|
471
|
+
// gives up the invoker's focus order.
|
|
472
|
+
const trigger = triggerRef.current instanceof HTMLElement ? triggerRef.current : undefined;
|
|
467
473
|
popover.showPopover({
|
|
468
|
-
source:
|
|
474
|
+
source: trigger
|
|
469
475
|
});
|
|
470
476
|
});
|
|
471
477
|
} else {
|
|
@@ -68,7 +68,7 @@ export interface UseLayerDismissalReturn {
|
|
|
68
68
|
* routes each Escape press to the top-most REGISTERED layer, so one press
|
|
69
69
|
* dismisses exactly one of them. Dialog (and what is built on it, including
|
|
70
70
|
* CommandPalette), Popover and the menus built on it, ContextMenu, Tooltip,
|
|
71
|
-
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
71
|
+
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
72
72
|
* `Drawer` register today.
|
|
73
73
|
*
|
|
74
74
|
* `DropdownMenuSubMenu` and `PowerSearchEditPopover` still run their own Escape
|
|
@@ -25,7 +25,7 @@ import { isTextComposing, isTopmostLayer, registerLayer } from "./layerStack.js"
|
|
|
25
25
|
* routes each Escape press to the top-most REGISTERED layer, so one press
|
|
26
26
|
* dismisses exactly one of them. Dialog (and what is built on it, including
|
|
27
27
|
* CommandPalette), Popover and the menus built on it, ContextMenu, Tooltip,
|
|
28
|
-
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
28
|
+
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
29
29
|
* `Drawer` register today.
|
|
30
30
|
*
|
|
31
31
|
* `DropdownMenuSubMenu` and `PowerSearchEditPopover` still run their own Escape
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @file container.stylex.ts
|
|
3
3
|
* @input Uses @stylexjs/stylex, spacing from theme
|
|
4
4
|
* @output StyleX utility for layout container styling
|
|
5
|
-
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
6
|
-
*
|
|
5
|
+
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
6
|
+
* Drawer
|
|
7
7
|
*
|
|
8
8
|
* ## Public API for themes
|
|
9
9
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* --astryx-card-padding-block-end
|
|
18
18
|
*
|
|
19
19
|
* Read order per level: `var(--astryx-…, <next level>)`, terminating at
|
|
20
|
-
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
20
|
+
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
21
21
|
* drawer.
|
|
22
22
|
*
|
|
23
23
|
* ```ts
|
|
@@ -221,8 +221,8 @@ export interface ContainerOptions {
|
|
|
221
221
|
* This allows themes to override container padding via component-specific
|
|
222
222
|
* public CSS custom properties without touching internal vars.
|
|
223
223
|
*
|
|
224
|
-
* Used by Card, Section, Dialog, BottomSheet, and
|
|
225
|
-
*
|
|
224
|
+
* Used by Card, Section, Dialog, BottomSheet, and Drawer when no explicit
|
|
225
|
+
* padding prop is provided.
|
|
226
226
|
* @default undefined (uses explicit spacing token values)
|
|
227
227
|
*/
|
|
228
228
|
useThemeDefault?: ContainerComponent;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @file container.stylex.ts
|
|
5
5
|
* @input Uses @stylexjs/stylex, spacing from theme
|
|
6
6
|
* @output StyleX utility for layout container styling
|
|
7
|
-
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
8
|
-
*
|
|
7
|
+
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
8
|
+
* Drawer
|
|
9
9
|
*
|
|
10
10
|
* ## Public API for themes
|
|
11
11
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* --astryx-card-padding-block-end
|
|
20
20
|
*
|
|
21
21
|
* Read order per level: `var(--astryx-…, <next level>)`, terminating at
|
|
22
|
-
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
22
|
+
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
23
23
|
* drawer.
|
|
24
24
|
*
|
|
25
25
|
* ```ts
|
|
@@ -133,7 +133,7 @@ const bottomSheetInlineEnd = `var(--astryx-bottom-sheet-padding-inline-end, ${bo
|
|
|
133
133
|
const bottomSheetBlockStart = `var(--astryx-bottom-sheet-padding-block-start, ${bottomSheetShorthand})`;
|
|
134
134
|
const bottomSheetBlockEnd = `var(--astryx-bottom-sheet-padding-block-end, ${bottomSheetShorthand})`;
|
|
135
135
|
|
|
136
|
-
// Drawer
|
|
136
|
+
// Drawer padding chains: --astryx-* then the next specificity level,
|
|
137
137
|
// terminating at --spacing-4 like Dialog. Built as chained const strings (no
|
|
138
138
|
// function calls) so StyleX can statically analyze them; see naming.ts for the
|
|
139
139
|
// prefix policy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/Markdown/plugins/frontmatter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAKL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
|
|
38
|
-
const
|
|
38
|
+
const entries = new Map();
|
|
39
39
|
for (const line of body.slice(0, close.index).split(/\r?\n/)) {
|
|
40
40
|
if (line.trim() === '') {
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
const separator = line.indexOf(':');
|
|
44
44
|
const key = line.slice(0, separator).trim();
|
|
45
|
-
if (separator <= 0 || key === '' ||
|
|
45
|
+
if (separator <= 0 || key === '' || entries.has(key)) {
|
|
46
46
|
return {
|
|
47
47
|
status: 'none'
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
entries.set(key, line.slice(separator + 1).trim());
|
|
51
51
|
}
|
|
52
|
+
// A plain object, so a parser that returns the record unchanged passes the
|
|
53
|
+
// JSON-like metadata check. `fromEntries` defines every key as an own data
|
|
54
|
+
// property, so a field named `__proto__` stays a field.
|
|
55
|
+
const fields = Object.fromEntries(entries);
|
|
52
56
|
let end = openingLength + close.index + close[0].length;
|
|
53
57
|
if (source.startsWith('\r\n', end)) {
|
|
54
58
|
end += 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,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G;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAqED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,uBAAuB,EAAE,EAC/D,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,OAAO,EACP,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,OAAiB,EACjB,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,SAAS,EACT,QAAgB,EAChB,YAAoB,EACpB,cAAc,EAAE,uBAAuB,EACvC,SAAiB,EACjB,iBAAiB,EAAE,0BAA0B,EAC7C,SAAS,EAAE,kBAAkB,EAC7B,eAAe,EAAE,wBAAwB,EACzC,SAAiB,EACjB,cAAwB,EACxB,WAAW,EACX,SAAa,EACb,YAAY,EACZ,iBAA2B,EAC3B,YAAwB,EACxB,aAAqB,EACrB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,OAAO,EACP,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAykDvB;yBA/nDe,aAAa"}
|
|
@@ -29,13 +29,12 @@ import { PanelSearchInput } from "../Field/PanelSearchInput.js";
|
|
|
29
29
|
import { CheckboxInput } from "../CheckboxInput/index.js";
|
|
30
30
|
import { Badge } from "../Badge/index.js";
|
|
31
31
|
import "../theme/tokens.stylex.js";
|
|
32
|
-
import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
32
|
+
import { colorVars, focusVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
33
33
|
import { isOptionData, isDivider, isSection, normalizeOption, getSelectableOptions } from "../Selector/utils.js";
|
|
34
34
|
import { useMultiCombobox } from "./hooks.js";
|
|
35
35
|
import { getInputARIA, isImeKeyEvent, mergeProps } from "../utils/index.js";
|
|
36
36
|
import { devWarn, warnOnce } from "../utils/devWarning.js";
|
|
37
|
-
import "../utils/
|
|
38
|
-
import { FOCUS_OUTLINE_PARTS } from "../utils/focusOutline.stylex.js";
|
|
37
|
+
import { getInteractionModality, useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
39
38
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
40
39
|
import { FOCUSABLE_SELECTOR } from "../hooks/focusableSelector.js";
|
|
41
40
|
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
@@ -894,8 +893,8 @@ export function MultiSelector({
|
|
|
894
893
|
getActionCellId,
|
|
895
894
|
activeDescendantId,
|
|
896
895
|
onTriggerClick,
|
|
897
|
-
onKeyDown,
|
|
898
|
-
onItemMouseEnter
|
|
896
|
+
onKeyDown: onComboboxKeyDown,
|
|
897
|
+
onItemMouseEnter: onComboboxItemMouseEnter
|
|
899
898
|
} = useMultiCombobox({
|
|
900
899
|
selectableItems: sortedItems,
|
|
901
900
|
isDisabled: isDisabled || isEffectivelyReadOnly,
|
|
@@ -918,6 +917,21 @@ export function MultiSelector({
|
|
|
918
917
|
}, [getActionCellIdForActivate])
|
|
919
918
|
});
|
|
920
919
|
|
|
920
|
+
// A hover moves the highlight too, but the focus ring follows the shared
|
|
921
|
+
// interaction modality (architecture:interaction-modality INV1): it is read
|
|
922
|
+
// whenever a key or the pointer moves the highlight, so an action cell
|
|
923
|
+
// highlighted after pointer input keeps the hover treatment and no ring.
|
|
924
|
+
useInteractionModalityTracking();
|
|
925
|
+
const [isKeyboardHighlight, setIsKeyboardHighlight] = useState(() => getInteractionModality() === 'keyboard');
|
|
926
|
+
const onKeyDown = useCallback(event => {
|
|
927
|
+
onComboboxKeyDown(event);
|
|
928
|
+
setIsKeyboardHighlight(getInteractionModality() === 'keyboard');
|
|
929
|
+
}, [onComboboxKeyDown]);
|
|
930
|
+
const onItemMouseEnter = useCallback((...args) => {
|
|
931
|
+
onComboboxItemMouseEnter(...args);
|
|
932
|
+
setIsKeyboardHighlight(getInteractionModality() === 'keyboard');
|
|
933
|
+
}, [onComboboxItemMouseEnter]);
|
|
934
|
+
|
|
921
935
|
// The trigger button owns its click so a consumer `onClick`, which lands on
|
|
922
936
|
// the button, composes after the built-in toggle. A press elsewhere in the
|
|
923
937
|
// control box (padding, start icon, chevron) still opens the panel.
|
|
@@ -1179,14 +1193,14 @@ export function MultiSelector({
|
|
|
1179
1193
|
className: "x78zum5 x6s0dn4 x2lah0s xh6dtrn"
|
|
1180
1194
|
},
|
|
1181
1195
|
1: {
|
|
1182
|
-
className: "x78zum5 x6s0dn4 x2lah0s xh6dtrn
|
|
1196
|
+
className: "x78zum5 x6s0dn4 x2lah0s xh6dtrn xak0ai5 x9ssot5 x19bwoy8 x1eqjuhu"
|
|
1183
1197
|
}
|
|
1184
|
-
}[!!(isHighlighted && highlightedCell === 'action') << 0],
|
|
1198
|
+
}[!!(isHighlighted && highlightedCell === 'action' && isKeyboardHighlight) << 0],
|
|
1185
1199
|
children: isSelectAll || isCreate ? null : item.action
|
|
1186
1200
|
})]
|
|
1187
1201
|
}) : content
|
|
1188
1202
|
}, item.value);
|
|
1189
|
-
}, [isGrid, highlightedCell, getActionCellId, renderOption, indicatorPosition, highlightedIndex, optimisticValue, allEnabledSelected, selectAllState, selectAllLabel, getItemId, handleNavigableToggle, onItemMouseEnter, size, t]);
|
|
1203
|
+
}, [isGrid, highlightedCell, isKeyboardHighlight, getActionCellId, renderOption, indicatorPosition, highlightedIndex, optimisticValue, allEnabledSelected, selectAllState, selectAllLabel, getItemId, handleNavigableToggle, onItemMouseEnter, size, t]);
|
|
1190
1204
|
|
|
1191
1205
|
// Render all options. Uses sortedItems as the single source of truth for
|
|
1192
1206
|
// item order — no independent sorting here. Structural elements (dividers,
|