Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/good_first_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ body:
label: Resources
description: Helpful resources for completing this task
value: |
- [Contribution Guide - Start Here!](https://github.com/AOSSIE-Org/TODO/blob/main/CONTRIBUTING.md)
- [Discord Channel](https://discord.gg/hjUhu33uAn)
- [Contribution Guide - Start Here!](https://github.com/AOSSIE-Org/SupportUsButton/blob/main/CONTRIBUTING.md)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- [Discord Channel #support-us-button](https://discord.gg/vK2NfgG)
validations:
required: false

Expand All @@ -54,9 +54,9 @@ body:
label: Getting Started
description: Before you begin, please confirm the following
options:
- label: I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- label: I have joined the [Discord server](https://discord.gg/vK2NfgG) and will post updates there
required: true
- label: I have read the [Contribution Guide](https://github.com/AOSSIE-Org/Template-Repo/blob/main/CONTRIBUTING.md)
- label: I have read the [Contribution Guide](https://github.com/AOSSIE-Org/SupportUsButton/blob/main/CONTRIBUTING.md)
required: true
- label: I understand this issue is assigned on a first-come, first-served basis
required: true
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI & Quality Checks

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
Comment thread
coderabbitai[bot] marked this conversation as resolved.

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
name: Type-Check, Test & Build
runs-on: ubuntu-latest
Comment thread
coderabbitai[bot] marked this conversation as resolved.
permissions:
contents: read

steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
cache: "npm"

- name: Install Dependencies
run: npm install

- name: Type Check
run: npm run type-check

- name: Run Tests
run: npm test
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Build Package
run: npm run build
62 changes: 62 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SupportUsButton — AI Agent Guidelines & Architecture Directives

Welcome, AI Agent! This document contains essential instructions, code style standards, and architectural directives for operating on the **SupportUsButton** repository.

---

## 🛠️ Stack & Workspace Overview

- **Package Name:** `support-us-button`
- **Framework:** React 19 / React 18 (`react`, `react-dom`)
- **Language:** TypeScript 5.9 (`tsconfig.json`)
- **Styling:** Tailwind CSS v4 (`@tailwindcss/cli` & `@tailwindcss/vite`)
- **Bundler:** Rollup 4 (`rollup.config.js`)
- **Dev Preview:** Vite 8 (`demo/App.tsx`)

### Key Build & Test Commands:
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- **Type-Check:** `npx tsc --noEmit`
- **Build Package:** `npm run build`
- **Develop Demo:** `npm run dev:demo`

---

## 🎨 Theme Inheritance Architecture

1. **Default Theme (`Theme="auto"`)**:
- The component MUST inherit the host website's font family (`font-inherit`) and background natively via CSS transparency (`bg-transparent text-inherit`).
- Do **NOT** hardcode fixed background colors or font stacks on the outer component wrapper when `Theme="auto"`.

2. **Parent Style Detection (`useParentStyles` hook)**:
- Uses `window.getComputedStyle` with upward DOM traversal inside `useIsomorphicLayoutEffect`.
- Used primarily to evaluate relative luminance (`isDarkColor`) to invert logo (`brightness-0 invert`) and button contrast dynamically.

---

## 📁 Repository Structure

```text
SupportUsButton/
├── brand/ # Brand assets (logo.svg, favicon.svg, Brand.md)
├── demo/ # Interactive Vite Dev Preview app (App.tsx)
├── dist/ # Bundled package outputs (ESM, CJS, UMD, style.css)
├── src/
│ ├── components/ # SupportUsButton.tsx
│ ├── hooks/ # useParentStyles.ts
│ ├── styles/ # style.css (Tailwind v4 input)
│ ├── types/ # index.ts (TypeScript definitions)
│ └── index.ts # Main package entrypoint
├── AGENTS.md # AI agent instructions (this file)
├── BestPracticesChecklist.md # Audit & best practices status
├── MAINTAINERS.md # Project maintainers and mentors
├── README.md # User-facing package documentation
└── rollup.config.js # Rollup bundler configuration
```

---

## ⚠️ Important Guidelines for Agents

1. **Preserve Compatibility**: Maintain support for both React 18 and React 19.
2. **Always Run Type-Check & Build**: Before declaring a task completed, execute `npx tsc --noEmit` and `npm run build`.
3. **No Unneeded Dependencies**: Avoid adding external runtime dependencies unless explicitly approved.
43 changes: 43 additions & 0 deletions BestPracticesChecklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AOSSIE Best Practices Checklist — SupportUsButton

This document tracks compliance with the **AOSSIE Best Practices Guidelines** for the **SupportUsButton** project.

---

## 🔴 Must (Mandatory Practices)

- [x] **Licensing & Copyright**: Includes GNU General Public License v3.0 in [`LICENSE`](LICENSE).
- [x] **Project Branding**: Complete SVG logo, favicon, color palette, and typography documented in [`brand/Brand.md`](brand/Brand.md).
- [x] **Maintainers List**: Listed in [`MAINTAINERS.md`](MAINTAINERS.md).
- [x] **Clean Documentation**: `README.md` and `CONTRIBUTING.md` contain no broken links or TODOs left.
- [x] **Build & Run Instructions**: `README.md` contains clear installation, development, testing, and build instructions.
- [x] **Type Safety**: Written in 100% strict TypeScript with type definitions exported.
- [x] **No Magic Constants**: Styling tokens and default properties are configured cleanly in types and CSS variables.
- [x] **Zero Build Warnings**: `npm run build` compiles cleanly with zero warnings or errors.
- [x] **AI Agent Directives**: Context and operational guidelines provided in [`AGENTS.md`](AGENTS.md).
- [x] **CodeRabbit Configuration**: Customized in [`.coderabbit.yaml`](.coderabbit.yaml).

---

## 🟡 Should (Recommended Practices)

- [x] **Automatic Host Style Adaptation**: Package inherits host page `font-family`, `background-color`, and `color` natively.
- [x] **Contrast Fail-Safes**: Dynamic relative luminance contrast calculation (`isDarkColor`) for logo and button visibility on light/dark host themes.
- [x] **Automated Testing & CI**: Unit testing and GitHub Actions workflow configured for PR validation.
- [x] **Micro-Animations**: GPU-accelerated CSS keyframe transitions (`animate-sub-fade-in`, `animate-sub-scale-in`).
- [x] **Zero Third-Party UI Dependencies**: Ultra-lightweight package architecture (only standard `tslib` helper; zero external UI framework dependencies) producing ~12 KB minified JS output (`dist/index.esm.js`) and ~4 KB minified CSS (`dist/style.css`).
- [x] **Multi-Bundle Formats**: Exports ESM (`dist/index.esm.js`), CommonJS (`dist/index.cjs.js`), and UMD (`dist/index.umd.js`).

---

## 🟢 Could (Optional / Future Enhancements)

- [ ] Interactive online playground demo deployed to GitHub Pages.
- [ ] Automated npm release workflow via GitHub Actions on tagged releases.

---

## 📑 Verification Log

* **TypeScript Validation (`npx tsc --noEmit`)**: ✅ Passed (0 errors)
* **Bundle Build (`npm run build`)**: ✅ Passed (0 warnings)
38 changes: 22 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Contributing to TODO: Project Name
# Contributing to SupportUsButton

⭐ First off, thank you for considering contributing to this project! ⭐

We welcome contributions from everyone. By participating in this project, you agree to abide by our Code of Conduct.

## IMPORTANT: Discord Communication is Mandatory
## 💬 IMPORTANT: Discord Communication is Mandatory

**All project communication MUST happen on Discord. We do not pay attention to GitHub notifications.**
**All project communication MUST happen on Discord in the [#support-us-button](https://discord.gg/vK2NfgG) channel. We do not pay attention to GitHub notifications.**

- Join our [Discord server](https://discord.gg/hjUhu33uAn) before starting any work
- Post your PR/issue updates in the relevant Discord channel (**MANDATORY**)
- Join our [Discord server & #support-us-button channel](https://discord.gg/vK2NfgG) before starting any work
- Post your PR/issue updates in the `#support-us-button` Discord channel (**MANDATORY**)
- All discussions, questions, and updates should be on Discord
- GitHub is for code only - Discord is for communication

**PRs without Discord updates will not be reviewed or may face delays.**

## 📋 Table of Contents
## 📋 Table of Contents

- [How Can I Contribute?](#how-can-i-contribute)
- [Coding with AI](#coding-with-ai)
Expand Down Expand Up @@ -68,7 +68,8 @@ What we expect:

### Prerequisites

TODO: List prerequisites specific to your project
- Node.js (>= 18.0.0)
- npm (>= 9.0.0)

### Setup

Expand All @@ -79,13 +80,13 @@ TODO: List prerequisites specific to your project

2. **Clone Your Fork**
```bash
git clone https://github.com/YOUR_USERNAME/TODO.git
cd TODO
git clone https://github.com/YOUR_USERNAME/SupportUsButton.git
cd SupportUsButton
```

3. **Add Upstream Remote**
```bash
git remote add upstream https://github.com/AOSSIE-Org/TODO.git
git remote add upstream https://github.com/AOSSIE-Org/SupportUsButton.git
```

4. **Install Dependencies**
Expand Down Expand Up @@ -119,14 +120,19 @@ git checkout -b fix/your-bug-fix
- Add comments where necessary
- Update documentation if needed

### 3. Test Your Changes
### 3. Test & Build Your Changes

TODO: Add project-specific testing instructions
Run type checks, build, and test verification before opening your PR:

```bash
# Type check TypeScript definitions
npx tsc --noEmit

# Run unit tests
npm test
# or
npm run lint

# Build production library bundle & minified CSS
npm run build
```

### 4. Commit Your Changes
Expand Down Expand Up @@ -223,7 +229,7 @@ Steps to test the changes

## 📝 Code Style Guidelines

TODO: Add project-specific code style guidelines
Maintain 100% strict TypeScript types and export clean React component contracts. Ensure automatic theme inheritance (`Theme="auto"`) and CSS fallbacks remain unbroken.

### General Guidelines

Expand Down Expand Up @@ -538,4 +544,4 @@ If you encounter issues not covered here:
- Check for existing PRs before starting to avoid duplication, as there might PRs that didn't mention the related issue


Thank you for contributing to TODO! Your efforts help make this project better for everyone. 🚀
Thank you for contributing to SupportUsButton! Your efforts help make this project better for everyone. 🚀
18 changes: 18 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Maintainers

This document lists the maintainers of the **SupportUsButton** project.

| Name | GitHub Username | Discord Username | Email Address |
| -------------------------------- | ------------------ | ------------------ | ---------------------------- |
| Bruno Woltzenlogel Paleo | @Zahnentferner | @b.wp | zahnentferner@gmail.com |
| Rahul Vyas | @rahul-vyas-dev | @rahulvyas_dev | rahulvyas.5100@gmail.com |
| Saksham Jain | @reach2saksham | @theonlypro | reach2saksham2004@gmail.com |

---

## 📩 Contacting Maintainers

* **Security Vulnerabilities**: For private security reports, please email [reach2saksham2004@gmail.com](mailto:reach2saksham2004@gmail.com) directly before public disclosure.
* **Architectural Questions & Governance**:
1. **AOSSIE Discord Channel**: [#support-us-button](https://discord.gg/hjUhu33uAn)
2. **GitHub Issues**: [github.com/AOSSIE-Org/SupportUsButton/issues](https://github.com/AOSSIE-Org/SupportUsButton/issues)
68 changes: 68 additions & 0 deletions brand/Brand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# SupportUsButton — Brand & Design Specifications

This document defines the official branding, logo assets, color palette, typography guidelines, and design tokens for the **SupportUsButton** project by **AOSSIE**.

---

## 🎨 Brand Identity Overview

**SupportUsButton** is an open-source, customizable, tier-based React component package designed to display donation and sponsorship options cleanly on web applications while seamlessly adapting to any host site's visual theme.

---

## 🖼️ Logo & Assets

All official brand assets are located inside the [`brand/`](./) directory.

* **Primary Logo (SVG)**: [`logo.svg`](./logo.svg)
* **Favicon / Logomark (SVG)**: [`favicon.svg`](./favicon.svg)

### Usage Rules:
Comment thread
coderabbitai[bot] marked this conversation as resolved.

* Always maintain aspect ratios when displaying the SVG logo.
* On dark backgrounds, use the primary logo or inverted contrast version (`brightness-0 invert`).
* On light host backgrounds, use dark contrast text and borders (`brightness-0`).

---

## 🎨 Color Palette

The SupportUsButton brand palette balances modern dark UI elements with high-contrast accent highlights.

| Token | Hex Value | RGB / HSL | Usage |
| :--- | :--- | :--- | :--- |
| **Accent Primary** | `#ffd700` | `rgb(255, 215, 0)` | Hover highlights, primary CTA accents, gold tier badges |
| **Dark Background** | `#191919` | `rgb(25, 25, 25)` | Predefined dark theme container background |
| **Dark Surface** | `#111111` | `rgb(17, 17, 17)` | Surface containers and card backgrounds |
| **Light Background** | `#F4F4F4` | `rgb(244, 244, 244)` | Predefined light theme container background |
| **Text Dark** | `#191919` | `rgb(25, 25, 25)` | Text on light backgrounds |
| **Text Light** | `#F4F4F4` | `rgb(244, 244, 244)` | Text on dark backgrounds |

---

## 🔤 Typography

SupportUsButton is designed with **automatic font-family inheritance** so that it matches the host website typography natively out-of-the-box.

### Font Family Specs:

* **Primary (Inherited)**: `font-family: inherit` (Default for `Theme="auto"`)
* **Fallback Stack**: `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`
* **Heading Sizes**:
* Hero Title: `text-3xl sm:text-3xl md:text-5xl` (`font-medium`)
* Section Headers: `text-xl sm:text-2xl lg:text-3xl` (`font-medium`)
* CTA Button Text: `text-[18px]` (`font-semibold`)

---

## 📦 CSS Custom Variables

Host applications can override custom CSS variables if explicit theme control is needed:

```css
:root {
--color-primary: #ffd700;
--color-background-light: #f4f4f4;
--color-background-dark: #191919;
}
```
3 changes: 3 additions & 0 deletions brand/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading