Skip to content

✨ feat: add xpay icon#262

Open
sriakula1 wants to merge 2 commits intolobehub:masterfrom
sriakula1:feat/add-xpay-icon-v2
Open

✨ feat: add xpay icon#262
sriakula1 wants to merge 2 commits intolobehub:masterfrom
sriakula1:feat/add-xpay-icon-v2

Conversation

@sriakula1
Copy link

@sriakula1 sriakula1 commented Feb 28, 2026

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

🔀 变更说明 | Description of Change

Add xpay provider icon with all standard variants:

  • Mono — Monochrome logomark SVG ({x✦} icon)
  • Color — Multi-color logomark (turquoise brackets, navy X, gold star)
  • Text — Text-only brand wordmark ("xpay")
  • Combine — Logomark + wordmark combined layout (supports type='color'|'mono')
  • Avatar — Rounded avatar wrapper with brand color background

Brand colors: #0F1C4D (navy primary), #00DC9C (turquoise), #FFB400 (gold). Registered as provider group.

Also registers Xpay in the provider config, provider enum, icon exports, and table of contents.

📝 补充信息 | Additional Information

Files added:

  • src/Xpay/components/Avatar.tsx
  • src/Xpay/components/Color.tsx
  • src/Xpay/components/Combine.tsx
  • src/Xpay/components/Mono.tsx
  • src/Xpay/components/Text.tsx
  • src/Xpay/index.ts
  • src/Xpay/index.md
  • src/Xpay/style.ts

Files modified:

  • src/features/providerConfig.tsx — Added Xpay to provider config
  • src/features/providerEnum.ts — Added Xpay enum entry
  • src/icons.ts — Added Xpay export
  • src/toc.ts — Added Xpay to table of contents

Brand reference: brandfetch.com/xpay.sh

Summary by Sourcery

Add Xpay as a new provider icon with full variants and integrate it into the icon library and provider mappings.

New Features:

  • Introduce Xpay provider icon with mono, color, text, combined, and avatar variants.
  • Expose Xpay icon through the main icon exports and document its usage examples and brand colors.
  • Register Xpay in the provider enum, provider configuration, and table of contents for discovery in the UI and docs.

Documentation:

  • Add Xpay provider documentation page with usage examples for icons, text, combined layout, avatars, and brand color preview.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 28, 2026

Reviewer's Guide

Adds the new Xpay provider icon package (mono, color, text, combined, avatar variants) and wires it into the icon system, provider mapping, enum, exports, docs, and table of contents.

Class diagram for Xpay icon components

classDiagram
  direction LR

  class IconType {
    <<interface>>
    +render(props)
  }

  class XpayMono {
    +IconType(props)
  }

  class XpayColor {
    +IconType(props)
  }

  class XpayText {
    +IconType(props)
  }

  class IconCombineProps {
    +number size
    +number spaceMultiple
    +number textMultiple
    +string ariaLabel
  }

  class CombineProps {
    +string type
  }

  class IconCombine {
    +render(Icon, Text, size, spaceMultiple, textMultiple, ariaLabel)
  }

  class XpayCombine {
    +CombineProps props
    +render(type, size, spaceMultiple, textMultiple, ariaLabel)
  }

  class IconAvatarProps {
    +number size
    +string background
    +string color
    +number iconMultiple
    +string ariaLabel
  }

  class AvatarProps {
  }

  class IconAvatar {
    +render(Icon, size, background, color, iconMultiple, ariaLabel)
  }

  class XpayAvatar {
    +AvatarProps props
    +render(size, background, color, iconMultiple, ariaLabel)
  }

  class XpayStyles {
    +string TITLE
    +number COMBINE_TEXT_MULTIPLE
    +number COMBINE_SPACE_MULTIPLE
    +string COLOR_PRIMARY
    +string AVATAR_BACKGROUND
    +string AVATAR_COLOR
    +number AVATAR_ICON_MULTIPLE
  }

  class XpayCompoundedIcon {
    +XpayColor Color
    +XpayText Text
    +XpayCombine Combine
    +XpayAvatar Avatar
    +string colorPrimary
    +string title
  }

  class XpayDefaultExport {
    +XpayColor Color
    +XpayText Text
    +XpayCombine Combine
    +XpayAvatar Avatar
    +string colorPrimary
    +string title
  }

  XpayMono ..|> IconType
  XpayColor ..|> IconType
  XpayText ..|> IconType

  XpayCombine ..> IconCombineProps
  XpayCombine ..> IconCombine
  XpayCombine ..> XpayColor
  XpayCombine ..> XpayMono
  XpayCombine ..> XpayText

  XpayAvatar ..> IconAvatarProps
  XpayAvatar ..> IconAvatar
  XpayAvatar ..> XpayMono

  XpayStyles <.. XpayCombine
  XpayStyles <.. XpayAvatar
  XpayStyles <.. XpayDefaultExport

  XpayCompoundedIcon <|.. XpayDefaultExport
  XpayMono <|-- XpayDefaultExport
