@yca-software/2chi-react-core
v1.0.9
Published
Design system and shared SPA kit for 2chi React apps.
Readme
@yca-software/2chi-react-core
Design system and shared SPA kit for 2chi React apps.
Install
pnpm add @yca-software/2chi-react-coreImport styles once in your app entry:
import '@yca-software/2chi-react-core/styles.css';Peers: react, react-dom, react-hook-form, react-router, react-i18next, i18next, @tanstack/react-query
Usage
Prefer subpath imports:
import { Button } from '@yca-software/2chi-react-core/ui';
import { useAPI, createApiProvider } from '@yca-software/2chi-react-core/api';
import { formatApiError } from '@yca-software/2chi-react-core/errors';
import { AdminListPage } from '@yca-software/2chi-react-core';| Subpath | Contents |
|---------|----------|
| /ui | Design-system components |
| /marketing | Landing-page sections |
| /api | HTTP client, token refresh |
| /auth | Cookies, JWT helpers |
| /errors | API error formatting |
| /forms | react-hook-form fields |
| /hooks | Admin list, i18n hooks |
| /constants | Cookie names, pagination |
| /admin | Admin detail helpers |
The root export re-exports everything. @yca-software/2chi-react-core/design-system is a deprecated alias for ..
Development
pnpm install
pnpm run build
pnpm run ci
pnpm run storybookRelease
Publishing is automated when you create a GitHub Release:
- Bump
versioninpackage.json - Commit and push to
main - Tag
vX.Y.Zand publish the release
CI runs build, lint, tests, then publishes to npm with NPM_TOKEN.
