Thank you for your interest in contributing! This guide will help you get started.
- Getting Started
- Development Setup
- Project Structure
- Creating Components
- Coding Standards
- Testing
- Submitting Changes
- Design Tokens
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/wm-project-astro-components.git cd wm-project-astro-components - Install dependencies:
npm install
- Create a feature branch:
git checkout -b feat/your-feature-name
# Run tests in watch mode
npm run test
# Run Storybook for component development
npm run storybook
# Build design tokens
npm run tokens:build
# Lint code
npm run lint
# Format code
npm run formatsrc/
accessibility/ # A11y components (SkipLinks, FocusTrap, ThemeToggle, etc.)
content/ # Content components (ReadingProgress, ShareBar, TOC)
design-system/ # Base styles, tokens, providers
ecommerce/ # E-commerce (Cart, ProductCard, Wishlist, etc.)
forms/ # Form components (ContactForm, Newsletter)
gallery/ # Gallery components (BeforeAfter)
images/ # Image components (OptimizedImage)
layout/ # Layout components (Header, Footer)
layouts/ # Page layouts (Bento, Magazine, Dashboard, etc.)
maps/ # Map components (GoogleMap, OpenStreetMap)
media/ # Media components (VideoPlayer, AudioPlayer, ImageGallery)
navigation/ # Navigation (Breadcrumbs, Pagination, Sidebar)
products/ # Product display components
sections/ # Section templates (Hero, CTA, Pricing, Team, etc.)
seo/ # SEO components (SEOHead, JsonLD, OpenGraph, etc.)
social/ # Social components (SocialShare, SocialFollow)
ui/ # UI primitives (Badge, Modal, Tabs, Toast, etc.)
Use the CLI to scaffold new components:
npx wm-components create ComponentName --category=uiEvery component MUST:
- Have TypeScript Props interface at the top of the frontmatter
- Include a JSDoc header with description, features, and
@example - Include copyright notice:
@copyright 2007-2026 Wender Media - Arnold Wender. MIT License. - Be WCAG 2.1 AA compliant (keyboard navigation, ARIA labels, focus management)
- Use design tokens - never hardcode colors, spacing, or typography values
- Support dark mode via CSS custom properties
- Be exported from the category's
index.ts
---
/**
* ComponentName - WenderMedia Astro Components
*
* Brief description of the component.
*
* Features:
* - Feature 1
* - Feature 2
*
* @example
* <ComponentName prop="value" />
* @copyright 2007-2026 Wender Media - Arnold Wender. MIT License.
* @see https://github.com/arnoldwender/wm-project-astro-components
*/
export interface Props {
// ...
}
---- Atoms (ui/): Import NOTHING from other component categories
- Molecules (content/, forms/): Import ONLY atoms
- Organisms (sections/, layouts/): Import molecules and atoms
- Never import upward in the hierarchy
- ALWAYS use design tokens via CSS custom properties:
/* Correct */ color: var(--color-primary-500); padding: var(--space-4); /* Wrong - never hardcode values */ color: #3b82f6; padding: 16px;
- Use semantic HTML elements (
<section>,<nav>,<article>, etc.) - Give meaningful IDs to sections:
id="features",id="pricing"
- Color contrast minimum 4.5:1 (text), 3:1 (large text)
- Touch targets minimum 44x44px
- Keyboard navigation on all interactive elements
- Visible focus states
alttext on every<img>- ARIA labels on interactive elements without visible text
- No third-party tracking by default
- Consent-based loading for external embeds (YouTube, Google Maps, etc.)
- Privacy-first design patterns
# Unit tests
npm run test
# With coverage report
npm run test:coverage
# Accessibility tests
npm run test:a11y- Place test files next to the component:
ComponentName.test.ts - Test accessibility with
axe-core - Test keyboard navigation
- Test all component states and variants
- Ensure all tests pass:
npm run test - Ensure linting passes:
npm run lint - Add a changeset describing your changes:
npm run changeset
- Commit with a descriptive message:
git commit -m "[feat] Add new ComponentName with a11y support" - Push and create a Pull Request
[action] Brief description
Actions: feat, fix, refactor, docs, style, test, chore
- Keep PRs focused on a single feature or fix
- Include screenshots for visual changes
- Update documentation if adding new components
- Ensure all CI checks pass
Tokens are managed with Style Dictionary.
Source files: tokens/src/*.json
# Build tokens to CSS, SCSS, JS, and JSON
npm run tokens:buildOutput formats:
tokens/dist/tokens.css- CSS custom propertiestokens/dist/_tokens.scss- SCSS variablestokens/dist/tokens.js- JavaScript moduletokens/dist/tokens.json- Raw JSON
- Open an issue
- Email: info@wendermedia.com
- Website: wendermedia.com
By contributing, you agree that your contributions will be licensed under the MIT License.