@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
|
@@ -5,7 +5,7 @@ export const docs = {
|
|
|
5
5
|
name: 'ScrollableArea',
|
|
6
6
|
displayName: 'Scrollable Area',
|
|
7
7
|
category: 'Layout',
|
|
8
|
-
keywords: ['scroll', 'overflow', 'viewport', 'logical axis', 'keyboard', 'overscroll', 'sticky', 'scrollbar', 'padding', 'full bleed'],
|
|
8
|
+
keywords: ['scroll', 'overflow', 'viewport', 'logical axis', 'keyboard', 'overscroll', 'sticky', 'scrollbar', 'padding', 'full bleed', 'scrollarea', 'scrollview'],
|
|
9
9
|
usage: {
|
|
10
10
|
description: 'Provides a native scroll viewport and a real observed content box. The viewport enters the tab order only while a requested logical axis is effectively scrollable, and containment applies only to effective axes.',
|
|
11
11
|
bestPractices: [
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 3
|
|
3
|
+
template_version: 7
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:SideNav
|
|
6
|
+
authority: current
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: cixzhang
|
|
10
|
+
approved_at: 2026-10-16
|
|
11
|
+
owners: [cixzhang]
|
|
12
|
+
review_triggers: [layout, behavior, accessibility]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/SideNav/SideNav.test.tsx,
|
|
16
|
+
apps/storybook/stories/SideNav.stories.tsx,
|
|
17
|
+
scripts/check-knowledge.mjs,
|
|
18
|
+
]
|
|
19
|
+
modules: []
|
|
20
|
+
families: [family:navigation-destinations]
|
|
21
|
+
design_specs: []
|
|
22
|
+
architecture:
|
|
23
|
+
[
|
|
24
|
+
architecture:component-theming-surface,
|
|
25
|
+
architecture:interaction-modality,
|
|
26
|
+
architecture:internationalization,
|
|
27
|
+
architecture:public-component-api,
|
|
28
|
+
]
|
|
29
|
+
contributing: []
|
|
30
|
+
system_specs: [spec:AST-017/FR3]
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# SideNav component contract
|
|
34
|
+
|
|
35
|
+
<!-- Describe the system, not the project: present tense, what it does. No proposals, history, pull requests, or research in the record; see docs/contributing/spec-writing.md and report its rubric results in the pull request. -->
|
|
36
|
+
|
|
37
|
+
This record governs how nested SideNavItem rows are drawn: their width, where
|
|
38
|
+
their nesting indent sits, and what the indent area does. It covers SideNav,
|
|
39
|
+
SideNavSection, and SideNavItem only as far as that geometry depends on them.
|
|
40
|
+
SideNavItem's link and destination safety is governed by
|
|
41
|
+
`family:navigation-destinations`; other SideNav behavior remains described by
|
|
42
|
+
its source, tests, and consumer docs until a record claims it.
|
|
43
|
+
|
|
44
|
+
## Contract at a glance
|
|
45
|
+
|
|
46
|
+
| Area | Contract |
|
|
47
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| Public contract | None. No prop, value, default, or theme target changes. |
|
|
49
|
+
| Behavior | Every SideNavItem row spans the full width of its nav list at any depth. Depth shows as inline-start indent inside the row: one `--spacing-6` step per level, added to the row's own padding. |
|
|
50
|
+
| End-user impact | A person scanning a nested nav sees hover, pressed, selected, and focus fills that line up with the top-level rows, and can click a nested row's indent to activate it, as they would its label. |
|
|
51
|
+
| Builder impact | No new choice or prop. Icons and labels keep their per-depth position. Content placed directly inside a SideNavItem that is not itself a SideNavItem sits at the nav list edge, because the nested group adds no inset; no supported setting insets it. |
|
|
52
|
+
| Compatibility/readiness | Nonbreaking change of visual direction (`spec:AST-017/FR3`). The collapsed rail and top-level rows are unchanged. Authority is current; implementation may be staged. |
|
|
53
|
+
| Review checks | Reject a nested row narrower than a top-level row, an indent drawn outside the row, an indent area that shows feedback but does not activate, a clipped focus ring, or an indent in the flyout's top level. |
|
|
54
|
+
| Governing rules | DD1 and FR3–FR5 below; `family:navigation-destinations` for destinations; `architecture:internationalization` for logical direction. |
|
|
55
|
+
|
|
56
|
+
This table is a review projection; the body below is authoritative.
|
|
57
|
+
|
|
58
|
+
## Intent
|
|
59
|
+
|
|
60
|
+
SideNav is the vertical navigation region of an app. SideNavItem rows can nest
|
|
61
|
+
to show a hierarchy of destinations. Nesting must read as one list of equal
|
|
62
|
+
rows, so the eye compares labels and states across depths rather than seeing a
|
|
63
|
+
second, narrower kind of row. SideNav owns this because only SideNavItem knows
|
|
64
|
+
a row's depth and its row padding.
|
|
65
|
+
|
|
66
|
+
## Compatibility and migration
|
|
67
|
+
|
|
68
|
+
- Released default preserved: `no`; nested rows change from inset to full width.
|
|
69
|
+
Top-level rows and the collapsed rail are unchanged.
|
|
70
|
+
- Compatibility class: nonbreaking appearance change of visual direction under
|
|
71
|
+
`spec:AST-017/FR3`; no public API, accepted input, or accessibility semantic
|
|
72
|
+
changes.
|
|
73
|
+
- Controlled/uncontrolled behavior: unchanged.
|
|
74
|
+
- Migration decision: none; there is no supported way to keep the inset look.
|
|
75
|
+
|
|
76
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
77
|
+
|
|
78
|
+
## Ownership boundary
|
|
79
|
+
|
|
80
|
+
**Owns**
|
|
81
|
+
|
|
82
|
+
- The width of every expanded SideNavItem row, at every depth.
|
|
83
|
+
- Where a nested row's indent sits, its step, and how it adds to the row's
|
|
84
|
+
padding.
|
|
85
|
+
- What the indent area paints and what a click on it does.
|
|
86
|
+
- Whether the nested group clips its rows.
|
|
87
|
+
|
|
88
|
+
**Does not own / non-goals**
|
|
89
|
+
|
|
90
|
+
- Destination acceptance, blocking, and router handoff — owned by
|
|
91
|
+
`family:navigation-destinations`.
|
|
92
|
+
- The collapsed item's tooltip and how it attaches — outside this record.
|
|
93
|
+
- Exact fill colors, radius, row height, and row padding per size — owned by
|
|
94
|
+
the shared nav item styles and the `side-nav-item` theme target.
|
|
95
|
+
- Layout of caller content placed directly inside a SideNavItem that is not a
|
|
96
|
+
SideNavItem — owned by the product callsite.
|
|
97
|
+
- SideNavHeading, SideNavCollapseButton, and the SideNav header, footer, and
|
|
98
|
+
resize zones.
|
|
99
|
+
|
|
100
|
+
## Public concepts
|
|
101
|
+
|
|
102
|
+
| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
|
|
103
|
+
| ------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ------- | ------------------- | --------- | ---------------------- |
|
|
104
|
+
| Nesting depth | `0`, `1`, `2`, … (derived, not a prop) | The number of SideNavItem ancestors of a row within the same list. A collapsed rail's flyout restarts at 0. | Expanded rail; mobile drawer; flyout | `0` | `component:SideNav` | stable | Not caller-settable |
|
|
105
|
+
| Row size | `sm`, `md`, `lg` (existing SideNavItem `size`) | Sets the row's height and base inline padding; the indent adds to that padding. | Every row | `md` | `component:SideNav` | stable | Rejected by the type |
|
|
106
|
+
|
|
107
|
+
## Behavioral and layout contract
|
|
108
|
+
|
|
109
|
+
| ID | Invariant | Basis | Draft review state |
|
|
110
|
+
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------- |
|
|
111
|
+
| FR1 | SideNav renders its navigation children in a scrollable list, which may be grouped by SideNavSection. A SideNavItem with children renders them, after its own row, in a group labelled by the parent's label; unless `collapsible` is `false`, the group expands and collapses and is hidden from assistive technology and inert while collapsed. | Current source, docs, and tests | Current behavior |
|
|
112
|
+
| FR2 | In a collapsed rail, a SideNavItem without an icon is not rendered; a leaf item renders icon-only, named by a non-blank caller `aria-label` or else its label; an item with children renders an icon-only trigger that opens a flyout listing its children as the flyout's top level. | Current source, docs, and tests | Current behavior |
|
|
113
|
+
| FR3 | In an expanded rail, in a flyout, and in the mobile navigation drawer, every SideNavItem row MUST span the full inline size of its list at any depth. A row at depth `n` MUST start its content `n` × `--spacing-6` beyond the row's own inline-start padding for its size, inside the row; the nested group MUST add no inset. A flyout's top level is depth 0. | `component:SideNav/DEC-1` | Settled intent; implementation may be staged |
|
|
114
|
+
| FR4 | The indent area MUST be part of the row's target: a click there, including a modified or middle click on a link row, does what the same click on the row's primary element does. When the row also carries an independent expand toggle or `actions`, the indent belongs to the primary link or button, and the toggle and actions keep their own activation at the row's trailing edge. | `component:SideNav/DEC-1`; `family:navigation-destinations` | Settled intent; implementation may be staged |
|
|
115
|
+
| FR5 | An expanded nested group MUST NOT clip its rows once it has finished opening, so a nested row's focus ring paints in full. The group MAY clip while collapsed and while it opens or closes. | `component:SideNav/DEC-1` | Settled intent; implementation may be staged |
|
|
116
|
+
|
|
117
|
+
### Allowed variation
|
|
118
|
+
|
|
119
|
+
- **AV1 — Depth and size.** Any depth and any row size may appear; FR3 holds for
|
|
120
|
+
each row from its own size's padding.
|
|
121
|
+
- **AV2 — Theme tokens.** A theme that changes `--spacing-6` or the row padding
|
|
122
|
+
tokens changes the step or the base with them.
|
|
123
|
+
- **AV3 — Row implementation.** The element that carries the indent may change
|
|
124
|
+
while the painted row stays full width and the indent stays clickable.
|
|
125
|
+
|
|
126
|
+
### Representative states
|
|
127
|
+
|
|
128
|
+
| State | Required invariant | Allowed variation |
|
|
129
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------- |
|
|
130
|
+
| Depth 1–3, `md` | Row width equals a top-level row's; content starts one step further in per level. | Labels, icons, selection. |
|
|
131
|
+
| `sm` and `lg` nested rows | Indent adds to that size's base padding. | Row height by size. |
|
|
132
|
+
| Nested row with own link and children | Full-width row; indent is part of the link; the expand toggle stays at the trailing edge. | Collapsed or expanded children. |
|
|
133
|
+
| Nested row with `actions` | Full-width row; indent is part of the primary element; actions stay at the trailing edge. | Action content. |
|
|
134
|
+
| Keyboard focus on a nested row | The focus ring paints in full around the row. | Ring style by theme. |
|
|
135
|
+
| Right-to-left | Indent sits at the inline start (right); same widths. | Writing direction. |
|
|
136
|
+
| Collapsed rail | Icon-only items; the flyout's top level has no indent; deeper flyout levels indent. | Flyout content. |
|
|
137
|
+
|
|
138
|
+
### Transformation and precedence order
|
|
139
|
+
|
|
140
|
+
- **ORD1 — Row inline-start padding.** The row's size padding, then plus depth ×
|
|
141
|
+
`--spacing-6`. A caller's `style` on a nested item composes after the indent in the
|
|
142
|
+
shared order (`architecture:public-component-api`): properties the caller does
|
|
143
|
+
not set keep the indent, and a caller-set inline-start padding replaces it.
|
|
144
|
+
|
|
145
|
+
### Performance and resources
|
|
146
|
+
|
|
147
|
+
- **PR1 — No measurement.** Depth and indent come from composition; no
|
|
148
|
+
measurement, observer, or extra render pass is added.
|
|
149
|
+
|
|
150
|
+
## Accessibility contract
|
|
151
|
+
|
|
152
|
+
- **AR1 — Presentation only.** Width and indent MUST NOT change any row's role,
|
|
153
|
+
accessible name, state, DOM order, or tab order.
|
|
154
|
+
- **AR2 — Visible focus.** A nested row's focus indicator MUST paint in full at
|
|
155
|
+
every depth (FR5).
|
|
156
|
+
|
|
157
|
+
## Design relationships
|
|
158
|
+
|
|
159
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
160
|
+
| ---------------- | ------------------------------------------------------------------ | ------------------------ | -------------- | ------------------ |
|
|
161
|
+
| Navigation items | Nested rows read as equal rows of one list; depth reads as indent. | Owner choice (DD1) | Prominent | FR3–FR5 |
|
|
162
|
+
|
|
163
|
+
### Design decisions
|
|
164
|
+
|
|
165
|
+
<!-- design-decisions:v1 -->
|
|
166
|
+
|
|
167
|
+
| ID | Decision | Intent or reason | Applies to | Allowed variation |
|
|
168
|
+
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
169
|
+
| DD1 | Every SideNavItem row spans the full width of its nav list at any depth; nesting shows as indent inside the row, ahead of its content. Hover, pressed, selected, and focus paint the whole row, indent included. | Fills line up across depths, so the nav reads as one list of equal rows while labels keep their per-level alignment; the indent belongs to the row's primary target rather than sitting beside it as a gap. | SideNavItem rows at every depth, at rest and through hover, pressed, selected, disabled, and focus | Themes restyle fill, radius, and padding through the `side-nav-item` target; the step follows `--spacing-6`. |
|
|
170
|
+
|
|
171
|
+
## Family and system relationships
|
|
172
|
+
|
|
173
|
+
- `family:navigation-destinations` owns the accept/block result for a
|
|
174
|
+
SideNavItem `href`; the indent area activates the same destination the primary
|
|
175
|
+
element does (FR4).
|
|
176
|
+
- `architecture:internationalization` owns logical direction; the indent is
|
|
177
|
+
inline-start and mirrors under right-to-left.
|
|
178
|
+
- `architecture:interaction-modality` owns shared focus-visible behavior; FR5
|
|
179
|
+
keeps the ring visible at every depth.
|
|
180
|
+
- `architecture:component-theming-surface` owns the `side-nav-item` target;
|
|
181
|
+
this record adds no target or state.
|
|
182
|
+
- `architecture:public-component-api` owns how caller styling inputs compose;
|
|
183
|
+
ORD1 places the indent before a caller's `style`.
|
|
184
|
+
- `spec:AST-017/FR3` classifies the change as a nonbreaking change of visual
|
|
185
|
+
direction.
|
|
186
|
+
- `component:TreeList` DD1–DD3 record the same row geometry for TreeList. They
|
|
187
|
+
are precedent, not authority here; each component owns its own rows.
|
|
188
|
+
|
|
189
|
+
## Verification map
|
|
190
|
+
|
|
191
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
192
|
+
| --------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
|
193
|
+
| FR1, FR2 | `SideNav.test.tsx` nesting, collapsible, and collapsed-rail suites | Nested, collapsible, collapsed rail, flyout | Removing the labelled group, its collapsed inert state, or the collapsed icon-only and flyout paths fails. | `audit:SideNav/anatomy` |
|
|
194
|
+
| FR3, ORD1 | Focused `SideNav.test.tsx` indent coverage, required with implementation | Depth 1 and 2; `sm` and `md`; split and actions rows; caller `style`; flyout | A group inset, a missing or wrong indent, a dropped caller `style`, an indent that overrides a caller-set inline-start padding, or an indented flyout top level fails. | `audit:SideNav/layout` |
|
|
195
|
+
| FR3, DD1 | Real-browser geometry over the SideNav nested stories | Depths 1–3; `sm`, `md`, `lg`; light and dark; right-to-left; mobile drawer | A nested row's box narrower than a top-level row's, or a label moved from its per-depth position, fails. | `audit:SideNav/layout` |
|
|
196
|
+
| FR4 | Real-browser click in the indent area of plain, split, and actions rows | Link and button rows; plain, modified, and middle clicks; nested rows with toggle and actions | A click in the indent that does nothing or differs from the same click on the primary element, or a toggle or action that activates the row, fails. | `audit:SideNav/behavior` |
|
|
197
|
+
| FR5, AR2 | `SideNav.test.tsx` group clipping case and real-browser keyboard focus on nested rows | Only-child and last nested rows; after opening; collapsed | A focus ring cut at any edge of an expanded group, or an expanded group that still clips, fails. | `audit:SideNav/a11y` |
|
|
198
|
+
| FR2, FR3 | Real-browser collapsed rail and flyout | Collapsed rail with nested children | Any change to the collapsed rail, or an indent on the flyout's top level, fails. | `audit:SideNav/layout` |
|
|
199
|
+
| AR1 | Accessibility-tree comparison of nested rows | Plain, split, and actions rows | Any change in role, name, state, or order fails. | `audit:SideNav/a11y` |
|
|
200
|
+
|
|
201
|
+
## Decision log
|
|
202
|
+
|
|
203
|
+
<!-- Record the boundary or requirement, not how it was reached. A rejected alternative is at most one line here, kept only when it is consequential and likely to recur. -->
|
|
204
|
+
|
|
205
|
+
### DEC-1 — Nested rows are full width; depth is indent inside the row
|
|
206
|
+
|
|
207
|
+
**Reference:** `component:SideNav/DEC-1`
|
|
208
|
+
**Decider:** cixzhang, 2026-10-16
|
|
209
|
+
|
|
210
|
+
A nested row that starts at its indent paints its fills from a different edge
|
|
211
|
+
than the rows above it, so it reads as a different, narrower component. A row that
|
|
212
|
+
spans the full width with its indent inside lines up every fill and keeps each
|
|
213
|
+
label at its per-depth position. The indent is part of the row's primary
|
|
214
|
+
target, so it acts as well as lights up. Full-width rows reach the nested group's
|
|
215
|
+
edges, so an open group must not clip them, or their focus ring is cut off.
|
|
216
|
+
|
|
217
|
+
Rejected: indenting the nested group from outside the rows, because fills then
|
|
218
|
+
start at a different edge per depth.
|
|
219
|
+
|
|
220
|
+
## Open questions
|
|
221
|
+
|
|
222
|
+
None.
|
|
223
|
+
|
|
224
|
+
## Content boundary
|
|
225
|
+
|
|
226
|
+
This file does not duplicate consumer prop tables/examples, current audit
|
|
227
|
+
results, implementation steps, or family/system rules. It links to their owners.
|
|
@@ -828,6 +828,210 @@ describe('SideNavItem', () => {
|
|
|
828
828
|
expect(screen.getByText('Security')).toBeInTheDocument();
|
|
829
829
|
});
|
|
830
830
|
|
|
831
|
+
it('keeps nested rows full width and indents their content inside the row', () => {
|
|
832
|
+
render(
|
|
833
|
+
<SideNavItem label="Settings">
|
|
834
|
+
<SideNavItem label="General" href="/settings/general">
|
|
835
|
+
<SideNavItem label="Advanced" href="/settings/general/advanced" />
|
|
836
|
+
</SideNavItem>
|
|
837
|
+
</SideNavItem>,
|
|
838
|
+
);
|
|
839
|
+
|
|
840
|
+
// The children group adds no inset of its own, so a nested row's hover
|
|
841
|
+
// and selected fill spans the nav list like a top-level row's.
|
|
842
|
+
const groups = screen.getAllByRole('group', {hidden: true});
|
|
843
|
+
for (const group of groups) {
|
|
844
|
+
expect(declaredOn(group, 'padding-inline-start')).toEqual([]);
|
|
845
|
+
expect(
|
|
846
|
+
declaredOn(group.firstElementChild!, 'padding-inline-start'),
|
|
847
|
+
).toEqual([]);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// The indent lives inside each row instead, one step per nesting level.
|
|
851
|
+
// An ordinary row is the link itself: its own padding plus the steps.
|
|
852
|
+
const top = screen.getByRole('button', {name: 'Settings'});
|
|
853
|
+
const general = screen.getByRole('link', {name: 'General'});
|
|
854
|
+
const advanced = screen.getByRole('link', {name: 'Advanced'});
|
|
855
|
+
expect(indentOf(top)).toBeNull();
|
|
856
|
+
expect(indentOf(advanced)).toBe(
|
|
857
|
+
'calc(var(--spacing-2) + 2 * var(--spacing-6))',
|
|
858
|
+
);
|
|
859
|
+
|
|
860
|
+
// A split row (own href plus children) keeps the wrapper's base padding
|
|
861
|
+
// and puts the steps on the link, so the whole indent is clickable
|
|
862
|
+
// instead of dead space that still shows hover and press feedback.
|
|
863
|
+
expect(indentOf(general.parentElement!)).toBeNull();
|
|
864
|
+
expect(indentOf(general)).toBe('calc(1 * var(--spacing-6))');
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
it('clips the children group only while it is collapsed', async () => {
|
|
868
|
+
// Nested rows sit flush with the group, so a permanent clip would cut off
|
|
869
|
+
// their focus ring. The group clips for the collapse animation only.
|
|
870
|
+
const user = userEvent.setup();
|
|
871
|
+
render(
|
|
872
|
+
<SideNavItem label="Settings" collapsible>
|
|
873
|
+
<SideNavItem label="General" href="/settings/general" />
|
|
874
|
+
</SideNavItem>,
|
|
875
|
+
);
|
|
876
|
+
const group = () => screen.getByRole('group', {hidden: true});
|
|
877
|
+
expect(declaredOn(group(), 'overflow')).toEqual(['visible']);
|
|
878
|
+
expect(declaredOn(group().firstElementChild!, 'overflow')).toEqual([]);
|
|
879
|
+
|
|
880
|
+
await user.click(screen.getByRole('button', {name: 'Settings'}));
|
|
881
|
+
expect(declaredOn(group(), 'overflow')).toEqual(['hidden']);
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
it('puts the indent on the primary link of a nested actions row', () => {
|
|
885
|
+
render(
|
|
886
|
+
<SideNavItem label="Projects">
|
|
887
|
+
<SideNavItem
|
|
888
|
+
label="Alpha"
|
|
889
|
+
href="/projects/alpha"
|
|
890
|
+
actions={
|
|
891
|
+
<button type="button" aria-label="Alpha actions">
|
|
892
|
+
More
|
|
893
|
+
</button>
|
|
894
|
+
}
|
|
895
|
+
/>
|
|
896
|
+
</SideNavItem>,
|
|
897
|
+
);
|
|
898
|
+
const alpha = screen.getByRole('link', {name: 'Alpha'});
|
|
899
|
+
expect(indentOf(alpha.parentElement!)).toBeNull();
|
|
900
|
+
expect(indentOf(alpha)).toBe('calc(1 * var(--spacing-6))');
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
it("composes a caller's style with the indent on a nested row", () => {
|
|
904
|
+
render(
|
|
905
|
+
<SideNavItem label="Settings">
|
|
906
|
+
<SideNavItem
|
|
907
|
+
label="General"
|
|
908
|
+
href="/settings/general"
|
|
909
|
+
style={{color: 'rebeccapurple'}}
|
|
910
|
+
/>
|
|
911
|
+
<SideNavItem
|
|
912
|
+
label="Security"
|
|
913
|
+
href="/settings/security"
|
|
914
|
+
style={{color: 'rebeccapurple'}}>
|
|
915
|
+
<SideNavItem label="Keys" href="/settings/security/keys" />
|
|
916
|
+
</SideNavItem>
|
|
917
|
+
</SideNavItem>,
|
|
918
|
+
);
|
|
919
|
+
// Ordinary row: the link is the row.
|
|
920
|
+
const general = screen.getByRole('link', {name: 'General'});
|
|
921
|
+
expect(general.style.color).toBe('rebeccapurple');
|
|
922
|
+
expect(indentOf(general)).toBe(
|
|
923
|
+
'calc(var(--spacing-2) + 1 * var(--spacing-6))',
|
|
924
|
+
);
|
|
925
|
+
// Split row: the caller's style still lands on the primary link.
|
|
926
|
+
const security = screen.getByRole('link', {name: 'Security'});
|
|
927
|
+
expect(security.style.color).toBe('rebeccapurple');
|
|
928
|
+
expect(indentOf(security)).toBe('calc(1 * var(--spacing-6))');
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
it("keeps a caller's className on the row element", () => {
|
|
932
|
+
render(
|
|
933
|
+
<SideNavItem label="Settings">
|
|
934
|
+
<SideNavItem
|
|
935
|
+
label="General"
|
|
936
|
+
href="/settings/general"
|
|
937
|
+
className="caller-row"
|
|
938
|
+
/>
|
|
939
|
+
<SideNavItem
|
|
940
|
+
label="Security"
|
|
941
|
+
href="/settings/security"
|
|
942
|
+
className="caller-row">
|
|
943
|
+
<SideNavItem label="Keys" href="/settings/security/keys" />
|
|
944
|
+
</SideNavItem>
|
|
945
|
+
</SideNavItem>,
|
|
946
|
+
);
|
|
947
|
+
// Ordinary row: the link is the row, and the caller's class sits beside
|
|
948
|
+
// the row's own classes instead of being replaced by them.
|
|
949
|
+
const general = screen.getByRole('link', {name: 'General'});
|
|
950
|
+
expect(general).toHaveClass('caller-row');
|
|
951
|
+
expect(general).toHaveClass('astryx-side-nav-item');
|
|
952
|
+
// Split row: the class lands on the primary link, as `style` does.
|
|
953
|
+
expect(screen.getByRole('link', {name: 'Security'})).toHaveClass(
|
|
954
|
+
'caller-row',
|
|
955
|
+
);
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
it("keeps a caller's className on a collapsed rail item", () => {
|
|
959
|
+
render(
|
|
960
|
+
<SideNav collapsible={{isCollapsed: true, hasButton: false}}>
|
|
961
|
+
<SideNavItem
|
|
962
|
+
label="Home"
|
|
963
|
+
href="/"
|
|
964
|
+
icon="calendar"
|
|
965
|
+
className="caller-row"
|
|
966
|
+
/>
|
|
967
|
+
</SideNav>,
|
|
968
|
+
);
|
|
969
|
+
expect(screen.getByRole('link', {name: 'Home'})).toHaveClass('caller-row');
|
|
970
|
+
});
|
|
971
|
+
|
|
972
|
+
it("lets a caller's inline-start padding replace the indent", () => {
|
|
973
|
+
// The caller's `style` composes after the indent: a caller-set
|
|
974
|
+
// inline-start padding is an inline declaration, so it wins over the
|
|
975
|
+
// indent's class rule on the element that carries the indent, on both
|
|
976
|
+
// the ordinary and the split row path.
|
|
977
|
+
render(
|
|
978
|
+
<SideNavItem label="Settings">
|
|
979
|
+
<SideNavItem
|
|
980
|
+
label="General"
|
|
981
|
+
href="/settings/general"
|
|
982
|
+
style={{paddingInlineStart: '20px'}}
|
|
983
|
+
/>
|
|
984
|
+
<SideNavItem
|
|
985
|
+
label="Security"
|
|
986
|
+
href="/settings/security"
|
|
987
|
+
style={{paddingInlineStart: '20px'}}>
|
|
988
|
+
<SideNavItem label="Keys" href="/settings/security/keys" />
|
|
989
|
+
</SideNavItem>
|
|
990
|
+
</SideNavItem>,
|
|
991
|
+
);
|
|
992
|
+
const general = screen.getByRole('link', {name: 'General'});
|
|
993
|
+
expect(general.style.paddingInlineStart).toBe('20px');
|
|
994
|
+
const security = screen.getByRole('link', {name: 'Security'});
|
|
995
|
+
expect(security.style.paddingInlineStart).toBe('20px');
|
|
996
|
+
// A row whose caller sets no padding keeps its indent.
|
|
997
|
+
expect(indentOf(screen.getByRole('link', {name: 'Keys'}))).toBe(
|
|
998
|
+
'calc(var(--spacing-2) + 2 * var(--spacing-6))',
|
|
999
|
+
);
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
it('indents a small nested row from the small row padding', () => {
|
|
1003
|
+
render(
|
|
1004
|
+
<SideNavItem label="Settings">
|
|
1005
|
+
<SideNavItem label="General" href="/settings/general" size="sm" />
|
|
1006
|
+
</SideNavItem>,
|
|
1007
|
+
);
|
|
1008
|
+
expect(indentOf(screen.getByRole('link', {name: 'General'}))).toBe(
|
|
1009
|
+
'calc(var(--spacing-1) + 1 * var(--spacing-6))',
|
|
1010
|
+
);
|
|
1011
|
+
});
|
|
1012
|
+
|
|
1013
|
+
it('does not indent the first level of a collapsed rail flyout', async () => {
|
|
1014
|
+
const user = userEvent.setup();
|
|
1015
|
+
renderCollapsed(
|
|
1016
|
+
<SideNavItem label="Settings" icon={StubIcon}>
|
|
1017
|
+
<SideNavItem label="General" href="/settings/general">
|
|
1018
|
+
<SideNavItem label="Advanced" href="/settings/general/advanced" />
|
|
1019
|
+
</SideNavItem>
|
|
1020
|
+
</SideNavItem>,
|
|
1021
|
+
);
|
|
1022
|
+
await user.click(screen.getByRole('button', {name: 'Settings'}));
|
|
1023
|
+
|
|
1024
|
+
// jsdom leaves the native popover `display: none`, hence `hidden: true`.
|
|
1025
|
+
// The flyout lists the parent's children as its own top level.
|
|
1026
|
+
const general = screen.getByRole('link', {name: 'General', hidden: true});
|
|
1027
|
+
const advanced = screen.getByRole('link', {name: 'Advanced', hidden: true});
|
|
1028
|
+
expect(indentOf(general)).toBeNull();
|
|
1029
|
+
expect(indentOf(general.parentElement!)).toBeNull();
|
|
1030
|
+
expect(indentOf(advanced)).toBe(
|
|
1031
|
+
'calc(var(--spacing-2) + 1 * var(--spacing-6))',
|
|
1032
|
+
);
|
|
1033
|
+
});
|
|
1034
|
+
|
|
831
1035
|
it('passes data-testid', () => {
|
|
832
1036
|
render(<SideNavItem label="Dashboard" data-testid="nav-item" />);
|
|
833
1037
|
expect(screen.getByTestId('nav-item')).toBeInTheDocument();
|
|
@@ -2457,6 +2661,22 @@ function declaredOn(el: Element, prop: string): string[] {
|
|
|
2457
2661
|
.filter(value => value != null);
|
|
2458
2662
|
}
|
|
2459
2663
|
|
|
2664
|
+
/**
|
|
2665
|
+
* The nesting indent a row carries, or null for none. The indent is a
|
|
2666
|
+
* runtime StyleX value, so it rides the row's inline style as a custom
|
|
2667
|
+
* property; read the value rather than the generated property name.
|
|
2668
|
+
*/
|
|
2669
|
+
function indentOf(el: HTMLElement): string | null {
|
|
2670
|
+
const {style} = el;
|
|
2671
|
+
for (let i = 0; i < style.length; i++) {
|
|
2672
|
+
const value = style.getPropertyValue(style[i]).trim();
|
|
2673
|
+
if (value.includes('var(--spacing-6)')) {
|
|
2674
|
+
return value;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
return null;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2460
2680
|
/**
|
|
2461
2681
|
* The selectors that actually paint the shared ring on `el`, read out of the
|
|
2462
2682
|
* live stylesheet with StyleX's `:not(#\#)` specificity padding stripped so
|
|
@@ -90,7 +90,7 @@ export const docs = {
|
|
|
90
90
|
{
|
|
91
91
|
name: 'children',
|
|
92
92
|
type: 'ReactNode',
|
|
93
|
-
description: 'Sub-items for nesting.',
|
|
93
|
+
description: 'Sub-items for nesting. Nested items span the full width of the nav list, like top-level items; their content is indented one step per nesting level.',
|
|
94
94
|
slotElements: [
|
|
95
95
|
{
|
|
96
96
|
__element: 'SideNavItem',
|
|
@@ -213,7 +213,7 @@ export const docsDense = {
|
|
|
213
213
|
'Passive right-side content only (badges, counts). Interactive controls go in actions.',
|
|
214
214
|
actions:
|
|
215
215
|
'Row-level secondary controls (icon buttons, menus) rendered as siblings of the primary element, after the expand/collapse toggle and before nested children in DOM/focus order. Inherit the row control size via SizeContext (explicit size wins). Hidden when rail collapsed. Passive content goes in endContent; interactive content goes here.',
|
|
216
|
-
children: 'Sub-items for nesting.',
|
|
216
|
+
children: 'Sub-items for nesting. Nested rows stay full width; content indents one step per level.',
|
|
217
217
|
collapsible: 'Enables collapse for items w/ children. true=uncontrolled, object=controlled mode.',
|
|
218
218
|
size: "Row size variant: 'sm' | 'md' | 'lg'.",
|
|
219
219
|
},
|