Skip to content

Consume HIG packages for docs shell, controls and callouts - #26

Merged
joeblau merged 1 commit into
mainfrom
feat/hig-34-docs-packages
Oct 15, 2026
Merged

joeblau merged 1 commit into
mainfrom
feat/hig-34-docs-packages

Conversation

@joeblau

@joeblau joeblau commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of bloxwap/hig#34 (Haptic row). The Haptic docs now load their palette, control geometry and shared controls from the HIG 0.1.0 candidate packages. Before this PR they used a copied CSS file plus primitives written by hand in this repo. The SDK demos and docs hosting stay the same.

Changes

  • Packages instead of copies. apps/docs installs @bloxwap/hig-tokens, @bloxwap/hig-contracts and @bloxwap/hig-react from vendor/bloxwap-hig/*.tgz. These are the unmodified output of npm ci && npm run build && npm run release:dry-run -- --channel candidate at bloxwap/hig@7c67a07. They are installed through file: dependencies, and root overrides point HIG's internal dependencies at the same files. global.css imports @bloxwap/hig-tokens/css and @bloxwap/hig-react/css. styles/hig/ (the copied distribution from Add HIG semantic haptic adapters and migrate docs shell tokens #25) is deleted. styles/tokens.css is now only a Fumadocs/Tailwind bridge with no color literals.
  • Controls.
    • Install/copy: HIG Tabs + IconButton.
    • Demo settings: HIG Switch/Slider.
    • Forms/actions: HIG Button and Field/Input. Links and the Vaul close button use the .hig-button recipe.
    • Code window: HIG Surface/Text with a focusable pre.
    • MDX Callout: renders the HIG Callout, used for the hardware-certification limits on the Platforms and HIG pages.
    • The local .btn*, .switch, .board-slider, .demo-input and .install-tabs CSS is removed. lucide-react is removed (it duplicated the copy that fumadocs-ui installs for itself).
  • Unchanged (SDK-owned): the preset board (11 presets + custom), Haptic wrappers, the Vaul drawer demo, the Fumadocs shell and static Orama search, the /haptic base path, metadata/sitemap/robots/deep links, API examples, @bloxwap/font Next loaders, and the platform capability/certification wording.
  • Guards.
    • npm run lint (.github/scripts/hig-check.mjs) checks the tarball SHA-256 values, the package CSS imports, and that no local palette literals or --hig-* redefinitions exist.
    • check-export.mjs fails if a native TTF from the tokens tarball ends up in the export.
    • playwright.config.ts accepts DOCS_PORT; the default is still 4177.
  • New smoke tests:
    • install tabs: Arrow/Home/End keyboard navigation, plus copy with clipboard readback in Chromium or an announced fallback in other browsers
    • keyboard search (⌘/Ctrl+K → ArrowDown → Enter) to a deep link, then keyboard activation and tab order
    • HIG callout and 48px control geometry

Measurements

Static export with /haptic. Details in .github/evidence/hig-34/bytes.json and the README.

Metric Before (e64c32c) After Δ
Exported CSS raw / gzip 149,878 / 23,528 148,539 / 23,642 −1,339 / +114
Exported JS raw / gzip 1,124,240 / 363,600 1,125,248 / 363,743 +1,008 / +143
Exported fonts 12,965,628 12,965,628 0
Whole export 15,679,991 15,681,140 +1,149
Docs source CSS bytes / lines 25,732 / 486 17,371 / 225 −8,361 / −261
Docs direct deps 10 12 +3 HIG, −lucide-react
Lockfile packages 556 606 +3 HIG, +48 nested Radix, −1

Removed files: apps/docs/styles/hig/{tokens.css,LICENSE,README.md}.

Screenshots (Playwright Chromium, reduced motion, desktop 1440×900 and mobile 390×844) for home, the preset board demo, API and interaction examples, before and after: .github/evidence/hig-34/.

Known exceptions

  • HIG packaging: Radix duplicates. @bloxwap/hig-react pins its optional Radix peers to 1.1.15. fumadocs-ui already resolves 1.2.0, so npm nests 48 Radix packages that the docs never import, and none of them reach the bundle. npm overrides do not apply to peer edges, and legacy-peer-deps would drop peers the package tests need.
  • HIG packaging: recipes entry. @bloxwap/hig-react/recipes statically imports overlay, which needs all four Radix peers. The docs therefore build the CodeWindow recipe from surface instead of importing recipes.
  • Tarball size. The tokens tarball is 4.4 MB because it carries HIG's native TTFs. The docs never serve them, and the export check enforces that.
  • Registry. HIG is not on npm. Swap to registry versions when HIG publishes; the upgrade steps are in vendor/bloxwap-hig/README.md.

Verification (local macOS, Node 24.10.0 / npm 11.6.1)

  • npm ci ✅
  • node --test .github/scripts/wait-for-registry.test.mjs: 8/8 ✅
  • npm run lint ✅
  • npm run typecheck ✅
  • npm run coverage: 79 tests ✅
  • npm run test:matrix: React 18.3.1 / 19.3.0 ✅
  • npm run size: 3,840 gzip bytes of an 8,192 budget ✅
  • npm run pack:check ✅
  • npm audit --audit-level=high: 0 vulnerabilities ✅
  • NEXT_PUBLIC_BASE_PATH=/haptic npm run docs:check (9 snippets) ✅
  • npm run docs:build (routes, base-path links, no TTF) ✅
  • DOCS_PORT=4143 npm run docs:smoke (browser, automated): 21/21 passed in chromium, webkit and mobile-chromium (Pixel 7), and 63/63 with --repeat-each=3.
    • Local Firefox (Playwright firefox-1555) does not launch on this macOS host ("Could not find profile folder", same on main). Firefox runs in CI.
  • npm run test:browser (package-only, unchanged by this PR) needs port 4176 and an audio sink, so it was left to CI.

CI on 8df3523 is green (gh pr checks --watch). Documentation: docs:check, docs:build and docs:smoke 28/28 across chromium, firefox, webkit and mobile-chromium. Tests: lint (3 tarballs verified), typecheck, coverage, matrix, size, pack:check, audit, and test:browser 9/9. GitGuardian passed. The deploy and live smoke jobs are skipped on PRs.

No physical iOS/Android hardware, simulator or emulator haptics, VoiceOver/TalkBack, or tactile observation is claimed. Those remain haptic#9/#7. No npm publish, tag or release was performed.

Rollback: revert this PR.

🤖 Generated with Claude Code

Replace the copied HIG CSS distribution and the hand-written button,
switch, slider, input and install-tab primitives with the HIG 0.1.0
candidate packages (@bloxwap/hig-tokens/css, @bloxwap/hig-react/css and
Tabs/IconButton/Button/Switch/Slider/Field/Surface/Callout). The tarballs
are the unmodified dry-run output of bloxwap/hig@7c67a07, vendored with
checksums that npm run lint verifies.

The preset board, Haptic targets, Vaul drawer, Fumadocs static search,
/haptic base path and platform capability language stay SDK-owned.
lucide-react is dropped (it duplicated fumadocs-ui's own copy). Adds
smoke coverage for install-tab keyboard navigation and copy, keyboard
search to a deep link, and HIG callout/control geometry, plus
before/after measurements and screenshots.

Part of bloxwap/hig#34.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant