Skip to content

feat(Username): add Username component (#DS-5240)#428

Open
NikGurev wants to merge 2 commits into
mainfrom
feat/DS-5240
Open

feat(Username): add Username component (#DS-5240)#428
NikGurev wants to merge 2 commits into
mainfrom
feat/DS-5240

Conversation

@NikGurev

Copy link
Copy Markdown
Contributor

No description provided.

@NikGurev NikGurev self-assigned this Jul 22, 2026
@NikGurev
NikGurev requested a review from KamilEmeleev as a code owner July 22, 2026 15:25
@NikGurev NikGurev added the enhancement New feature or request label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 5304a6d):

https://react-koobiq-next--prs-428-cpntbs4g.web.app

(expires Mon, 27 Jul 2026 15:27:36 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Username component to @koobiq/react-components for rendering user identity strings (full name, login, site) with multiple layout modes and formatting helpers, and wires it into Storybook + the public API extractor pipeline.

Changes:

  • Introduces Username plus slot subcomponents (UsernamePrimary, UsernameSecondary, UsernameSecondaryHint) and associated CSS Modules styling.
  • Adds name-formatting utilities (formatUsername, formatUsernameCustom) and a plain-text builder (buildUsernameText).
  • Adds Storybook docs/stories, unit tests, and updates API Extractor config + generated API report.

Reviewed changes

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

Show a summary per file
File Description
tools/public_api_guard/components/Username.api.md New API Extractor report for the Username public surface.
tools/api-extractor/config.json Registers Username for API extraction/report generation.
packages/components/src/components/Username/utils.ts Adds formatting + plain-text helper utilities for Username rendering.
packages/components/src/components/Username/UsernameSecondaryHint.tsx Adds the “hint” slot component for site rendering.
packages/components/src/components/Username/UsernameSecondary.tsx Adds the “secondary” slot component for login + hint rendering.
packages/components/src/components/Username/UsernamePrimary.tsx Adds the “primary” slot component for the main name/login.
packages/components/src/components/Username/Username.tsx Implements the Username component and its rendering logic.
packages/components/src/components/Username/Username.test.tsx Adds Vitest/RTL coverage for component behavior and utilities.
packages/components/src/components/Username/Username.stories.tsx Adds Storybook stories showcasing modes, types, compact, custom view, etc.
packages/components/src/components/Username/Username.module.css Adds styles for layout modes, visual types, and slot elements.
packages/components/src/components/Username/Username.mdx Adds Storybook documentation for usage, props, and formatting helpers.
packages/components/src/components/Username/types.ts Defines public types and prop unions for Username.
packages/components/src/components/Username/index.ts Exports the component, slots, types, and utils from the feature folder.
packages/components/src/components/index.ts Re-exports Username from the components entrypoint.

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

Comment on lines +22 to +25
export type UsernameBaseProps = {
/** User profile data. Not required when children (custom view) is provided. */
userInfo?: UsernameUserInfo;
/**
Comment on lines +72 to +84
return (
<span {...rootProps}>
{hasFullName && <UsernamePrimary>{name}</UsernamePrimary>}
{isNotNil(userInfo?.login) && (
<UsernameSecondary>
{userInfo!.login}
{isNotNil(userInfo?.site) && (
<UsernameSecondaryHint> ({userInfo!.site})</UsernameSecondaryHint>
)}
</UsernameSecondary>
)}
</span>
);
Comment on lines +64 to +66
{isNotNil(userInfo?.site) && (
<UsernameSecondaryHint> ({userInfo!.site})</UsernameSecondaryHint>
)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants