Skip to content

Commit ff78d9e

Browse files
Merge pull request #5 from rahul-vyas-dev/main
chore: add TypeScript types for support us button component and updat…
2 parents 592027e + 644c106 commit ff78d9e

3 files changed

Lines changed: 212 additions & 0 deletions

File tree

package-lock.json

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@
3838
},
3939
"devDependencies": {
4040
"@tailwindcss/postcss": "^4.2.1",
41+
"@types/react": "^19.2.14",
4142
"autoprefixer": "^10.4.27",
4243
"postcss": "^8.5.6",
4344
"tailwindcss": "^4.2.1",
4445
"typescript": "^5.9.3"
46+
},
47+
"peerDependencies": {
48+
"react": ">=18",
49+
"react-dom": ">=18"
4550
}
4651
}

src/types/index.ts

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
import type { ReactNode } from "react";
2+
3+
/* =========================
4+
Theme
5+
========================= */
6+
7+
export type Theme = "AOSSIE" | "light" | "dark" | "minimal" | "corporate";
8+
9+
/* =========================================================
10+
Button Variant
11+
========================================================= */
12+
13+
export type ButtonVariant = "solid" | "outline" | "ghost" | "gradient";
14+
15+
/* =========================
16+
IMAGE TYPE
17+
========================= */
18+
19+
export type Image = {
20+
src?: string;
21+
alt?: string;
22+
};
23+
24+
/* =========================
25+
Hero SECTION
26+
========================= */
27+
28+
export type Hero = {
29+
/** Optional Hero background Image */
30+
Image?: Image;
31+
32+
title: string;
33+
description: string;
34+
35+
/** Label like: YOU'RE SPONSORING */
36+
sponsorLabel?: string;
37+
};
38+
39+
/* =========================
40+
PROJECT INFORMATION
41+
========================= */
42+
43+
export type projectInformation = {
44+
name: string;
45+
description: string;
46+
};
47+
48+
/* =========================
49+
ORGANIZATION INFORMATION
50+
========================= */
51+
52+
export type organizationInformation = {
53+
name: string;
54+
description: string;
55+
56+
/** Organization logo */
57+
logo?: Image | string;
58+
59+
projectInformation: projectInformation;
60+
};
61+
62+
/* =========================
63+
SPONSOR TIERS
64+
========================= */
65+
66+
export type Tier = "Platinum" | "Gold" | "Silver" | "Bronze";
67+
68+
/* =========================
69+
SPONSOR CARD
70+
========================= */
71+
72+
export type sponsor = {
73+
name: string;
74+
75+
/** Sponsor logo or avatar */
76+
logo?: string;
77+
78+
/** Sponsor website */
79+
link?: string;
80+
81+
/** Sponsorship tier */
82+
sponsorshipTier?: Tier;
83+
};
84+
85+
/* =========================
86+
CURRENT SPONSORS
87+
========================= */
88+
89+
export type sponsors = sponsor[];
90+
91+
/* =========================
92+
SPONSOR LINKS (CTA)
93+
========================= */
94+
95+
export type sponsorLink = {
96+
name: string;
97+
url: string;
98+
icon?: ReactNode;
99+
className?: string;
100+
101+
/** open link in new tab */
102+
newTab?: boolean;
103+
};
104+
105+
/* =========================
106+
CTA SECTION
107+
========================= */
108+
109+
export type CTASection = {
110+
title: string;
111+
description: string;
112+
sponsorLink: sponsorLink[];
113+
};
114+
115+
/* =========================
116+
BACKGROUND PATTERNS
117+
========================= */
118+
119+
export type Pattern = "dots" | "grid" | "stripes" | "none";
120+
121+
/* =========================
122+
SUPPORT US COMPO PROPS
123+
========================= */
124+
125+
export interface supportUsButtonProps {
126+
// Theme for the button, can be one of "AOSSIE", "light", "dark", "minimal", or "corporate"
127+
Theme?: Theme;
128+
129+
// Optional background pattern for the button, can be one of "dots", "grid", "stripes", or "none"
130+
pattern?: Pattern;
131+
132+
// Information about the Hero section, including title, description, sponsor label, and optional background Image
133+
hero: Hero;
134+
135+
// Information about the organization, including name, description, logo, and project information
136+
organizationInformation: organizationInformation;
137+
138+
// List of current sponsors, each with name, optional logo, link, and sponsorship tier
139+
sponsors: sponsors;
140+
141+
// Information about the call-to-action section, including title, description, and sponsor links
142+
ctaSection: CTASection;
143+
144+
// Optional class name for custom styling
145+
classNames?: {
146+
container?: string;
147+
Hero?: string;
148+
organizationInformation?: string;
149+
sponsors?: string;
150+
ctaSection?: string;
151+
};
152+
153+
// Optional button variant for styling the call-to-action buttons
154+
buttonVariant?: ButtonVariant;
155+
}

0 commit comments

Comments
 (0)