Loading

Class diagram for Xpay provider wiring into icon system

classDiagram
  direction LR

  class ModelProvider {
    <<enum>>
    Xpay
    Xinference
    Fal
    Ai302
    AiHubMix
  }

  class XpayDefaultExport

  class XpayIconExport {
    +Xpay: XpayDefaultExport
  }

  class ProviderMapping {
    +Icon: any
    +combineMultiple: number
    +keywords: ModelProvider[]
  }

  class ProviderMappingsConfig {
    +providerMappings: ProviderMapping[]
  }

  class IconTocParam {
    +hasAvatar: bool
    +hasBrand: bool
    +hasBrandColor: bool
    +hasColor: bool
    +hasCombine: bool
    +hasText: bool
    +hasTextCn: bool
    +hasTextColor: bool
  }

  class IconToc {
    +id: string
    +title: string
    +fullTitle: string
    +group: string
    +color: string
    +desc: string
    +docsUrl: string
    +param: IconTocParam
  }

  class TocConfig {
    +toc: IconToc[]
  }

  class XpayTocEntry {
    +id_Xpay: string
    +group_provider: string
    +color_0F1C4D: string
    +desc_https_xpay_sh: string
    +docsUrl_xpay: string
  }

  class XpayDocPage {
    +icons: example
    +text: example
    +combine: example
    +avatars: example
    +colors: example
  }

  XpayIconExport --> XpayDefaultExport

  ProviderMappingsConfig "1" o--> "*" ProviderMapping
  ProviderMapping --> ModelProvider
  ProviderMapping --> XpayDefaultExport : Icon

  TocConfig "1" o--> "*" IconToc
  IconToc --> IconTocParam
  XpayTocEntry <|-- IconToc

  XpayDocPage --> XpayDefaultExport
Loading

File-Level Changes

Change Details Files
Introduce full Xpay icon implementation (mono, color, text, combined, avatar) with shared styling constants and compound export API.
  • Create mono SVG icon using currentColor and brand logomark+wordmark geometry
  • Create color SVG icon using Xpay brand palette for brackets, X, and star elements
  • Create text-only SVG wordmark matching Xpay logo proportions
  • Add Avatar wrapper that renders mono glyph inside standardized avatar component with brand background and foreground colors
  • Add Combine component that composes icon and text with configurable mono/color type and spacing/text scale
  • Expose all variants through a compounded Xpay icon export including colorPrimary and title metadata
  • Define shared TITLE, primary color, combine layout multipliers, and avatar styling constants
src/Xpay/components/Mono.tsx
src/Xpay/components/Color.tsx
src/Xpay/components/Text.tsx
src/Xpay/components/Avatar.tsx
src/Xpay/components/Combine.tsx
src/Xpay/index.ts
src/Xpay/style.ts
Document Xpay usage in the icon docs site with examples for all main variants and color preview.
  • Add MDX page describing Xpay icon group and linking to provider site
  • Show basic icon usage for base and Color variants
  • Show Text, Combine (mono and color), and Avatar (round and square) usage snippets
  • Expose colorPrimary via ColorPreview example
src/Xpay/index.md
Register Xpay as a provider icon throughout the system (TOC, provider enum, mappings, and exports).
  • Add Xpay entry to the icon table of contents with provider group metadata and capabilities (hasAvatar, hasColor, hasCombine, hasText)
  • Extend ModelProvider enum with Xpay identifier
  • Map Xpay icon to ModelProvider.Xpay in providerMappings with combineMultiple factor
  • Export Xpay from the root icons barrel including props type alias
src/toc.ts
src/features/providerEnum.ts
src/features/providerConfig.tsx
src/icons.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@lobehubbot
Copy link
Member

👍 @sriakula1


Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In src/toc.ts, consider setting hasBrandColor: true for Xpay since you expose colorPrimary and add a Colors section in the docs, so the UI can surface the brand color consistently with other providers.
  • You already define COLOR_PRIMARY (and related avatar colors) in src/Xpay/style.ts, but components/Color.tsx re-embeds the hex values; importing and using the shared constants there would avoid duplication and make future brand color updates safer.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `src/toc.ts`, consider setting `hasBrandColor: true` for Xpay since you expose `colorPrimary` and add a Colors section in the docs, so the UI can surface the brand color consistently with other providers.
- You already define `COLOR_PRIMARY` (and related avatar colors) in `src/Xpay/style.ts`, but `components/Color.tsx` re-embeds the hex values; importing and using the shared constants there would avoid duplication and make future brand color updates safer.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sriakula1
Copy link
Author

👍 @sriakula1 Thank you for raising your pull request and contributing to our Community Please make sure you have followed our contributing guidelines. We will review it as soon as possible. If you encounter any problems, please feel free to connect with us. 非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。 如果您遇到任何问题,请随时与我们联系。

Hi, could you review the request if it could be merged please?

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