@chipmo/design-system
v1.0.0
Published
Chipmo design system: tokens + web components shared across all Chipmo ERP products. Works in React, Vue, and plain HTML.
Maintainers
Readme
Chipmo design system
Shared tokens + components for every Chipmo ERP. One repo, one npm package, every product looks like Chipmo.
Install
npm install @chipmo/design-systemPublic on npm — no registry setup needed.
Use
// once, at app root
import '@chipmo/design-system/tokens.css';
import '@chipmo/design-system'; // registers <chp-*> elements<chp-card heading="Нэхэмжлэх #INV-2041">
<chp-badge slot="actions" tone="success">Төлөгдсөн</chp-badge>
<chp-input label="Харилцагч" value="Монгол Транс ХХК"></chp-input>
<chp-button variant="primary">Хадгалах</chp-button>
</chp-card>React: import { Button, Badge, Input, Card } from '@chipmo/design-system/react'
Vue 3: import '@chipmo/design-system/vue' — see src/vue/index.js for Vite config.
Try it in 30 seconds
A full working demo lives at examples/index.html — buttons, badges, inputs, a card, and a light/dark toggle. It loads everything from CDN, so you can test the design system with zero install: save this as demo.html and open it in a browser.
<!doctype html>
<html lang="mn">
<head>
<link rel="stylesheet" href="https://unpkg.com/@chipmo/design-system/dist/tokens.css" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
<script type="module">
import 'https://esm.sh/@chipmo/design-system';
</script>
<style>
body { font-family: 'Inter', sans-serif; background: var(--chp-bg-page);
color: var(--chp-text-primary); padding: 2rem; }
</style>
</head>
<body>
<chp-card heading="Нэхэмжлэх #INV-2041" style="max-width: 420px">
<chp-badge slot="actions" tone="success">Төлөгдсөн</chp-badge>
<chp-input label="Харилцагч" value="Монгол Транс ХХК"></chp-input>
<br />
<chp-button variant="primary">Хадгалах</chp-button>
<chp-button variant="outline">Цуцлах</chp-button>
</chp-card>
<script>
// components emit chp-* events
document.querySelector('chp-button')
.addEventListener('chp-click', () => alert('Хадгалагдлаа'));
</script>
</body>
</html>Force dark mode by adding data-theme="dark" to the <html> tag — or leave it off and the tokens follow the visitor's system preference automatically.
The demo also deploys automatically to GitHub Pages on every merge to main:
https://YOUR-ORG.github.io/design-system/ — the always-current showcase of the latest components and tokens.
Dark mode
Automatic via prefers-color-scheme. Force it with <html data-theme="dark">.
Working with AI coding tools
This repo is built to be used with AI pair programming. CLAUDE.md contains the rules
agents must follow; custom-elements.json (generated on build) is the machine-readable
component API; llms.txt is the index. Copy CLAUDE.md into consumer ERP repos or
reference it from theirs.
Developing
npm install
npm run build # generates dist/tokens.css + custom-elements.jsonEdit colors only in tokens/design-tokens.json, then rebuild. Never edit dist/.
Releasing
Merging to main triggers CI to build and publish to npm. Consumer ERP
repos using Renovate pick up the new version automatically via auto-merged PRs.
