-
Notifications
You must be signed in to change notification settings - Fork 10
chore: add TypeScript types for support us button component and updat… #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| import type { ReactNode } from "react"; | ||
|
|
||
| /* ========================= | ||
| Theme | ||
| ========================= */ | ||
|
|
||
| export type Theme = "AOSSIE" | "light" | "dark" | "minimal" | "corporate"; | ||
|
|
||
| /* ========================================================= | ||
| Button Variant | ||
| ========================================================= */ | ||
|
|
||
| export type ButtonVariant = "solid" | "outline" | "ghost" | "gradient"; | ||
|
|
||
| /* ========================= | ||
| IMAGE TYPE | ||
| ========================= */ | ||
|
|
||
| export type Image = { | ||
| src?: string; | ||
| alt?: string; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| Hero SECTION | ||
| ========================= */ | ||
|
|
||
| export type Hero = { | ||
| /** Optional Hero background Image */ | ||
| Image?: Image; | ||
|
|
||
| title: string; | ||
| description: string; | ||
|
|
||
| /** Label like: YOU'RE SPONSORING */ | ||
| sponsorLabel?: string; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| PROJECT INFORMATION | ||
| ========================= */ | ||
|
|
||
| export type projectInformation = { | ||
| name: string; | ||
| description: string; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| ORGANIZATION INFORMATION | ||
| ========================= */ | ||
|
|
||
| export type organizationInformation = { | ||
| name: string; | ||
| description: string; | ||
|
|
||
| /** Organization logo */ | ||
| logo?: Image | string; | ||
|
|
||
| projectInformation: projectInformation; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| SPONSOR TIERS | ||
| ========================= */ | ||
|
|
||
| export type Tier = "Platinum" | "Gold" | "Silver" | "Bronze"; | ||
|
|
||
| /* ========================= | ||
| SPONSOR CARD | ||
| ========================= */ | ||
|
|
||
| export type sponsor = { | ||
| name: string; | ||
|
|
||
| /** Sponsor logo or avatar */ | ||
| logo?: string; | ||
|
|
||
| /** Sponsor website */ | ||
| link?: string; | ||
|
|
||
| /** Sponsorship tier */ | ||
| sponsorshipTier?: Tier; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| CURRENT SPONSORS | ||
| ========================= */ | ||
|
|
||
| export type sponsors = sponsor[]; | ||
|
|
||
| /* ========================= | ||
| SPONSOR LINKS (CTA) | ||
| ========================= */ | ||
|
|
||
| export type sponsorLink = { | ||
| name: string; | ||
| url: string; | ||
| icon?: ReactNode; | ||
| className?: string; | ||
|
|
||
| /** open link in new tab */ | ||
| newTab?: boolean; | ||
| }; | ||
|
|
||
| /* ========================= | ||
| CTA SECTION | ||
| ========================= */ | ||
|
|
||
| export type CTASection = { | ||
| title: string; | ||
| description: string; | ||
| sponsorLink: sponsorLink[]; | ||
| }; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| /* ========================= | ||
| BACKGROUND PATTERNS | ||
| ========================= */ | ||
|
|
||
| export type Pattern = "dots" | "grid" | "stripes" | "none"; | ||
|
|
||
| /* ========================= | ||
| SUPPORT US COMPO PROPS | ||
| ========================= */ | ||
|
|
||
| export interface supportUsButtonProps { | ||
| // Theme for the button, can be one of "AOSSIE", "light", "dark", "minimal", or "corporate" | ||
| Theme?: Theme; | ||
|
|
||
| // Optional background pattern for the button, can be one of "dots", "grid", "stripes", or "none" | ||
| pattern?: Pattern; | ||
|
|
||
| // Information about the Hero section, including title, description, sponsor label, and optional background Image | ||
| hero: Hero; | ||
|
|
||
| // Information about the organization, including name, description, logo, and project information | ||
| organizationInformation: organizationInformation; | ||
|
|
||
| // List of current sponsors, each with name, optional logo, link, and sponsorship tier | ||
| sponsors: sponsors; | ||
|
|
||
| // Information about the call-to-action section, including title, description, and sponsor links | ||
| ctaSection: CTASection; | ||
|
|
||
| // Optional class name for custom styling | ||
| classNames?: { | ||
| container?: string; | ||
| Hero?: string; | ||
| organizationInformation?: string; | ||
| sponsors?: string; | ||
| ctaSection?: string; | ||
| }; | ||
|
|
||
| // Optional button variant for styling the call-to-action buttons | ||
| buttonVariant?: ButtonVariant; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
For a published npm library, is an open-ended React peer dependency like ">=18" recommended, or should the range be capped to explicitly tested majors such as "^18.3.0 || ^19.0.0"? Please include the latest stable React major version in the answer.💡 Result:
For a published npm library, avoid an open-ended React peer dependency like
"react": ">=18"because it will also accept future majors (e.g. React 20) that may introduce breaking changes—so users can end up installing an incompatible React version without any peer warning.Prefer declaring the broadest range you actually support, but cap it to supported majors, e.g.:
"react": "^18.0.0 || ^19.0.0"(and same forreact-dom)"react": ">=18 <20"Only raise the minimum (e.g.
^18.3.0) if you truly require APIs/behavior introduced in that minor.This aligns with the intent of peer dependencies (declare what you’re compatible with, not just what you happened to test once) and avoids npm v7+ peer-resolution conflicts surprising consumers. (nodejs.org)
Latest stable React major: React 19 (current latest line is 19.2.x; e.g. 19.2.4 was released Jan 26, 2026). (react.dev)
Citations:
Cap the React peer range to tested majors.
>=18will accept React 20+ without evidence that this library has been validated there. Specify the explicit range of tested majors, such as^18.0.0 || ^19.0.0(or>=18 <20).🤖 Prompt for AI Agents