Skip to content

feat(ui-components): add Signature and FunctionSignature components#8667

Open
canerakdas wants to merge 8 commits intonodejs:mainfrom
canerakdas:feat/functionsignature
Open

feat(ui-components): add Signature and FunctionSignature components#8667
canerakdas wants to merge 8 commits intonodejs:mainfrom
canerakdas:feat/functionsignature

Conversation

@canerakdas
Copy link
Member

Description

Adds new Signature and FunctionSignature components for rendering API function signatures with support for nested parameters, return types, and optional attributes.

Ref: nodejs/doc-kit#587
Figma: https://www.figma.com/design/a10cjjw3MzvRQMPT9FP3xz/Node.js?node-id=6382-1517&t=T63PRMdf9tzlCrww-0

Validation

image image

Related Issues

Related to nodejs/doc-kit#587

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings February 27, 2026 23:40
@canerakdas canerakdas requested a review from a team as a code owner February 27, 2026 23:40
@vercel
Copy link

vercel bot commented Feb 27, 2026

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: nodejs-org.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.09%. Comparing base (377f606) to head (54be608).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8667      +/-   ##
==========================================
+ Coverage   75.08%   75.09%   +0.01%     
==========================================
  Files         104      104              
  Lines        9098     9159      +61     
  Branches      315      315              
==========================================
+ Hits         6831     6878      +47     
- Misses       2265     2279      +14     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new UI components to render API/function signatures (including nested parameters, optional markers, and return sections) for use across Node.js Doc Kit’s UI component library.

Changes:

  • Introduces Signature (root/item wrapper) and supporting subcomponents (SignatureRoot, SignatureItem, SignatureHeader) with new styles.
  • Adds FunctionSignature container to render a recursive signature tree from structured data.
  • Adds Storybook stories for both components and bumps @node-core/ui-components patch version.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui-components/src/Containers/FunctionSignature/index.tsx Adds the FunctionSignature container and recursive renderer for signature items
packages/ui-components/src/Containers/FunctionSignature/index.stories.tsx Adds Storybook scenarios for nested params, return types, and type-only definitions
packages/ui-components/src/Common/Signature/index.tsx Adds Signature component that switches between root and item rendering
packages/ui-components/src/Common/Signature/index.stories.tsx Adds Storybook examples for optional attributes, long names, and nesting
packages/ui-components/src/Common/Signature/SignatureRoot/index.tsx Adds root wrapper with titled section and aria-labelledby wiring
packages/ui-components/src/Common/Signature/SignatureRoot/index.module.css Styles the root container and title
packages/ui-components/src/Common/Signature/SignatureItem/index.tsx Adds item renderer supporting return-kind styling, description, and nested children
packages/ui-components/src/Common/Signature/SignatureItem/index.module.css Styles items, nested children layout, and return-item presentation
packages/ui-components/src/Common/Signature/SignatureHeader/index.tsx Adds header rendering for name/type with optional marker and return indicator
packages/ui-components/src/Common/Signature/SignatureHeader/index.module.css Styles header layout, long-name wrapping, and type/link presentation
packages/ui-components/package.json Bumps package version to 1.6.1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@canerakdas
Copy link
Member Author

johntravolta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants