@astryxdesign/core 0.7.2-canary.6d4f178 → 0.7.2-canary.6fddf4f
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/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +40 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +36 -7
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts +6 -4
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.js +4 -3
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +24 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +46 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +4 -2
- package/dist/MobileNav/MobileNav.d.ts +9 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +30 -3
- package/dist/SideNav/SideNavItem.d.ts +8 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +71 -9
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +4 -2
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +3 -3
- package/dist/astryx.css +5 -0
- package/package.json +3 -3
- package/scripts/agent-doc-state.mjs +38 -0
- package/scripts/postinstall.mjs +1 -1
- package/src/AppShell/AppShell.tsx +45 -1
- package/src/Card/Card.doc.mjs +1 -1
- package/src/Code/Code.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +2 -0
- package/src/Drawer/Drawer.doc.mjs +1 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +17 -5
- package/src/DropdownMenu/DropdownMenu.tsx +36 -8
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +169 -10
- package/src/DropdownMenu/DropdownMenuGroup.tsx +6 -4
- package/src/DropdownMenu/DropdownMenuLazySheet.test.tsx +126 -0
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +334 -0
- package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +43 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +71 -0
- package/src/Field/FieldLabel.doc.mjs +133 -26
- package/src/Field/FieldLabel.spec.md +172 -0
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +296 -0
- package/src/Heading/Heading.test.tsx +57 -0
- package/src/Heading/Heading.tsx +6 -2
- package/src/Icon/Icon.doc.mjs +36 -0
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- package/src/MetadataList/MetadataList.doc.mjs +1 -1
- package/src/MobileNav/MobileNav.tsx +30 -3
- package/src/MobileNav/MobileNavCloseEdgeCases.test.tsx +173 -15
- package/src/MoreMenu/MoreMenu.test.tsx +5 -1
- package/src/ProgressBar/ProgressBar.doc.mjs +1 -0
- package/src/Resizable/useResizable.doc.mjs +2 -0
- package/src/ScrollableArea/ScrollableArea.doc.mjs +1 -1
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +179 -0
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +96 -17
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/Text/Text.test.tsx +57 -0
- package/src/Text/Text.tsx +6 -2
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +4 -0
- package/src/Toolbar/Toolbar.test.tsx +0 -8
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +163 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.renders.tsx +63 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.states.ts +142 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.test.tsx +126 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +22 -0
- package/src/TopNav/TopNavMegaMenu.tsx +7 -3
- package/src/TopNav/TopNavMenu.test.tsx +19 -0
- package/src/TopNav/TopNavMenu.tsx +11 -3
- package/src/postinstall.test.mjs +46 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAsChD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG,MAAM,CAAC;AAE9D;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH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BA0bf;yBAzce,QAAQ"}
|
|
@@ -29,6 +29,7 @@ import { LayoutHeader } from "../Layout/LayoutHeader.js";
|
|
|
29
29
|
import { LayoutPanel } from "../Layout/LayoutPanel.js";
|
|
30
30
|
import { LayoutContent } from "../Layout/LayoutContent.js";
|
|
31
31
|
import { MobileNavToggle } from "../MobileNav/MobileNavToggle.js";
|
|
32
|
+
import { MAX_CLOSE_DELAY_MS as MOBILE_NAV_MAX_CLOSE_DELAY_MS } from "../MobileNav/MobileNav.js";
|
|
32
33
|
import { SideNavRenderContext } from "../SideNav/SideNavRenderContext.js";
|
|
33
34
|
import { TopNavRenderContext } from "../TopNav/TopNavRenderContext.js";
|
|
34
35
|
import { TopNavMobileContentContext } from "../TopNav/TopNavMobileContentContext.js";
|
|
@@ -62,6 +63,20 @@ const ActivityWrapper = HasActivity ? ({
|
|
|
62
63
|
|
|
63
64
|
const MAIN_CONTENT_ID = 'astryx-app-shell-main';
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Extra time, on top of MobileNav's own worst-case close delay, that
|
|
68
|
+
* AppShell waits before flipping its `Activity` boundary to `'hidden'`.
|
|
69
|
+
*
|
|
70
|
+
* React's `Activity` hides its subtree with `display: none !important`
|
|
71
|
+
* synchronously in the same commit as the mode flip, and re-runs the
|
|
72
|
+
* cleanup of every effect inside it — which would otherwise clear
|
|
73
|
+
* MobileNav's own scheduled `dialog.close()` before it fires, or cut off
|
|
74
|
+
* its slide-out CSS transition before it plays (#5701). Waiting strictly
|
|
75
|
+
* longer than MobileNav's own cap, rather than the same duration, means
|
|
76
|
+
* this never turns into a race decided by browser timer-firing order.
|
|
77
|
+
*/
|
|
78
|
+
const ACTIVITY_HIDE_BUFFER_MS = 50;
|
|
79
|
+
|
|
65
80
|
// =============================================================================
|
|
66
81
|
// Types
|
|
67
82
|
// =============================================================================
|
|
@@ -259,6 +274,30 @@ export function AppShell({
|
|
|
259
274
|
const isBelowBreakpoint = useMediaQuery(breakpointQuery, sideNavBreakpoint === 'none' ? false : mobileNavConfig?.defaultIsMobile);
|
|
260
275
|
const [uncontrolledMobileOpen, setUncontrolledMobileOpen] = useState(false);
|
|
261
276
|
const isMobileNavOpen = mobileNavConfig?.isOpen ?? uncontrolledMobileOpen;
|
|
277
|
+
|
|
278
|
+
// Holds the mobile nav's `Activity` boundary visible for a beat after a
|
|
279
|
+
// close, so MobileNav's own close effect gets a real chance to run its
|
|
280
|
+
// slide-out transition and schedule its delayed `dialog.close()` before
|
|
281
|
+
// Activity hides the subtree (#5701). Only the CLOSE is deferred: opening
|
|
282
|
+
// reads `isMobileNavOpen` directly below, so a controlled open is visible in
|
|
283
|
+
// the commit that carries it instead of one effect later.
|
|
284
|
+
const [isMobileNavCloseHeld, setIsMobileNavCloseHeld] = useState(isMobileNavOpen);
|
|
285
|
+
// Arm the hold during render, from the open state itself, so no Effect has
|
|
286
|
+
// to copy props into state; the Effect below only owns the release timer.
|
|
287
|
+
if (isMobileNavOpen && !isMobileNavCloseHeld) {
|
|
288
|
+
setIsMobileNavCloseHeld(true);
|
|
289
|
+
}
|
|
290
|
+
useEffect(() => {
|
|
291
|
+
if (!HasActivity || isMobileNavOpen) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
const delayMs = window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : MOBILE_NAV_MAX_CLOSE_DELAY_MS + ACTIVITY_HIDE_BUFFER_MS;
|
|
295
|
+
const timeout = setTimeout(() => {
|
|
296
|
+
setIsMobileNavCloseHeld(false);
|
|
297
|
+
}, delayMs);
|
|
298
|
+
return () => clearTimeout(timeout);
|
|
299
|
+
}, [isMobileNavOpen]);
|
|
300
|
+
const isMobileNavActivityVisible = isMobileNavOpen || isMobileNavCloseHeld;
|
|
262
301
|
const mobileNavOnOpenChange = mobileNavConfig?.onOpenChange;
|
|
263
302
|
const setMobileNavOpen = useCallback(open => {
|
|
264
303
|
if (!mobileNavIsControlled) {
|
|
@@ -520,7 +559,7 @@ export function AppShell({
|
|
|
520
559
|
start: sideNavContent,
|
|
521
560
|
content: mainContent
|
|
522
561
|
}), shouldRenderMobileNavReactNode && mobileNavReactNode, shouldRenderConfigContent && mobileNavConfigContent, isBelowBreakpoint && !mobileNavDisabled && mobileNavReactNode == null && !mobileNavConfigContent && /*#__PURE__*/_jsxs(ActivityWrapper, {
|
|
523
|
-
mode:
|
|
562
|
+
mode: isMobileNavActivityVisible ? 'visible' : 'hidden',
|
|
524
563
|
children: [hasSideNav && !hasTopNav && /*#__PURE__*/_jsx(SideNavRenderContext, {
|
|
525
564
|
value: "drawer",
|
|
526
565
|
children: sideNav
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file DropdownMenu.tsx
|
|
3
|
-
* @input Uses React, StyleX, usePopover, MenuBottomSheet, Button, List,
|
|
3
|
+
* @input Uses React, StyleX, usePopover, MenuBottomSheet (lazy), Button, List,
|
|
4
4
|
* useListFocus, and the shared viewport-safe menu-width resolver
|
|
5
5
|
* @output Exports DropdownMenu with caller-selected popover or bottom-sheet
|
|
6
6
|
* presentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAKnD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AA0B9D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG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,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAsB,SAAQ,qBAAqB;IAC3D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AAiuCpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA4CpD;yBA5Ce,YAAY"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DropdownMenu.tsx
|
|
7
|
-
* @input Uses React, StyleX, usePopover, MenuBottomSheet, Button, List,
|
|
7
|
+
* @input Uses React, StyleX, usePopover, MenuBottomSheet (lazy), Button, List,
|
|
8
8
|
* useListFocus, and the shared viewport-safe menu-width resolver
|
|
9
9
|
* @output Exports DropdownMenu with caller-selected popover or bottom-sheet
|
|
10
10
|
* presentation
|
|
@@ -58,8 +58,8 @@ import { resolveMenuWidth } from "./menuWidth.js";
|
|
|
58
58
|
import "../Layer/layerViewportInset.stylex.js";
|
|
59
59
|
import { layerViewportInset } from "../Layer/layerViewportInset.stylex.js";
|
|
60
60
|
import { useAdaptivePresentation } from "../hooks/useAdaptivePresentation.js";
|
|
61
|
-
|
|
62
|
-
import { MenuBottomSheetActionList } from "./
|
|
61
|
+
// Loaded on demand: only the bottom-sheet presentation renders the sheet.
|
|
62
|
+
import { MenuBottomSheet, MenuBottomSheetActionList } from "./lazyMenuBottomSheet.js";
|
|
63
63
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
64
64
|
import "../theme/tokens.stylex.js";
|
|
65
65
|
import { spacingVars, colorVars, radiusVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
@@ -491,12 +491,41 @@ function DropdownMenuBottomSheet({
|
|
|
491
491
|
if (!isOpen || openModalityRef.current !== 'keyboard') {
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
const findFirstAction = () => actionListRef.current?.querySelector('button:not(:disabled), a[href]') ?? null;
|
|
495
|
+
let observer = null;
|
|
496
|
+
let frame = requestAnimationFrame(() => {
|
|
497
|
+
const action = findFirstAction();
|
|
498
|
+
if (action != null) {
|
|
499
|
+
action.focus({
|
|
500
|
+
preventScroll: true
|
|
501
|
+
});
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
// The sheet loads on demand, so a keyboard open can arrive before its
|
|
505
|
+
// rows exist. Wait for them, then focus a frame later so the sheet's
|
|
506
|
+
// own open-focus has already run.
|
|
507
|
+
observer = new MutationObserver(() => {
|
|
508
|
+
const loaded = findFirstAction();
|
|
509
|
+
if (loaded == null) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
observer?.disconnect();
|
|
513
|
+
observer = null;
|
|
514
|
+
frame = requestAnimationFrame(() => {
|
|
515
|
+
loaded.focus({
|
|
516
|
+
preventScroll: true
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
observer.observe(document.body, {
|
|
521
|
+
childList: true,
|
|
522
|
+
subtree: true
|
|
497
523
|
});
|
|
498
524
|
});
|
|
499
|
-
return () =>
|
|
525
|
+
return () => {
|
|
526
|
+
cancelAnimationFrame(frame);
|
|
527
|
+
observer?.disconnect();
|
|
528
|
+
};
|
|
500
529
|
}, [currentItems, isOpen]);
|
|
501
530
|
useEffect(() => {
|
|
502
531
|
if (!isOpen) {
|
|
@@ -23,7 +23,8 @@ import type { BaseProps } from '../BaseProps';
|
|
|
23
23
|
export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'className' | 'style'> {
|
|
24
24
|
/**
|
|
25
25
|
* Heading shown above the group's rows and used as the group's accessible
|
|
26
|
-
* name (`aria-labelledby`). Omit it for an unnamed group.
|
|
26
|
+
* name (`aria-labelledby`). Omit it for an unnamed group. Keep this content
|
|
27
|
+
* non-interactive; controls belong in DropdownMenu's `header` or `footer`.
|
|
27
28
|
*/
|
|
28
29
|
title?: ReactNode;
|
|
29
30
|
/** The rows of the group: menu items, selectable items, sub-menus. */
|
|
@@ -34,9 +35,10 @@ export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'clas
|
|
|
34
35
|
/**
|
|
35
36
|
* A titled group of menu rows.
|
|
36
37
|
*
|
|
37
|
-
* Renders `role="group"` named by its heading. The heading is
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Renders `role="group"` named by its heading. The heading is not a
|
|
39
|
+
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
40
|
+
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
41
|
+
* `footer`. The compound peer of
|
|
40
42
|
* `{type: 'section', title, items}` in the `items` data API.
|
|
41
43
|
*
|
|
42
44
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC
|
|
1
|
+
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE,sBAAsB,+BAuBxB;yBA9Be,iBAAiB"}
|
|
@@ -32,9 +32,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
/**
|
|
33
33
|
* A titled group of menu rows.
|
|
34
34
|
*
|
|
35
|
-
* Renders `role="group"` named by its heading. The heading is
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Renders `role="group"` named by its heading. The heading is not a
|
|
36
|
+
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
37
|
+
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
38
|
+
* `footer`. The compound peer of
|
|
38
39
|
* `{type: 'section', title, items}` in the `items` data API.
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file lazyMenuBottomSheet.ts
|
|
3
|
+
* @input Uses React lazy and Suspense, useIsHydrating, MenuBottomSheet, and
|
|
4
|
+
* MenuBottomSheetActionList
|
|
5
|
+
* @output Exports MenuBottomSheet and MenuBottomSheetActionList wrappers that
|
|
6
|
+
* load the touch sheet on first render
|
|
7
|
+
* @position Internal to DropdownMenu
|
|
8
|
+
*
|
|
9
|
+
* The touch sheet (BottomSheet, its gestures, and the touch action list) only
|
|
10
|
+
* renders for the bottom-sheet presentation. Loading it on demand keeps it out
|
|
11
|
+
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
12
|
+
* the wrapped component's props and renders nothing until its module loads.
|
|
13
|
+
*
|
|
14
|
+
* Neither wrapper renders on the server or in the render that hydrates server
|
|
15
|
+
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
16
|
+
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
17
|
+
* visible markup, so it first renders right after hydration.
|
|
18
|
+
*/
|
|
19
|
+
import { type ComponentProps, type ReactElement } from 'react';
|
|
20
|
+
import type { MenuBottomSheet as EagerMenuBottomSheet } from './MenuBottomSheet';
|
|
21
|
+
import type { MenuBottomSheetActionList as EagerMenuBottomSheetActionList } from './MenuBottomSheetActionList';
|
|
22
|
+
export declare function MenuBottomSheet(props: ComponentProps<typeof EagerMenuBottomSheet>): ReactElement | null;
|
|
23
|
+
export declare function MenuBottomSheetActionList(props: ComponentProps<typeof EagerMenuBottomSheetActionList>): ReactElement | null;
|
|
24
|
+
//# sourceMappingURL=lazyMenuBottomSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyMenuBottomSheet.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/lazyMenuBottomSheet.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,eAAe,IAAI,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EAAC,yBAAyB,IAAI,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAc7G,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACjD,YAAY,GAAG,IAAI,CASrB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,cAAc,CAAC,OAAO,8BAA8B,CAAC,GAC3D,YAAY,GAAG,IAAI,CASrB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file lazyMenuBottomSheet.ts
|
|
7
|
+
* @input Uses React lazy and Suspense, useIsHydrating, MenuBottomSheet, and
|
|
8
|
+
* MenuBottomSheetActionList
|
|
9
|
+
* @output Exports MenuBottomSheet and MenuBottomSheetActionList wrappers that
|
|
10
|
+
* load the touch sheet on first render
|
|
11
|
+
* @position Internal to DropdownMenu
|
|
12
|
+
*
|
|
13
|
+
* The touch sheet (BottomSheet, its gestures, and the touch action list) only
|
|
14
|
+
* renders for the bottom-sheet presentation. Loading it on demand keeps it out
|
|
15
|
+
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
16
|
+
* the wrapped component's props and renders nothing until its module loads.
|
|
17
|
+
*
|
|
18
|
+
* Neither wrapper renders on the server or in the render that hydrates server
|
|
19
|
+
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
20
|
+
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
21
|
+
* visible markup, so it first renders right after hydration.
|
|
22
|
+
*/
|
|
23
|
+
import { createElement, lazy, Suspense } from 'react';
|
|
24
|
+
import { useIsHydrating } from "../hooks/useIsHydrating.js";
|
|
25
|
+
const LazyMenuBottomSheet = /*#__PURE__*/lazy(async () => import("./MenuBottomSheet.js").then(module => ({
|
|
26
|
+
default: module.MenuBottomSheet
|
|
27
|
+
})));
|
|
28
|
+
const LazyMenuBottomSheetActionList = /*#__PURE__*/lazy(async () => import("./MenuBottomSheetActionList.js").then(module => ({
|
|
29
|
+
default: module.MenuBottomSheetActionList
|
|
30
|
+
})));
|
|
31
|
+
export function MenuBottomSheet(props) {
|
|
32
|
+
if (useIsHydrating()) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/createElement(Suspense, {
|
|
36
|
+
fallback: null
|
|
37
|
+
}, /*#__PURE__*/createElement(LazyMenuBottomSheet, props));
|
|
38
|
+
}
|
|
39
|
+
export function MenuBottomSheetActionList(props) {
|
|
40
|
+
if (useIsHydrating()) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/createElement(Suspense, {
|
|
44
|
+
fallback: null
|
|
45
|
+
}, /*#__PURE__*/createElement(LazyMenuBottomSheetActionList, props));
|
|
46
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAyB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACX,MAAM,gBAAgB,CAAC;AAkBxB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAG7C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAM5C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAA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,WAAW,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAE9C;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAWD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,kBAAkB,EAClB,KAAiB,EACjB,OAAiB,EACjB,QAAY,EACZ,kBAAyB,EACzB,SAAS,EACT,QAAQ,EACR,OAAiB,EACjB,UAAkB,EAClB,gBAAwB,EACxB,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,YAAY,+BAsGd;yBA1He,OAAO"}
|
package/dist/Heading/Heading.js
CHANGED
|
@@ -105,9 +105,11 @@ export function Heading({
|
|
|
105
105
|
// the closed built-in StyleX maps with an unknown name.
|
|
106
106
|
const builtinType = type && isBuiltinHeadingType(type) ? type : undefined;
|
|
107
107
|
|
|
108
|
-
// Truncation detection
|
|
108
|
+
// Truncation detection. Only the tooltip reads the measured overflow, so
|
|
109
|
+
// with the tooltip off the text is clipped by CSS alone and nothing is
|
|
110
|
+
// measured or observed.
|
|
109
111
|
const truncation = useTruncation({
|
|
110
|
-
maxLines
|
|
112
|
+
maxLines: hasTruncateTooltip === false ? 0 : maxLines
|
|
111
113
|
});
|
|
112
114
|
|
|
113
115
|
// Tooltip for truncated text
|
|
@@ -36,6 +36,15 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { type ReactNode } from 'react';
|
|
38
38
|
import type { BaseProps } from '../BaseProps';
|
|
39
|
+
/**
|
|
40
|
+
* Longest the drawer will wait before closing, however long the hold is.
|
|
41
|
+
*
|
|
42
|
+
* Exported so `AppShell` can defer hiding this drawer's `Activity` boundary
|
|
43
|
+
* by at least this long too (`ACTIVITY_HIDE_BUFFER_MS` in AppShell.tsx) —
|
|
44
|
+
* otherwise Activity's `display: none !important` lands before this delay's
|
|
45
|
+
* own scheduled `dialog.close()` has a chance to run (#5701).
|
|
46
|
+
*/
|
|
47
|
+
export declare const MAX_CLOSE_DELAY_MS = 250;
|
|
39
48
|
/**
|
|
40
49
|
* Shortest duration in a `transition-duration` list, in ms; null if unreadable.
|
|
41
50
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileNav.d.ts","sourceRoot":"","sources":["../../src/MobileNav/MobileNav.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAwBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MobileNav.d.ts","sourceRoot":"","sources":["../../src/MobileNav/MobileNav.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAwBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4L5C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAItC;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkBpE;AA+DD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAEzC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EACR,MAAM,EACN,KAAW,EACX,IAAa,EACb,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BAuQhB;yBAtRe,SAAS"}
|
|
@@ -162,8 +162,15 @@ const dynamicStyles = {
|
|
|
162
162
|
// Close timing
|
|
163
163
|
// =============================================================================
|
|
164
164
|
|
|
165
|
-
/**
|
|
166
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Longest the drawer will wait before closing, however long the hold is.
|
|
167
|
+
*
|
|
168
|
+
* Exported so `AppShell` can defer hiding this drawer's `Activity` boundary
|
|
169
|
+
* by at least this long too (`ACTIVITY_HIDE_BUFFER_MS` in AppShell.tsx) —
|
|
170
|
+
* otherwise Activity's `display: none !important` lands before this delay's
|
|
171
|
+
* own scheduled `dialog.close()` has a chance to run (#5701).
|
|
172
|
+
*/
|
|
173
|
+
export const MAX_CLOSE_DELAY_MS = 250;
|
|
167
174
|
/** Fraction of the hold to close at, so the close never lands on its boundary. */
|
|
168
175
|
const CLOSE_WITHIN_HOLD = 0.6;
|
|
169
176
|
|
|
@@ -308,6 +315,21 @@ export function MobileNav({
|
|
|
308
315
|
// Element that was focused when the drawer opened; focus goes back to it
|
|
309
316
|
// once the native dialog has closed (see closeAndRestoreFocus).
|
|
310
317
|
const triggerElementRef = useRef(null);
|
|
318
|
+
|
|
319
|
+
// Keeps the dialog rendered from the commit that closes it until the delayed
|
|
320
|
+
// `close()` below has run. The `display` transition on the dialog is meant to
|
|
321
|
+
// do this, but a browser that does not hold a discrete `display` transition
|
|
322
|
+
// (WebKit) drops the dialog to `display: none` at once while it is still an
|
|
323
|
+
// open modal: nothing is visible, yet the whole page stays inert until the
|
|
324
|
+
// timer fires. Set during render, so it is already true in the commit that
|
|
325
|
+
// closes. The drawer's transform and the backdrop stay keyed to `isOpen`, so
|
|
326
|
+
// the slide-out is unchanged.
|
|
327
|
+
const [isCloseHeld, setIsCloseHeld] = useState(false);
|
|
328
|
+
const [wasOpen, setWasOpen] = useState(isOpen);
|
|
329
|
+
if (wasOpen !== isOpen) {
|
|
330
|
+
setWasOpen(isOpen);
|
|
331
|
+
setIsCloseHeld(!isOpen);
|
|
332
|
+
}
|
|
311
333
|
const gutterRef = useRef(null);
|
|
312
334
|
|
|
313
335
|
// Gives back the gutter held open in place of the hidden scrollbar.
|
|
@@ -374,7 +396,12 @@ export function MobileNav({
|
|
|
374
396
|
releaseGutter();
|
|
375
397
|
closeTimeoutRef.current = setTimeout(() => {
|
|
376
398
|
closeAndRestoreFocus(dialog, triggerElementRef);
|
|
399
|
+
setIsCloseHeld(false);
|
|
377
400
|
}, resolveCloseDelay(dialog));
|
|
401
|
+
} else {
|
|
402
|
+
// Nothing is open, so there is no close to hold the dialog for, and no
|
|
403
|
+
// close timer is left to release the hold.
|
|
404
|
+
setIsCloseHeld(false);
|
|
378
405
|
}
|
|
379
406
|
return () => {
|
|
380
407
|
if (closeTimeoutRef.current) {
|
|
@@ -444,7 +471,7 @@ export function MobileNav({
|
|
|
444
471
|
id: dialogId,
|
|
445
472
|
...mergeProps(themeProps('mobile-nav', {
|
|
446
473
|
side: resolvedSide
|
|
447
|
-
}), stylex.props(layerTextReset.reset, layerStructureReset.reset, styles.dialog, overlayPaddingReset.reset, isOpen && styles.open, styles.backdrop, isOpen && styles.backdropOpen, xstyle), className, style),
|
|
474
|
+
}), stylex.props(layerTextReset.reset, layerStructureReset.reset, styles.dialog, overlayPaddingReset.reset, (isOpen || isCloseHeld) && styles.open, styles.backdrop, isOpen && styles.backdropOpen, xstyle), className, style),
|
|
448
475
|
...rest,
|
|
449
476
|
"data-testid": testId,
|
|
450
477
|
"aria-label": label ?? (typeof header === 'string' ? header : t('@astryx.mobileNav.navigation')),
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
* `TopNavMenu` use). Hover is a progressive enhancement over the popover's
|
|
14
14
|
* click behavior and is inert on coarse pointers.
|
|
15
15
|
*
|
|
16
|
+
* Nested rows span the full width of the nav list, like top-level rows, so
|
|
17
|
+
* their hover and selected fill lines up with the rows above them. The
|
|
18
|
+
* nesting indent sits inside the row as extra inline-start padding, one step
|
|
19
|
+
* per level, tracked through a private depth context.
|
|
20
|
+
*
|
|
16
21
|
* SYNC: When modified, update these files to stay in sync:
|
|
17
22
|
* - /packages/core/src/SideNav/SideNav.doc.mjs
|
|
18
23
|
* - /packages/core/src/SideNav/SideNav.test.tsx
|
|
@@ -84,7 +89,9 @@ export interface SideNavItemProps extends BaseProps<HTMLElement> {
|
|
|
84
89
|
*/
|
|
85
90
|
actions?: ReactNode;
|
|
86
91
|
/**
|
|
87
|
-
* Sub-items for nesting.
|
|
92
|
+
* Sub-items for nesting. Nested items span the full width of the nav
|
|
93
|
+
* list, like top-level items; their content is indented one step per
|
|
94
|
+
* nesting level.
|
|
88
95
|
*/
|
|
89
96
|
children?: ReactNode;
|
|
90
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAYf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,iCAAiC,CAAC;AA4ShF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EACR,OAAO,GACP;QACE,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;KACpD,CAAC;IACN;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,EAAE,EACF,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,UAAkB,EAClB,UAAkB,EAClB,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EAAE,eAAe,EAC5B,IAAW,EACX,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,MAAM,EACN,GAAG,IAAI,EACR,EAAE,gBAAgB,sCAkalB;yBApbe,WAAW"}
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
* `TopNavMenu` use). Hover is a progressive enhancement over the popover's
|
|
18
18
|
* click behavior and is inert on coarse pointers.
|
|
19
19
|
*
|
|
20
|
+
* Nested rows span the full width of the nav list, like top-level rows, so
|
|
21
|
+
* their hover and selected fill lines up with the rows above them. The
|
|
22
|
+
* nesting indent sits inside the row as extra inline-start padding, one step
|
|
23
|
+
* per level, tracked through a private depth context.
|
|
24
|
+
*
|
|
20
25
|
* SYNC: When modified, update these files to stay in sync:
|
|
21
26
|
* - /packages/core/src/SideNav/SideNav.doc.mjs
|
|
22
27
|
* - /packages/core/src/SideNav/SideNav.test.tsx
|
|
@@ -24,7 +29,7 @@
|
|
|
24
29
|
* - /apps/storybook/stories/SideNav.stories.tsx
|
|
25
30
|
* - /packages/cli/assets/templates/blocks/components/SideNav/ (showcase blocks)
|
|
26
31
|
*/
|
|
27
|
-
import { useCallback, useId, useMemo, useRef, useState } from 'react';
|
|
32
|
+
import { createContext, use, useCallback, useId, useMemo, useRef, useState } from 'react';
|
|
28
33
|
import * as stylex from '@stylexjs/stylex';
|
|
29
34
|
import "../theme/tokens.stylex.js";
|
|
30
35
|
import { colorVars, spacingVars, sizeVars, fontWeightVars, typeScaleVars, durationVars, easeVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
@@ -133,6 +138,47 @@ const styles = {
|
|
|
133
138
|
}
|
|
134
139
|
};
|
|
135
140
|
|
|
141
|
+
// Nesting indent, drawn inside the row: one `--spacing-6` step per nesting
|
|
142
|
+
// level. The row itself stays full width, so its hover and selected fill
|
|
143
|
+
// matches a top-level row's.
|
|
144
|
+
// - `sm` / `md` — the ordinary row, where the row element is the link or
|
|
145
|
+
// button: its own inline-start padding plus the steps.
|
|
146
|
+
// SYNC: the base padding matches navItemStyles.sm / .md / .lg.
|
|
147
|
+
// - `primary` — the row-wrapper path: the wrapper keeps its base padding and
|
|
148
|
+
// the steps go on the primary link or button, so the whole indent is part
|
|
149
|
+
// of the click target rather than dead space that still shows feedback.
|
|
150
|
+
const _temp = {
|
|
151
|
+
kZCmMZ: "xnvo3vl",
|
|
152
|
+
"$$css": true
|
|
153
|
+
};
|
|
154
|
+
const _temp2 = {
|
|
155
|
+
kZCmMZ: "xnvo3vl",
|
|
156
|
+
"$$css": true
|
|
157
|
+
};
|
|
158
|
+
const _temp3 = {
|
|
159
|
+
kZCmMZ: "xnvo3vl",
|
|
160
|
+
"$$css": true
|
|
161
|
+
};
|
|
162
|
+
const indentStyles = {
|
|
163
|
+
sm: depth => [_temp, {
|
|
164
|
+
"--x-paddingInlineStart": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`calc(${spacingVars['--spacing-1']} + ${depth} * ${spacingVars['--spacing-6']})`)
|
|
165
|
+
}],
|
|
166
|
+
md: depth => [_temp2, {
|
|
167
|
+
"--x-paddingInlineStart": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`calc(${spacingVars['--spacing-2']} + ${depth} * ${spacingVars['--spacing-6']})`)
|
|
168
|
+
}],
|
|
169
|
+
primary: depth => [_temp3, {
|
|
170
|
+
"--x-paddingInlineStart": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`calc(${depth} * ${spacingVars['--spacing-6']})`)
|
|
171
|
+
}]
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* How many SideNavItems deep the current item sits: 0 at the top level,
|
|
176
|
+
* 1 inside one parent, and so on. A collapsed rail's flyout resets it to 0,
|
|
177
|
+
* since the flyout lists a parent's children as its own top level.
|
|
178
|
+
*/
|
|
179
|
+
const SideNavItemDepthContext = /*#__PURE__*/createContext(0);
|
|
180
|
+
SideNavItemDepthContext.displayName = 'SideNavItemDepthContext';
|
|
181
|
+
|
|
136
182
|
/**
|
|
137
183
|
* Cascaded to the `actions` slot through `SizeContext` so a consumer's row
|
|
138
184
|
* controls come out the same height as the built-in expand/collapse toggle,
|
|
@@ -259,6 +305,7 @@ export function SideNavItem({
|
|
|
259
305
|
const id = useId();
|
|
260
306
|
const hasChildren = !!children;
|
|
261
307
|
const itemRef = useRef(null);
|
|
308
|
+
const depth = use(SideNavItemDepthContext);
|
|
262
309
|
|
|
263
310
|
// Popover for collapsed items with children
|
|
264
311
|
const popover = usePopover({
|
|
@@ -391,7 +438,10 @@ export function SideNavItem({
|
|
|
391
438
|
children: label
|
|
392
439
|
}), /*#__PURE__*/_jsx(SideNavCollapseContext, {
|
|
393
440
|
value: EXPANDED_COLLAPSE_STATE,
|
|
394
|
-
children:
|
|
441
|
+
children: /*#__PURE__*/_jsx(SideNavItemDepthContext, {
|
|
442
|
+
value: 0,
|
|
443
|
+
children: children
|
|
444
|
+
})
|
|
395
445
|
})]
|
|
396
446
|
}), {
|
|
397
447
|
placement: 'end',
|
|
@@ -457,6 +507,15 @@ export function SideNavItem({
|
|
|
457
507
|
disabled: isDisabled ? 'disabled' : null
|
|
458
508
|
});
|
|
459
509
|
const itemStyleArgs = [navItemStyles.item, interactionOverlayStyles.backgroundColor, navItemStyles[size], isSelected && navItemStyles.selected, isDisabled && navItemStyles.disabled];
|
|
510
|
+
const rowIndent = depth > 0 && indentStyles[size === 'sm' ? 'sm' : 'md'](depth);
|
|
511
|
+
const primaryIndent = depth > 0 && indentStyles.primary(depth);
|
|
512
|
+
|
|
513
|
+
// The indent is a runtime value, so it reaches the element as an inline
|
|
514
|
+
// style. These props are spread after `rest`, so fold the caller's `style`
|
|
515
|
+
// back in (caller wins) rather than letting the indent replace it.
|
|
516
|
+
const callerStyle = {
|
|
517
|
+
style: rest.style
|
|
518
|
+
};
|
|
460
519
|
|
|
461
520
|
// Three shapes of the same row appearance:
|
|
462
521
|
// - `rowProps` — split-action path (toggle, no actions): presentational
|
|
@@ -471,7 +530,7 @@ export function SideNavItem({
|
|
|
471
530
|
...pressable
|
|
472
531
|
};
|
|
473
532
|
const focusableRowProps = {
|
|
474
|
-
...mergeProps(itemThemeProps, focusOutlineProps.focusVisible(...itemStyleArgs)),
|
|
533
|
+
...mergeProps(itemThemeProps, mergeProps(focusOutlineProps.focusVisible(...itemStyleArgs, rowIndent), callerStyle)),
|
|
475
534
|
...pressable
|
|
476
535
|
};
|
|
477
536
|
const actionsRowProps = {
|
|
@@ -511,10 +570,10 @@ export function SideNavItem({
|
|
|
511
570
|
onClick: handleClick,
|
|
512
571
|
...rest,
|
|
513
572
|
...rowPrimaryAriaProps,
|
|
514
|
-
...(hasActions ?
|
|
573
|
+
...mergeProps(hasActions ?
|
|
515
574
|
// The wrapper rings for this element; suppressing here is what
|
|
516
575
|
// keeps the UA's own ring from painting inside that one.
|
|
517
|
-
focusOutlineProps.suppressed(styles.splitAction) : focusOutlineProps.focusVisible(styles.splitAction)),
|
|
576
|
+
focusOutlineProps.suppressed(styles.splitAction, primaryIndent) : focusOutlineProps.focusVisible(styles.splitAction, primaryIndent), callerStyle),
|
|
518
577
|
children: itemContent
|
|
519
578
|
}), hasIndependentToggle && /*#__PURE__*/_jsx("button", {
|
|
520
579
|
type: "button",
|
|
@@ -575,21 +634,24 @@ export function SideNavItem({
|
|
|
575
634
|
inert: isItemCollapsed ? true : undefined,
|
|
576
635
|
...{
|
|
577
636
|
0: {
|
|
578
|
-
className: "xrvj5dj x1tu4anv
|
|
637
|
+
className: "xrvj5dj x1tu4anv x1rea2x4 x6kj92 xd00j3c x1eizr8u xsr0bmt xostmdb x1k6wr6r xlr8y92"
|
|
579
638
|
},
|
|
580
639
|
1: {
|
|
581
|
-
className: "xrvj5dj
|
|
640
|
+
className: "xrvj5dj x6kj92 xd00j3c x1eizr8u xsr0bmt xlr8y92 xihq33y xb3r6kr xf1rc6"
|
|
582
641
|
}
|
|
583
642
|
}[!!isItemCollapsed << 0],
|
|
584
643
|
children: /*#__PURE__*/_jsxs("div", {
|
|
585
644
|
...{
|
|
586
|
-
className: "
|
|
645
|
+
className: "x2lwn1j"
|
|
587
646
|
},
|
|
588
647
|
children: [/*#__PURE__*/_jsx("span", {
|
|
589
648
|
id: `${id}-label`,
|
|
590
649
|
hidden: true,
|
|
591
650
|
children: label
|
|
592
|
-
}),
|
|
651
|
+
}), /*#__PURE__*/_jsx(SideNavItemDepthContext, {
|
|
652
|
+
value: depth + 1,
|
|
653
|
+
children: children
|
|
654
|
+
})]
|
|
593
655
|
})
|
|
594
656
|
})]
|
|
595
657
|
});
|
package/dist/Text/Text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAyB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EACV,QAAQ,EAER,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV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H,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAE9C;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC1D;AA2BD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,gBAAgB,CAQpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAa,EACb,IAAI,EACJ,KAAK,EACL,MAAM,EACN,OAAkB,EAClB,QAAY,EACZ,kBAAyB,EACzB,SAAS,EACT,QAAQ,EACR,OAAiB,EACjB,UAAkB,EAClB,gBAAwB,EACxB,iBAAyB,EACzB,MAAM,EACN,SAAS,EACT,KAAK,EACL,EAAE,EAAE,SAAkB,EACtB,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BA8FX;yBAnHe,IAAI"}
|
package/dist/Text/Text.js
CHANGED
|
@@ -123,9 +123,11 @@ export function Text({
|
|
|
123
123
|
// Resolve display - force block when maxLines > 0 or hasCapsize
|
|
124
124
|
const resolvedDisplay = maxLines > 0 || hasCapsize ? 'block' : display;
|
|
125
125
|
|
|
126
|
-
// Truncation detection
|
|
126
|
+
// Truncation detection. Only the tooltip reads the measured overflow, so
|
|
127
|
+
// with the tooltip off the text is clipped by CSS alone and nothing is
|
|
128
|
+
// measured or observed.
|
|
127
129
|
const truncation = useTruncation({
|
|
128
|
-
maxLines
|
|
130
|
+
maxLines: hasTruncateTooltip === false ? 0 : maxLines
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
// Tooltip for truncated text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMegaMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAkBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TopNavMegaMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAkBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgN5C,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAW,EACX,SAAe,EACf,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,mBAAmB,4BAuCrB;yBAhDe,cAAc"}
|