@hezhijie0327/zjdesign 0.1.1 → 0.1.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.
package/AGENTS.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ZJ Design (`@hezhijie0327/zjdesign`) — the shared design system of the ZJ product family (ZJBlog / ZJKVM / ZJSearch / ZJStudio): warm paper, ink text, amber gold. It packages the family's design tokens (CSS), Tailwind class fragments, theme hooks and React components so the four apps consume one versioned source instead of repo-local copies. Design language reference: [DESIGN.md](DESIGN.md); human-facing docs: [README.md](README.md).
4
4
 
5
+ ## HANDOVER.md
6
+
7
+ When a multi-step task is interrupted, write progress to `HANDOVER.md` so the next session can pick up where you left off. Include: what was done, what remains, key decisions made, and the next concrete step. Delete the file when the task is complete.
8
+
5
9
  ## Behavioral Guidelines
6
10
 
7
11
  **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
@@ -10,35 +14,87 @@ ZJ Design (`@hezhijie0327/zjdesign`) — the shared design system of the ZJ prod
10
14
 
11
15
  **Don't assume. Don't hide confusion. Surface tradeoffs.**
12
16
 
13
- - State assumptions explicitly; ask when uncertain.
17
+ Before implementing:
18
+
19
+ - State your assumptions explicitly. If uncertain, ask.
14
20
  - If multiple interpretations exist, present them — don't pick silently.
15
21
  - If a simpler approach exists, say so. Push back when warranted.
22
+ - If something is unclear, stop. Name what's confusing. Ask.
16
23
 
17
24
  ### 2. Simplicity First
18
25
 
19
26
  **Minimum code that solves the problem. Nothing speculative.**
20
27
 
21
- - No features beyond what was asked; no abstractions for single-use code.
28
+ - No features beyond what was asked.
29
+ - No abstractions for single-use code.
22
30
  - No "flexibility" or "configurability" that wasn't requested.
31
+ - No error handling for impossible scenarios.
32
+ - If you write 200 lines and it could be 50, rewrite it.
33
+
34
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
23
35
 
24
36
  ### 3. Surgical Changes
25
37
 
26
38
  **Touch only what you must. Clean up only your own mess.**
27
39
 
28
- - Match existing style; don't refactor what isn't broken.
29
- - Remove only what your own change orphaned.
40
+ When editing existing code:
41
+
42
+ - Don't "improve" adjacent code, comments, or formatting.
43
+ - Don't refactor things that aren't broken.
44
+ - Match existing style, even if you'd do it differently.
45
+ - If you notice unrelated dead code, mention it — don't delete it.
46
+
47
+ When your changes create orphans:
48
+
49
+ - Remove imports/variables/functions that YOUR changes made unused.
50
+ - Don't remove pre-existing dead code unless asked.
51
+
52
+ The test: Every changed line should trace directly to the user's request.
30
53
 
31
54
  ### 4. Goal-Driven Execution
32
55
 
33
56
  **Define success criteria. Loop until verified.**
34
57
 
35
- For every change: `pnpm lint && pnpm check && pnpm test && pnpm build` must pass, and visual changes must be verified in the playground (`pnpm dev`) against all three palette tiers (light / dark / black).
58
+ Transform tasks into verifiable goals:
59
+
60
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
61
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
62
+ - "Refactor X" → "Ensure tests pass before and after"
63
+
64
+ For multi-step tasks, state a brief plan:
65
+
66
+ ```
67
+ 1. [Step] → verify: [check]
68
+ 2. [Step] → verify: [check]
69
+ 3. [Step] → verify: [check]
70
+ ```
71
+
72
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
73
+
74
+ **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
75
+
76
+ **Additional rules:**
77
+
78
+ - Be concise in output but thorough in reasoning.
79
+ - Do not re-read files you have already read.
80
+ - User instructions always override this file.
81
+ - Don't wrestle with indentation in the Edit tool — focus on logic, let the project's formatter fix formatting. Use `sed` or `python3` freely when the Edit tool struggles with whitespace.
36
82
 
37
83
  ## Git commit convention
38
84
 
39
- Every commit subject starts with a type prefix — `feat` / `fix` / `chore` / `docs` / `revert` / `refactor` / `perf` / `test` / `build` — optionally scoped: `fix(modal): ...`. Subject: imperative, lowercase start, no trailing period, aim ≤ 72 chars; detail goes in the body after a blank line (why, not what). Never rewrite pushed history.
85
+ Every commit subject starts with a type prefix — `feat` / `fix` / `chore` / `docs` / `revert` / `refactor` / `perf` / `test` / `build` — optionally scoped: `fix(toolbar): ...`. Subject: imperative, lowercase start, no trailing period, aim ≤ 72 chars; detail goes in the body after a blank line (why, not what); breaking changes take `!` before the colon or a `BREAKING CHANGE:` body footer. Never rewrite pushed history.
40
86
 
