# Changelog

## 0.6.1

### Patch Changes

- v0.6.1 — META-001 fix + npm files[] expansion (consumer-facing patches)

  Two unrelated patch-level fixes bundled because both unblock consumer reference adoption (v1.0 trigger condition 3b).

  ## Fixes

  ### ESLint plugin `no-inline-svg` — Vue SFC `<template>` `<svg>` detection (META-001)

  Prior to this fix, the ESLint plugin rule only detected `<svg`-in-string-literals and JSX `<svg>` tags. Vue SFC `<template>` `<svg>` markup (the common consumer case) was missed entirely — while the CLI `audit-product-code.mjs` R1 caught it.

  Result for consumer adopting both CLI + ESLint plugin: rule named `no-inline-svg` reports two different sets of violations, contradicting `CONSUMER_AUDIT_SETUP.md §What ships` "Same rules" promise.

  **Fix**: use `vue-eslint-parser`'s `defineTemplateBodyVisitor` to add VElement + VText visitors alongside the existing script visitor. Plugin now catches every `<svg>` element in Vue SFC templates (more granular than CLI which reports once per file).

  Empirical re-verification on MicroApps Console vue-app (2026-05-19):

  - Before: 9 errors (all emoji/arrow; 0 real `<svg>`)
  - After: 42 errors (33 `<svg>` + 8 arrow + 1 emoji)

  ### `package.json` `files[]` — include `scripts/` `templates/` and consumer-facing docs

  v0.6.0 npm tarball was missing `scripts/` (audit CLI), `templates/` (eslint config example), and consumer-facing docs (CONSUMER_AUDIT_SETUP.md / MIGRATION_TO_V1.md / API_STABILITY.md). Master HEAD already corrected this pre-v0.6.0 release; v0.6.1 ships it.

  ## Refs

  - Backlog: `docs/internal/backlog.md` META-001
  - Retrospect: `docs/internal/retrospection/2026-05-19-consumer-verification-microapps.md`
  - Consumer verification plan: `docs/internal/_plans/new-session-prompt-consumer-product-verification.md`

## 0.6.0

### Minor Changes

