Update TableOfContents hover states, semantic HTML, and Group API#424
Update TableOfContents hover states, semantic HTML, and Group API#424pedromenezes1 merged 6 commits intomainfrom
Conversation
…ntic HTML - Replace pill/background-tint hover with border-l indicator pattern - Switch from div to ul/li semantic structure - Add href and active props to Group for clickable labels - Fix group sub-item alignment with main rail - Match Tailwind docs flex/gap spacing pattern - Add h3 heading support to docs TOC sidebar - Expand API Reference for all sub-components - Fix registry codegen forwardRef sub-component detection
commit: |
Docs PreviewCommit: |
…s-redesign # Conflicts: # packages/kumo-docs-astro/src/pages/components/table-of-contents.mdx
|
/bonk |
PR Review: TableOfContents Redesign (#424)After reviewing the changes, I can confirm this is a well-structured PR with focused improvements to the ✅ Component Changes - TableOfContentsVisual Design Improvements:
Semantic HTML:
Group API Expansion:
✅ Critical Fix: Registry CodegenThe fix in // Now handles multi-line forwardRef generics correctly
const forwardRefPattern = new RegExp(
`const\\s+${value}\\s*=\\s*forwardRef<[\\s\\S]*?,\\s*(\\w+)\\s*>\\s*\\(`
);This affects all compound components (TableOfContents, Table, Dialog, Popover, etc.) - a significant improvement to the component registry accuracy. ✅ Documentation Site
✅ TestsAll 20 TableOfContents tests pass:
The registry utility tests (66 tests) also pass, validating the forwardRef props extraction fix. ChangesetAppropriate minor version bump with clear description of changes. Overall Assessment: This PR is well-crafted, focused, and improves both the visual design and technical implementation. The registry codegen fix is particularly valuable as it benefits all compound components in the library. |
|
LGTM! nice improvements |










































Updates the
TableOfContentscomponent to drop the background hover tint and border radius, use semantic HTML, and expand the Group API.Component changes
border-lpattern — items have a transparent left border that becomes visible on hover (subtle) and active (brand blue)TableOfContentsListrenders<ul>, items wrap in<li>, groups render as<li>with nested<ul>TableOfContents.Groupnow acceptshrefandactiveprops. Passhrefto make the group label a clickable link, or omit for a plain titleflex flex-col gap-2(8px)Docs site changes
h3support in TOC sidebar:h3headings now appear as nested items under their parenth2usingTOC.Grouphref) and plain title labelsRegistry codegen fix
forwardRef-based sub-components had their props invisible to the registry. Affects all compound components (TableOfContents, Table, Dialog, Popover, etc.)Screenshots
The table of contents sidebar now captures h3 headings and nests them under their parent h2, giving a more complete overview of the page structure.
The API Reference section now documents all sub-components (Title, List, Item, Group) with their props, where previously only the root component was shown.
Groups now support an optional href prop, making the group label a clickable navigation link instead of just a plain title.