@hirobius/design-system 0.21.0 → 0.23.0

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.
Files changed (117) hide show
  1. package/AGENTS.md +13 -1
  2. package/CHANGELOG.md +1043 -0
  3. package/CONSUMING.md +25 -11
  4. package/DESIGN.md +24 -24
  5. package/MIGRATIONS.md +603 -0
  6. package/NOTICE.md +1 -1
  7. package/README.md +22 -12
  8. package/UPGRADING.md +243 -0
  9. package/codemods/hds-prefix.mjs +28 -13
  10. package/codemods/jsx-fold.mjs +28 -13
  11. package/codemods/lib/atomic-write.mjs +28 -0
  12. package/codemods/lib/installed-version.mjs +354 -0
  13. package/codemods/lib/project.mjs +395 -0
  14. package/codemods/lib/record.mjs +110 -0
  15. package/codemods/lib/scan.mjs +323 -0
  16. package/codemods/lib/semver.mjs +57 -0
  17. package/codemods/not-found-pattern.mjs +3 -3
  18. package/codemods/patterns-subpath.mjs +28 -12
  19. package/codemods/registry.mjs +67 -0
  20. package/codemods/tile-grid.mjs +3 -3
  21. package/codemods/upgrade.mjs +909 -0
  22. package/dist/chunks/{empty-state-DNoThgfV.js → empty-state-ChC_xZfg.js} +109 -92
  23. package/dist/chunks/{form-By82qZcC.js → form-zCZ_B83I.js} +16 -16
  24. package/dist/css-contract.json +1 -0
  25. package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
  26. package/dist/fonts.css +5 -5
  27. package/dist/form.js +1 -1
  28. package/dist/hirobius-ui.js +1254 -1181
  29. package/dist/manifest.js +6 -5
  30. package/dist/patterns.js +164 -162
  31. package/dist/styles.css +1 -1
  32. package/dist/tokens.css +1 -1
  33. package/dist/tokens.js +14 -1
  34. package/dist/types/src/app/components/alert-dialog.d.ts +1 -1
  35. package/dist/types/src/app/components/alert.d.ts +1 -1
  36. package/dist/types/src/app/components/asset-img.d.ts +2 -1
  37. package/dist/types/src/app/components/avatar-group.d.ts +1 -1
  38. package/dist/types/src/app/components/avatar.d.ts +1 -1
  39. package/dist/types/src/app/components/badge.d.ts +1 -1
  40. package/dist/types/src/app/components/blockquote.d.ts +1 -1
  41. package/dist/types/src/app/components/breadcrumb.d.ts +1 -1
  42. package/dist/types/src/app/components/button.d.ts +2 -2
  43. package/dist/types/src/app/components/callout.d.ts +3 -2
  44. package/dist/types/src/app/components/card.d.ts +6 -4
  45. package/dist/types/src/app/components/checkbox.d.ts +1 -1
  46. package/dist/types/src/app/components/code-block.d.ts +2 -1
  47. package/dist/types/src/app/components/combobox.d.ts +2 -2
  48. package/dist/types/src/app/components/data-table-section.d.ts +2 -1
  49. package/dist/types/src/app/components/destructive-section.d.ts +2 -1
  50. package/dist/types/src/app/components/dialog.d.ts +1 -1
  51. package/dist/types/src/app/components/disclosure.d.ts +1 -1
  52. package/dist/types/src/app/components/divider.d.ts +2 -2
  53. package/dist/types/src/app/components/empty-state.d.ts +1 -1
  54. package/dist/types/src/app/components/field.d.ts +1 -1
  55. package/dist/types/src/app/components/form-actions.d.ts +2 -1
  56. package/dist/types/src/app/components/form.d.ts +2 -1
  57. package/dist/types/src/app/components/grid.d.ts +1 -1
  58. package/dist/types/src/app/components/hds-tooltip.d.ts +1 -1
  59. package/dist/types/src/app/components/icon.d.ts +2 -2
  60. package/dist/types/src/app/components/inline-link.d.ts +1 -1
  61. package/dist/types/src/app/components/input.d.ts +1 -1
  62. package/dist/types/src/app/components/kbd.d.ts +1 -1
  63. package/dist/types/src/app/components/menu.d.ts +1 -1
  64. package/dist/types/src/app/components/metadata-list.d.ts +1 -1
  65. package/dist/types/src/app/components/metric-tiles.d.ts +3 -1
  66. package/dist/types/src/app/components/page-header.d.ts +1 -0
  67. package/dist/types/src/app/components/page.d.ts +1 -0
  68. package/dist/types/src/app/components/pagination.d.ts +1 -1
  69. package/dist/types/src/app/components/popover.d.ts +1 -1
  70. package/dist/types/src/app/components/progress.d.ts +1 -1
  71. package/dist/types/src/app/components/radio.d.ts +1 -1
  72. package/dist/types/src/app/components/reveal.d.ts +1 -0
  73. package/dist/types/src/app/components/select.d.ts +1 -1
  74. package/dist/types/src/app/components/skeleton.d.ts +1 -1
  75. package/dist/types/src/app/components/slider.d.ts +1 -1
  76. package/dist/types/src/app/components/spinner.d.ts +1 -1
  77. package/dist/types/src/app/components/stack.d.ts +1 -1
  78. package/dist/types/src/app/components/stat.d.ts +1 -1
  79. package/dist/types/src/app/components/status-list-item.d.ts +1 -1
  80. package/dist/types/src/app/components/status-tile.d.ts +1 -1
  81. package/dist/types/src/app/components/table.d.ts +1 -1
  82. package/dist/types/src/app/components/tabs.d.ts +4 -2
  83. package/dist/types/src/app/components/tag.d.ts +1 -1
  84. package/dist/types/src/app/components/text.d.ts +1 -1
  85. package/dist/types/src/app/components/textarea.d.ts +1 -1
  86. package/dist/types/src/app/components/timestamp.d.ts +1 -1
  87. package/dist/types/src/app/components/toast.d.ts +1 -1
  88. package/dist/types/src/app/components/toggle.d.ts +1 -1
  89. package/dist/types/src/app/context/hds-theme.d.ts +1 -1
  90. package/dist/types/src/app/design-system/generated-token-refs.d.ts +13 -0
  91. package/dist/types/src/app/design-system/generated-token-values.d.ts +14 -1
  92. package/dist/types/src/app/hooks/useInteractionState.d.ts +7 -1
  93. package/dist/types/src/index.d.ts +126 -32
  94. package/dist/variables.css +33 -22
  95. package/docs/CONSUMING.md +2 -2
  96. package/hirobius.tokens.json +173 -79
  97. package/llms.txt +29 -7
  98. package/mcp/catalog.mjs +10 -7
  99. package/mcp/core-set.mjs +66 -0
  100. package/mcp/guide.mjs +9 -52
  101. package/package.json +28 -11
  102. package/public/hds-manifest.json +365 -207
  103. package/public/llms/components.txt +1 -1
  104. package/public/llms-full.txt +54 -32
  105. package/public/llms.txt +29 -7
  106. package/src/app/data/component-api.json +104 -71
  107. package/upgrade/index.json +215 -0
  108. package/upgrade/releases/0.17.0.json +962 -0
  109. package/upgrade/releases/0.18.0.json +8 -0
  110. package/upgrade/releases/0.19.0.json +233 -0
  111. package/upgrade/releases/0.19.1.json +8 -0
  112. package/upgrade/releases/0.20.0.json +5108 -0
  113. package/upgrade/releases/0.21.0.json +538 -0
  114. package/upgrade/releases/0.22.0.json +94 -0
  115. package/upgrade/releases/0.23.0.json +259 -0
  116. package/upgrade/schema.json +1102 -0
  117. package/dist/fonts/geist-mono-400.woff2 +0 -0