41
- Commit incrementally — one logical change per commit, after lint and tests pass. Only ONE co-author line is allowed:
87
+ - Commit incrementally — one logical change per commit, after lint and tests pass. Present changes for review before committing.
88
+ - PRs: link the issue, summarize the change and verification (tests/benchmarks), and include config/log/pprof evidence for bug fixes.
89
+
90
+ ### Co-Author Format
91
+
92
+ - Always add co-author information. If closing an issue in commit text, verify against `main` first: `gh issue view <issue-id>`.
93
+ - Only ONE co-author line is allowed. If multiple agents contributed, aggregate into ONE entry.
94
+
95
+ Format: `Co-authored-by: <AgentName> <Email>`
96
+
97
+ Valid examples (choose EXACTLY ONE):
42
98
 
43
99
  ```
44
100
  Co-authored-by: ZCode <noreply@z.ai>
@@ -46,8 +102,14 @@ Co-authored-by: ZCode <noreply@z.ai>
46
102
 
47
103
  ## Documentation format
48
104
 
49
- - **Language**: AGENTS.md, DESIGN.md are English; README.md is Chinese (human-facing). Keep literal UI strings and code identifiers verbatim.
50
- - **Formatting**: ATX headings (`#`), never skip a level; code fences always carry a language tag; tables for structured reference; no decorative emoji in headings or bullets; bold for key terms only.
105
+ Family-wide Markdown rules, shared verbatim across all ZJ projects:
106
+
107
+ - **Language**: AGENTS.md, AUDIT.md, DESIGN.md and other agent-facing docs are English; README.md is Chinese (human-facing). Keep literal UI strings and code identifiers verbatim.
108
+ - **AGENTS.md skeleton** — generic sections first, then project; omit sections that don't apply, keep the order:
109
+ `# AGENTS.md` → 1–2 sentence intro (what the project is + key doc links) → Behavioral Guidelines → Git commit convention → Documentation format → Project → Commands → Architecture → Conventions (Gotchas as a subsection) → project-specific sections → Key Docs.
110
+ - **README.md skeleton**: `# <project>` → badge block → one-line positioning + stack + key links → 特性 → 快速开始 → 配置 / 用法 → 文档 → License (omit as needed).
111
+ - **README badges** (shields.io, after the title, in order): Version (only where a real version exists, linked to the repo's GitHub releases), License (Apache 2.0 with Commons Clause — every project), primary-language badge (Go / TypeScript / Bash / Python / Docker), Biome for TypeScript projects; pure data/config repos get License only. Version links use the real GitHub repo name.
112
+ - **Formatting**: ATX headings (`#`), never skip a level; code fences always carry a language tag (`bash`, `go`, `json`, `text` for trees); tables for structured reference; no decorative emoji in headings or bullets; bold for key terms only.
51
113
 
52
114
  ## Project
53
115
 
@@ -88,7 +150,7 @@ pnpm test # vitest run (jsdom)
88
150
  pnpm dev # vite playground (visual verification, :5199 in docs)
89
151
  ```
90
152
 
91
- Release: bump version in `package.json`, `pnpm build && pnpm test && pnpm lint && pnpm check`, `npm publish` (publishConfig pins the official registry). npm package names are lowercase — the scope is `@hezhijie0327`, package `zjdesign`.
153
+ Release (OIDC trusted publishing — no NPM_TOKEN secret): `./bump_version.sh [major|minor|patch|X.Y.Z]` (PowerShell twin: `bump_version.ps1`), then commit, tag `v<version>`, push — `.github/workflows/release.yml` gates on lint + typecheck + tests + build and publishes via the GitHub Actions OIDC token (requires the one-time "Trusted Publisher" binding on npmjs.com: repo `hezhijie0327/ZJDesign` + workflow `release.yml`; npm CLI ≥ 11.5.1, provided by Node 24). Provenance is automatic; the tag must match package.json. npm package names are lowercase — the scope is `@hezhijie0327`, package `zjdesign`.
92
154
 
93
155
  ## Conventions
94
156
 
@@ -1,4 +1,4 @@
1
- import { n as BRAND_DOT, z as cn } from "../styles-CZ-LL-aM.mjs";
1
+ import { V as cn, n as BRAND_DOT } from "../styles-DhIa1Tm9.mjs";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/brand/Wordmark.tsx
@@ -9,7 +9,7 @@ function Wordmark({ children, className, dotClassName }) {
9
9
  className: cn("font-serif text-2xl font-semibold tracking-tight", className),
10
10
  children: [children, /* @__PURE__ */ jsx("span", {
11
11
  "aria-hidden": "true",
12
- className: cn(BRAND_DOT, "ms-0.5", dotClassName)
12
+ className: cn(BRAND_DOT, dotClassName)
13
13
  })]
14
14
  });
15
15
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as SEGMENT_ITEM_OFF, O as SEGMENT, _ as META, a as BTN_PRIMARY, b as MONO_CHIP, h as LIST_ROW, i as BTN_OUTLINE, j as SEGMENT_ITEM_ON, o as CARD, p as ICON_BTN, r as BTN_GHOST, y as MODAL_SCRIM, z as cn } from "./styles-CZ-LL-aM.mjs";
1
+ import { A as SEGMENT, M as SEGMENT_ITEM_OFF, N as SEGMENT_ITEM_ON, V as cn, _ as META, a as BTN_PRIMARY, b as MODAL_SCRIM, h as LIST_ROW, i as BTN_OUTLINE, o as CARD, p as ICON_BTN, r as BTN_GHOST, x as MONO_CHIP } from "./styles-DhIa1Tm9.mjs";
2
2
  import { a as THEME_COLOR_DARK, c as cookieThemeStorage, d as readThemeStyle, f as setThemeStyle, h as reducedMotion, i as THEME_COLOR_BLACK, l as createThemeController, m as watchThemeDark, n as useExitPresence, o as THEME_COLOR_LIGHT, p as watchSystemTheme, r as THEME_BOOTSTRAP, s as applyThemeStyle, t as useTheme, u as localStorageThemeStorage } from "./hooks-_Gk75q-U.mjs";
3
3
  import { forwardRef, useEffect, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { I as TAPE, z as cn } from "../styles-CZ-LL-aM.mjs";
1
+ import { R as TAPE, V as cn } from "../styles-DhIa1Tm9.mjs";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/paper/Tape.tsx
@@ -29,11 +29,11 @@ declare const DIVIDE_LIST = "divide-y divide-line/70";
29
29
  /** Compact list row (callers compose CARD + DIVIDE_LIST for a card shell) */
30
30
  declare const LIST_ROW = "group flex items-center justify-between gap-4 px-5 py-4 transition-colors hover:bg-surface-2 sm:gap-6 sm:px-6";
31
31
  /** Primary action button (gold pill) */
32
- declare const BTN_PRIMARY = "inline-flex h-10 items-center gap-2 rounded-full bg-accent-strong px-5 text-sm font-semibold text-accent-contrast shadow-card transition-all hover:bg-accent-strong-hover hover:shadow-pop";
32
+ declare const BTN_PRIMARY = "inline-flex h-10 items-center gap-2 rounded-full bg-accent-strong px-5 text-sm font-semibold text-accent-contrast shadow-card transition-all hover:bg-accent-strong-hover hover:shadow-pop disabled:pointer-events-none disabled:opacity-50";
33
33
  /** Secondary action button (outlined pill) */
34
- declare const BTN_OUTLINE = "inline-flex h-10 items-center gap-2 rounded-full border border-line bg-surface px-5 text-sm font-medium text-ink transition-colors hover:bg-surface-2";
34
+ declare const BTN_OUTLINE = "inline-flex h-10 items-center gap-2 rounded-full border border-line bg-surface px-5 text-sm font-medium text-ink transition-colors hover:bg-surface-2 disabled:pointer-events-none disabled:opacity-50";
35
35
  /** Tertiary action button (ghost pill: text only, hover lights the surface) */
36
- declare const BTN_GHOST = "inline-flex h-10 items-center gap-2 rounded-full px-5 text-sm font-medium text-ink-2 transition-colors hover:bg-surface-2 hover:text-ink";
36
+ declare const BTN_GHOST = "inline-flex h-10 items-center gap-2 rounded-full px-5 text-sm font-medium text-ink-2 transition-colors hover:bg-surface-2 hover:text-ink disabled:pointer-events-none disabled:opacity-50";
37
37
  /** Torn-edge paper strip button (pairs with the global .paper-strip background):
38
38
  * the paper color is injected via [--strip:…], slightly tilted, lifted straight
39
39
  * on hover. */
@@ -61,8 +61,8 @@ declare const META = "font-mono text-xs text-ink-3";
61
61
  * floor: eyebrows are decorative but also carry section names. */
62
62
  declare const EYEBROW = "font-mono text-xs uppercase tracking-[0.2em] text-ink-3";
63
63
  /** Brand wordmark dot: the gold full stop after the serif wordmark (em-relative,
64
- * scales with the wordmark font size) */
65
- declare const BRAND_DOT = "inline-block size-[0.25em] rounded-full bg-accent-strong";
64
+ * scales with the wordmark font size; the 0.14em lead is part of the signature) */
65
+ declare const BRAND_DOT = "ms-[0.14em] inline-block size-[0.25em] rounded-full bg-accent-strong";
66
66
  /** Input base: rounded field on the surface ground with an accent focus ring */
67
67
  declare const INPUT = "rounded-lg border border-line bg-surface px-3 text-sm transition-colors focus:ring-accent/30";
68
68
  /** Floating panel (canvas chrome / overlay panels): tighter radius + pop shadow */
@@ -114,5 +114,11 @@ declare const SHEET = "fixed inset-x-0 bottom-0 z-90 rounded-t-2xl border-t bord
114
114
  /** Ghost watermark: hollow outlined large mono text (family GHOST_DATE
115
115
  * language, content-agnostic) — decorative, keep aria-hidden on consumers */
116
116
  declare const GHOST_TEXT = "hollow-text pointer-events-none absolute select-none whitespace-nowrap font-mono font-bold leading-none";
117
+ /** Timeline fold toggle row (ZJSearch/ZJStudio family: think/step headers) */
118
+ declare const META_TOGGLE = "inline-flex min-h-6 items-center gap-1 transition-colors hover:text-ink";
119
+ /** The machine-voice pane (AI reading panes, args debug panes): the boxed
120
+ * ground that says "produced by the pipeline, not the answer" — ZJSearch
121
+ * family fragment, same name same value. */
122
+ declare const READ_PANE = "rounded-lg bg-surface-2/50 py-2 ps-3 pe-10 text-xs leading-relaxed whitespace-pre-wrap break-words text-ink-2";
117
123
  //#endregion
118
- export { ALERT_DANGER, BRAND_DOT, BTN_GHOST, BTN_OUTLINE, BTN_PRIMARY, CARD, CARD_HOVER, CHIP, DIVIDE_LIST, EYEBROW, GHOST_DATE, GHOST_TEXT, ICON_BTN, INPUT, LIST_ROW, MEDIA_FAILED, META, MODAL_PANEL, MODAL_SCRIM, MONO_CHIP, PANEL, PANEL_COL, PANEL_ROW, PANEL_STATE_CHIP, PAPER_STRIP, SECTION, SECTION_DETAIL, SEGMENT, SEGMENT_ITEM, SEGMENT_ITEM_OFF, SEGMENT_ITEM_ON, SHEET, STATUS_CHIP, STRIP_PAPER, STRIP_PRIMARY, TAPE, TOOLBAR, TOOLBAR_DIVIDER, cn };
124
+ export { ALERT_DANGER, BRAND_DOT, BTN_GHOST, BTN_OUTLINE, BTN_PRIMARY, CARD, CARD_HOVER, CHIP, DIVIDE_LIST, EYEBROW, GHOST_DATE, GHOST_TEXT, ICON_BTN, INPUT, LIST_ROW, MEDIA_FAILED, META, META_TOGGLE, MODAL_PANEL, MODAL_SCRIM, MONO_CHIP, PANEL, PANEL_COL, PANEL_ROW, PANEL_STATE_CHIP, PAPER_STRIP, READ_PANE, SECTION, SECTION_DETAIL, SEGMENT, SEGMENT_ITEM, SEGMENT_ITEM_OFF, SEGMENT_ITEM_ON, SHEET, STATUS_CHIP, STRIP_PAPER, STRIP_PRIMARY, TAPE, TOOLBAR, TOOLBAR_DIVIDER, cn };
@@ -1,3 +1,3 @@
1
- import { A as SEGMENT_ITEM_OFF, C as PANEL_ROW, D as SECTION_DETAIL, E as SECTION, F as STRIP_PRIMARY, I as TAPE, L as TOOLBAR, M as SHEET, N as STATUS_CHIP, O as SEGMENT, P as STRIP_PAPER, R as TOOLBAR_DIVIDER, S as PANEL_COL, T as PAPER_STRIP, _ as META, a as BTN_PRIMARY, b as MONO_CHIP, c as CHIP, d as GHOST_DATE, f as GHOST_TEXT, g as MEDIA_FAILED, h as LIST_ROW, i as BTN_OUTLINE, j as SEGMENT_ITEM_ON, k as SEGMENT_ITEM, l as DIVIDE_LIST, m as INPUT, n as BRAND_DOT, o as CARD, p as ICON_BTN, r as BTN_GHOST, s as CARD_HOVER, t as ALERT_DANGER, u as EYEBROW, v as MODAL_PANEL, w as PANEL_STATE_CHIP, x as PANEL, y as MODAL_SCRIM, z as cn } from "../styles-CZ-LL-aM.mjs";
1
+ import { A as SEGMENT, B as TOOLBAR_DIVIDER, C as PANEL_COL, D as READ_PANE, E as PAPER_STRIP, F as STATUS_CHIP, I as STRIP_PAPER, L as STRIP_PRIMARY, M as SEGMENT_ITEM_OFF, N as SEGMENT_ITEM_ON, O as SECTION, P as SHEET, R as TAPE, S as PANEL, T as PANEL_STATE_CHIP, V as cn, _ as META, a as BTN_PRIMARY, b as MODAL_SCRIM, c as CHIP, d as GHOST_DATE, f as GHOST_TEXT, g as MEDIA_FAILED, h as LIST_ROW, i as BTN_OUTLINE, j as SEGMENT_ITEM, k as SECTION_DETAIL, l as DIVIDE_LIST, m as INPUT, n as BRAND_DOT, o as CARD, p as ICON_BTN, r as BTN_GHOST, s as CARD_HOVER, t as ALERT_DANGER, u as EYEBROW, v as META_TOGGLE, w as PANEL_ROW, x as MONO_CHIP, y as MODAL_PANEL, z as TOOLBAR } from "../styles-DhIa1Tm9.mjs";
2
2
 
3
- export { ALERT_DANGER, BRAND_DOT, BTN_GHOST, BTN_OUTLINE, BTN_PRIMARY, CARD, CARD_HOVER, CHIP, DIVIDE_LIST, EYEBROW, GHOST_DATE, GHOST_TEXT, ICON_BTN, INPUT, LIST_ROW, MEDIA_FAILED, META, MODAL_PANEL, MODAL_SCRIM, MONO_CHIP, PANEL, PANEL_COL, PANEL_ROW, PANEL_STATE_CHIP, PAPER_STRIP, SECTION, SECTION_DETAIL, SEGMENT, SEGMENT_ITEM, SEGMENT_ITEM_OFF, SEGMENT_ITEM_ON, SHEET, STATUS_CHIP, STRIP_PAPER, STRIP_PRIMARY, TAPE, TOOLBAR, TOOLBAR_DIVIDER, cn };
3
+ export { ALERT_DANGER, BRAND_DOT, BTN_GHOST, BTN_OUTLINE, BTN_PRIMARY, CARD, CARD_HOVER, CHIP, DIVIDE_LIST, EYEBROW, GHOST_DATE, GHOST_TEXT, ICON_BTN, INPUT, LIST_ROW, MEDIA_FAILED, META, META_TOGGLE, MODAL_PANEL, MODAL_SCRIM, MONO_CHIP, PANEL, PANEL_COL, PANEL_ROW, PANEL_STATE_CHIP, PAPER_STRIP, READ_PANE, SECTION, SECTION_DETAIL, SEGMENT, SEGMENT_ITEM, SEGMENT_ITEM_OFF, SEGMENT_ITEM_ON, SHEET, STATUS_CHIP, STRIP_PAPER, STRIP_PRIMARY, TAPE, TOOLBAR, TOOLBAR_DIVIDER, cn };
@@ -33,11 +33,11 @@ const DIVIDE_LIST = "divide-y divide-line/70";
33
33
  /** Compact list row (callers compose CARD + DIVIDE_LIST for a card shell) */
34
34
  const LIST_ROW = "group flex items-center justify-between gap-4 px-5 py-4 transition-colors hover:bg-surface-2 sm:gap-6 sm:px-6";
35
35
  /** Primary action button (gold pill) */
36
- const BTN_PRIMARY = "inline-flex h-10 items-center gap-2 rounded-full bg-accent-strong px-5 text-sm font-semibold text-accent-contrast shadow-card transition-all hover:bg-accent-strong-hover hover:shadow-pop";
36
+ const BTN_PRIMARY = "inline-flex h-10 items-center gap-2 rounded-full bg-accent-strong px-5 text-sm font-semibold text-accent-contrast shadow-card transition-all hover:bg-accent-strong-hover hover:shadow-pop disabled:pointer-events-none disabled:opacity-50";
37
37
  /** Secondary action button (outlined pill) */
38
- const BTN_OUTLINE = "inline-flex h-10 items-center gap-2 rounded-full border border-line bg-surface px-5 text-sm font-medium text-ink transition-colors hover:bg-surface-2";
38
+ const BTN_OUTLINE = "inline-flex h-10 items-center gap-2 rounded-full border border-line bg-surface px-5 text-sm font-medium text-ink transition-colors hover:bg-surface-2 disabled:pointer-events-none disabled:opacity-50";
39
39
  /** Tertiary action button (ghost pill: text only, hover lights the surface) */
40
- const BTN_GHOST = "inline-flex h-10 items-center gap-2 rounded-full px-5 text-sm font-medium text-ink-2 transition-colors hover:bg-surface-2 hover:text-ink";
40
+ const BTN_GHOST = "inline-flex h-10 items-center gap-2 rounded-full px-5 text-sm font-medium text-ink-2 transition-colors hover:bg-surface-2 hover:text-ink disabled:pointer-events-none disabled:opacity-50";
41
41
  /** Torn-edge paper strip button (pairs with the global .paper-strip background):
42
42
  * the paper color is injected via [--strip:…], slightly tilted, lifted straight
43
43
  * on hover. */
@@ -65,8 +65,8 @@ const META = "font-mono text-xs text-ink-3";
65
65
  * floor: eyebrows are decorative but also carry section names. */
66
66
  const EYEBROW = "font-mono text-xs uppercase tracking-[0.2em] text-ink-3";
67
67
  /** Brand wordmark dot: the gold full stop after the serif wordmark (em-relative,
68
- * scales with the wordmark font size) */
69
- const BRAND_DOT = "inline-block size-[0.25em] rounded-full bg-accent-strong";
68
+ * scales with the wordmark font size; the 0.14em lead is part of the signature) */
69
+ const BRAND_DOT = "ms-[0.14em] inline-block size-[0.25em] rounded-full bg-accent-strong";
70
70
  /** Input base: rounded field on the surface ground with an accent focus ring */
71
71
  const INPUT = "rounded-lg border border-line bg-surface px-3 text-sm transition-colors focus:ring-accent/30";
72
72
  /** Floating panel (canvas chrome / overlay panels): tighter radius + pop shadow */
@@ -118,6 +118,12 @@ const SHEET = "fixed inset-x-0 bottom-0 z-90 rounded-t-2xl border-t border-line
118
118
  /** Ghost watermark: hollow outlined large mono text (family GHOST_DATE
119
119
  * language, content-agnostic) — decorative, keep aria-hidden on consumers */
120
120
  const GHOST_TEXT = "hollow-text pointer-events-none absolute select-none whitespace-nowrap font-mono font-bold leading-none";
121
+ /** Timeline fold toggle row (ZJSearch/ZJStudio family: think/step headers) */
122
+ const META_TOGGLE = "inline-flex min-h-6 items-center gap-1 transition-colors hover:text-ink";
123
+ /** The machine-voice pane (AI reading panes, args debug panes): the boxed
124
+ * ground that says "produced by the pipeline, not the answer" — ZJSearch
125
+ * family fragment, same name same value. */
126
+ const READ_PANE = "rounded-lg bg-surface-2/50 py-2 ps-3 pe-10 text-xs leading-relaxed whitespace-pre-wrap break-words text-ink-2";
121
127
 
122
128
  //#endregion
123
- export { SEGMENT_ITEM_OFF as A, PANEL_ROW as C, SECTION_DETAIL as D, SECTION as E, STRIP_PRIMARY as F, TAPE as I, TOOLBAR as L, SHEET as M, STATUS_CHIP as N, SEGMENT as O, STRIP_PAPER as P, TOOLBAR_DIVIDER as R, PANEL_COL as S, PAPER_STRIP as T, META as _, BTN_PRIMARY as a, MONO_CHIP as b, CHIP as c, GHOST_DATE as d, GHOST_TEXT as f, MEDIA_FAILED as g, LIST_ROW as h, BTN_OUTLINE as i, SEGMENT_ITEM_ON as j, SEGMENT_ITEM as k, DIVIDE_LIST as l, INPUT as m, BRAND_DOT as n, CARD as o, ICON_BTN as p, BTN_GHOST as r, CARD_HOVER as s, ALERT_DANGER as t, EYEBROW as u, MODAL_PANEL as v, PANEL_STATE_CHIP as w, PANEL as x, MODAL_SCRIM as y, cn as z };
129
+ export { SEGMENT as A, TOOLBAR_DIVIDER as B, PANEL_COL as C, READ_PANE as D, PAPER_STRIP as E, STATUS_CHIP as F, STRIP_PAPER as I, STRIP_PRIMARY as L, SEGMENT_ITEM_OFF as M, SEGMENT_ITEM_ON as N, SECTION as O, SHEET as P, TAPE as R, PANEL as S, PANEL_STATE_CHIP as T, cn as V, META as _, BTN_PRIMARY as a, MODAL_SCRIM as b, CHIP as c, GHOST_DATE as d, GHOST_TEXT as f, MEDIA_FAILED as g, LIST_ROW as h, BTN_OUTLINE as i, SEGMENT_ITEM as j, SECTION_DETAIL as k, DIVIDE_LIST as l, INPUT as m, BRAND_DOT as n, CARD as o, ICON_BTN as p, BTN_GHOST as r, CARD_HOVER as s, ALERT_DANGER as t, EYEBROW as u, META_TOGGLE as v, PANEL_ROW as w, MONO_CHIP as x, MODAL_PANEL as y, TOOLBAR as z };
@@ -1,72 +1,77 @@
1
1
  /* The family paper language (DESIGN.md §7): torn-edge note paper, strip
2
- buttons, marker highlights, hollow watermarks, postmarks, chapter rules
3
- and film-sprocket numerals. Pure CSS — a jagged clip-path polygon on a
2
+ buttons, marker highlights, hollow watermarks, chapter rules and
3
+ film-sprocket numerals. Pure CSS — a jagged clip-path polygon on a
4
4
  background layer, drop-shadow instead of box-shadow (clip-path cuts the
5
5
  box). Decorations follow the §7 physics: whitespace only, aria-hidden +
6
6
  pointer-events-none, deterministic micro-tilts (never random — SSR and
7
- hydration must agree; the Tape component carries the seed algorithm). */
7
+ hydration must agree; the Tape component carries the seed algorithm).
8
8
 
9
- @layer components {
10
- /* Torn-edge note paper: ruled-line texture over --surface. The clip-path
11
- is on the element itself, so tape and other overlap decorations must be
12
- SIBLING nodes positioned over it, never children (they would be cut). */
13
- .paper-note {
14
- background:
15
- repeating-linear-gradient(transparent 0 30px, color-mix(in oklab, var(--line) 60%, transparent) 30px 31px),
16
- var(--surface);
17
- clip-path: polygon(
18
- 1% 2%,
19
- 7% 0.5%,
20
- 16% 1.8%,
21
- 29% 0%,
22
- 42% 1.8%,
23
- 56% 0.4%,
24
- 69% 1.8%,
25
- 83% 0%,
26
- 94% 1.6%,
27
- 99.2% 3%,
28
- 100% 13%,
29
- 99.4% 28%,
30
- 100% 44%,
31
- 99% 61%,
32
- 100% 77%,
33
- 99.3% 91%,
34
- 97.2% 100%,
35
- 86% 99%,
36
- 71% 100%,
37
- 56% 98.6%,
38
- 41% 100%,
39
- 27% 99.2%,
40
- 13% 100%,
41
- 3.2% 98.6%,
42
- 0% 91%,
43
- 1.4% 75%,
44
- 0% 59%,
45
- 1.8% 43%,
46
- 0.4% 27%,
47
- 1% 13%
48
- );
49
- filter: drop-shadow(0 10px 18px color-mix(in oklab, var(--ink) 14%, transparent));
50
- }
9
+ Written as Tailwind v4 @utility declarations (imported CSS is processed by
10
+ the consumer's Tailwind pipeline), so variants like hover:paper-strip work
11
+ and app-level @utility overrides of the same name win cleanly. */
12
+
13
+ /* Torn-edge note paper: ruled-line texture over --surface. The clip-path
14
+ is on the element itself, so tape and other overlap decorations must be
15
+ SIBLING nodes positioned over it, never children (they would be cut). */
16
+ @utility paper-note {
17
+ background:
18
+ repeating-linear-gradient(transparent 0 30px, color-mix(in oklab, var(--line) 60%, transparent) 30px 31px),
19
+ var(--surface);
20
+ clip-path: polygon(
21
+ 1% 2%,
22
+ 7% 0.5%,
23
+ 16% 1.8%,
24
+ 29% 0%,
25
+ 42% 1.8%,
26
+ 56% 0.4%,
27
+ 69% 1.8%,
28
+ 83% 0%,
29
+ 94% 1.6%,
30
+ 99.2% 3%,
31
+ 100% 13%,
32
+ 99.4% 28%,
33
+ 100% 44%,
34
+ 99% 61%,
35
+ 100% 77%,
36
+ 99.3% 91%,
37
+ 97.2% 100%,
38
+ 86% 99%,
39
+ 71% 100%,
40
+ 56% 98.6%,
41
+ 41% 100%,
42
+ 27% 99.2%,
43
+ 13% 100%,
44
+ 3.2% 98.6%,
45
+ 0% 91%,
46
+ 1.4% 75%,
47
+ 0% 59%,
48
+ 1.8% 43%,
49
+ 0.4% 27%,
50
+ 1% 13%
51
+ );
52
+ filter: drop-shadow(0 10px 18px color-mix(in oklab, var(--ink) 14%, transparent));
53
+ }
51
54
 
52
- /* Blank variant of the note ground: the same torn edge and drop-shadow,
53
- NO ruled lines. The ruled ground only works for STATIC lists — an
54
- interactive note whose middle scrolls would drift text across fixed
55
- lines, so it pins on the blank slip instead. */
55
+ /* Blank variant of the note ground: the same torn edge and drop-shadow,
56
+ NO ruled lines. The ruled ground only works for STATIC lists — an
57
+ interactive note whose middle scrolls would drift text across fixed
58
+ lines, so it pins on the blank slip instead. (Plain class: the `--`
59
+ suffix is not valid @utility syntax.) */
60
+ @layer components {
56
61
  .paper-note--blank {
57
62
  background: var(--surface);
58
63
  }
64
+ }
59
65
 
60
- /* Torn-edge strip button: the paper is a ::before layer so the element's
61
- own focus ring stays intact; the shadow rides a filter to follow the
62
- torn outline. Paper colour comes in via --strip (fallback --surface). */
63
- .paper-strip {
64
- position: relative;
65
- isolation: isolate;
66
- filter: drop-shadow(1px 2px 0 color-mix(in oklab, var(--ink) 10%, transparent));
67
- }
66
+ /* Torn-edge strip button: the paper is a ::before layer so the element's
67
+ own focus ring stays intact; the shadow rides a filter to follow the
68
+ torn outline. Paper colour comes in via --strip (fallback --surface). */
69
+ @utility paper-strip {
70
+ position: relative;
71
+ isolation: isolate;
72
+ filter: drop-shadow(1px 2px 0 color-mix(in oklab, var(--ink) 10%, transparent));
68
73
 
69
- .paper-strip::before {
74
+ &::before {
70
75
  content: "";
71
76
  position: absolute;
72
77
  inset: 0;
@@ -100,57 +105,57 @@
100
105
  );
101
106
  }
102
107
 
103
- .paper-strip:hover {
108
+ &:hover {
104
109
  filter: drop-shadow(2px 4px 0 color-mix(in oklab, var(--ink) 14%, transparent));
105
110
  }
111
+ }
106
112
 
107
- /* Marker-pen highlight behind a headline keyword: a torn gold strip sweeping
108
- the lower half of the text. In the physical world a hand-pressed tape
109
- never sits parallel to the baseline, hence the -0.5° tilt. Position it
110
- as the first child of a `relative inline-block` span; the text itself
111
- goes in a following `relative` span. */
112
- .marker-strip {
113
- clip-path: polygon(
114
- 0 14%,
115
- 6% 4%,
116
- 15% 10%,
117
- 28% 2%,
118
- 42% 11%,
119
- 57% 5%,
120
- 72% 11%,
121
- 88% 3%,
122
- 100% 9%,
123
- 97% 36%,
124
- 100% 61%,
125
- 98% 83%,
126
- 93% 100%,
127
- 79% 92%,
128
- 63% 100%,
129
- 46% 93%,
130
- 30% 100%,
131
- 14% 93%,
132
- 2% 100%,
133
- 0 70%,
134
- 3% 40%
135
- );
136
- transform: rotate(-0.5deg);
137
- }
113
+ /* Marker-pen highlight behind a headline keyword: a torn gold strip sweeping
114
+ the lower half of the text. In the physical world a hand-pressed tape
115
+ never sits parallel to the baseline, hence the -0.5° tilt. Position it
116
+ as the first child of a `relative inline-block` span; the text itself
117
+ goes in a following `relative` span. */
118
+ @utility marker-strip {
119
+ clip-path: polygon(
120
+ 0 14%,
121
+ 6% 4%,
122
+ 15% 10%,
123
+ 28% 2%,
124
+ 42% 11%,
125
+ 57% 5%,
126
+ 72% 11%,
127
+ 88% 3%,
128
+ 100% 9%,
129
+ 97% 36%,
130
+ 100% 61%,
131
+ 98% 83%,
132
+ 93% 100%,
133
+ 79% 92%,
134
+ 63% 100%,
135
+ 46% 93%,
136
+ 30% 100%,
137
+ 14% 93%,
138
+ 2% 100%,
139
+ 0 70%,
140
+ 3% 40%
141
+ );
142
+ transform: rotate(-0.5deg);
143
+ }
138
144
 
139
- /* Hollow stroked watermark text: transparent fill, stroke only; the stroke
140
- color defaults to soft gold and can be overridden via --hollow-stroke.
141
- Pure decoration — consumers must aria-hidden it. */
142
- .hollow-text {
143
- color: transparent;
144
- -webkit-text-stroke: 1px var(--hollow-stroke, var(--accent-soft));
145
- }
145
+ /* Hollow stroked watermark text: transparent fill, stroke only; the stroke
146
+ color defaults to soft gold and can be overridden via --hollow-stroke.
147
+ Pure decoration — consumers must aria-hidden it. */
148
+ @utility hollow-text {
149
+ color: transparent;
150
+ -webkit-text-stroke: 1px var(--hollow-stroke, var(--accent-soft));
151
+ }
146
152
 
147
- /* Hand-drawn section dividers: a hairline slightly rotated between sibling
148
- sections, mimicking the journal divider between paper pages. */
149
- .paper-chapter {
150
- position: relative;
151
- }
153
+ /* Hand-drawn section dividers: a hairline slightly rotated between sibling
154
+ sections, mimicking the journal divider between paper pages. */
155
+ @utility paper-chapter {
156
+ position: relative;
152
157
 
153
- .paper-chapter + .paper-chapter::before {
158
+ & + &::before {
154
159
  content: "";
155
160
  position: absolute;
156
161
  inset-inline: 1rem;
@@ -160,29 +165,31 @@
160
165
  transform: rotate(-0.4deg);
161
166
  opacity: 0.7;
162
167
  }
168
+ }
163
169
 
164
- /* Film sprocket number (storyboard numerals): film edges left/right +
165
- perforation rows top/bottom; the color follows currentColor, and
166
- consumers toggle the active state with text color classes. */
167
- .film-number {
168
- display: inline-grid;
169
- place-items: center;
170
- min-width: 1.65rem;
171
- height: 1.7rem;
172
- padding-inline: 0.2rem;
173
- border-inline: 1px solid currentColor;
174
- background:
175
- repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 6px) left top / 100% 2px repeat-x,
176
- repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 6px) left bottom / 100% 2px repeat-x;
177
- }
170
+ /* Film sprocket number (storyboard numerals): film edges left/right +
171
+ perforation rows top/bottom; the color follows currentColor, and
172
+ consumers toggle the active state with text color classes. */
173
+ @utility film-number {
174
+ display: inline-grid;
175
+ place-items: center;
176
+ min-width: 1.65rem;
177
+ height: 1.7rem;
178
+ padding-inline: 0.2rem;
179
+ border-inline: 1px solid currentColor;
180
+ background:
181
+ repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 6px) left top / 100% 2px repeat-x,
182
+ repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 6px) left bottom / 100% 2px repeat-x;
183
+ }
178
184
 
179
- /* Round postmark (the SEALED stamp on a sealed letter): a dashed outer ring
180
- + a solid inner ring via ::before, sandwiching the real metadata text at
181
- the center (date/label) — unlike the decorative pieces above, the postmark
182
- carries information and is not aria-hidden. Size and the deterministic
183
- rotation come from the consumer. Ships its own display, so it must live
184
- in the components layer for utilities (hidden / sm:grid) to be able to
185
- override it. */
185
+ /* Round postmark (the SEALED stamp on a sealed letter): a dashed outer ring
186
+ + a solid inner ring via ::before, sandwiching the real metadata text at
187
+ the center (date/label) — unlike the decorative pieces above, the postmark
188
+ carries information and is not aria-hidden. Size and the deterministic
189
+ rotation come from the consumer. Ships its own display, so it must live
190
+ in the components layer for utilities (hidden / sm:grid) to be able to
191
+ override it. */
192
+ @layer components {
186
193
  .paper-postmark {
187
194
  position: relative;
188
195
  display: grid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hezhijie0327/zjdesign",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "ZJ Design — the shared design system of the ZJ product family (warm paper / ink / amber-gold). Tokens, Tailwind fragments, hooks and React components.",
5
5
  "keywords": [
6
6
  "design-system",