@epilot360/illustrations

中文文档
1.2.1发布于 2026/07/23MITTypeScriptES Module零依赖近 30 天下载 5862

A tree-shakable illustration library for epilot platform

原始使用文档
文档目录18 节
  1. Features
  2. Installation
  3. Usage
  4. Basic Usage
  5. With Custom Size
  6. With Accessibility
  7. With Custom Styling
  8. Available Illustrations
  9. CouponDiscount
  10. Development
  11. Prerequisites
  12. Setup
  13. Scripts
  14. Using in Single-SPA Microfrontends
  15. Bundle Size
  16. Browser Support
  17. Contributing
  18. License

@epilot360/illustrations

A tree-shakable illustration library for the epilot platform. Built with React, TypeScript, and optimized for minimal bundle size.

Features

  • 🎨 High-quality SVG illustrations created in Figma
  • 📦 Tree-shakable - only import what you need
  • ⚡ Optimized for performance - minimal bundle size
  • 🎯 TypeScript support - full type safety
  • ♿ Accessible - built with accessibility in mind
  • 📱 Responsive - works on all screen sizes
  • 🎛️ Customizable - flexible sizing and styling options

Installation

npm install @epilot360/illustrations
# or
yarn add @epilot360/illustrations
# or
pnpm add @epilot360/illustrations

Usage

Basic Usage

import { CouponDiscount } from '@epilot360/illustrations';

function App() {
  return (
    <div>
      <CouponDiscount />
    </div>
  );
}

With Custom Size

import { CouponDiscount } from '@epilot360/illustrations';

function App() {
  return (
    <div>
      {/* Using predefined sizes */}
      <CouponDiscount size="large" />
      
      {/* Using custom dimensions */}
      <CouponDiscount width={200} height={200} />
    </div>
  );
}

With Accessibility

import { CouponDiscount } from '@epilot360/illustrations';

function App() {
  return (
    <div>
      {/* Decorative (hidden from screen readers) */}
      <CouponDiscount />
      
      {/* With accessibility label */}
      <CouponDiscount 
        aria-label="20% discount coupon"
      />
    </div>
  );
}

With Custom Styling

import { CouponDiscount } from '@epilot360/illustrations';

function App() {
  return (
    <div>
      <CouponDiscount 
        className="my-custom-class"
        style={{ 
          border: '2px solid #e2e8f0',
          borderRadius: '8px'
        }}
      />
    </div>
  );
}

Available Illustrations

CouponDiscount

A vibrant coupon discount illustration perfect for promotional content and marketing materials.

Props:

  • size?: 'small' | 'medium' | 'large' - Predefined size variants
  • width?: string | number - Custom width
  • height?: string | number - Custom height
  • className?: string - Additional CSS class
  • style?: React.CSSProperties - Inline styles
  • aria-label?: string - Accessibility label. If provided, the illustration will be accessible to screen readers. If not provided, the illustration will be decorative (hidden from screen readers).

Development

Prerequisites

  • Node.js 18+
  • npm, yarn, or pnpm

Setup

# Install dependencies
npm install

# Start development server for documentation
npm run dev

# Build the library
npm run build:lib

# Build documentation site
npm run build:docs

Scripts

Documentation & Library

  • npm run dev - Start development server for documentation
  • npm run build:lib - Build the library for distribution
  • npm run build:docs - Build the documentation site

SystemJS Bundle for Single-SPA

  • npm run dev:bundle - Build and serve SystemJS bundle with Vite (http://localhost:3456)
  • npm run build:bundle - Build SystemJS bundle for microfrontends
  • npm run serve:bundle:vite - Serve built bundle with Vite preview server

Code Quality

  • npm run type-check - Run TypeScript type checking
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues

Using in Single-SPA Microfrontends

This library can be used as a SystemJS bundle in single-spa applications:

# Build and serve the bundle locally
npm run dev:bundle

The bundle will be available at http://localhost:3456/bundle.js with full CORS support.

Import Map Configuration:

{
  "imports": {
    "@epilot360/illustrations": "http://localhost:3456/bundle.js"
  }
}

The bundle uses:

  • SystemJS format for single-spa compatibility
  • Classic JSX transform (no react/jsx-runtime dependency)
  • External React/ReactDOM (shared dependencies)

Bundle Size

The library is optimized for minimal bundle size:

  • Tree-shakable: Only import the illustrations you need
  • SVG-based: Vector graphics for crisp rendering at any size
  • Minified: Production builds are minified and optimized
  • No external dependencies: Zero runtime dependencies

Browser Support

  • Chrome 88+
  • Firefox 85+
  • Safari 14+
  • Edge 88+

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-illustration
  3. Add your illustration following the existing patterns
  4. Update documentation
  5. Run tests and linting: npm run lint && npm run type-check
  6. Commit your changes: git commit -m 'Add new illustration'
  7. Push to the branch: git push origin feature/new-illustration
  8. Create a Pull Request

License

MIT © Epilot

版本与发布记录

@epilot360/illustrations 共发布 12 个版本,首次发布于 2025/11/11;过去 12 个月发布了 8 个版本。

版本发布日期距今
1.2.1latest2026/07/233 个月前
1.2.02026/07/163 个月前
1.1.02026/06/154 个月前
1.1.0-alpha.0alpha2026/06/085 个月前
1.0.72026/01/159 个月前
1.0.62025/11/2111 个月前

关于 @epilot360/illustrations 的常见问题

@epilot360/illustrations 是什么?

A tree-shakable illustration library for epilot platform

如何安装 @epilot360/illustrations?

在项目目录运行 npm install @epilot360/illustrations,或使用 pnpm add / yarn add / bun add。

@epilot360/illustrations 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@epilot360/illustrations 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@epilot360/illustrations 可以商用吗?

@epilot360/illustrations 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@epilot360/illustrations 的下载量有多少?

根据 npm 官方下载统计,@epilot360/illustrations 在 2026/10/14 – 2026/11/12 这 30 天内被下载 5,862 次,日均约 195 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@epilot360/illustrations 还在维护吗?

最新版本 1.2.1 发布于 2026/07/23(3 个月前);至今共发布 12 个版本,其中过去 12 个月发布了 8 个;首次发布于 2025/11/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。