@hanzo/design 0.3.2 → 0.3.3

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.
@@ -178,6 +178,20 @@ export declare const spacing: {
178
178
  readonly 'hero-y-lg': "8rem";
179
179
  readonly 'header-height': "4rem";
180
180
  };
181
+ /** grid tokens (from tokens/grid.css). Values are raw CSS. */
182
+ export declare const grid: {
183
+ readonly 'grid-columns': "12";
184
+ readonly 'grid-gap': "var(--space-6)";
185
+ readonly 'grid-gap-tight': "var(--space-4)";
186
+ readonly 'grid-gap-loose': "var(--space-8)";
187
+ readonly 'breakpoint-sm': "40rem";
188
+ readonly 'breakpoint-md': "48rem";
189
+ readonly 'breakpoint-lg': "64rem";
190
+ readonly 'breakpoint-xl': "80rem";
191
+ readonly 'breakpoint-2xl': "96rem";
192
+ readonly 'grid-card-min': "18rem";
193
+ readonly 'grid-card-min-wide': "24rem";
194
+ };
181
195
  /** radius tokens (from tokens/radius.css). Values are raw CSS. */
182
196
  export declare const radius: {
183
197
  readonly radius: "0.5rem";
@@ -418,6 +432,17 @@ export declare const cssVars: {
418
432
  readonly '--hero-y': "5rem";
419
433
  readonly '--hero-y-lg': "8rem";
420
434
  readonly '--header-height': "4rem";
435
+ readonly '--grid-columns': "12";
436
+ readonly '--grid-gap': "var(--space-6)";
437
+ readonly '--grid-gap-tight': "var(--space-4)";
438
+ readonly '--grid-gap-loose': "var(--space-8)";
439
+ readonly '--breakpoint-sm': "40rem";
440
+ readonly '--breakpoint-md': "48rem";
441
+ readonly '--breakpoint-lg': "64rem";
442
+ readonly '--breakpoint-xl': "80rem";
443
+ readonly '--breakpoint-2xl': "96rem";
444
+ readonly '--grid-card-min': "18rem";
445
+ readonly '--grid-card-min-wide': "24rem";
421
446
  readonly '--radius': "0.5rem";
422
447
  readonly '--radius-sm': "0.375rem";
423
448
  readonly '--radius-md': "0.5rem";
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.gen.d.ts","sourceRoot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': '4rem',
183
183
  };
184
+ /** grid tokens (from tokens/grid.css). Values are raw CSS. */
185
+ export const grid = {
186
+ 'grid-columns': '12',
187
+ 'grid-gap': 'var(--space-6)',
188
+ 'grid-gap-tight': 'var(--space-4)',
189
+ 'grid-gap-loose': 'var(--space-8)',
190
+ 'breakpoint-sm': '40rem',
191
+ 'breakpoint-md': '48rem',
192
+ 'breakpoint-lg': '64rem',
193
+ 'breakpoint-xl': '80rem',
194
+ 'breakpoint-2xl': '96rem',
195
+ 'grid-card-min': '18rem',
196
+ 'grid-card-min-wide': '24rem',
197
+ };
184
198
  /** radius tokens (from tokens/radius.css). Values are raw CSS. */
185
199
  export const radius = {
186
200
  'radius': '0.5rem',
@@ -421,6 +435,17 @@ export const cssVars = {
421
435
  '--hero-y': '5rem',
422
436
  '--hero-y-lg': '8rem',
423
437
  '--header-height': '4rem',
438
+ '--grid-columns': '12',
439
+ '--grid-gap': 'var(--space-6)',
440
+ '--grid-gap-tight': 'var(--space-4)',
441
+ '--grid-gap-loose': 'var(--space-8)',
442
+ '--breakpoint-sm': '40rem',
443
+ '--breakpoint-md': '48rem',
444
+ '--breakpoint-lg': '64rem',
445
+ '--breakpoint-xl': '80rem',
446
+ '--breakpoint-2xl': '96rem',
447
+ '--grid-card-min': '18rem',
448
+ '--grid-card-min-wide': '24rem',
424
449
  '--radius': '0.5rem',
425
450
  '--radius-sm': '0.375rem',
426
451
  '--radius-md': '0.5rem',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/design",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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
6
  "license": "BSD-3-Clause",
@@ -14,7 +14,7 @@ const tokensDir = join(root, 'tokens')
14
14
  // The token files, in the same order styles.css imports them. base.css is the
15
15
  // semantic-alias layer (references other vars) — parsed too, so `--background`
16
16
  // etc. are available programmatically.
17
- const FILES = ['colors', 'typography', 'spacing', 'radius', 'elevation', 'motion', 'z', 'fonts', 'base']
17
+ const FILES = ['colors', 'typography', 'spacing', 'grid', 'radius', 'elevation', 'motion', 'z', 'fonts', 'base']
18
18
 
19
19
  // group name for each file (the export const); a couple read better renamed.
20
20
  const GROUP = { z: 'zIndex' }
package/src/tokens.gen.ts CHANGED
@@ -185,6 +185,21 @@ export const spacing = {
185
185
  'header-height': '4rem',
186
186
  } as const
187
187
 
188
+ /** grid tokens (from tokens/grid.css). Values are raw CSS. */
189
+ export const grid = {
190
+ 'grid-columns': '12',
191
+ 'grid-gap': 'var(--space-6)',
192
+ 'grid-gap-tight': 'var(--space-4)',
193
+ 'grid-gap-loose': 'var(--space-8)',
194
+ 'breakpoint-sm': '40rem',
195
+ 'breakpoint-md': '48rem',
196
+ 'breakpoint-lg': '64rem',
197
+ 'breakpoint-xl': '80rem',
198
+ 'breakpoint-2xl': '96rem',
199
+ 'grid-card-min': '18rem',
200
+ 'grid-card-min-wide': '24rem',
201
+ } as const
202
+
188
203
  /** radius tokens (from tokens/radius.css). Values are raw CSS. */
189
204
  export const radius = {
190
205
  'radius': '0.5rem',
@@ -433,6 +448,17 @@ export const cssVars = {
433
448
  '--hero-y': '5rem',
434
449
  '--hero-y-lg': '8rem',
435
450
  '--header-height': '4rem',
451
+ '--grid-columns': '12',
452
+ '--grid-gap': 'var(--space-6)',
453
+ '--grid-gap-tight': 'var(--space-4)',
454
+ '--grid-gap-loose': 'var(--space-8)',
455
+ '--breakpoint-sm': '40rem',
456
+ '--breakpoint-md': '48rem',
457
+ '--breakpoint-lg': '64rem',
458
+ '--breakpoint-xl': '80rem',
459
+ '--breakpoint-2xl': '96rem',
460
+ '--grid-card-min': '18rem',
461
+ '--grid-card-min-wide': '24rem',
436
462
  '--radius': '0.5rem',
437
463
  '--radius-sm': '0.375rem',
438
464
  '--radius-md': '0.5rem',
package/styles.css CHANGED
@@ -7,6 +7,7 @@
7
7
  @import url("tokens/colors.css");
8
8
  @import url("tokens/typography.css");
9
9
  @import url("tokens/spacing.css");
10
+ @import url("tokens/grid.css");
10
11
  @import url("tokens/radius.css");
11
12
  @import url("tokens/elevation.css");
12
13
  @import url("tokens/motion.css");
@@ -0,0 +1,50 @@
1
+ /* Grid — one definition of the field every Hanzo surface lays out on.
2
+
3
+ Derived, not invented. Across hanzo.ai and hanzo.app the grid written by hand
4
+ is overwhelmingly ONE grid: `grid-cols-1 md:grid-cols-2 lg:grid-cols-3` with a
5
+ 1.5rem gutter (240 / 197 / 127 / 185 occurrences on hanzo.ai alone, and the
6
+ same shape leads on app). 1, 2, 3 and 4 columns account for 97% of every
7
+ grid-cols- in both repos, and all four divide 12 cleanly — so 12 is the base
8
+ the spans are cut from, and the long tail (5, 6, 7, 8, 12) still lands on it.
9
+
10
+ Containers, gutters and section rhythm are NOT restated here: spacing.css
11
+ already owns --container-max / --container-prose / --container-wide /
12
+ --gutter* / --section-y*, and a grid that redeclared them would be a second
13
+ answer to a settled question. This file adds only what a grid knows that
14
+ spacing does not — how many columns, how far apart, and where it reflows. */
15
+ :root{
16
+ /* The base. Spans are cut from twelve because 1/2/3/4/6 all divide it. */
17
+ --grid-columns:12;
18
+
19
+ /* Gutter. --grid-gap is the measured card-grid default (gap-6 leads hanzo.ai
20
+ at 185 uses); tight and loose are the neighbouring steps that cover app's
21
+ gap-4 (45) and the wide editorial grids (gap-8, 75). All three reference the
22
+ space ramp — the grid does not get its own private set of distances. */
23
+ --grid-gap:var(--space-6);
24
+ --grid-gap-tight:var(--space-4);
25
+ --grid-gap-loose:var(--space-8);
26
+
27
+ /* Reflow points, byte-identical to the Tailwind v4 defaults these surfaces
28
+ already compile against. Same NAMES and same VALUES on purpose: the utility
29
+ layer and anything reading tokens then resolve one value, not two that agree
30
+ by luck. md and lg carry ~85% of every breakpoint prefix in use; xl is 44
31
+ occurrences across both repos and 2xl is 1. */
32
+ --breakpoint-sm:40rem;
33
+ --breakpoint-md:48rem;
34
+ --breakpoint-lg:64rem;
35
+ --breakpoint-xl:80rem;
36
+ --breakpoint-2xl:96rem;
37
+
38
+ /* Intrinsic card grids: state ONE track minimum instead of three column counts
39
+ at three breakpoints. `repeat(auto-fit, minmax(var(--grid-card-min), 1fr))`
40
+ reflows 1 -> 2 -> 3 at the same widths the explicit recipe does, and it does
41
+ it from the space available rather than from the viewport — so a card grid
42
+ inside a sidebar behaves correctly, which the breakpoint version cannot.
43
+
44
+ 18rem is chosen, not rounded to: inside --container-max less --gutter-lg on
45
+ both sides, lg (64rem) leaves ~60rem, where 3 tracks need 3x18 + 2x1.5 =
46
+ 57rem and 4 would need 76.5rem; md (48rem) leaves ~44rem, where 2 tracks
47
+ need 37.5rem and 3 would need 57rem. The measured 1/2/3 ladder falls out. */
48
+ --grid-card-min:18rem;
49
+ --grid-card-min-wide:24rem;
50
+ }