@hanzo/design 0.4.5 → 0.4.7
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/LICENSE +10 -24
- package/README.md +1 -1
- package/package.json +3 -3
- package/scripts/check-tokens.mjs +41 -0
- package/skills/design-system/SKILL.md +1 -1
- package/styles.css +9 -9
- package/tailwind.css +9 -9
- package/tokens/colors.css +9 -9
package/LICENSE
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
Licensed under either of
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
* Apache License, Version 2.0 (LICENSE-APACHE or
|
|
4
|
+
https://www.apache.org/licenses/LICENSE-2.0)
|
|
5
|
+
* MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
at your option.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
Unless you explicitly state otherwise, any contribution intentionally
|
|
10
|
+
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
|
11
|
+
license, shall be dual licensed as above, without any additional terms or
|
|
12
|
+
conditions.
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
this list of conditions and the following disclaimer in the documentation
|
|
13
|
-
and/or other materials provided with the distribution.
|
|
14
|
-
|
|
15
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
-
contributors may be used to endorse or promote products derived from
|
|
17
|
-
this software without specific prior written permission.
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
14
|
+
See HIP-0137 (hanzoai/hips) for the standard this follows.
|
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ Tokens track `hanzo.ai` (`app/globals.css`, `tailwind.config.ts`, `DESIGN.md`) a
|
|
|
126
126
|
|
|
127
127
|
## License
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
MIT OR Apache-2.0, per [HIP-0137](https://github.com/hanzoai/hips/blob/main/HIPs/hip-0137-one-license.md). Brand marks (the Hanzo logo, partner and provider logos) are the property of their respective owners and are provided for identification.
|
|
130
130
|
|
|
131
131
|
## Using it in a Tailwind app
|
|
132
132
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/design",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"packageManager": "pnpm@11.17.0",
|
|
5
5
|
"description": "Hanzo Design System \u2014 monochrome, dark-default tokens + components + brand assets, the single source of truth for every Hanzo surface. CSS + typed programmatic tokens.",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/hanzoai/design.git"
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
"bin": {
|
|
71
71
|
"hanzo-design-lint": "./scripts/lint.mjs"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|
package/scripts/check-tokens.mjs
CHANGED
|
@@ -59,6 +59,47 @@ const pass = (msg) => console.log(` ok ${msg}`)
|
|
|
59
59
|
: pass(`all ${urls.length} asset url()s resolve from the package root`)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// ── 1a. the bundles must PARSE ───────────────────────────────────────────
|
|
63
|
+
// 0.4.2 and 0.4.3 shipped a stray `*/` in styles.css AND tailwind.css: an
|
|
64
|
+
// edit added prose to the end of a comment that was already closed, so a
|
|
65
|
+
// paragraph of English sat in the stylesheet as raw CSS, terminated by a
|
|
66
|
+
// second `*/`. Browsers recover from that — they skip to the next thing that
|
|
67
|
+
// looks like a rule and carry on — so the whole kit rendered correctly in
|
|
68
|
+
// Chromium at three widths in both themes, and every screenshot looked right.
|
|
69
|
+
// PostCSS does not recover. It throws, which means those two versions could
|
|
70
|
+
// not be built against by any Vite/Next/Tailwind consumer at all.
|
|
71
|
+
//
|
|
72
|
+
// The lesson is specific: RENDERING IS NOT PARSING. A visual check cannot see
|
|
73
|
+
// this class of defect, because the browser's error recovery is what hides it.
|
|
74
|
+
// So it is checked structurally, here, on the artifacts a consumer receives.
|
|
75
|
+
//
|
|
76
|
+
// Done by hand rather than with postcss because the defect is lexical and the
|
|
77
|
+
// scan is fifteen lines — CSS comments do not nest, so one left-to-right pass
|
|
78
|
+
// that skips comment bodies finds every stray terminator and every unclosed
|
|
79
|
+
// opener. A parser dependency would be a heavier answer to a smaller question.
|
|
80
|
+
{
|
|
81
|
+
for (const f of ['styles.css', 'tailwind.css']) {
|
|
82
|
+
const s = read(join(root, f))
|
|
83
|
+
let i = 0, opened = 0, strays = [], unterminated = null
|
|
84
|
+
while (i < s.length - 1) {
|
|
85
|
+
if (s[i] === '/' && s[i + 1] === '*') {
|
|
86
|
+
opened++
|
|
87
|
+
const j = s.indexOf('*/', i + 2)
|
|
88
|
+
if (j < 0) { unterminated = s.slice(0, i).split('\n').length; break }
|
|
89
|
+
i = j + 2
|
|
90
|
+
continue
|
|
91
|
+
}
|
|
92
|
+
if (s[i] === '*' && s[i + 1] === '/') { strays.push(s.slice(0, i).split('\n').length); i += 2; continue }
|
|
93
|
+
i++
|
|
94
|
+
}
|
|
95
|
+
const braces = [...s].reduce((n, c) => n + (c === '{') - (c === '}'), 0)
|
|
96
|
+
if (unterminated !== null) fail(`${f}: unterminated /* at line ${unterminated}`)
|
|
97
|
+
else if (strays.length) fail(`${f}: stray */ outside any comment at line ${strays.join(', ')} — a consumer's PostCSS build throws here`)
|
|
98
|
+
else if (braces !== 0) fail(`${f}: ${Math.abs(braces)} unbalanced ${braces > 0 ? '{' : '}'}`)
|
|
99
|
+
else pass(`${f} is lexically sound — ${opened} comments closed, braces balanced`)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
62
103
|
// ── 1b. the Tailwind bridge is complete and self-contained ───────────────
|
|
63
104
|
// An app should write ONE import and get working utilities. Each thing checked
|
|
64
105
|
// here failed silently in production before it was checked: a missing slot
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-system
|
|
3
3
|
description: "Use whenever you generate, edit, or review a Hanzo user interface — a page, component, screen, email, or any code change touching colour, type, spacing, elevation, motion, or stacking order. Use it when PLANNING UI work too, so the plan names tokens rather than values. Teaches the Hanzo token layer (@hanzo/design, derived from @hanzo/brand plus @hanzo/logo) and runs the linter that proves generated code actually reaches it. Triggers — build a page, add a component, style, theme, dark mode, colour, hex, palette, font size, spacing, padding, z-index, modal, dropdown, toast, button, card, dialog, icon, make it look Hanzo, brand, design review."
|
|
4
|
-
license:
|
|
4
|
+
license: MIT OR Apache-2.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# The Hanzo design system
|
package/styles.css
CHANGED
|
@@ -229,23 +229,23 @@
|
|
|
229
229
|
silent (the border simply stops existing) and has shipped before. */
|
|
230
230
|
.light{
|
|
231
231
|
color-scheme:light;
|
|
232
|
-
--background:#
|
|
232
|
+
--background:#f7f7f7;
|
|
233
233
|
--foreground:#0a0a0a;
|
|
234
234
|
/* A ladder, not four names for #f5f5f5. Light lifts by the same tiny steps
|
|
235
235
|
dark does — ~2% per rung — so --surface-0..3 mean something in both themes. */
|
|
236
|
-
--card:#
|
|
236
|
+
--card:#f2f2f2;
|
|
237
237
|
--card-foreground:#0a0a0a;
|
|
238
|
-
--popover:#
|
|
238
|
+
--popover:#fbfbfb;
|
|
239
239
|
--popover-foreground:#0a0a0a;
|
|
240
240
|
--primary:#0a0a0a;
|
|
241
241
|
--primary-hover:#262626;
|
|
242
242
|
--primary-foreground:#fafafa;
|
|
243
|
-
--secondary:#
|
|
243
|
+
--secondary:#e4e4e4;
|
|
244
244
|
--secondary-hover:#e0e0e0;
|
|
245
245
|
--secondary-foreground:#0a0a0a;
|
|
246
|
-
--muted:#
|
|
246
|
+
--muted:#ededed;
|
|
247
247
|
--muted-foreground:#525252;
|
|
248
|
-
--accent:#
|
|
248
|
+
--accent:#e4e4e4;
|
|
249
249
|
--accent-foreground:#0a0a0a;
|
|
250
250
|
--destructive:var(--state-error);
|
|
251
251
|
--destructive-hover:#dc2626;
|
|
@@ -270,9 +270,9 @@
|
|
|
270
270
|
--selection:rgb(0 0 0 / .16);
|
|
271
271
|
--glass:rgb(0 0 0 / .04);
|
|
272
272
|
--glass-strong:rgb(0 0 0 / .07);
|
|
273
|
-
--surface-card:#
|
|
274
|
-
--surface-card-emphasis:#
|
|
275
|
-
--surface-card-quiet:#
|
|
273
|
+
--surface-card:#f2f2f2;
|
|
274
|
+
--surface-card-emphasis:#fdfdfd;
|
|
275
|
+
--surface-card-quiet:#f5f5f5;
|
|
276
276
|
--surface-overlay:rgb(255 255 255 / .95);
|
|
277
277
|
--surface-header:rgb(255 255 255 / .8);
|
|
278
278
|
--surface-scrim:rgb(0 0 0 / .5);
|
package/tailwind.css
CHANGED
|
@@ -252,23 +252,23 @@
|
|
|
252
252
|
silent (the border simply stops existing) and has shipped before. */
|
|
253
253
|
.light{
|
|
254
254
|
color-scheme:light;
|
|
255
|
-
--background:#
|
|
255
|
+
--background:#f7f7f7;
|
|
256
256
|
--foreground:#0a0a0a;
|
|
257
257
|
/* A ladder, not four names for #f5f5f5. Light lifts by the same tiny steps
|
|
258
258
|
dark does — ~2% per rung — so --surface-0..3 mean something in both themes. */
|
|
259
|
-
--card:#
|
|
259
|
+
--card:#f2f2f2;
|
|
260
260
|
--card-foreground:#0a0a0a;
|
|
261
|
-
--popover:#
|
|
261
|
+
--popover:#fbfbfb;
|
|
262
262
|
--popover-foreground:#0a0a0a;
|
|
263
263
|
--primary:#0a0a0a;
|
|
264
264
|
--primary-hover:#262626;
|
|
265
265
|
--primary-foreground:#fafafa;
|
|
266
|
-
--secondary:#
|
|
266
|
+
--secondary:#e4e4e4;
|
|
267
267
|
--secondary-hover:#e0e0e0;
|
|
268
268
|
--secondary-foreground:#0a0a0a;
|
|
269
|
-
--muted:#
|
|
269
|
+
--muted:#ededed;
|
|
270
270
|
--muted-foreground:#525252;
|
|
271
|
-
--accent:#
|
|
271
|
+
--accent:#e4e4e4;
|
|
272
272
|
--accent-foreground:#0a0a0a;
|
|
273
273
|
--destructive:var(--state-error);
|
|
274
274
|
--destructive-hover:#dc2626;
|
|
@@ -293,9 +293,9 @@
|
|
|
293
293
|
--selection:rgb(0 0 0 / .16);
|
|
294
294
|
--glass:rgb(0 0 0 / .04);
|
|
295
295
|
--glass-strong:rgb(0 0 0 / .07);
|
|
296
|
-
--surface-card:#
|
|
297
|
-
--surface-card-emphasis:#
|
|
298
|
-
--surface-card-quiet:#
|
|
296
|
+
--surface-card:#f2f2f2;
|
|
297
|
+
--surface-card-emphasis:#fdfdfd;
|
|
298
|
+
--surface-card-quiet:#f5f5f5;
|
|
299
299
|
--surface-overlay:rgb(255 255 255 / .95);
|
|
300
300
|
--surface-header:rgb(255 255 255 / .8);
|
|
301
301
|
--surface-scrim:rgb(0 0 0 / .5);
|
package/tokens/colors.css
CHANGED
|
@@ -214,23 +214,23 @@
|
|
|
214
214
|
silent (the border simply stops existing) and has shipped before. */
|
|
215
215
|
.light{
|
|
216
216
|
color-scheme:light;
|
|
217
|
-
--background:#
|
|
217
|
+
--background:#f7f7f7;
|
|
218
218
|
--foreground:#0a0a0a;
|
|
219
219
|
/* A ladder, not four names for #f5f5f5. Light lifts by the same tiny steps
|
|
220
220
|
dark does — ~2% per rung — so --surface-0..3 mean something in both themes. */
|
|
221
|
-
--card:#
|
|
221
|
+
--card:#f2f2f2;
|
|
222
222
|
--card-foreground:#0a0a0a;
|
|
223
|
-
--popover:#
|
|
223
|
+
--popover:#fbfbfb;
|
|
224
224
|
--popover-foreground:#0a0a0a;
|
|
225
225
|
--primary:#0a0a0a;
|
|
226
226
|
--primary-hover:#262626;
|
|
227
227
|
--primary-foreground:#fafafa;
|
|
228
|
-
--secondary:#
|
|
228
|
+
--secondary:#e4e4e4;
|
|
229
229
|
--secondary-hover:#e0e0e0;
|
|
230
230
|
--secondary-foreground:#0a0a0a;
|
|
231
|
-
--muted:#
|
|
231
|
+
--muted:#ededed;
|
|
232
232
|
--muted-foreground:#525252;
|
|
233
|
-
--accent:#
|
|
233
|
+
--accent:#e4e4e4;
|
|
234
234
|
--accent-foreground:#0a0a0a;
|
|
235
235
|
--destructive:var(--state-error);
|
|
236
236
|
--destructive-hover:#dc2626;
|
|
@@ -255,9 +255,9 @@
|
|
|
255
255
|
--selection:rgb(0 0 0 / .16);
|
|
256
256
|
--glass:rgb(0 0 0 / .04);
|
|
257
257
|
--glass-strong:rgb(0 0 0 / .07);
|
|
258
|
-
--surface-card:#
|
|
259
|
-
--surface-card-emphasis:#
|
|
260
|
-
--surface-card-quiet:#
|
|
258
|
+
--surface-card:#f2f2f2;
|
|
259
|
+
--surface-card-emphasis:#fdfdfd;
|
|
260
|
+
--surface-card-quiet:#f5f5f5;
|
|
261
261
|
--surface-overlay:rgb(255 255 255 / .95);
|
|
262
262
|
--surface-header:rgb(255 255 255 / .8);
|
|
263
263
|
--surface-scrim:rgb(0 0 0 / .5);
|