@hugocxl/design 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BRAND.md +82 -0
- package/DESIGN.md +100 -0
- package/LICENSE +21 -0
- package/README.md +111 -1
- package/dist/design.css +264 -0
- package/dist/design.js +20 -0
- package/dist/react.d.ts +128 -0
- package/dist/react.js +124 -0
- package/dist/tailwind.css +53 -0
- package/dist/theme.js +16 -0
- package/dist/tokens.css +78 -0
- package/dist/tokens.d.ts +76 -0
- package/dist/tokens.js +121 -0
- package/dist/tokens.json +73 -0
- package/package.json +78 -1
- package/skills/design/SKILL.md +67 -0
package/package.json
CHANGED
|
@@ -1 +1,78 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@hugocxl/design",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The design system for @hugocxl product pages and personal sites: system font, pale canvas, ink greys, one cranberry accent, light and dark.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Hugo Corta",
|
|
8
|
+
"homepage": "https://github.com/hugocxl/design#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/hugocxl/design.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/hugocxl/design/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"design-system",
|
|
16
|
+
"css",
|
|
17
|
+
"tailwind",
|
|
18
|
+
"react",
|
|
19
|
+
"hugocxl"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"skills",
|
|
24
|
+
"DESIGN.md",
|
|
25
|
+
"BRAND.md"
|
|
26
|
+
],
|
|
27
|
+
"style": "./dist/design.css",
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"*.css",
|
|
30
|
+
"./dist/theme.js",
|
|
31
|
+
"./dist/design.js"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/design.css",
|
|
35
|
+
"./css": "./dist/design.css",
|
|
36
|
+
"./design.css": "./dist/design.css",
|
|
37
|
+
"./tokens.css": "./dist/tokens.css",
|
|
38
|
+
"./tokens": {
|
|
39
|
+
"types": "./dist/tokens.d.ts",
|
|
40
|
+
"default": "./dist/tokens.js"
|
|
41
|
+
},
|
|
42
|
+
"./tokens.json": "./dist/tokens.json",
|
|
43
|
+
"./tailwind.css": "./dist/tailwind.css",
|
|
44
|
+
"./theme.js": "./dist/theme.js",
|
|
45
|
+
"./design.js": "./dist/design.js",
|
|
46
|
+
"./react": {
|
|
47
|
+
"types": "./dist/react.d.ts",
|
|
48
|
+
"default": "./dist/react.js"
|
|
49
|
+
},
|
|
50
|
+
"./DESIGN.md": "./DESIGN.md",
|
|
51
|
+
"./BRAND.md": "./BRAND.md",
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "node scripts/build.mjs",
|
|
56
|
+
"test": "node scripts/build.mjs && node --test test/build.test.mjs",
|
|
57
|
+
"prepack": "node scripts/build.mjs"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": ">=18"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"react": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"lightningcss": "1.33.0",
|
|
69
|
+
"react": "19.3.1",
|
|
70
|
+
"react-dom": "19.3.1"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"engines": {
|
|
76
|
+
"node": ">=20"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: Use @hugocxl/design for the look of every @hugocxl website, product or launch page, docs, changelog and the personal site — classes, tokens, Tailwind theme and React components. Use whenever you create, style, port or review one of these web pages. Not for apps.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @hugocxl/design
|
|
7
|
+
|
|
8
|
+
A tiny web design system: system UI font, pale canvas `#f8f8f8` / dark `#151515`, ink greys, one cranberry accent. Full rules: `node_modules/@hugocxl/design/DESIGN.md`. Voice: `BRAND.md`.
|
|
9
|
+
|
|
10
|
+
## Load it
|
|
11
|
+
|
|
12
|
+
| Need | Import |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Everything (tokens + classes) | `@hugocxl/design/css` → `dist/design.css` |
|
|
15
|
+
| Tokens only | `@hugocxl/design/tokens.css`, `@hugocxl/design/tokens` (JS), `tokens.json` |
|
|
16
|
+
| Tailwind v4 | `@import "tailwindcss"; @import "@hugocxl/design/tailwind.css";` |
|
|
17
|
+
| Theme switch | `@hugocxl/design/theme.js` as a classic `<script>` in `<head>` |
|
|
18
|
+
| Hairline + copy buttons | `@hugocxl/design/design.js` as a module (optional) |
|
|
19
|
+
| React | `@hugocxl/design/react` |
|
|
20
|
+
|
|
21
|
+
## Page skeleton
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<body class="ds" data-layout="plain">
|
|
25
|
+
<header class="ds-masthead">
|
|
26
|
+
<a class="ds-wordmark" href="./">Name</a>
|
|
27
|
+
<nav aria-label="Main"><a href="docs.html"><svg class="ds-icon">…</svg>Docs</a></nav>
|
|
28
|
+
<a href="https://github.com/hugocxl/name">GitHub</a>
|
|
29
|
+
<button class="ds-theme" type="button" data-ds-theme aria-label="Switch theme"><svg class="ds-icon">…</svg></button>
|
|
30
|
+
</header>
|
|
31
|
+
<main><article class="ds-column ds-opening">
|
|
32
|
+
<section class="ds-hero">
|
|
33
|
+
<p class="ds-eyebrow">Name</p>
|
|
34
|
+
<h1>One sentence that ends in an <span class="ds-accent">accent phrase.</span></h1>
|
|
35
|
+
<p>One muted subhead.</p>
|
|
36
|
+
<p class="ds-actions"><a class="ds-button" href="…">Primary</a><a class="ds-more" href="…">Secondary<svg class="ds-icon">…</svg></a></p>
|
|
37
|
+
</section>
|
|
38
|
+
<figure class="ds-wide"><div class="ds-media"><img …></div><figcaption class="ds-caption"><span class="ds-label">Fig. 01 / What it shows</span></figcaption></figure>
|
|
39
|
+
<section class="ds-section" id="x"><h2>Plain heading</h2><p>Point in ink. <span class="ds-muted">Detail in muted.</span></p></section>
|
|
40
|
+
</article></main>
|
|
41
|
+
<footer class="ds-footer"><ul><li>© 2026 Hugo Corta</li></ul><ul><li><a href="https://github.com/hugocxl">GitHub</a></li><li><a href="https://www.npmjs.com/~hugocxl">npm</a></li></ul></footer>
|
|
42
|
+
</body>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Docs and changelog pages replace the hero with `<hgroup class="ds-title"><h1>Docs</h1><p>Subline</p></hgroup>` and optional `<ul class="ds-meta"><li class="ds-label">Version 1.2.0</li></ul>`.
|
|
46
|
+
|
|
47
|
+
## Classes
|
|
48
|
+
|
|
49
|
+
`ds` · `ds-masthead` · `ds-wordmark` · `ds-theme` · `ds-column` · `ds-opening` · `ds-hero` · `ds-eyebrow` · `ds-accent` · `ds-actions` · `ds-button` · `ds-more` · `ds-title` · `ds-meta` · `ds-section` · `ds-muted` · `ds-label` · `ds-wide` · `ds-media` · `ds-caption` · `ds-grid[data-columns=2|3|4]` (`li > h3 + p`) · `ds-index` (`li > span.ds-label + div > h3 + p`) · `ds-table` · `ds-table-scroll` · `ds-code` (`pre > code` + `button`) · `ds-footer` · `ds-icon` · `ds-vector` · `ds-visually-hidden`.
|
|
50
|
+
|
|
51
|
+
## React
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import '@hugocxl/design/css';
|
|
55
|
+
import { Page, Masthead, Hero, Title, Section, Button, Figure, Grid, Index, Footer, ThemeToggle, themeScript } from '@hugocxl/design/react';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`Page({ masthead, footer, children })` wraps children in `main > article.ds-column.ds-opening`. `Masthead({ wordmark, href, links: [{ label, href, icon, current }], pageLink, theme })`. `Hero({ eyebrow, title, lead, actions })`. `Button({ href, variant: 'primary' | 'more', icon })`. `Figure({ src, alt, width, height, caption, wide })`. `Grid({ columns, items: [{ title, description, href, visual }] })`. `Index({ items: [{ label, title, href, description }] })`. `Footer({ start, end })` defaults to the standard footer. Put `themeScript` inline in `<head>`.
|
|
59
|
+
|
|
60
|
+
## Rules
|
|
61
|
+
|
|
62
|
+
- Site CSS may only use `--ds-*` values: no new colors, fonts, sizes, radii, shadows or gradients.
|
|
63
|
+
- One accent phrase per screen; links are underlined text, never accent-colored.
|
|
64
|
+
- One primary button per row; at most three nav items, each an icon before its words.
|
|
65
|
+
- Sentence case, plain words, no exclamation marks or emoji.
|
|
66
|
+
- Real screenshots in `.ds-media`; illustrations from `@hugocxl/vectors`; icons from `@hugocxl/icons` (Stroke).
|
|
67
|
+
- Migrating from `@hugocxl/design-system` 0.3: swap `system/ds.css` for `@hugocxl/design/css`, `system/theme.js` for `theme.js`, `system/ds.js` for `design.js`. Removed: fonts, sounds, `ds-sound`, `ds-menu`, `ds-pager`, `ds-form`/`ds-input`, `ds-note`, `ds-dot`/status colors, hue tokens and `data-layout="field"`.
|