- v0.6.0 — tooling + audit infrastructure + Button legacy props removal (BREAKING) + ESLint plugin

  11 items total: 8 additive (Tier 1-B mockup audits, Tier 2-G STATUS lint, INFRA-F32/F33/F34, hook 升级) + 1 hotfix + **2 BREAKING** (Button legacy props deletion, new ESLint plugin subpath export).

  ## BREAKING

  ### Button — legacy props `variant` / `size` / `disabled` / `loading` removed

  These props were `@deprecated since 0.5.0` and are now **deleted**. Migrate to canonical:

  | Old                             | New                                                            |
  | ------------------------------- | -------------------------------------------------------------- |
  | `<Button variant="fill-green">` | `<Button canonical-style="filling" canonical-color="green">`   |
  | `<Button variant="ghost-red">`  | `<Button canonical-style="ghost" canonical-color="red">`       |
  | `<Button variant="text-gray">`  | `<Button canonical-style="rimless" canonical-color="gray 1">`  |
  | `<Button size="l">`             | `<Button canonical-size="L">` (size enum upper-cased)          |
  | `<Button :disabled="true">`     | `<Button canonical-status="disable">`                          |
  | `<Button :loading="true">`      | `<Button canonical-status="loading" canonical-icon="loading">` |

  Variant→canonical mapping for fill/ghost styles all 4 colors (green/gray/red/orange):

  - `fill-*` → `canonical-style="filling"` + `canonical-color="*"`
  - `ghost-*` → `canonical-style="ghost"` + `canonical-color="*"`
  - `text-*` → `canonical-style="rimless"` + `canonical-color="*"`

  For consumers using `<ButtonBridge>` from `@nancyzeng0210/tvu-design-system` (the canonical wrapper), no change needed — its API is already canonical.

  ## NEW — ESLint plugin (subpath export)

  `@nancyzeng0210/tvu-design-system/eslint-plugin` — ships inside the main package as a subpath export. 4 rules covering R1/R2 + library import discipline (AGENTS.md 硬规则 #6):

  ```js
  // eslint.config.js (consumer)
  import tvuPlugin from "@nancyzeng0210/tvu-design-system/eslint-plugin";
  export default [tvuPlugin.configs.recommended];
  ```

  Rules: `no-hardcoded-color` / `no-inline-svg` / `icon-from-dist` / `no-base-component-import`.

  Functionally overlaps with the existing CLI `audit-product-code.mjs` (R1/R2/R16) for non-ESLint workflows.

  ## Additive (Tier 1-B / Tier 2-G / INFRA-F32-F34 + hook + hotfix)

  **Tier 1-B mockup audit (能力 4 first L3+ gates)**:

  - `scripts/audit-mockup-integrity.mjs` — M-INTEGRITY (I1 sibling layout / I2 SECTION overlap / I3 children-bbox wrap)
  - `scripts/audit-mockup-colors.mjs` — M-COLOR (C1 icon path fill / C2 hover state / C3 BG vs text grey)
  - `scripts/audit-mockup-library-binding.mjs` — M0 / M1 / M30 library binding (this session; MicroApps 716 findings baseline)

  **Tier 1-C foundation CLI (R1/R2/R16)**:

  - `scripts/audit-product-code.mjs` — invokable via `pnpm audit:consumer-code`

  **Tier 2-G STATUS consistency lint**:

  - `scripts/audit-status-consistency.mjs` — version triple-match + stale marker detect + active 项数 sanity. 13th strict gate.

  **INFRA-F32 figma-data/mockup/ sync mechanism**: parametrized api.mjs + `sync-mockup-data.mjs` + `.gitignore figma-data/mockup/`.

  **INFRA-F33 code-side figma name normalize**: `extractStyles()` collapses whitespace in figma style keys; token-aliases.ts reverted to single-space canonical.

  **INFRA-F34 scripts stdlib stability + CI Node matrix**: `audit:scripts-stdlib` + `.github/workflows/publish.yml` Node 20+22 audit-matrix job.

  **Hook allow-list 升级**: `.husky/pre-commit` — `figma-data/normalized/figma-styles.json` moved BLOCK → allow.

  **Hotfix**: `tvu-design-mockup/SKILL.md` broken doc link (`../../` → `../../../`).

  ## Release gates

  11 strict → **13 strict** (audit:scripts-stdlib + audit:status-consistency) + Node 20/22 CI matrix pre-flight.

  ## Migration checklist for consumers

  1. Search codebase for `<Button variant=` / `<Button size=` / `<Button :disabled=` / `<Button :loading=` → replace per the table above.
  2. (Optional) Add ESLint plugin to your config: `import tvuPlugin from '@nancyzeng0210/tvu-design-system/eslint-plugin'`.
  3. Run `pnpm audit:consumer-code` (CLI) for non-ESLint quick check.

## 0.5.0

### Minor Changes

- b868c63: Button canonical API 完整化（canonicalTheme axis）+ Tier 2-E/F tooling CLI + CANONICAL-007 + EXTRACT-006

  - Phase 6.8: Button/ButtonBridge gain `canonicalTheme?: 'dark' | 'light'` prop (8-axis complete). Legacy props @deprecated since this version, removed next.
  - scripts/figma-url-to-canonical.mjs: Figma URL → canonical component lookup CLI.
  - scripts/lint-skills.mjs: skill doc link validator, 11th strict gate.
  - CANONICAL-007: Pagination native `<button>` → DS `<Button>` (canonicalStyle/Color/Size/Radius props + `:deep(.btn)` compact override; active=filling+green, inactive=filling+gray1, arrows=rimless).
  - EXTRACT-006: Figma extract pipeline adds `extractStyles()` step — pulls `GET /v1/files/{key}/styles` + batched `getNodes` (≤100 ids), normalizes Text/Effect/Fill/Grid into `figma-data/normalized/figma-styles.json`. Whitespace-normalized prev-key lookup preserves existing `canonicalToken`/`usage`/`description`; `scaleTokens` and `_alignment_decisions` preserved as-is. First live run: 14 text (7 new PingFang SC) / 4 effect / 0 fill / 0 grid.
  - INFRA-F32: `figma-sync/sync-mockup-data.mjs` + `pnpm sync:mockup <fileKey>` — accepts product file key, pulls raw `getFile` via parametrized api.mjs (`getFile/getNodes/getFileStyles/getVariables/getImages` now take optional `fileKey` arg, default = env library key), writes `figma-data/mockup/<fileKey>.json` (gitignored). Unblocks Tier 1-B audit:mockup-conformance (deferred to v0.6.0). Live verified with MicroApps `DtZcMkhNy6qh6jbQQnhreQ` (~65 MB raw dump, idempotent re-run via `_meta.extractedAt` strip).

## 0.4.0

### Minor Changes

- API 形态统一 minor — Phase 6.6a/6.6b dual-form + Phase 6.7 Badge SoT 一致性 reconciliation + Tier 2-D backlog ID generator.

  **All non-breaking** (pickup originally tagged 破坏性=是 but post-implementation 实证 全 non-breaking — dual-form adds named slots without removing prop API; Phase 6.7 is 0 code change; Tier 2-D is a new dev tool).

  ### Highlights

  - **FormItem.label dual-form** (commit 529bb366): adds `#label` named slot to FormItem. Default slot stays as content/control area (Element Plus convention).
  - **Tooltip.content dual-form** (commit 0db2bfd0): adds `#content` named slot to Tooltip. Default slot stays as trigger element. FormItemPage Custom Label Slot demo upgraded to use public Icon export path (`@/src/index`).
  - **Badge SoT 一致性 ack** (commit 5546ae0b): canonical Badge has had `color | tag | type=Circle|Rectangle` API since checkpoint 9e3ca1ae; pickup spec drift discovered and reconciled in translation SoT. No code change.
  - **`scripts/new-backlog.mjs`** (commit 50ff23d0): Node ESM CLI to suggest next available backlog ID across SoT files. Usage: `pnpm new-backlog <PREFIX>`. Valid prefixes: CANONICAL / BRIDGE / BRIDGE-MOCKUP / BRIDGE-DESIGN / EXTRACT / META / INFRA.

  ### Infra

  - audit:translation-completeness h2 section-boundary fix (commit cca1a043): `auditActiveVsResolved` now truncates section.end at next `^## ` h2 header so trailing `### v1.0.0` section doesn't swallow track-A timeline tables.

  ### Docs

  - FormItem and Tooltip pages each gain a "Custom <Label|Content> Slot" demo block.
  - divergences.md + divergences-decisions.json clarified for all three v0.4.0 entries (formitem-label-dual-form / tooltip-content-dual-form / badge-api-split) — codeSide rewritten to reflect named-slot reality; resolved status flipped at wrap-up.

## 0.3.0

### Minor Changes

- v0.3.0 — Tier 1-A translation schema 化 + BRIDGE-005 generator schema 升级 + Phase 6.4 runtime additions

  **Tier 1-A (4 sprints) — translation/\* JSON + Schema + audit:translation-completeness (10th strict gate)**:

  - `axis-implementation-map.md` → `axis-implementation-map.json` + JSON Schema (16 instances)
  - `prop-aliases.md` split → `prop-aliases.json` (102 entries 13 scope) + 瘦身 md narrative
  - `divergences.md` split → `divergences-decisions.json` (26 decisions 8 category) + 保留 narrative
  - 新 `audit:translation-completeness` 6 维 audit (forward coverage / backward consistency / JSON schema / divergences resolved / token bidirectional / active vs resolved cross-check) — 10th strict gate in `prepublishOnly`
  - AJV 2020 dialect schema 验证

  **SoT drift cleanup + audit dim 6**:

  - Phase 6.3 实际 2026-04-28 已 resolved (commit `897d709c`)，STATUS / tracker 历史 stale active 列入是 SoT drift，已修正
  - audit:translation-completeness 维度 6 (active vs resolved cross-check) 机械防 SoT drift 复发
  - BreadcrumbItem.showSeparator vs Figma showIcon alias drift fix (prop-aliases entry 修正)
  - INFRA-F30 4th source: `audit-tokenized-diff` timestamp idempotent write

  **BRIDGE-005 — Figma boolean property schema 升级**:

  - `figma-sync/generate-docs-figma-members.mjs` 加 `parseBooleanPropsFromTsx()` + `lookupBooleanPropertyAlias()`
  - `DocsFigmaMembers<T>` 新增 `booleanProperties?: readonly BooleanProperty[]` 字段
  - 9 components 重生成 (含 5 个 booleanProperties: BreadcrumbItem / Pagination / PromptMessage / Switch / Table / TopBar)
  - Plan owner fix: axis-named props 排除 (figma-mcp-cache TSX lossy 把 enum axis 推断成 boolean)

  **Phase 6.4 — Runtime addition props (non-breaking)**:

  - `Input.showCount?: boolean = false` + `maxlength?: number` (Figma feature=text count → 右下角 counter)
  - `Select.multiple?: boolean = false` (Figma status=multi select → sugar shortcut)
  - `Select.editable?: boolean = false` (Figma UX=editable → derived state + CSS hook)
  - 既有 `status='multi select'` / `ux='editable'` API 保持工作 (OR 合并)
  - 3 新 runtime-addition entries in prop-aliases.json
  - 108 tests passed (+3 new tests)

## 0.2.0

### Minor Changes

- v0.2.0 — Chart canonical + audit gate upgrades + visual baseline

  ### Highlights

  - 新增 `Chart` canonical 组件 — 6 variants (Line / Bar / Stacked Bar / Area / Pie / Doughnut) · Chart.js 4.5 + vue-chartjs 5.3 + 12 色 categorical palette
  - `audit:published-vs-code` 升 9th strict gate — figma-only count 降到 0（BRIDGE-MOCKUP-004 tracker 收尾）
  - Playwright 视觉基线落地 — 29 page × dark/light = 58 baseline
  - Pre-commit hook v1 上线 — husky + vue-tsc/vitest/figma-data 三红灯 gate

  ### Added

  - **`Chart` canonical component**（`src/canonical/Chart.vue`）— 6 variants matching Figma `chart/*` component set
    - `type`: `line` / `bar` / `stacked-bar` / `area` / `pie` / `doughnut`
    - 12-color categorical palette（`--chart-color-1` ~ `--chart-color-12`）— brand / blue / orange / red + 紫 / 黄 / 青绿 / 洋红 / 靛蓝 / 珊瑚 / chartreuse / lavender
    - Theme-aware：dark / light variants via `<html data-theme>` switch
    - peerDeps：`chart.js ^4.4.0` + `vue-chartjs ^5.3.0`
  - **`PromptMessage.autoDismissMs?: number` prop** — auto-dismiss timer via `watchEffect` + `onBeforeUnmount` cleanup（CANONICAL-002）
  - **Docs site auto-sync version chip + dropdown** — displays current package version + last sync date from package.json / git / CHANGELOG

  ### Changed

  - **`audit:published-vs-code` upgraded to strict gate** — 9th in `prepublishOnly` chain；`continue-on-error` removed from `publish.yml`；figma-only count 0
  - **`Pagination` figma alignment refactor** — 7 mismatch fixed（nav row gap / Simple nav width / Classic btn bg+border+font-weight / Small btn size 24→32px）+ `.pg-main` → `.pg-content` + `.pg-nav-row` hierarchy（CANONICAL-006）

  ### Fixed

  - **`Progress` dark track token** — `--progress-track-bg-dark` → `var(--line-deep)` (#353535) for figma fidelity（CANONICAL-004）

  ### Infra（internal — 不影响 dist/ consumer）

  - **INFRA-F20** Playwright visual baseline — `tests/visual/docs-pages.spec.ts` (29 page × 2 theme = 58 baseline)
  - **INFRA-F21 v1** husky pre-commit hook — 3 red-block gates (vue-tsc / vitest / figma-data write block)
  - **INFRA-F26** extract-figma timestamp idempotence — `extract.mjs` + `normalize-component-tokens.mjs` `stripPaths` + `--force`
  - **INFRA-F29** `normalize.mjs` `normalizedAt` churn — inline patch reusing F26 helper (MD5 verified idempotent)
  - **BRIDGE-MOCKUP-004** tracker close — `figma-to-code-mapping.json` status update + `publish.yml` `continue-on-error` removed + `RELEASING.md` gate table updated
  - Vitest fixture sync — 10 drift fixes after CANONICAL-002/006/008 + data-module migration

  ### Verified

  - ✅ All 9 strict audit gates pass（`audit:design-system` / `figma-conformance` / `docs-site` / `component-tokens` / `tokenized-diff` / `icon-fill-currentcolor` / `component-no-inline-svg` / `no-hardcoded-design-tokens` / `published-vs-code`）
  - ✅ Vitest：105 passed / 1 skipped
  - ✅ Playwright visual：58/58 baseline match
  - ⏳ Pending（post-publish）：GitHub Packages 页实物显示 `@nancyzeng0210/tvu-design-system@0.2.0`（按 STATUS.md release wrap-up 协议强制 verify）

## 0.1.3

### Patch Changes

- a61ee85: CANONICAL-010: PopupBox canonical 实现（modal dialog + 命令式 API）

  - 新增 base modal 组件 `src/components/PopupBox/PopupBox.vue`（Teleport + 自写 backdrop / focus trap / ESC / scroll lock, 0 dep）
  - 新增命令式 API `PopupBox.alert` / `.confirm` / `.open`（类 Element Plus ElMessageBox）
  - 新增 canonical wrapper `src/canonical/PopupBox.vue`（figma Theme=Dark/Light 1:1 对齐）
  - 加 docs page `playground/docs/pages/PopupBoxPage.vue`（button-driven imperative demo）
  - `audit:published-vs-code` figma-only count 从 2 减到 1（PopupBox 移出）
  - BRIDGE-MOCKUP-004 tracker 子项 1/2 完成（仍待 CANONICAL-011 Chart 完成才升 strict）

## 0.1.2

### Patch Changes

- fix(publish): rename package scope @tvu → @nancyzeng0210 (GitHub Packages owner alignment)

  Package name renamed from `@tvu/design-system` → `@nancyzeng0210/tvu-design-system` to match GitHub Packages owner constraint (NancyZeng0210). v0.1.0 / v0.1.1 was never actually published due to this scope mismatch (CI looked green but `pnpm publish` step silently failed; Packages 页全空才暴露真相). v0.1.2 is the first successful publish under the renamed scope. No consumer impact (no install ever succeeded before v0.1.2).

## 0.1.1

### Patch Changes

- 72fc6be: CANONICAL-009: audit:design-system 升 strict

  - 修 audit 脚本 scoped CSS vars false-positive（每 .vue 内部定义的 --xxx 现纳入 defined set）
  - 加 carrier components 白名单（Icon + Logo carrier 模式 by design，按 SOT 来源派发 SVG）
  - Tab.vue hex 替换为 grey scale token (--color-grey-10 / --color-grey-12)
  - exit code 纳入 hardcoded color + raw SVG injection（不只 undefined token）

> **Format**: Keep a Changelog (实用裁剪) — `Highlights` / `Added` / `Changed` / `Fixed` / `Verified` 五段
> **Maintenance**: 0.1.0+ 由 [`changesets`](https://github.com/changesets/changesets) 自动聚合
> 新 PR 加 `.changeset/*.md` 描述变更；发版时跑 `pnpm changeset:version` 聚合并 bump version

## [0.1.0] - 2026-05-09

### Highlights

- 19 canonical Vue 3 组件 / 29 named export — 1:1 对齐 TVU Figma library
- 18 toggle-aware docs pages — Element Plus 风格文档站，全页跟随 docsTheme inject
- 642 个图标 / 28 categories — 同时输出 Vue 组件 / 每分类 ESM / 单 SVG CDN 三模式
- 完整 token system — CSS variables，theme-aware（`<html data-theme="light">` 切换）
- T4-spike 验证："AI 拿 Figma URL → 1:1 还原代码" 闭环可达

### Added

- **Canonical 组件 29 named export**：`Icon` / `Button` / `Radio` / `Switch` / `InputBoxLine` / `InputBoxFilled` / `Badge` / `Breadcrumb` / `BreadcrumbItem` / `CheckBox` / `FormItem` / `InputNumber` / `Notification` / `PromptMessage` / `Pagination` / `Progress` / `Rating` / `SelectBoxLine` / `SelectBoxFilled` / `Slider` / `Steps` / `StepItem` / `Table` / `Tab` / `TabItem` / `TabList` / `TopBar` / `DropDownListSelect` / `Tooltip`
- **Icon system**：642 icons across 28 categories，三种消费方式：
  - Vue 组件：`<Icon name="time/clock" />`
  - 每分类 ESM：`import { SettingIcons } from '@tvu/design-system/icons/esm'`
  - CDN SVG：`dist/icons/svg/<category>/<file>.svg`
- **翻译层 SoT 4 文件**（`src/design-system/translation/`）：
  - `prop-aliases.md` — 命名 alias 登记（如 `closable ↔ showCloseIcon`）
  - `divergences.md` — 显式不映射 / 双形态映射 / Button 双 API 决策 / Code 端双源段
  - `icon-aliases.ts` — 图标 alias 表（如 `status/warning ↔ icon/Message/Error 4`）
  - `token-aliases.ts` — figma Style → canonical token 映射
- **Bridge 机制**：硬规则 #6（canonical SoT）+ `pnpm sync:figma-library` audit pipeline（conformance / docs-site / published-vs-code 三层）
- **跨 AI 工具协作契约**：`AGENTS.md` / `docs/meta-rules.md` / `docs/internal/mockup-conventions.md` / `docs/internal/figma-component-catalog.md`
- **Theme system**：dark / light toggle 通过 `<html data-theme="light">` 切换；默认 dark

### Changed

- **INFRA-F19** — docs site theme-aware 完整化（18 page 单 grid 跟随全局 toggle，禁止 dark/light 并排展示）
- **INFRA-F22** — generator theme axis case-insensitive（修 FormItem figma 真源大写 axis 派生失败）
- **INFRA-F23** — FormItemPage 整页重写（toggle-aware 范式）
- **Phase X.4.2** — 19 components canonical 完全对齐 figma + Badge 三轮 figma roundtrip

### Fixed

- **CANONICAL-001** — Tooltip `placement=top-*` 系列 arrow CSS 偏移
- **CANONICAL-003** — `BaseNotification` iconMap 真源不一致 + `Icon.vue` inline `currentColor` override（外部 CSS 现可 control icon color）

### Verified

- **T4-spike** — Badge "AI 拿 Figma URL → 1:1 还原" PASS（commit `b9e5ac3c`）
- **INFRA-F25** — SVG / Icon / token design-conformance audit suite 起步（含 `audit:icon-fill-currentcolor` / `audit:no-hardcoded-design-tokens` / `audit:component-no-inline-svg`）

[0.1.0]: https://github.com/NancyZeng0210/TVU-Design-System/releases/tag/v0.1.0
