@astryxdesign/core 0.7.2-canary.fe2c655 → 0.7.2
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/CHANGELOG.md +156 -2
- package/README.md +4 -4
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +40 -1
- package/dist/AspectRatio/AspectRatio.d.ts +6 -8
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +44 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +8 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -2
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +1 -0
- package/dist/CheckboxInput/CheckboxInput.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +3 -1
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +6 -2
- package/dist/CheckboxList/CheckboxListItem.d.ts +9 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +4 -2
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +37 -5
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +84 -113
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +21 -0
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +5 -3
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuDivider.js +7 -3
- 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/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +15 -4
- 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/DropdownMenu/menuRegionStops.d.ts +38 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRegionStops.js +131 -0
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +4 -10
- package/dist/Field/Field.d.ts +1 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +8 -4
- package/dist/FormLayout/FormLayout.d.ts +5 -4
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +1 -1
- package/dist/FormLayout/FormLayoutContext.d.ts +3 -3
- package/dist/FormLayout/FormLayoutContext.js +3 -3
- package/dist/Grid/Grid.d.ts +8 -7
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -4
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Grid/GridSpan.d.ts.map +1 -1
- package/dist/Grid/GridSpan.js +1 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +4 -2
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +19 -4
- package/dist/List/List.d.ts +46 -19
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +28 -10
- package/dist/List/ListContext.d.ts +8 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +7 -2
- package/dist/List/ListItem.d.ts +13 -5
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +21 -8
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.d.ts.map +1 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +8 -2
- package/dist/Markdown/plugins/headingLinks.d.ts.map +1 -1
- package/dist/Markdown/plugins/headingLinks.js +9 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +5 -1
- package/dist/MetadataList/MetadataListContext.d.ts +1 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- 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/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +5 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +45 -11
- package/dist/RadioList/RadioList.d.ts +1 -1
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +6 -2
- package/dist/RadioList/RadioListItem.d.ts +9 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +2 -0
- package/dist/SideNav/SideNavItem.d.ts +8 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +76 -10
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +4 -2
- package/dist/ToggleButton/ToggleButton.d.ts +3 -2
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +12 -1
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +5 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +2 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +57 -9
- package/dist/astryx.css +27 -4
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +18 -13
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +15 -9
- package/docs.mjs +4 -4
- package/package.json +4 -4
- package/scripts/agent-doc-state.mjs +66 -6
- package/scripts/postinstall.mjs +44 -3
- package/src/AppShell/AppShell.tsx +45 -1
- package/src/AspectRatio/AspectRatio.test.tsx +44 -43
- package/src/AspectRatio/AspectRatio.tsx +38 -18
- package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +157 -0
- package/src/Avatar/Avatar.doc.mjs +5 -3
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +3 -2
- package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +24 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +30 -1
- package/src/Card/Card.doc.mjs +1 -1
- package/src/Chat/ChatLayoutScrollButton.test.tsx +13 -0
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +64 -19
- package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +3 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +34 -0
- package/src/CheckboxInput/CheckboxInput.tsx +3 -1
- package/src/CheckboxList/CheckboxList.fr10.test.tsx +29 -2
- package/src/CheckboxList/CheckboxList.test.tsx +22 -0
- package/src/CheckboxList/CheckboxList.tsx +4 -1
- package/src/CheckboxList/CheckboxListItem.doc.mjs +16 -0
- package/src/CheckboxList/CheckboxListItem.tsx +10 -0
- package/src/Code/Code.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +2 -0
- package/src/CommandPalette/CommandPaletteInput.test.tsx +53 -4
- package/src/CommandPalette/CommandPaletteInput.tsx +33 -3
- package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +335 -0
- package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +292 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +2 -3
- package/src/ContextMenu/ContextMenu.test.tsx +12 -2
- package/src/ContextMenu/ContextMenu.tsx +4 -1
- package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +438 -0
- package/src/Dialog/Dialog.test.tsx +46 -0
- package/src/Dialog/Dialog.tsx +20 -7
- package/src/Dialog/__tests__/Dialog.a11y.known-failures.ts +0 -14
- package/src/Drawer/Drawer.doc.mjs +1 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +79 -6
- package/src/DropdownMenu/DropdownMenu.tsx +88 -144
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuContext.tsx +24 -0
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuDivider.spec.md +192 -0
- package/src/DropdownMenu/DropdownMenuDivider.tsx +9 -5
- 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/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +185 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +17 -3
- package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +280 -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/DropdownMenu/menuRegionStops.ts +167 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -2
- package/src/EmptyState/EmptyState.spec.md +189 -0
- package/src/EmptyState/EmptyState.test.tsx +74 -3
- package/src/EmptyState/EmptyState.tsx +4 -8
- package/src/Field/Field.doc.mjs +14 -8
- package/src/Field/Field.spec.md +217 -0
- package/src/Field/Field.test.tsx +60 -2
- package/src/Field/Field.tsx +17 -8
- 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/FormLayout/FormLayout.doc.mjs +6 -3
- package/src/FormLayout/FormLayout.spec.md +192 -0
- package/src/FormLayout/FormLayout.test.tsx +15 -0
- package/src/FormLayout/FormLayout.tsx +7 -6
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Grid/Grid.doc.mjs +7 -1
- package/src/Grid/Grid.spec.md +93 -113
- package/src/Grid/Grid.test.tsx +22 -0
- package/src/Grid/Grid.tsx +10 -9
- package/src/Grid/GridSpan.doc.mjs +3 -3
- package/src/Grid/GridSpan.tsx +4 -1
- 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/Indicator/Indicator.doc.mjs +3 -3
- package/src/Item/Item.doc.mjs +12 -8
- package/src/Item/Item.test.tsx +61 -0
- package/src/Item/Item.tsx +40 -4
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- package/src/List/List.doc.mjs +14 -1
- package/src/List/List.spec.md +129 -77
- package/src/List/List.test.tsx +163 -94
- package/src/List/List.tsx +74 -18
- package/src/List/ListContext.tsx +9 -3
- package/src/List/ListItem.doc.mjs +16 -0
- package/src/List/ListItem.tsx +56 -27
- package/src/List/index.ts +1 -1
- package/src/Markdown/Markdown.tsx +14 -1
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/MetadataList/MetadataList.doc.mjs +3 -3
- package/src/MetadataList/MetadataList.test.tsx +38 -0
- package/src/MetadataList/MetadataList.tsx +8 -1
- package/src/MetadataList/MetadataListContext.tsx +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/PowerSearch/PowerSearch.test.tsx +62 -0
- package/src/PowerSearch/PowerSearch.tsx +9 -0
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +71 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +45 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +1 -0
- package/src/RadioList/RadioList.fr10.test.tsx +45 -2
- package/src/RadioList/RadioList.test.tsx +22 -0
- package/src/RadioList/RadioList.tsx +4 -1
- package/src/RadioList/RadioListItem.doc.mjs +16 -0
- package/src/RadioList/RadioListItem.tsx +10 -1
- 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 +220 -0
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +99 -17
- package/src/Slider/Slider.spec.md +39 -18
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/TabList/TabList.spec.md +57 -44
- package/src/Table/Table.spec.md +6 -1
- package/src/Table/plugins/activation/useTableActivation.spec.md +254 -0
- package/src/Text/Text.test.tsx +57 -0
- package/src/Text/Text.tsx +6 -2
- package/src/TimeInput/TimeInput.fr10.test.tsx +15 -0
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.test.tsx +95 -0
- package/src/ToggleButton/ToggleButton.tsx +12 -1
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +4 -0
- package/src/Token/Token.tsx +1 -1
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +86 -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 +47 -0
- package/src/TopNav/TopNavMegaMenu.tsx +9 -3
- package/src/TopNav/TopNavMenu.test.tsx +46 -1
- package/src/TopNav/TopNavMenu.tsx +13 -3
- package/src/TreeList/TreeList.doc.mjs +1 -0
- package/src/TreeList/TreeList.test.tsx +327 -6
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListBranches.tsx +6 -0
- package/src/TreeList/TreeListItem.tsx +88 -13
- package/src/docPropLiterals.test.ts +36 -10
- package/src/hooks/useMenuHover.ts +18 -13
- package/src/postinstall.test.mjs +79 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -29
- package/src/reset.test.ts +11 -0
- package/src/theme/derivedVarRegistry.test.ts +7 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
- package/src/utils/plainDate.test.ts +37 -1
- package/src/utils/plainDate.ts +15 -5
|
@@ -233,14 +233,59 @@ describe('TopNavMenu — drawer focus ring', () => {
|
|
|
233
233
|
expectSharedFocusRing(screen.getByRole('button', {name: /Products/}));
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
it('draws the shared ring on a drawer item', () => {
|
|
236
|
+
it('draws the shared ring on a drawer item', async () => {
|
|
237
|
+
const user = userEvent.setup();
|
|
237
238
|
render(
|
|
238
239
|
<TopNavRenderContext value="drawer">
|
|
239
240
|
<TopNavMenu label="Products" items={mockItems} />
|
|
240
241
|
</TopNavRenderContext>,
|
|
241
242
|
);
|
|
243
|
+
await user.click(screen.getByRole('button', {name: /Products/}));
|
|
242
244
|
expectSharedFocusRing(screen.getByRole('link', {name: /Analytics/}));
|
|
243
245
|
});
|
|
246
|
+
|
|
247
|
+
it('clips the drawer section only while it is collapsed', async () => {
|
|
248
|
+
// The ring paints outside the item, so a permanent clip would cut it off.
|
|
249
|
+
const user = userEvent.setup();
|
|
250
|
+
render(
|
|
251
|
+
<TopNavRenderContext value="drawer">
|
|
252
|
+
<TopNavMenu label="Products" items={mockItems} />
|
|
253
|
+
</TopNavRenderContext>,
|
|
254
|
+
);
|
|
255
|
+
const trigger = screen.getByRole('button', {name: /Products/});
|
|
256
|
+
const section = document.getElementById(
|
|
257
|
+
trigger.getAttribute('aria-controls') ?? '',
|
|
258
|
+
)!;
|
|
259
|
+
expect(getComputedStyle(section).overflow).toBe('hidden');
|
|
260
|
+
expect(getComputedStyle(section.firstElementChild!).overflow).toBe('');
|
|
261
|
+
|
|
262
|
+
await user.click(trigger);
|
|
263
|
+
expect(getComputedStyle(section).overflow).toBe('visible');
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe('TopNavMenu — drawer collapsed section', () => {
|
|
268
|
+
it('makes collapsed items inert and hidden from assistive technology', async () => {
|
|
269
|
+
const user = userEvent.setup();
|
|
270
|
+
render(
|
|
271
|
+
<TopNavRenderContext value="drawer">
|
|
272
|
+
<TopNavMenu label="Products" items={mockItems} />
|
|
273
|
+
</TopNavRenderContext>,
|
|
274
|
+
);
|
|
275
|
+
const trigger = screen.getByRole('button', {name: /Products/});
|
|
276
|
+
const region = document.getElementById(
|
|
277
|
+
trigger.getAttribute('aria-controls') ?? '',
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
expect(region).toHaveAttribute('inert');
|
|
281
|
+
expect(region).toHaveAttribute('aria-hidden', 'true');
|
|
282
|
+
expect(screen.queryByRole('link', {name: /Analytics/})).toBeNull();
|
|
283
|
+
|
|
284
|
+
await user.click(trigger);
|
|
285
|
+
expect(region).not.toHaveAttribute('inert');
|
|
286
|
+
expect(region).toHaveAttribute('aria-hidden', 'false');
|
|
287
|
+
expect(screen.getByRole('link', {name: /Analytics/})).toBeInTheDocument();
|
|
288
|
+
});
|
|
244
289
|
});
|
|
245
290
|
|
|
246
291
|
describe('TopNavMenu pass-through props', () => {
|
|
@@ -194,18 +194,26 @@ const drawerStyles = stylex.create({
|
|
|
194
194
|
chevronExpanded: {
|
|
195
195
|
transform: 'rotate(180deg)',
|
|
196
196
|
},
|
|
197
|
+
// The section clips its items only for the 0fr collapse animation: a
|
|
198
|
+
// permanent clip cuts off the focus ring, which paints outside the item.
|
|
199
|
+
// `overflow` is discrete, so it rides the transition with `allow-discrete`
|
|
200
|
+
// and switches to `visible` only after the open has finished. Collapsing
|
|
201
|
+
// clips again at once.
|
|
197
202
|
items: {
|
|
198
203
|
display: 'grid',
|
|
199
204
|
gridTemplateRows: '0fr',
|
|
200
|
-
|
|
201
|
-
|
|
205
|
+
overflow: 'hidden',
|
|
206
|
+
transitionProperty: 'grid-template-rows, overflow',
|
|
207
|
+
transitionBehavior: 'allow-discrete',
|
|
208
|
+
transitionDuration: `${durationVars['--duration-medium']}, 0s`,
|
|
202
209
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
203
210
|
},
|
|
204
211
|
itemsExpanded: {
|
|
205
212
|
gridTemplateRows: '1fr',
|
|
213
|
+
overflow: 'visible',
|
|
214
|
+
transitionDelay: `0s, ${durationVars['--duration-medium']}`,
|
|
206
215
|
},
|
|
207
216
|
itemsInner: {
|
|
208
|
-
overflow: 'hidden',
|
|
209
217
|
minHeight: 0,
|
|
210
218
|
},
|
|
211
219
|
item: {
|
|
@@ -486,6 +494,8 @@ export function TopNavMenu({
|
|
|
486
494
|
</button>
|
|
487
495
|
<div
|
|
488
496
|
id={`${menuId}-items`}
|
|
497
|
+
aria-hidden={!drawerExpanded}
|
|
498
|
+
inert={!drawerExpanded ? true : undefined}
|
|
489
499
|
{...stylex.props(
|
|
490
500
|
drawerStyles.items,
|
|
491
501
|
drawerExpanded && drawerStyles.itemsExpanded,
|
|
@@ -89,6 +89,7 @@ export const docs = {
|
|
|
89
89
|
{name: '--tree-list-indent', description: 'Per-level indentation step. Each nesting level indents its rows by this distance, and the guide lines follow it so they stay aligned. Set it on the `tree-list` target to retune the metric (e.g. `var(--spacing-5)` for a wider indent).', default: 'var(--spacing-4)'},
|
|
90
90
|
{name: '--tree-list-row-gap', description: 'Vertical gap between adjacent rows. Default `2px` (var(--spacing-0-5)) gives a subtle separation; set it on the `tree-list` target to widen or close the gap. The connector guides span the gap automatically (the line stays continuous) and do not overhang the last row, so no guide-height tuning is needed.', default: 'var(--spacing-0-5)'},
|
|
91
91
|
{name: '--_tree-indent', description: 'Distance one row is indented, computed per row from --tree-list-indent and the row depth. Set --tree-list-indent to retune indentation; this is the resolved value.', default: '0px', private: true},
|
|
92
|
+
{name: '--_tree-focus-z', description: 'Stacking order of a row while its treeitem has keyboard focus, published by each treeitem so its focused row paints above the guide lines. Not a theming lever.', default: 'auto', private: true},
|
|
92
93
|
],
|
|
93
94
|
},
|
|
94
95
|
components: [
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {describe, it, expect, vi} from 'vitest';
|
|
13
13
|
import {render, screen, fireEvent} from '@testing-library/react';
|
|
14
|
+
import type {ReactNode} from 'react';
|
|
14
15
|
import userEvent from '@testing-library/user-event';
|
|
15
16
|
import * as stylex from '@stylexjs/stylex';
|
|
16
17
|
import {TreeList} from './TreeList';
|
|
@@ -609,12 +610,12 @@ describe('TreeList', () => {
|
|
|
609
610
|
});
|
|
610
611
|
|
|
611
612
|
it("variant='noGuides' preserves per-level indentation on the rows", () => {
|
|
612
|
-
// Indentation lives
|
|
613
|
-
// element), so it must survive when the connectors are
|
|
614
|
-
// per-row distance is published as the `--_tree-indent`
|
|
615
|
-
// (not an inline longhand — see #4308), so the theme
|
|
616
|
-
// the `
|
|
617
|
-
// than a shallower one.
|
|
613
|
+
// Indentation lives inside the row's padding-inline-start (not the
|
|
614
|
+
// guide element), so it must survive when the connectors are
|
|
615
|
+
// suppressed. The per-row distance is published as the `--_tree-indent`
|
|
616
|
+
// custom property (not an inline longhand — see #4308), so the theme
|
|
617
|
+
// layer can override the `padding-inline-start` declaration. A deeper
|
|
618
|
+
// row is indented more than a shallower one.
|
|
618
619
|
const {container} = render(
|
|
619
620
|
<TreeList items={deepItems} variant="noGuides" />,
|
|
620
621
|
);
|
|
@@ -720,6 +721,326 @@ describe('TreeList', () => {
|
|
|
720
721
|
expect(indentOf('Mid')).toContain('var(--tree-list-indent)');
|
|
721
722
|
expect(indentOf('Leaf')).toContain('var(--tree-list-indent)');
|
|
722
723
|
});
|
|
724
|
+
|
|
725
|
+
it('indents inside the row so nested rows keep the full list width', () => {
|
|
726
|
+
// The row box keeps its own inline padding and stays full width; the
|
|
727
|
+
// indent is padding on a child inside it. A nested row's hover and
|
|
728
|
+
// selected fill therefore spans the list like a root row's, while its
|
|
729
|
+
// content lands where a margin indent would have put it.
|
|
730
|
+
render(<TreeList items={deepItems} />);
|
|
731
|
+
const rules = collectCssText();
|
|
732
|
+
expect(rules).toMatch(
|
|
733
|
+
/padding-inline-start:\s*var\(--_tree-indent,\s*0px\)/,
|
|
734
|
+
);
|
|
735
|
+
expect(rules).not.toMatch(/margin-inline-start:\s*var\(--_tree-indent/);
|
|
736
|
+
|
|
737
|
+
const row = screen
|
|
738
|
+
.getByText('Leaf')
|
|
739
|
+
.closest<HTMLElement>('.astryx-tree-list-item')!;
|
|
740
|
+
const indented = row.firstElementChild as HTMLElement;
|
|
741
|
+
expect(indented.className).toContain('indentedContent');
|
|
742
|
+
expect(row.className).not.toContain('indentedContent');
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
it("keeps the indent when a caller sets the row's padding", () => {
|
|
746
|
+
// Caller padding lands on the row box; the indent is on a separate
|
|
747
|
+
// element inside it, so the two compose instead of one replacing the
|
|
748
|
+
// other.
|
|
749
|
+
const items = [
|
|
750
|
+
{
|
|
751
|
+
id: 'root',
|
|
752
|
+
label: 'Root',
|
|
753
|
+
isExpanded: true,
|
|
754
|
+
children: [
|
|
755
|
+
{id: 'leaf', label: 'Leaf', style: {paddingInlineStart: '20px'}},
|
|
756
|
+
],
|
|
757
|
+
},
|
|
758
|
+
];
|
|
759
|
+
render(<TreeList items={items} />);
|
|
760
|
+
const row = screen
|
|
761
|
+
.getByText('Leaf')
|
|
762
|
+
.closest<HTMLElement>('.astryx-tree-list-item')!;
|
|
763
|
+
expect(row.style.paddingInlineStart).toBe('20px');
|
|
764
|
+
expect(row.getAttribute('style')).toContain('--_tree-indent');
|
|
765
|
+
expect((row.firstElementChild as HTMLElement).className).toContain(
|
|
766
|
+
'indentedContent',
|
|
767
|
+
);
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
describe('link rows', () => {
|
|
771
|
+
const linkItems = (endContent?: ReactNode): TreeListItemData[] => [
|
|
772
|
+
{
|
|
773
|
+
id: 'docs',
|
|
774
|
+
label: 'Docs',
|
|
775
|
+
isExpanded: true,
|
|
776
|
+
children: [
|
|
777
|
+
{id: 'report', label: 'Report', href: '/report', endContent},
|
|
778
|
+
],
|
|
779
|
+
},
|
|
780
|
+
];
|
|
781
|
+
const rowSurfaceOf = (link: HTMLElement) =>
|
|
782
|
+
link.closest<HTMLElement>('.astryx-tree-list-item')!
|
|
783
|
+
.firstElementChild as HTMLElement;
|
|
784
|
+
|
|
785
|
+
it('follows the link when the row is clicked outside its label', () => {
|
|
786
|
+
// The indent is part of the row now, so a click there must do what
|
|
787
|
+
// the row does. The click is delegated to the anchor through the
|
|
788
|
+
// shared enlarged-surface hook, modifier keys included.
|
|
789
|
+
render(<TreeList items={linkItems()} />);
|
|
790
|
+
const link = screen.getByRole('link', {name: 'Report'});
|
|
791
|
+
const clicks: MouseEvent[] = [];
|
|
792
|
+
link.addEventListener('click', e => {
|
|
793
|
+
clicks.push(e);
|
|
794
|
+
e.preventDefault();
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
fireEvent.click(rowSurfaceOf(link), {metaKey: true});
|
|
798
|
+
expect(clicks).toHaveLength(1);
|
|
799
|
+
expect(clicks[0].metaKey).toBe(true);
|
|
800
|
+
|
|
801
|
+
// The row box's own padding follows the link too.
|
|
802
|
+
fireEvent.click(rowSurfaceOf(link).parentElement!);
|
|
803
|
+
expect(clicks).toHaveLength(2);
|
|
804
|
+
|
|
805
|
+
// Clicking the label itself reaches the anchor once, not twice.
|
|
806
|
+
fireEvent.click(link);
|
|
807
|
+
expect(clicks).toHaveLength(3);
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
it('reports one click to ancestors per press', () => {
|
|
811
|
+
// The delegated click bubbles from the anchor; the original stops,
|
|
812
|
+
// so a listener above the tree sees exactly one click.
|
|
813
|
+
const onTreeClick = vi.fn();
|
|
814
|
+
render(<TreeList items={linkItems()} onClick={onTreeClick} />);
|
|
815
|
+
const link = screen.getByRole('link', {name: 'Report'});
|
|
816
|
+
link.addEventListener('click', e => e.preventDefault());
|
|
817
|
+
|
|
818
|
+
fireEvent.click(rowSurfaceOf(link));
|
|
819
|
+
expect(onTreeClick).toHaveBeenCalledTimes(1);
|
|
820
|
+
expect(onTreeClick.mock.calls[0][0].target).toBe(link);
|
|
821
|
+
});
|
|
822
|
+
|
|
823
|
+
it('leaves a role-based control in the row to itself', () => {
|
|
824
|
+
const onSwitch = vi.fn();
|
|
825
|
+
render(
|
|
826
|
+
<TreeList
|
|
827
|
+
items={linkItems(
|
|
828
|
+
<span
|
|
829
|
+
role="switch"
|
|
830
|
+
aria-checked="false"
|
|
831
|
+
aria-label="Pin"
|
|
832
|
+
tabIndex={0}
|
|
833
|
+
onClick={onSwitch}>
|
|
834
|
+
Pin
|
|
835
|
+
</span>,
|
|
836
|
+
)}
|
|
837
|
+
/>,
|
|
838
|
+
);
|
|
839
|
+
const link = screen.getByRole('link', {name: 'Report'});
|
|
840
|
+
const onLinkClick = vi.fn((e: Event) => e.preventDefault());
|
|
841
|
+
link.addEventListener('click', onLinkClick);
|
|
842
|
+
|
|
843
|
+
fireEvent.click(screen.getByRole('switch', {name: 'Pin'}));
|
|
844
|
+
expect(onSwitch).toHaveBeenCalledTimes(1);
|
|
845
|
+
expect(onLinkClick).not.toHaveBeenCalled();
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
it('opens the link in a new tab on a middle-click in the row', () => {
|
|
849
|
+
const open = vi.spyOn(window, 'open').mockImplementation(() => null);
|
|
850
|
+
render(<TreeList items={linkItems()} />);
|
|
851
|
+
const link = screen.getByRole('link', {name: 'Report'});
|
|
852
|
+
|
|
853
|
+
fireEvent.mouseUp(rowSurfaceOf(link), {button: 1});
|
|
854
|
+
expect(open).toHaveBeenCalledWith('/report', '_blank', 'noopener');
|
|
855
|
+
|
|
856
|
+
// A middle-click on the label is the browser's own.
|
|
857
|
+
open.mockClear();
|
|
858
|
+
fireEvent.mouseUp(link, {button: 1});
|
|
859
|
+
expect(open).not.toHaveBeenCalled();
|
|
860
|
+
open.mockRestore();
|
|
861
|
+
});
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
it('does not follow a disabled link row', () => {
|
|
865
|
+
const items = [
|
|
866
|
+
{
|
|
867
|
+
id: 'docs',
|
|
868
|
+
label: 'Docs',
|
|
869
|
+
isExpanded: true,
|
|
870
|
+
children: [
|
|
871
|
+
{id: 'report', label: 'Report', href: '/report', isDisabled: true},
|
|
872
|
+
],
|
|
873
|
+
},
|
|
874
|
+
];
|
|
875
|
+
render(<TreeList items={items} />);
|
|
876
|
+
const link = screen.getByRole('link', {name: 'Report', hidden: true});
|
|
877
|
+
const onLinkClick = vi.fn((e: Event) => e.preventDefault());
|
|
878
|
+
link.addEventListener('click', onLinkClick);
|
|
879
|
+
const row = link.closest<HTMLElement>('.astryx-tree-list-item')!;
|
|
880
|
+
fireEvent.click(row.firstElementChild!);
|
|
881
|
+
expect(onLinkClick).not.toHaveBeenCalled();
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
describe('row clicks outside the label (FR7)', () => {
|
|
885
|
+
// Each row sits under an expanded root, so it has an indent; the click
|
|
886
|
+
// lands on the row surface (indent, reserved chevron column, padding),
|
|
887
|
+
// not on the label.
|
|
888
|
+
const underRoot = (children: TreeListItemData[]): TreeListItemData[] => [
|
|
889
|
+
{id: 'root', label: 'Root', isExpanded: true, children},
|
|
890
|
+
];
|
|
891
|
+
// The row box itself (its own padding) and the indented content inside
|
|
892
|
+
// it: FR7 covers clicks on both.
|
|
893
|
+
const rowOf = (label: string) =>
|
|
894
|
+
screen.getByText(label).closest<HTMLElement>('.astryx-tree-list-item')!;
|
|
895
|
+
const rowSurfaceOf = (label: string) =>
|
|
896
|
+
rowOf(label).firstElementChild as HTMLElement;
|
|
897
|
+
const folder: TreeListItemData = {
|
|
898
|
+
id: 'folder',
|
|
899
|
+
label: 'Folder',
|
|
900
|
+
children: [{id: 'file', label: 'File'}],
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
it("runs an action row's onClick once", () => {
|
|
904
|
+
const onClick = vi.fn();
|
|
905
|
+
render(
|
|
906
|
+
<TreeList items={underRoot([{id: 'run', label: 'Run', onClick}])} />,
|
|
907
|
+
);
|
|
908
|
+
fireEvent.click(rowSurfaceOf('Run'));
|
|
909
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
910
|
+
fireEvent.click(rowOf('Run'));
|
|
911
|
+
expect(onClick).toHaveBeenCalledTimes(2);
|
|
912
|
+
|
|
913
|
+
// The label's own button still runs it once per press, not twice.
|
|
914
|
+
fireEvent.click(screen.getByRole('button', {name: 'Run'}));
|
|
915
|
+
expect(onClick).toHaveBeenCalledTimes(3);
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
it('toggles a parent row', () => {
|
|
919
|
+
render(<TreeList items={underRoot([folder])} />);
|
|
920
|
+
expect(screen.queryByText('File')).not.toBeInTheDocument();
|
|
921
|
+
fireEvent.click(rowSurfaceOf('Folder'));
|
|
922
|
+
expect(screen.getByText('File')).toBeInTheDocument();
|
|
923
|
+
fireEvent.click(rowOf('Folder'));
|
|
924
|
+
expect(screen.queryByText('File')).not.toBeInTheDocument();
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
it('does nothing on a disabled action or parent row', () => {
|
|
928
|
+
const onClick = vi.fn();
|
|
929
|
+
render(
|
|
930
|
+
<TreeList
|
|
931
|
+
items={underRoot([
|
|
932
|
+
{id: 'run', label: 'Run', onClick, isDisabled: true},
|
|
933
|
+
{...folder, isDisabled: true},
|
|
934
|
+
])}
|
|
935
|
+
/>,
|
|
936
|
+
);
|
|
937
|
+
fireEvent.click(rowSurfaceOf('Run'));
|
|
938
|
+
fireEvent.click(rowOf('Run'));
|
|
939
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
940
|
+
fireEvent.click(rowSurfaceOf('Folder'));
|
|
941
|
+
fireEvent.click(rowOf('Folder'));
|
|
942
|
+
expect(screen.queryByText('File')).not.toBeInTheDocument();
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
it('leaves a role-based control in start or end content to itself', () => {
|
|
946
|
+
// Native and role-based controls alike keep their own activation,
|
|
947
|
+
// the same rule link rows get from the shared enlarged-surface hook.
|
|
948
|
+
const onClick = vi.fn();
|
|
949
|
+
const onSwitch = vi.fn();
|
|
950
|
+
const pin = (name: string) => (
|
|
951
|
+
<span
|
|
952
|
+
role="switch"
|
|
953
|
+
aria-checked="false"
|
|
954
|
+
aria-label={name}
|
|
955
|
+
tabIndex={0}
|
|
956
|
+
onClick={onSwitch}>
|
|
957
|
+
{name}
|
|
958
|
+
</span>
|
|
959
|
+
);
|
|
960
|
+
render(
|
|
961
|
+
<TreeList
|
|
962
|
+
items={underRoot([
|
|
963
|
+
{
|
|
964
|
+
id: 'run',
|
|
965
|
+
label: 'Run',
|
|
966
|
+
onClick,
|
|
967
|
+
startContent: pin('Pin run start'),
|
|
968
|
+
endContent: pin('Pin run end'),
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
...folder,
|
|
972
|
+
startContent: pin('Pin folder start'),
|
|
973
|
+
endContent: pin('Pin folder end'),
|
|
974
|
+
},
|
|
975
|
+
])}
|
|
976
|
+
/>,
|
|
977
|
+
);
|
|
978
|
+
for (const name of [
|
|
979
|
+
'Pin run start',
|
|
980
|
+
'Pin run end',
|
|
981
|
+
'Pin folder start',
|
|
982
|
+
'Pin folder end',
|
|
983
|
+
]) {
|
|
984
|
+
fireEvent.click(screen.getByRole('switch', {name}));
|
|
985
|
+
}
|
|
986
|
+
expect(onSwitch).toHaveBeenCalledTimes(4);
|
|
987
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
988
|
+
expect(screen.queryByText('File')).not.toBeInTheDocument();
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
it('draws guides above full-width rows without taking pointer input', () => {
|
|
993
|
+
// Guide columns now sit inside deeper rows' boxes. They paint above the
|
|
994
|
+
// rows so a row fill never breaks the line, and let clicks fall through
|
|
995
|
+
// to the row underneath.
|
|
996
|
+
const {container} = render(<TreeList items={deepItems} />);
|
|
997
|
+
const guide = container.querySelector('.astryx-tree-list-guide');
|
|
998
|
+
expect(guide).not.toBeNull();
|
|
999
|
+
const column = guide!.parentElement!;
|
|
1000
|
+
expect(getComputedStyle(column).pointerEvents).toBe('none');
|
|
1001
|
+
expect(getComputedStyle(column).zIndex).toBe('1');
|
|
1002
|
+
// The tree contains that stacking so a guide cannot climb over
|
|
1003
|
+
// positioned content outside the list.
|
|
1004
|
+
const treeRoot = screen.getByRole('tree').parentElement!;
|
|
1005
|
+
expect(treeRoot.className).toContain('astryx-tree-list');
|
|
1006
|
+
expect(getComputedStyle(treeRoot).isolation).toBe('isolate');
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
it('lifts only rows that draw a focus ring above the guides', () => {
|
|
1010
|
+
// A plain row (no onClick, href or children) draws no focus ring, so it
|
|
1011
|
+
// stays under the guides: a focused selected plain row must not hide
|
|
1012
|
+
// them with its fill (DD3). Rows that draw the ring take the lift.
|
|
1013
|
+
render(
|
|
1014
|
+
<TreeList
|
|
1015
|
+
items={[
|
|
1016
|
+
{
|
|
1017
|
+
id: 'root',
|
|
1018
|
+
label: 'Root',
|
|
1019
|
+
isExpanded: true,
|
|
1020
|
+
children: [
|
|
1021
|
+
{id: 'plain', label: 'Plain', isSelected: true},
|
|
1022
|
+
{id: 'run', label: 'Run', onClick: () => {}},
|
|
1023
|
+
],
|
|
1024
|
+
},
|
|
1025
|
+
]}
|
|
1026
|
+
/>,
|
|
1027
|
+
);
|
|
1028
|
+
const rowOf = (label: string) =>
|
|
1029
|
+
screen.getByText(label).closest<HTMLElement>('.astryx-tree-list-item')!;
|
|
1030
|
+
expect(rowOf('Plain').className).not.toContain('focusLift');
|
|
1031
|
+
expect(rowOf('Run').className).toContain('focusLift');
|
|
1032
|
+
expect(rowOf('Root').className).toContain('focusLift');
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
it('lifts the focused row above the guides so they never cut its ring', () => {
|
|
1036
|
+
// Each treeitem publishes its own focus as `--_tree-focus-z`, and the
|
|
1037
|
+
// row reads it as its z-index, so the focused row paints above the
|
|
1038
|
+
// guide columns (z-index 1). Nested treeitems redeclare the default.
|
|
1039
|
+
render(<TreeList items={deepItems} />);
|
|
1040
|
+
const rules = collectCssText();
|
|
1041
|
+
expect(rules).toMatch(/--_tree-focus-z:\s*2/);
|
|
1042
|
+
expect(rules).toMatch(/z-index:\s*var\(--_tree-focus-z,\s*auto\)/);
|
|
1043
|
+
});
|
|
723
1044
|
});
|
|
724
1045
|
|
|
725
1046
|
// ===========================================================================
|
|
@@ -83,9 +83,13 @@ export interface TreeListProps extends BaseProps<HTMLDivElement> {
|
|
|
83
83
|
const styles = stylex.create({
|
|
84
84
|
root: {
|
|
85
85
|
position: 'relative',
|
|
86
|
+
// Contain the guides' and focused rows' `z-index` (TreeListBranches,
|
|
87
|
+
// TreeListItem) inside the tree, so they never climb over a sticky header
|
|
88
|
+
// or other positioned content outside the list.
|
|
89
|
+
isolation: 'isolate',
|
|
86
90
|
// Per-level indentation step. Public, themeable lever: a theme can retune
|
|
87
91
|
// the tree's indent metric (e.g. to `var(--spacing-5)`) via `defineTheme`
|
|
88
|
-
// on the `tree-list` target, and both the row
|
|
92
|
+
// on the `tree-list` target, and both the row indents (TreeListItem) and
|
|
89
93
|
// the guide-line offsets (TreeListBranches) read it so they stay aligned.
|
|
90
94
|
'--tree-list-indent': spacingVars['--spacing-4'],
|
|
91
95
|
// Vertical gap between adjacent rows. Public, themeable lever (default
|
|
@@ -32,10 +32,16 @@ const BRANCH_MARGIN = `calc(${spacingVars['--spacing-2']} + ${spacingVars['--spa
|
|
|
32
32
|
const LEVEL_INDENT = 'var(--tree-list-indent)';
|
|
33
33
|
|
|
34
34
|
const styles = stylex.create({
|
|
35
|
+
// Rows span the full width of the list and carry their indent inside, so
|
|
36
|
+
// the guide columns sit inside the row boxes of deeper rows. Lift the guides
|
|
37
|
+
// above the rows so a hovered or selected row's fill never breaks the line,
|
|
38
|
+
// and let pointer input fall through to the row underneath.
|
|
35
39
|
container: {
|
|
36
40
|
height: '100%',
|
|
37
41
|
position: 'absolute',
|
|
38
42
|
width: spacingVars['--spacing-5'],
|
|
43
|
+
zIndex: 1,
|
|
44
|
+
pointerEvents: 'none',
|
|
39
45
|
},
|
|
40
46
|
verticalLine: {
|
|
41
47
|
borderRadius: 1,
|