package/mcp/guide.mjs CHANGED
@@ -13,6 +13,8 @@
13
13
  * scripts/__tests__/generate-agents-md.test.mjs enforces it.
14
14
  */
15
15
 
16
+ import { CORE_COMPONENTS } from './core-set.mjs';
17
+
16
18
  /** Hooks are not components, so component-api.json has no entry for them. */
17
19
  export const HOOKS = {
18
20
  useToast: {
@@ -257,59 +259,14 @@ export const INTENTS = [
257
259
  ];
258
260
 
259
261
  /**
260
- * The ratified core set (scripts/lib/core-components.mjs, hds#254). Copied, not
261
- * imported, because scripts/ does not ship; scripts/__tests__/generate-agents-md.test.mjs
262
- * pins the two together.
262
+ * The recommended set: the ratified core (mcp/core-set.mjs, hds#254) plus every
263
+ * component a need above names, hooks excluded. This is a different set from the
264
+ * ratified core: it adds the patterns and layout parts the guide steers agents to
265
+ * (Page, MetricTiles, ...). list_core and AGENTS.md show this one and say so; the
266
+ * manifest `core` flag, llms.txt and SKILL.md show the ratified core.
263
267
  */
264
- export const RATIFIED_CORE = [
265
- 'Alert',
266
- 'Avatar',
267
- 'Badge',
268
- 'Box',
269
- 'Breadcrumb',
270
- 'Button',
271
- 'Card',
272
- 'Checkbox',
273
- 'Combobox',
274
- 'Container',
275
- 'Dialog',
276
- 'Disclosure',
277
- 'Divider',
278
- 'EmptyState',
279
- 'Field',
280
- 'Grid',
281
- 'HdsRouterProvider',
282
- 'HdsThemeProvider',
283
- 'Icon',
284
- 'InlineLink',
285
- 'Input',
286
- 'Kbd',
287
- 'Menu',
288
- 'Pagination',
289
- 'Popover',
290
- 'Progress',
291
- 'Radio',
292
- 'SegmentedControl',
293
- 'Select',
294
- 'Skeleton',
295
- 'Slider',
296
- 'Spinner',
297
- 'Stack',
298
- 'Surface',
299
- 'Table',
300
- 'Tabs',
301
- 'Tag',
302
- 'Text',
303
- 'Textarea',
304
- 'ToastProvider',
305
- 'Toggle',
306
- 'Tooltip',
307
- 'VisuallyHidden',
308
- ];
309
-
310
- /** The core set agents should prefer: the ratified core plus every `use` above, hooks excluded. */
311
- export function coreComponents() {
312
- const names = new Set(RATIFIED_CORE);
268
+ export function recommendedComponents() {
269
+ const names = new Set(CORE_COMPONENTS);
313
270
  for (const intent of INTENTS) for (const name of intent.use) if (!HOOKS[name]) names.add(name);
314
271
  return [...names].sort();
315
272
  }
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "author": "Adrian Milsap",
21
21
  "license": "SEE LICENSE IN NOTICE.md",
22
22
  "private": false,
23
- "version": "0.21.0",
23
+ "version": "0.23.0",
24
24
  "engines": {
25
25
  "node": ">=20",
26
26
  "pnpm": ">=8"
@@ -110,6 +110,12 @@
110
110
  "DESIGN.md",
111
111
  "CONSUMING.md",
112
112
  "docs/CONSUMING.md",
113
+ "UPGRADING.md",
114
+ "MIGRATIONS.md",
115
+ "CHANGELOG.md",
116
+ "upgrade/schema.json",
117
+ "upgrade/index.json",
118
+ "upgrade/releases/",
113
119
  "src/app/data/component-api.json",
114
120
  "codemods/patterns-subpath.mjs",
115
121
  "codemods/patterns-subpath.names.json",
@@ -119,6 +125,14 @@
119
125
  "codemods/jsx-fold.mjs",
120
126
  "codemods/not-found-pattern.mjs",
121
127
  "codemods/tile-grid.mjs",
128
+ "codemods/upgrade.mjs",
129
+ "codemods/registry.mjs",
130
+ "codemods/lib/atomic-write.mjs",
131
+ "codemods/lib/installed-version.mjs",
132
+ "codemods/lib/project.mjs",
133
+ "codemods/lib/record.mjs",
134
+ "codemods/lib/scan.mjs",
135
+ "codemods/lib/semver.mjs",
122
136
  "AGENTS.md",
123
137
  "mcp/",
124
138
  "scripts/eslint-plugin-hds/index.mjs",
@@ -227,6 +241,7 @@
227
241
  "pixelmatch": "^7.1.0",
228
242
  "playwright": "^1.58.2",
229
243
  "pngjs": "^7.0.0",
244
+ "postcss": "8.5.10",
230
245
  "prettier": "^3.8.3",
231
246
  "publint": "^0.3.21",
232
247
  "react": "18.3.1",
@@ -254,7 +269,9 @@
254
269
  "hds-prefix": "codemods/hds-prefix.mjs",
255
270
  "hds-not-found-pattern": "codemods/not-found-pattern.mjs",
256
271
  "hds-tile-grid": "codemods/tile-grid.mjs",
257
- "hds-mcp": "mcp/hds-mcp.mjs"
272
+ "hds-mcp": "mcp/hds-mcp.mjs",
273
+ "design-system": "codemods/upgrade.mjs",
274
+ "hds-upgrade": "codemods/upgrade.mjs"
258
275
  },
259
276
  "scripts": {
260
277
  "_comment:a11y-high-value": "The following check:* validators are high-value accessibility checks that catch real violations (check:focus found 1 missing focus class). Kept dormant/manual-only to avoid pre-commit performance regression. Candidates to wire into pretest after CI stability review.",
@@ -270,13 +287,13 @@
270
287
  "audit:sidecar": "node scripts/generate-security-posture.mjs",
271
288
  "audit:style-dictionary": "bash scripts/poc/style-dictionary-poc/run.sh",
272
289
  "build-storybook": "storybook build",
273
- "build:lib": "vite build -c vite.config.lib.ts && pnpm build:types && node scripts/build-vars-css.mjs && node scripts/build-fonts-css.mjs && node scripts/build-styles-css.mjs && node scripts/build-static-css.mjs",
290
+ "build:lib": "vite build -c vite.config.lib.ts && pnpm build:types && node scripts/build-vars-css.mjs && node scripts/build-fonts-css.mjs && node scripts/build-styles-css.mjs && node scripts/build-static-css.mjs && node scripts/build-css-contract.mjs",
274
291
  "build:types": "tsc -p tsconfig.dts.json && node scripts/strip-dts-side-effects.mjs && node scripts/add-dts-extensions.mjs",
275
292
  "catalog": "node scripts/generate-visual-catalog.mjs",
276
293
  "changelog:generate": "node scripts/generate-changelog.mjs",
277
294
  "changeset": "changeset",
278
295
  "changeset:add": "changeset",
279
- "changeset:version": "changeset version && node scripts/audit-component-integrity.mjs --api --update-baseline",
296
+ "changeset:version": "changeset version && pnpm build:lib && node scripts/upgrade/compile.mjs --release && node scripts/audit-component-integrity.mjs --api --update-baseline",
280
297
  "check": "pnpm check:full",
281
298
  "check:a11y": "pnpm lint --rule '{\"jsx-a11y/alt-text\":\"error\",\"jsx-a11y/img-redundant-alt\":\"error\"}'",
282
299
  "check:attributions": "node scripts/check-attributions.mjs",
@@ -297,7 +314,7 @@
297
314
  "check:figma-coverage": "node scripts/check-figma-coverage.mjs",
298
315
  "check:figma-drift": "node scripts/check-figma-drift.mjs",
299
316
  "check:figma-mapping": "node scripts/check-figma-mapping.mjs",
300
- "check:figma-staging-urls": "node scripts/check-figma-staging-urls.mjs",
317
+ "check:figma-retired-keys": "node scripts/check-figma-retired-keys.mjs",
301
318
  "check:focus": "node scripts/check-focus-states.mjs",
302
319
  "check:font-files": "node scripts/check-typography-discipline.mjs --font-files-only",
303
320
  "check:fonts": "node scripts/check-typography-discipline.mjs --fonts-only",
@@ -327,7 +344,7 @@
327
344
  "check:secrets": "node scripts/check-secrets.mjs",
328
345
  "check:security": "node scripts/check-security-baseline.mjs",
329
346
  "check:semantic-report": "node scripts/audit-tokens.mjs --report-only",
330
- "check:size": "pnpm build:lib && node scripts/build-button-probe.mjs && size-limit",
347
+ "check:size": "pnpm build:lib && node scripts/build-button-probe.mjs && pnpm size-limit",
331
348
  "check:spacing": "node scripts/check-hardcoded-spacing.mjs",
332
349
  "check:spacing-vocabulary": "node scripts/check-spacing-vocabulary.mjs",
333
350
  "check:story-coverage": "node scripts/check-story-coverage.mjs",
@@ -374,7 +391,6 @@
374
391
  "figma:native-import": "node scripts/build-figma-native-import.mjs",
375
392
  "figma:push": "node scripts/figma-push.mjs",
376
393
  "figma:snapshot": "node scripts/figma-snapshot.mjs",
377
- "figma:staging-inventory": "node scripts/generate-staging-inventory.mjs",
378
394
  "guardrail:sweep": "node scripts/guardrail-sweep.mjs",
379
395
  "harvest:design-md": "node scripts/harvest-design-md.mjs",
380
396
  "hds:new": "node scripts/scaffold-component.mjs",
@@ -393,7 +409,7 @@
393
409
  "prebuild-storybook": "node scripts/generate-component-api.mjs",
394
410
  "prebuild:lib": "node scripts/generate-component-api.mjs",
395
411
  "prestorybook": "node scripts/generate-component-api.mjs",
396
- "pretest": "node scripts/validate-manifest.mjs && node scripts/check-manifest-drift.mjs && node scripts/check-manifest-schema-semver.mjs && node scripts/audit-component-integrity.mjs --completeness && node scripts/audit-component-integrity.mjs --api && node scripts/check-source-canon.mjs && node scripts/check-binding-drift.mjs && node scripts/check-registry.mjs && node scripts/check-tenant-tokens.mjs && node scripts/check-props-exports.mjs && knip --no-exit-code && node scripts/check-dark-alias-flip.mjs && node scripts/check-focus-states.mjs && node scripts/generate-staging-inventory.mjs --check && node scripts/generate-consumer-skill.mjs --check && node scripts/generate-agents-md.mjs --check && node scripts/check-deprecations.mjs && node scripts/upgrade/schema.mjs --check && node scripts/check-docs.mjs && node --test scripts/check-docs.selftest.mjs",
412
+ "pretest": "node scripts/validate-manifest.mjs && node scripts/check-manifest-drift.mjs && node scripts/check-manifest-schema-semver.mjs && node scripts/audit-component-integrity.mjs --completeness && node scripts/audit-component-integrity.mjs --api && node scripts/check-source-canon.mjs && node scripts/check-binding-drift.mjs && node scripts/check-registry.mjs && node scripts/check-tenant-tokens.mjs && node scripts/check-props-exports.mjs && knip --no-exit-code && node scripts/check-dark-alias-flip.mjs && node scripts/check-focus-states.mjs && node scripts/generate-consumer-skill.mjs --check && node scripts/generate-agents-md.mjs --check && node scripts/check-deprecations.mjs && node scripts/upgrade/schema.mjs --check && node scripts/upgrade/compile.mjs --check && node scripts/check-docs.mjs && node --test scripts/check-docs.selftest.mjs && node scripts/check-upgrade-ledger.mjs",
397
413
  "pretypecheck": "node scripts/audit-tokens.mjs --report-only",
398
414
  "preview:build": "vite build --config preview/vite.config.mjs",
399
415
  "promote": "node scripts/promote.mjs",
@@ -401,11 +417,11 @@
401
417
  "release": "pnpm build:lib && pnpm smoke:consumer --skip-build && changeset publish",
402
418
  "scaffold:component": "node scripts/scaffold-component.mjs",
403
419
  "scaffold:tenant": "node scripts/scaffold-tenant.mjs",
404
- "size-limit": "size-limit --config .size-limit.cjs",
420
+ "size-limit": "node scripts/run-size-limit.mjs",
405
421
  "layout-contract:generate": "node scripts/generate-layout-contract.mjs",
406
422
  "status:touch": "node scripts/status-touch.mjs",
407
423
  "status:fold": "node scripts/status-fold.mjs",
408
- "smoke:consumer": "node scripts/smoke-consumer.mjs && node scripts/check-published-types.mjs && node scripts/check-rsc-directives.mjs && node scripts/check-pack-contents.mjs",
424
+ "smoke:consumer": "node scripts/smoke-consumer.mjs && node scripts/check-published-types.mjs && node scripts/check-rsc-directives.mjs && node scripts/check-pack-contents.mjs && node scripts/check-upgrade-css.mjs",
409
425
  "storybook": "storybook dev -p 6006",
410
426
  "storybook:deploy": "node scripts/deploy-storybook.mjs",
411
427
  "sync": "node scripts/build-tokens.mjs && node scripts/audit-tokens.mjs --forbidden && node scripts/build-handoff.mjs && node scripts/build-design-md.mjs && node scripts/build-figma-variables.mjs",
@@ -432,6 +448,7 @@
432
448
  "upgrade:consumers": "node scripts/upgrade/consumers.mjs",
433
449
  "codemod:names": "node scripts/build-codemod-pattern-names.mjs",
434
450
  "agents:generate": "node scripts/generate-agents-md.mjs",
435
- "check:agents-md": "node scripts/generate-agents-md.mjs --check"
451
+ "check:agents-md": "node scripts/generate-agents-md.mjs --check",
452
+ "upgrade:note": "node scripts/upgrade/note.mjs"
436
453
  }
437
454
  }