Add per-package README and LICENSE for npm

Each published package now includes its own README (shown on npm) and
a copy of the MIT license so both travel with the tarball.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
michael
2026-03-03 20:30:44 -08:00
parent ab29707b50
commit bee19cb71f
6 changed files with 380 additions and 0 deletions

21
packages/tokens/LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Dangerous Things
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

79
packages/tokens/README.md Normal file
View File

@@ -0,0 +1,79 @@
# @dangerousthings/tokens
Canonical design tokens for the Dangerous Things design system — colors, typography, and shape values defined in TypeScript and exported as CSS custom properties.
## Install
```bash
npm install @dangerousthings/tokens
```
## Brands
Three brand themes are included:
| Brand | Description |
|-------|-------------|
| **dt** | Neon cyberpunk — Tektur font, beveled corners, cyan/yellow/magenta palette |
| **classic** | Dark navy with magenta accents, standard border radius |
| **supra** | Material Design 3 — VivoKey blue, rounded corners, elevation shadows |
Each brand provides dark and light mode values.
## Usage
### TypeScript / JavaScript
```ts
import { dt } from "@dangerousthings/tokens/brands/dt";
console.log(dt.color.dark.primary); // "#00ffff"
console.log(dt.typography.heading); // "Tektur Variable"
console.log(dt.shape.bevelMd); // "2rem"
```
Import all brands at once:
```ts
import { brands } from "@dangerousthings/tokens";
Object.keys(brands); // ["dt", "classic", "supra"]
```
### Types
```ts
import type { BrandTokens, ColorTokens, ThemeBrand } from "@dangerousthings/tokens";
```
### CSS Custom Properties
Generated CSS files are available per brand:
```css
@import "@dangerousthings/tokens/css/dt.css";
```
This provides custom properties like `--color-primary`, `--color-primary-rgb`, `--font-heading`, `--bevel-md`, etc.
## Exports
| Path | Description |
|------|-------------|
| `@dangerousthings/tokens` | All brands, theme definitions, and types |
| `@dangerousthings/tokens/brands/dt` | DT brand tokens |
| `@dangerousthings/tokens/brands/classic` | Classic brand tokens |
| `@dangerousthings/tokens/brands/supra` | Supra brand tokens |
| `@dangerousthings/tokens/css/dt.css` | DT CSS custom properties |
| `@dangerousthings/tokens/css/classic.css` | Classic CSS custom properties |
| `@dangerousthings/tokens/css/supra.css` | Supra CSS custom properties |
## Token Categories
- **Color** — background, surface, text, brand primary/secondary/accent, semantic (success, warning, error, info)
- **Typography** — heading, body, and mono font families
- **Shape** — bevel sizes (sm/md/lg) and border radius (sm/md/lg)
## License
[MIT](LICENSE)