@sarjallab09/figma-intelligence 1.0.1 → 1.2.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 (297) hide show
  1. package/README.md +67 -36
  2. package/dist/bin/cli.js +2 -0
  3. package/dist/design-bridge/bridge.js +2 -0
  4. package/dist/figma-bridge-plugin/bridge-relay.js +2 -0
  5. package/dist/figma-bridge-plugin/code.js +1 -0
  6. package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package-lock.json +0 -3
  7. package/dist/figma-bridge-plugin/ui.html +4970 -0
  8. package/dist/figma-intelligence-layer/dist/index.js +2 -0
  9. package/dist/scripts/clean-existing-chunks.js +2 -0
  10. package/dist/scripts/connect-ai-tool.js +2 -0
  11. package/dist/scripts/convert-hub-pdfs.js +2 -0
  12. package/dist/scripts/figma-mcp-status.js +2 -0
  13. package/dist/scripts/register-codex-mcp.js +2 -0
  14. package/dist/scripts/test-copilot-chat.js +2 -0
  15. package/package.json +11 -8
  16. package/bin/cli.js +0 -859
  17. package/design-bridge/bridge.js +0 -196
  18. package/design-bridge/lib/assets.js +0 -367
  19. package/design-bridge/lib/prompt.js +0 -85
  20. package/design-bridge/lib/server.js +0 -66
  21. package/design-bridge/lib/stitch.js +0 -37
  22. package/design-bridge/lib/tokens.js +0 -82
  23. package/design-bridge/package-lock.json +0 -579
  24. package/figma-bridge-plugin/README.md +0 -97
  25. package/figma-bridge-plugin/anthropic-chat-runner.js +0 -192
  26. package/figma-bridge-plugin/bridge-relay.js +0 -2363
  27. package/figma-bridge-plugin/chat-runner.js +0 -459
  28. package/figma-bridge-plugin/code.js +0 -1528
  29. package/figma-bridge-plugin/codex-runner.js +0 -505
  30. package/figma-bridge-plugin/component-schemas.js +0 -110
  31. package/figma-bridge-plugin/content-context.js +0 -869
  32. package/figma-bridge-plugin/create-button.js +0 -216
  33. package/figma-bridge-plugin/gemini-cli-runner.js +0 -291
  34. package/figma-bridge-plugin/gemini-runner.js +0 -187
  35. package/figma-bridge-plugin/html-to-figma.js +0 -927
  36. package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
  37. package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +0 -159
  38. package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +0 -162
  39. package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +0 -148
  40. package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +0 -314
  41. package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +0 -175
  42. package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +0 -180
  43. package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +0 -165
  44. package/figma-bridge-plugin/perplexity-runner.js +0 -188
  45. package/figma-bridge-plugin/references/SKILL.md +0 -178
  46. package/figma-bridge-plugin/references/anatomy-spec.md +0 -159
  47. package/figma-bridge-plugin/references/api-spec.md +0 -162
  48. package/figma-bridge-plugin/references/color-spec.md +0 -148
  49. package/figma-bridge-plugin/references/full-spec-template.md +0 -314
  50. package/figma-bridge-plugin/references/property-spec.md +0 -175
  51. package/figma-bridge-plugin/references/screen-reader-spec.md +0 -180
  52. package/figma-bridge-plugin/references/structure-spec.md +0 -165
  53. package/figma-bridge-plugin/shared-prompt-config.js +0 -604
  54. package/figma-bridge-plugin/spec-helpers/build-table.js +0 -269
  55. package/figma-bridge-plugin/spec-helpers/classify-elements.js +0 -189
  56. package/figma-bridge-plugin/spec-helpers/index.js +0 -35
  57. package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +0 -49
  58. package/figma-bridge-plugin/spec-helpers/position-markers.js +0 -158
  59. package/figma-bridge-plugin/stitch-auth.js +0 -322
  60. package/figma-bridge-plugin/stitch-runner.js +0 -1427
  61. package/figma-bridge-plugin/token-resolver.js +0 -107
  62. package/figma-bridge-plugin/ui.html +0 -4467
  63. package/figma-intelligence-layer/.env.example +0 -39
  64. package/figma-intelligence-layer/docs/local-image-generation.md +0 -60
  65. package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +0 -101
  66. package/figma-intelligence-layer/jest.config.js +0 -14
  67. package/figma-intelligence-layer/mcp-config.json +0 -19
  68. package/figma-intelligence-layer/package-lock.json +0 -5892
  69. package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +0 -67
  70. package/figma-intelligence-layer/scripts/start-comfyui.sh +0 -33
  71. package/figma-intelligence-layer/src/index.ts +0 -2233
  72. package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +0 -404
  73. package/figma-intelligence-layer/src/shared/cache.ts +0 -187
  74. package/figma-intelligence-layer/src/shared/color-operations.ts +0 -533
  75. package/figma-intelligence-layer/src/shared/color-utils.ts +0 -138
  76. package/figma-intelligence-layer/src/shared/component-script-builder.ts +0 -413
  77. package/figma-intelligence-layer/src/shared/component-templates.ts +0 -2767
  78. package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +0 -694
  79. package/figma-intelligence-layer/src/shared/decision-log.ts +0 -128
  80. package/figma-intelligence-layer/src/shared/design-system-context.ts +0 -568
  81. package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +0 -131
  82. package/figma-intelligence-layer/src/shared/design-system-matcher.ts +0 -184
  83. package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +0 -196
  84. package/figma-intelligence-layer/src/shared/design-system-tokens.ts +0 -295
  85. package/figma-intelligence-layer/src/shared/dtcg-validator.ts +0 -530
  86. package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +0 -671
  87. package/figma-intelligence-layer/src/shared/figma-bridge.ts +0 -1408
  88. package/figma-intelligence-layer/src/shared/font-config.ts +0 -126
  89. package/figma-intelligence-layer/src/shared/icon-catalog.ts +0 -360
  90. package/figma-intelligence-layer/src/shared/icon-fetch.ts +0 -80
  91. package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +0 -162
  92. package/figma-intelligence-layer/src/shared/response-compression.ts +0 -440
  93. package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +0 -324
  94. package/figma-intelligence-layer/src/shared/token-binder.ts +0 -505
  95. package/figma-intelligence-layer/src/shared/token-math.ts +0 -427
  96. package/figma-intelligence-layer/src/shared/token-naming.ts +0 -468
  97. package/figma-intelligence-layer/src/shared/token-utils.ts +0 -420
  98. package/figma-intelligence-layer/src/shared/types.ts +0 -346
  99. package/figma-intelligence-layer/src/shared/typography-presets.ts +0 -94
  100. package/figma-intelligence-layer/src/shared/unsplash.ts +0 -165
  101. package/figma-intelligence-layer/src/shared/vision-client.ts +0 -607
  102. package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +0 -334
  103. package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +0 -446
  104. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +0 -782
  105. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +0 -496
  106. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +0 -230
  107. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +0 -66
  108. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +0 -810
  109. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +0 -1191
  110. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +0 -1346
  111. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +0 -148
  112. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +0 -499
  113. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +0 -910
  114. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +0 -989
  115. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +0 -1160
  116. package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +0 -424
  117. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +0 -38
  118. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +0 -111
  119. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +0 -114
  120. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +0 -103
  121. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +0 -1060
  122. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +0 -18
  123. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +0 -39
  124. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +0 -58
  125. package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +0 -298
  126. package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +0 -197
  127. package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +0 -494
  128. package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +0 -356
  129. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +0 -123
  130. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +0 -663
  131. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +0 -56
  132. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +0 -614
  133. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +0 -113
  134. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +0 -178
  135. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +0 -470
  136. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +0 -429
  137. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +0 -226
  138. package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +0 -535
  139. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +0 -660
  140. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +0 -209
  141. package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +0 -540
  142. package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +0 -391
  143. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +0 -2019
  144. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +0 -131
  145. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +0 -381
  146. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +0 -565
  147. package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +0 -764
  148. package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +0 -535
  149. package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +0 -84
  150. package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +0 -401
  151. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +0 -68
  152. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +0 -78
  153. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +0 -93
  154. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +0 -596
  155. package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +0 -462
  156. package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +0 -1470
  157. package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +0 -829
  158. package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +0 -702
  159. package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +0 -483
  160. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +0 -501
  161. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +0 -106
  162. package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +0 -676
  163. package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +0 -560
  164. package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +0 -1043
  165. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +0 -620
  166. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +0 -331
  167. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +0 -77
  168. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +0 -54
  169. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +0 -287
  170. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +0 -71
  171. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +0 -43
  172. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +0 -71
  173. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +0 -221
  174. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +0 -166
  175. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +0 -232
  176. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +0 -234
  177. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +0 -270
  178. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +0 -249
  179. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +0 -231
  180. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +0 -293
  181. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +0 -240
  182. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +0 -243
  183. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +0 -307
  184. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +0 -143
  185. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +0 -227
  186. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +0 -233
  187. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +0 -282
  188. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +0 -276
  189. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +0 -223
  190. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +0 -255
  191. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +0 -289
  192. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +0 -261
  193. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +0 -290
  194. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +0 -265
  195. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +0 -238
  196. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +0 -255
  197. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +0 -128
  198. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +0 -286
  199. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +0 -255
  200. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +0 -330
  201. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +0 -247
  202. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +0 -250
  203. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +0 -247
  204. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +0 -144
  205. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +0 -264
  206. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +0 -251
  207. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +0 -261
  208. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +0 -248
  209. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +0 -270
  210. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +0 -251
  211. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +0 -142
  212. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +0 -282
  213. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +0 -250
  214. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +0 -258
  215. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +0 -265
  216. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +0 -319
  217. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +0 -256
  218. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +0 -232
  219. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +0 -239
  220. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +0 -252
  221. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +0 -270
  222. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +0 -244
  223. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +0 -143
  224. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +0 -243
  225. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +0 -259
  226. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +0 -293
  227. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +0 -144
  228. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +0 -289
  229. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +0 -267
  230. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +0 -232
  231. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +0 -257
  232. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +0 -319
  233. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +0 -121
  234. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +0 -430
  235. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +0 -312
  236. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +0 -129
  237. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +0 -78
  238. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +0 -2333
  239. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +0 -100
  240. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +0 -32
  241. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +0 -59
  242. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +0 -18
  243. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +0 -53
  244. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +0 -19
  245. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +0 -91
  246. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +0 -71
  247. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +0 -19
  248. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +0 -110
  249. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +0 -19
  250. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +0 -67
  251. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +0 -58
  252. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +0 -79
  253. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +0 -50
  254. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +0 -33
  255. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +0 -55
  256. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +0 -73
  257. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +0 -81
  258. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +0 -409
  259. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +0 -198
  260. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +0 -701
  261. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +0 -88
  262. package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +0 -135
  263. package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +0 -491
  264. package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +0 -416
  265. package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +0 -722
  266. package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +0 -449
  267. package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +0 -393
  268. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +0 -406
  269. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +0 -292
  270. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +0 -24
  271. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +0 -172
  272. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +0 -409
  273. package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +0 -594
  274. package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +0 -710
  275. package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +0 -458
  276. package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +0 -134
  277. package/figma-intelligence-layer/tests/apg-doc.test.ts +0 -101
  278. package/figma-intelligence-layer/tests/design-system-context.test.ts +0 -152
  279. package/figma-intelligence-layer/tests/design-system-matcher.test.ts +0 -144
  280. package/figma-intelligence-layer/tests/figma-bridge.test.ts +0 -83
  281. package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +0 -56
  282. package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +0 -69
  283. package/figma-intelligence-layer/tests/smoke.test.ts +0 -174
  284. package/figma-intelligence-layer/tests/spec-generator.test.ts +0 -127
  285. package/figma-intelligence-layer/tests/token-migrate.test.ts +0 -21
  286. package/figma-intelligence-layer/tests/token-naming.test.ts +0 -30
  287. package/figma-intelligence-layer/tsconfig.json +0 -19
  288. package/scripts/clean-existing-chunks.js +0 -179
  289. package/scripts/connect-ai-tool.js +0 -490
  290. package/scripts/convert-hub-pdfs.js +0 -425
  291. package/scripts/figma-mcp-status.js +0 -349
  292. package/scripts/register-codex-mcp.js +0 -96
  293. /package/{design-bridge → dist/design-bridge}/.env.example +0 -0
  294. /package/{design-bridge → dist/design-bridge}/package.json +0 -0
  295. /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/manifest.json +0 -0
  296. /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package.json +0 -0
  297. /package/{figma-intelligence-layer → dist/figma-intelligence-layer}/package.json +0 -0
