Skip to content

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

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

feat(ui-components): add Signature and FunctionSignature components#8667
canerakdas wants to merge 9 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 (8ac227f) to head (988a489).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8667      +/-   ##
==========================================
+ Coverage   75.06%   75.09%   +0.02%     
==========================================
  Files         104      104              
  Lines        9161     9161              
  Branches      316      315       -1     
==========================================
+ Hits         6877     6879       +2     
+ Misses       2282     2280       -2     
  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

@ovflowd
Copy link
Member

ovflowd commented Feb 28, 2026

@canerakdas I also noticed there was no Chromatic deployment?

@avivkeller
Copy link
Member

Chromatic deployments run on label

@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Feb 28, 2026 5:09pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 96 🟢 93 🟢 100 🟢 100 🔗
/en/about 🟢 98 🟢 94 🟢 100 🟠 88 🔗
/en/about/previous-releases 🟢 97 🟢 97 🟢 100 🟢 100 🔗
/en/download 🟢 97 🟢 96 🟠 81 🟢 100 🔗
/en/download/archive/current 🟢 99 🟢 97 🟢 100 🟢 100 🔗
/en/blog 🟢 100 🟢 97 🟢 96 🟢 100 🔗

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM!

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

NOICE I love this component

@@ -0,0 +1,51 @@
import { ArrowTurnDownLeftIcon } from '@heroicons/react/24/outline';
Copy link
Member

Choose a reason for hiding this comment

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

what if we use arrow turn down right so the arrow point to the return keyword ? IMO that make sense that the above part so the function return something so the parent point to the result with the icon.

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.

5 participants