npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bernierllc/email-ui

v0.1.4

Published

React UI components for email management, templates, scheduling, and analytics

Readme

@bernierllc/email-ui

React UI components for email management, templates, scheduling, and analytics.

Installation

npm install @bernierllc/email-ui

Usage

import { TemplateEditor, EmailComposer, AnalyticsDashboard } from '@bernierllc/email-ui';

// Basic template editor
<TemplateEditor
  onSave={handleSaveTemplate}
  onCancel={() => setEditing(false)}
/>

// Email composer with scheduling
<EmailComposer
  templates={templates}
  onSend={handleSendEmail}
  onSchedule={handleScheduleEmail}
  onSaveDraft={handleSaveDraft}
/>

// Analytics dashboard
<AnalyticsDashboard
  analytics={analyticsData}
  onRefresh={handleRefresh}
  onExport={handleExport}
/>

Components

TemplateEditor

Full-featured email template editor with variable detection and preview mode.

Props

  • template?: Partial<EmailTemplate> - Existing template to edit
  • onSave: (template: TemplateFormData) => Promise<void> - Save handler
  • onCancel?: () => void - Cancel handler
  • isLoading?: boolean - Loading state
  • className?: string - Custom CSS class
  • style?: React.CSSProperties - Inline styles

Features

  • Variable extraction from content ({{variable}} syntax)
  • Live preview mode
  • Form validation
  • Category and tag management

EmailComposer

Comprehensive email composition interface with template integration.

Props

  • templates?: EmailTemplate[] - Available templates
  • onSend: (email: EmailComposition) => Promise<void> - Send handler
  • onSchedule?: (email: EmailComposition) => Promise<void> - Schedule handler
  • onSaveDraft?: (email: Partial<EmailComposition>) => Promise<void> - Draft handler
  • isLoading?: boolean - Loading state
  • className?: string - Custom CSS class
  • style?: React.CSSProperties - Inline styles

Features

  • Template selection and variable population
  • File attachments
  • Email scheduling
  • Draft saving
  • Form validation

AnalyticsDashboard

Comprehensive email analytics visualization with multiple view modes.

Props

  • analytics: EmailAnalytics[] - Analytics data array
  • isLoading?: boolean - Loading state
  • onRefresh?: () => Promise<void> - Refresh handler
  • onExport?: (format: 'csv' | 'pdf') => Promise<void> - Export handler
  • className?: string - Custom CSS class
  • style?: React.CSSProperties - Inline styles

Features

  • Overview metrics with calculated rates
  • Trends visualization
  • Detailed breakdown tables
  • Export functionality
  • Multiple view modes

API Reference

Type Definitions

EmailTemplate

interface EmailTemplate {
  id: string;
  name: string;
  subject: string;
  content: string;
  variables: string[];
  category?: string;
  tags?: string[];
  createdAt: Date;
  updatedAt: Date;
  isActive: boolean;
}

EmailComposition

interface EmailComposition {
  to: string[];
  cc?: string[];
  bcc?: string[];
  subject: string;
  content: string;
  templateId?: string;
  variables?: Record<string, any>;
  attachments?: File[];
  scheduleTime?: Date;
}

EmailAnalytics

interface EmailAnalytics {
  templateId?: string;
  sent: number;
  delivered: number;
  opened: number;
  clicked: number;
  bounced: number;
  complained: number;
  openRate: number;
  clickRate: number;
  bounceRate: number;
  period: {
    start: Date;
    end: Date;
  };
}

Integration

Logger Integration

Components support optional logger integration for debugging and monitoring:

import { Logger } from '@bernierllc/logger';

const logger = new Logger({ service: 'email-ui' });

// Components automatically detect and use logger when available
<TemplateEditor onSave={handleSave} />

Integration Status: ✅ Ready - Components automatically detect logger presence and provide enhanced debugging capabilities including:

  • Component lifecycle logging
  • User interaction tracking
  • Error reporting and debugging
  • Performance monitoring

NeverHub Integration

Components support optional NeverHub integration for enhanced functionality:

import { NeverHubAdapter } from '@bernierllc/neverhub-adapter';

// Components automatically detect NeverHub presence
// and enable enhanced capabilities when available

Integration Status: ✅ Ready - Components automatically detect NeverHub availability and enable:

  • Real-time email event notifications
  • Cross-component state synchronization
  • Enhanced metrics collection
  • Distributed debugging and monitoring

Integration Documentation

This package follows the graceful degradation pattern:

  • All components work independently without any integrations
  • Logger integration adds debugging and monitoring capabilities
  • NeverHub integration adds real-time and distributed features
  • No breaking changes when integrations are added or removed

Security

Input Sanitization

All user inputs are properly sanitized:

  • Email addresses validated with RFC-compliant patterns
  • HTML content sanitized to prevent XSS attacks
  • File uploads validated for type and size
  • Template variables escaped to prevent injection

Content Security Policy

Components are designed to work with strict CSP:

  • No inline styles or scripts
  • All dynamic content properly escaped
  • External resource loading controlled
  • Event handlers use proper event delegation

Data Protection

Components handle sensitive data securely:

  • Email content encrypted in transit
  • Temporary files cleaned up automatically
  • No sensitive data stored in browser storage
  • Audit logging for security events (when logger integration enabled)

Styling

Components use BEM CSS methodology for consistent styling:

.email-composer {
  /* Component root */
}

.email-composer__header {
  /* Component header */
}

.email-composer__form {
  /* Form container */
}

.form-group {
  /* Form field group */
}

.form-input {
  /* Input fields */
}

.btn {
  /* Base button styles */
}

.btn--primary {
  /* Primary button variant */
}

.btn--secondary {
  /* Secondary button variant */
}

Development

Building

npm run build

Testing

npm test
npm run test:coverage
npm run test:watch

Linting

npm run lint
npm run lint:fix

Dependencies

  • React 18+
  • Zod for validation
  • DOM APIs for browser functionality

License

Copyright (c) 2025 Bernier LLC. All rights reserved.

This package is licensed under the Bernier LLC license. See LICENSE file for details.

Support

For support and questions, please contact Bernier LLC or refer to the project documentation.