@@ -1,293 +0,0 @@
1
- /**
2
- * banner.ts — Gold-standard design knowledge for Banner components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const bannerKnowledge: ComponentKnowledge = {
7
- description:
8
- "Full-width persistent notification bar | Communicates system-level messages | Pinned to top, bottom, or inline position",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Default",
13
- visualChange: "Banner displays at full width with type-specific background color, icon, message text, and optional action/dismiss controls",
14
- opacity: "1",
15
- cursorWeb: "default",
16
- usage: "Active state — the banner is visible and conveying information, success, warning, or error to the user",
17
- },
18
- {
19
- state: "Hover (Action)",
20
- visualChange: "Action link or button within the banner transitions to its hover state — underline or background change",
21
- opacity: "1",
22
- cursorWeb: "pointer",
23
- usage: "Mouse cursor enters the inline action element within the banner",
24
- },
25
- {
26
- state: "Hover (Dismiss)",
27
- visualChange: "Dismiss (X) button background darkens one step; icon color may intensify",
28
- opacity: "1",
29
- cursorWeb: "pointer",
30
- usage: "Mouse cursor enters the dismiss button — signals the banner can be closed",
31
- },
32
- {
33
- state: "Focus (Action)",
34
- visualChange: "Action element receives a 2px focus ring using $focus-ring token; high contrast against banner background",
35
- opacity: "1",
36
- cursorWeb: "pointer",
37
- usage: "Action link or button receives keyboard focus via Tab key",
38
- },
39
- {
40
- state: "Focus (Dismiss)",
41
- visualChange: "Dismiss button receives a 2px focus ring offset by 2px from its edge",
42
- opacity: "1",
43
- cursorWeb: "pointer",
44
- usage: "Dismiss button receives keyboard focus via Tab key",
45
- },
46
- {
47
- state: "Dismissed",
48
- visualChange: "Banner slides out or fades to opacity 0; container collapses to height 0 and is removed from the layout flow",
49
- opacity: "0",
50
- cursorWeb: "default",
51
- usage: "User has dismissed the banner — it is no longer visible and should not occupy layout space",
52
- },
53
- {
54
- state: "Entering",
55
- visualChange: "Banner slides in from the top/bottom edge or fades in; height animates from 0 to full height",
56
- opacity: "0 → 1",
57
- cursorWeb: "default",
58
- usage: "Banner is appearing for the first time — entry animation provides smooth visual transition",
59
- },
60
- ],
61
-
62
- propertyDescriptions: {
63
- type: "Semantic variant controlling the color scheme and leading icon — info (blue), success (green), warning (amber), error (red)",
64
- message: "Primary text content of the banner — should be concise and actionable, typically one sentence",
65
- dismissible: "When true a close (X) button is rendered allowing the user to dismiss the banner; default is true for info, false for error",
66
- action: "Optional inline action rendered as a text button or link — e.g., 'Learn more', 'Upgrade now', 'Retry'",
67
- onDismiss: "Callback fired when the dismiss button is clicked; parent component manages whether the banner re-appears",
68
- onAction: "Callback fired when the inline action is clicked; typically navigates or triggers a remediation flow",
69
- position: "Layout position of the banner — 'top' (pinned to viewport top), 'bottom' (pinned to viewport bottom), 'inline' (flows with content)",
70
- icon: "Leading icon rendered before the message text — defaults to a type-appropriate icon (info circle, check circle, warning triangle, error circle)",
71
- persistent: "When true the banner cannot be dismissed and the dismiss button is hidden; used for critical system messages",
72
- fullWidth: "When true the banner spans the full viewport width regardless of parent container constraints; default for top/bottom positions",
73
- role: "ARIA role — 'alert' for urgent messages (error, warning), 'status' for informational messages (info, success)",
74
- },
75
-
76
- sizeSpecifications: [
77
- {
78
- size: "Compact",
79
- height: "40px",
80
- paddingLR: "16px",
81
- fontSize: "12px",
82
- iconSize: "16px",
83
- borderRadius: "0px",
84
- },
85
- {
86
- size: "Default",
87
- height: "48px",
88
- paddingLR: "20px",
89
- fontSize: "14px",
90
- iconSize: "20px",
91
- borderRadius: "0px",
92
- },
93
- {
94
- size: "Large",
95
- height: "56px",
96
- paddingLR: "24px",
97
- fontSize: "16px",
98
- iconSize: "24px",
99
- borderRadius: "0px",
100
- },
101
- ],
102
-
103
- designTokenBindings: [
104
- {
105
- property: "Info Background",
106
- tokenName: "$banner-info-bg",
107
- role: "Background fill for the informational banner variant",
108
- fallback: "#EFF6FF",
109
- },
110
- {
111
- property: "Info Text",
112
- tokenName: "$banner-info-text",
113
- role: "Text color for the informational banner message and icon",
114
- fallback: "#1E40AF",
115
- },
116
- {
117
- property: "Info Border",
118
- tokenName: "$banner-info-border",
119
- role: "Bottom border accent for the informational banner",
120
- fallback: "#93C5FD",
121
- },
122
- {
123
- property: "Success Background",
124
- tokenName: "$banner-success-bg",
125
- role: "Background fill for the success banner variant",
126
- fallback: "#F0FDF4",
127
- },
128
- {
129
- property: "Success Text",
130
- tokenName: "$banner-success-text",
131
- role: "Text color for the success banner message and icon",
132
- fallback: "#166534",
133
- },
134
- {
135
- property: "Warning Background",
136
- tokenName: "$banner-warning-bg",
137
- role: "Background fill for the warning banner variant",
138
- fallback: "#FFFBEB",
139
- },
140
- {
141
- property: "Warning Text",
142
- tokenName: "$banner-warning-text",
143
- role: "Text color for the warning banner message and icon",
144
- fallback: "#92400E",
145
- },
146
- {
147
- property: "Error Background",
148
- tokenName: "$banner-error-bg",
149
- role: "Background fill for the error/critical banner variant",
150
- fallback: "#FEF2F2",
151
- },
152
- {
153
- property: "Error Text",
154
- tokenName: "$banner-error-text",
155
- role: "Text color for the error banner message and icon",
156
- fallback: "#991B1B",
157
- },
158
- {
159
- property: "Dismiss Icon",
160
- tokenName: "$banner-dismiss-icon",
161
- role: "Color of the dismiss (X) button icon — slightly muted relative to the message text",
162
- fallback: "#6B7280",
163
- },
164
- {
165
- property: "Action Text",
166
- tokenName: "$banner-action-text",
167
- role: "Color of the inline action link/button — typically underlined and slightly bolder than message text",
168
- fallback: "#1D4ED8",
169
- },
170
- {
171
- property: "Focus Ring",
172
- tokenName: "$focus-ring",
173
- role: "Keyboard focus indicator ring for action and dismiss buttons within the banner",
174
- fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
175
- },
176
- {
177
- property: "Transition",
178
- tokenName: "$transition-banner",
179
- role: "Entry and exit animation timing for banner appearance and dismissal",
180
- fallback: "300ms ease-in-out",
181
- },
182
- ],
183
-
184
- structureRules: [
185
- "Banner uses horizontal Auto Layout with vertical center alignment — icon, message, spacer, action, dismiss in a single row",
186
- "Leading icon is fixed-size and vertically centered; it inherits the type-specific text color token",
187
- "Message text fills the remaining horizontal space with text-overflow: ellipsis for single-line overflow",
188
- "Action element is rendered as an inline text button or link after the message, separated by $spacing-md",
189
- "Dismiss button is the rightmost element — a small icon-only button with the X/close icon",
190
- "For top/bottom positions, the banner is fixed to the viewport edge and uses full viewport width",
191
- "Inline position renders the banner within the document flow — it pushes content below it down",
192
- "Banner has no border-radius by default (full-width edge-to-edge); inline variant may use small radius (4px)",
193
- "Multiple banners stack vertically with no gap between them — they appear as a unified notification area",
194
- ],
195
-
196
- typeHierarchyRules: [
197
- "Message text uses font-weight Regular (400) at the size-appropriate body scale",
198
- "Action text uses font-weight Medium (500) with underline decoration for link-style affordance",
199
- "Text uses sentence case — 'System maintenance scheduled', not 'System Maintenance Scheduled'",
200
- "Single-line only — message text must not wrap; truncate with ellipsis if it exceeds available width",
201
- "On mobile, message may wrap to two lines maximum; action moves below the message if space is tight",
202
- ],
203
-
204
- interactionRules: [
205
- { event: "Click Dismiss", trigger: "pointerup on dismiss (X) button", action: "Fire onDismiss callback; animate banner out; remove from layout flow" },
206
- { event: "Click Action", trigger: "pointerup on inline action button/link", action: "Fire onAction callback; banner may remain visible or dismiss depending on implementation" },
207
- { event: "Hover Dismiss", trigger: "pointerenter on dismiss button", action: "Darken dismiss button background; show pointer cursor" },
208
- { event: "Hover Action", trigger: "pointerenter on action element", action: "Show underline or darken action text for link-style hover feedback" },
209
- { event: "Focus Dismiss", trigger: "Tab key focuses dismiss button", action: "Show focus ring on dismiss button; announce 'Close' or 'Dismiss banner'" },
210
- { event: "Focus Action", trigger: "Tab key focuses action element", action: "Show focus ring on action; announce the action label" },
211
- { event: "Enter / Space", trigger: "Enter or Space on focused dismiss or action", action: "Fire the same handler as a click on that element" },
212
- { event: "Auto-Dismiss Timer", trigger: "Optional timer expires for non-critical banners", action: "Banner auto-dismisses with exit animation; never auto-dismiss error banners" },
213
- { event: "Page Scroll", trigger: "User scrolls the page with a top/bottom-fixed banner", action: "Banner remains fixed in its viewport position; content scrolls behind it" },
214
- ],
215
-
216
- contentGuidance: [
217
- "Banner messages should be one concise sentence — get to the point immediately",
218
- "Include an action when the user can do something about the message — 'Upgrade now', 'View details', 'Retry'",
219
- "Use the appropriate type for the message severity — info for neutral updates, warning for potential issues, error for failures",
220
- "Banner is distinct from Alert: banners are full-width and pinned to an edge; alerts are inline content-level components",
221
- "Do not use banners for transient success feedback — use a Toast for ephemeral notifications",
222
- "Error banners should not be dismissible unless the user can take an action to resolve the issue",
223
- "System maintenance or downtime announcements are ideal use cases for persistent info banners",
224
- "Warning banners should clearly state the consequence of inaction — 'Your trial expires in 3 days' is better than 'Trial ending soon'",
225
- ],
226
-
227
- responsiveBehaviour: [
228
- { breakpoint: "Mobile (<768px)", behavior: "Message text may wrap to two lines; action moves below message; dismiss button remains in top-right corner; min-height increases to accommodate wrapping" },
229
- { breakpoint: "Tablet (768-1023px)", behavior: "Single-line layout with message, action, and dismiss in one row; standard padding" },
230
- { breakpoint: "Desktop (1024-1439px)", behavior: "Full-width banner with ample horizontal space; all elements in a single row" },
231
- { breakpoint: "Ultra-wide (>=1440px)", behavior: "Banner content may be constrained to a max-width container centered within the full-width background" },
232
- ],
233
-
234
- accessibilitySpec: {
235
- intro:
236
- "Banners are system-level notifications that must be announced to assistive technologies appropriately based on their urgency level. Error and warning banners use role='alert' for assertive announcement; info and success use role='status' for polite announcement.",
237
- requirements: [
238
- { requirement: "ARIA Role", level: "A", notes: "Use role='alert' for error/warning banners (assertive); role='status' for info/success banners (polite)" },
239
- { requirement: "ARIA Live", level: "A", notes: "role='alert' implies aria-live='assertive'; role='status' implies aria-live='polite' — do not duplicate" },
240
- { requirement: "Dismiss Button Label", level: "A", notes: "Dismiss button must have aria-label='Dismiss banner' or 'Close notification' — the X icon alone is not sufficient" },
241
- { requirement: "Focus Management", level: "A", notes: "After dismissal, focus should move to the next logical element — not get lost in the DOM" },
242
- { requirement: "Keyboard Accessible", level: "A", notes: "Action and dismiss buttons must be reachable via Tab and activatable with Enter/Space" },
243
- { requirement: "Contrast Ratio", level: "AA", notes: "Message text must meet 4.5:1 contrast against the type-specific background; icon must meet 3:1 non-text contrast" },
244
- { requirement: "Touch Target", level: "AA", notes: "Dismiss button and action must have 44x44px minimum touch area" },
245
- { requirement: "No Auto-Dismiss for Errors", level: "A", notes: "Error banners must never auto-dismiss — users need time to read and act on critical information" },
246
- { requirement: "Content Shift", level: "AA", notes: "Banner entry/exit must not cause unexpected content shift — use smooth height animation" },
247
- { requirement: "Motion Preference", level: "AAA", notes: "Entry/exit animations must respect prefers-reduced-motion; fall back to instant show/hide" },
248
- ],
249
- outro: [
250
- "Test with screen readers to verify that role='alert' banners interrupt the current announcement and role='status' banners wait for a pause",
251
- "Ensure that multiple stacked banners are announced in a logical order — newest first or most critical first",
252
- "Verify that focus is not trapped on the banner — Tab must be able to move past it to page content",
253
- ],
254
- },
255
-
256
- qaAcceptanceCriteria: [
257
- { check: "Type Variants", platform: "All", expectedResult: "Info (blue), success (green), warning (amber), error (red) render with correct colors and icons" },
258
- { check: "Dismiss Button", platform: "Web", expectedResult: "Clicking X dismisses the banner with exit animation; fires onDismiss callback" },
259
- { check: "Action Button", platform: "Web", expectedResult: "Clicking action fires onAction callback; action shows hover/focus states" },
260
- { check: "Persistent Mode", platform: "All", expectedResult: "When persistent is true, dismiss button is hidden and banner cannot be closed" },
261
- { check: "Position Top", platform: "Web", expectedResult: "Banner is fixed to viewport top; content scrolls behind it; no overlap with content" },
262
- { check: "Position Bottom", platform: "Web", expectedResult: "Banner is fixed to viewport bottom; content scrolls behind it" },
263
- { check: "Position Inline", platform: "Web", expectedResult: "Banner renders in document flow; pushes content below it down" },
264
- { check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab focuses action then dismiss; Enter/Space activates both; focus ring visible" },
265
- { check: "Screen Reader (Alert)", platform: "Web", expectedResult: "Error/warning banners interrupt current announcement via role='alert'" },
266
- { check: "Screen Reader (Status)", platform: "Web", expectedResult: "Info/success banners announced politely via role='status'" },
267
- { check: "Entry Animation", platform: "Web", expectedResult: "Banner slides/fades in smoothly; no layout jump; respects reduced-motion preference" },
268
- { check: "Exit Animation", platform: "Web", expectedResult: "Banner slides/fades out; container collapses height; no orphaned whitespace" },
269
- { check: "Contrast", platform: "All", expectedResult: "All text meets 4.5:1 contrast against the type-specific background fill" },
270
- { check: "RTL Support", platform: "Web", expectedResult: "Icon moves to right; dismiss button moves to left; text alignment mirrors" },
271
- { check: "Stacked Banners", platform: "Web", expectedResult: "Multiple banners stack vertically with no gap; each individually dismissible" },
272
- ],
273
-
274
- dos: [
275
- "Use banners for system-level messages that apply to the entire page or application context",
276
- "Choose the correct type (info/success/warning/error) based on the message severity",
277
- "Provide an inline action when the user can take steps to address the message",
278
- "Use role='alert' for urgent messages (error, warning) and role='status' for informational ones",
279
- "Make error banners persistent — they should not auto-dismiss or be easily closed without resolution",
280
- "Keep banner messages to one sentence — be concise and direct about what happened and what to do",
281
- "Ensure smooth entry/exit animations that do not cause unexpected content shift",
282
- ],
283
-
284
- donts: [
285
- "Do not use banners for transient success feedback — use a Toast for ephemeral notifications instead",
286
- "Do not auto-dismiss error or warning banners — users need time to read and act on critical information",
287
- "Do not stack more than 3 banners simultaneously — consolidate messages or use a notification center",
288
- "Do not use banners for in-context validation messages — use inline form errors or Alert components",
289
- "Do not place banners inside cards, modals, or other contained components — banners are page-level elements",
290
- "Do not remove the leading icon — it provides an essential visual cue about the message severity",
291
- "Do not use the same banner type for all messages — differentiate severity with appropriate color coding",
292
- ],
293
- };
@@ -1,240 +0,0 @@
1
- /**
2
- * breadcrumb.ts — Gold-standard design knowledge for Breadcrumb components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const breadcrumbKnowledge: ComponentKnowledge = {
7
- description:
8
- "Secondary navigation pattern | Shows page hierarchy | Aids wayfinding and backtracking",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Default",
13
- visualChange: "Link items displayed in standard text color with separator between each item",
14
- opacity: "1",
15
- cursorWeb: "pointer",
16
- usage: "Resting state — breadcrumb trail is visible and link items are interactive",
17
- },
18
- {
19
- state: "Hover",
20
- visualChange: "Hovered link item underlines and shifts to the $breadcrumb-hover token color",
21
- opacity: "1",
22
- cursorWeb: "pointer",
23
- usage: "Mouse cursor enters a breadcrumb link's hit area",
24
- },
25
- {
26
- state: "Current Page",
27
- visualChange: "Last item rendered in $breadcrumb-text-current token; no underline; non-interactive",
28
- opacity: "1",
29
- cursorWeb: "default",
30
- usage: "Represents the user's current location in the hierarchy — must not be a link",
31
- },
32
- {
33
- state: "Focus",
34
- visualChange: "2px focus ring offset by 2px from the link text, using $focus-ring token",
35
- opacity: "1",
36
- cursorWeb: "pointer",
37
- usage: "A breadcrumb link receives keyboard focus via Tab key or programmatic focus call",
38
- },
39
- {
40
- state: "Disabled",
41
- visualChange: "All link items switch to muted/disabled tokens; separators remain visible",
42
- opacity: "0.4",
43
- cursorWeb: "not-allowed",
44
- usage: "Breadcrumb trail is contextually unavailable (e.g. during page transition or loading)",
45
- },
46
- {
47
- state: "Truncated",
48
- visualChange: "Middle items collapse into an ellipsis button; first and last N items remain visible",
49
- opacity: "1",
50
- cursorWeb: "pointer",
51
- usage: "Path exceeds maxItems threshold — truncation prevents overflow in constrained layouts",
52
- },
53
- ],
54
-
55
- propertyDescriptions: {
56
- items: "Ordered array of breadcrumb entries, each containing a label and optional href; last item is treated as current page",
57
- separator: "Visual divider between breadcrumb items — slash (/), chevron (›), or arrow (→); defaults to slash",
58
- maxItems: "Maximum number of visible items before truncation collapses middle items into an ellipsis menu",
59
- size: "Dimensional preset controlling height, font-size, and separator size (Small, Medium, Large)",
60
- ariaLabel: "Accessible label for the <nav> element; defaults to 'Breadcrumb' if not specified",
61
- showHomeIcon: "When true, the first breadcrumb item displays a home icon instead of or alongside its text label",
62
- collapsed: "When true, the breadcrumb renders in its truncated state regardless of item count",
63
- onNavigate: "Callback fired when a breadcrumb link is activated; receives the item index and href",
64
- },
65
-
66
- sizeSpecifications: [
67
- {
68
- size: "Small",
69
- height: "28px",
70
- paddingLR: "4px",
71
- fontSize: "12px",
72
- iconSize: "14px",
73
- borderRadius: "4px",
74
- },
75
- {
76
- size: "Medium",
77
- height: "32px",
78
- paddingLR: "6px",
79
- fontSize: "14px",
80
- iconSize: "16px",
81
- borderRadius: "6px",
82
- },
83
- {
84
- size: "Large",
85
- height: "40px",
86
- paddingLR: "8px",
87
- fontSize: "16px",
88
- iconSize: "20px",
89
- borderRadius: "8px",
90
- },
91
- ],
92
-
93
- designTokenBindings: [
94
- {
95
- property: "Link Text Color",
96
- tokenName: "$breadcrumb-text",
97
- role: "Default text color for interactive breadcrumb links",
98
- fallback: "#2563EB",
99
- },
100
- {
101
- property: "Current Page Text",
102
- tokenName: "$breadcrumb-text-current",
103
- role: "Text color for the non-interactive current-page item",
104
- fallback: "#1D2939",
105
- },
106
- {
107
- property: "Separator Color",
108
- tokenName: "$breadcrumb-separator",
109
- role: "Color of the divider character or icon between items",
110
- fallback: "#98A2B3",
111
- },
112
- {
113
- property: "Hover Color",
114
- tokenName: "$breadcrumb-hover",
115
- role: "Text color applied to link items on hover",
116
- fallback: "#1D4ED8",
117
- },
118
- {
119
- property: "Focus Ring",
120
- tokenName: "$focus-ring",
121
- role: "Keyboard focus indicator ring for breadcrumb links",
122
- fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
123
- },
124
- {
125
- property: "Font Family",
126
- tokenName: "$font-family-sans",
127
- role: "Breadcrumb text typeface",
128
- fallback: "Inter, system-ui, sans-serif",
129
- },
130
- {
131
- property: "Font Weight",
132
- tokenName: "$font-weight-regular",
133
- role: "Link weight — regular for subordinate navigation hierarchy",
134
- fallback: "400",
135
- },
136
- {
137
- property: "Spacing",
138
- tokenName: "$spacing-xs",
139
- role: "Horizontal gap between a breadcrumb item and its adjacent separator",
140
- fallback: "4px",
141
- },
142
- ],
143
-
144
- structureRules: [
145
- "Wrapper is a <nav> element with aria-label='Breadcrumb' containing an <ol> of <li> items",
146
- "Each <li> contains either an <a> element (navigable item) or a <span> (current page)",
147
- "Separators are placed between items using CSS ::before pseudo-elements or dedicated <span> elements with aria-hidden='true'",
148
- "Container uses horizontal Auto Layout (flexbox) with center vertical alignment and wrapping disabled",
149
- "Truncated state inserts an ellipsis button (<button>) that expands to reveal hidden items on click",
150
- "Touch target for each link is at least 44x28px regardless of visual text size (add transparent padding if needed)",
151
- "The current-page item is always the last item and must never be wrapped in an anchor tag",
152
- ],
153
-
154
- typeHierarchyRules: [
155
- "Font weight is Regular (400) for link items; Medium (500) for the current-page item",
156
- "Text uses sentence case for labels — match the page title exactly as it appears in navigation",
157
- "Link items display underline on hover only — no permanent underline in default state",
158
- "Single-line only; individual items truncate with ellipsis if they exceed a maximum character width",
159
- "Separator characters use the same font-size as the breadcrumb text but inherit separator color token",
160
- ],
161
-
162
- interactionRules: [
163
- { event: "Click / Tap", trigger: "pointerup on a breadcrumb link", action: "Navigate to the corresponding page; fire onNavigate callback" },
164
- { event: "Hover", trigger: "pointerenter on a link item", action: "Apply underline decoration and transition to $breadcrumb-hover color" },
165
- { event: "Focus", trigger: "Tab key or focus()", action: "Show focus ring around the link item; do not trigger navigation" },
166
- { event: "Blur", trigger: "Focus moves away from a link", action: "Remove focus ring" },
167
- { event: "Keydown Enter", trigger: "Enter key while a link is focused", action: "Navigate to the link destination (same as click)" },
168
- { event: "Ellipsis Click", trigger: "Click on the truncation ellipsis button", action: "Expand hidden items inline or show a dropdown menu of collapsed items" },
169
- { event: "Escape on Ellipsis Menu", trigger: "Escape key while ellipsis dropdown is open", action: "Close dropdown and return focus to the ellipsis button" },
170
- ],
171
-
172
- contentGuidance: [
173
- "Labels should match the page title exactly — do not abbreviate or paraphrase navigation labels",
174
- "Keep labels concise (1-3 words preferred); long labels should be truncated with ellipsis at the item level",
175
- "Always include a root/home item as the first breadcrumb entry",
176
- "Do not include the current page as a link — it must be non-interactive text",
177
- "Avoid deeply nested breadcrumbs (more than 5 levels); use truncation with maxItems instead",
178
- "Separators should be purely decorative — never use interactive separators",
179
- ],
180
-
181
- responsiveBehaviour: [
182
- { breakpoint: "Mobile (<768px)", behavior: "Show only the parent page as a back-link or truncate to first and last items with ellipsis" },
183
- { breakpoint: "Tablet (768-1023px)", behavior: "Show up to 3-4 items; truncate middle items with ellipsis if path is deeper" },
184
- { breakpoint: "Desktop (1024-1439px)", behavior: "Full breadcrumb trail visible; truncation only if maxItems is explicitly exceeded" },
185
- { breakpoint: "Ultra-wide (>=1440px)", behavior: "Full trail visible; breadcrumb width is constrained to content area — does not stretch with viewport" },
186
- ],
187
-
188
- accessibilitySpec: {
189
- intro:
190
- "Breadcrumbs are a critical wayfinding aid. Proper semantic structure ensures screen reader users can navigate the page hierarchy efficiently.",
191
- requirements: [
192
- { requirement: "Navigation Landmark", level: "A", notes: "Wrap in <nav> with aria-label='Breadcrumb' to create a distinct navigation landmark" },
193
- { requirement: "List Structure", level: "A", notes: "Use <ol>/<li> to convey the ordered hierarchy; screen readers announce item count and position" },
194
- { requirement: "Current Page", level: "A", notes: "Last item must have aria-current='page' so assistive tech announces it as the current location" },
195
- { requirement: "Separator Hidden", level: "A", notes: "All separator characters/icons must have aria-hidden='true' to prevent redundant announcements" },
196
- { requirement: "Focusable Links", level: "A", notes: "All navigable items must be reachable via Tab key; current-page item is not focusable" },
197
- { requirement: "Contrast Ratio", level: "AA", notes: "Link text to background: 4.5:1 minimum; separator to background: 3:1 non-text contrast" },
198
- { requirement: "Truncation Accessible", level: "AA", notes: "Ellipsis button must have aria-label='Show more breadcrumbs' and expanded state must be announced" },
199
- ],
200
- outro: [
201
- "Ensure the breadcrumb nav landmark is distinguishable from the primary navigation landmark",
202
- "When items are dynamically loaded, announce updates via aria-live or manage focus to the new content",
203
- ],
204
- },
205
-
206
- qaAcceptanceCriteria: [
207
- { check: "Visual Regression", platform: "All", expectedResult: "Breadcrumb renders pixel-perfect against baseline for each size and separator variant" },
208
- { check: "Hover State", platform: "Web", expectedResult: "Link underline and color transition appear smoothly on mouse enter/leave" },
209
- { check: "Current Page", platform: "All", expectedResult: "Last item is visually distinct, non-interactive, and has aria-current='page'" },
210
- { check: "Focus State", platform: "Web", expectedResult: "Focus ring visible on Tab for each link; current-page item is skipped in tab order" },
211
- { check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab moves through links in order; Enter activates navigation; no tab trap" },
212
- { check: "Screen Reader", platform: "Web", expectedResult: "Announces 'Breadcrumb navigation', list of N items, and current page designation" },
213
- { check: "Truncation", platform: "Web", expectedResult: "Middle items collapse when count exceeds maxItems; ellipsis button expands them" },
214
- { check: "Separator a11y", platform: "Web", expectedResult: "Separators are aria-hidden and not announced by screen readers" },
215
- { check: "Mobile Responsive", platform: "Mobile", expectedResult: "Breadcrumb collapses to back-link or truncated form on small viewports" },
216
- { check: "RTL Support", platform: "Web", expectedResult: "Item order and separator direction reverse correctly in RTL locales" },
217
- { check: "Contrast", platform: "All", expectedResult: "All link and separator colors pass 4.5:1 text and 3:1 non-text contrast ratios" },
218
- { check: "Long Labels", platform: "All", expectedResult: "Items with long text truncate with ellipsis; no line wrapping occurs" },
219
- ],
220
-
221
- dos: [
222
- "Use breadcrumbs to reflect the site hierarchy — not the user's browsing history",
223
- "Always include the root/home page as the first item in the trail",
224
- "Mark the current page with aria-current='page' and render it as non-interactive text",
225
- "Use a consistent separator throughout the breadcrumb trail",
226
- "Place breadcrumbs near the top of the content area, below the primary navigation",
227
- "Use truncation (maxItems) for deep hierarchies instead of allowing overflow",
228
- "Ensure each link label matches the destination page's title exactly",
229
- ],
230
-
231
- donts: [
232
- "Do not make the current-page item a clickable link — it reloads the same page unnecessarily",
233
- "Do not use breadcrumbs as the sole navigation method — they are supplementary",
234
- "Do not use breadcrumbs for flat site structures with no meaningful hierarchy",
235
- "Do not include decorative separators in the accessible tree — always use aria-hidden",
236
- "Do not abbreviate or truncate labels inconsistently across the trail",
237
- "Do not allow breadcrumbs to wrap to multiple lines — truncate or collapse instead",
238
- "Do not use breadcrumbs to represent multi-step wizard progress — use a stepper component",
239
- ],
240
- };