0.6.1 • Published 5 months ago

@coval-ai/components v0.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@coval-ai/components

A lightweight component library for Coval applications.

Installation

npm install @coval-ai/components

Or using yarn:

yarn add @coval-ai/components

Requirements

This package has the following peer dependencies:

  • React 16.8+ / 17 / 18
  • ReactDOM 16.8+ / 17 / 18
  • Recharts 2.0+
  • Axios 1.0+ (for API requests)
  • axios-cache-interceptor 1.8+ (for request caching)
  • axios-retry 4.5+ (for automatic retries)

Usage

CovalProvider

The CovalProvider is required to set up API configuration for the components. Authentication is handled automatically via cookies.

import { CovalProvider } from '@coval-ai/components';

function App() {
  return (
    <CovalProvider token="pk_coval_1234567890">
      <YourAppComponents />
    </CovalProvider>
  );
}

LatencyChart

A chart component for visualizing latency data from the Coval API.

import { LatencyChart } from '@coval-ai/components';

function Dashboard() {
  return (
    <div>
      <h1>Latency Dashboard</h1>
      <LatencyChart />
    </div>
  );
}

API Reference

CovalProvider

PropTypeRequiredDescription
apiUrlstringNoBase URL for the Coval API (default: API endpoint)
childrenReactNodeYesChild components

LatencyBarChart

The LatencyBarChart component fetches and displays latency data automatically when mounted.

Development

To start the development server:

npm run dev

Build

To build the package:

npm run build

Linting and Type Checking

npm run lint    # Run ESLint
npm run type    # Run TypeScript type checking
npm run format  # Format code with Prettier
npm run check   # Run lint and type checking together

Git Hooks

This project uses Lefthook for Git hooks and lint-staged to run linters on staged files. This ensures code quality before commits.

The Git hooks run automatically when you commit changes. The pre-commit hook runs ESLint and Prettier on staged files, and checks for TypeScript errors.

License

MIT © Coval

0.6.1

5 months ago

0.6.0

5 months ago

0.4.0-beta.1

5 months ago

0.3.0-beta.2

6 months ago

0.3.0-beta.1

6 months ago

0.2.2-beta.1

6 months ago

0.2.1-beta.1

6 months ago

0.2.0-beta.1

6 months ago

0.1.0-beta.1

6 months ago

0.0.1-beta.4

6 months ago

0.0.1-beta.3

6 months ago

0.0.1-beta.2

6 months ago

0.0.1-beta.1

6 months ago