@sarjallab09/figma-intelligence 1.1.0 → 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 -2505
  27. package/figma-bridge-plugin/chat-runner.js +0 -485
  28. package/figma-bridge-plugin/code.js +0 -1534
  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 -645
  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 -4542
  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 -1418
  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,238 +0,0 @@
1
- /**
2
- * grid.ts — Gold-standard design knowledge for Grid layout components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const gridKnowledge: ComponentKnowledge = {
7
- description:
8
- "CSS Grid-based layout container | Structures content in rows and columns | Purely presentational with no interactive states",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Default",
13
- visualChange: "Grid container renders its children according to the configured column, gap, and alignment properties; no visible chrome",
14
- opacity: "1",
15
- cursorWeb: "default",
16
- usage: "Only state — the grid is a passive structural container with no interactive or visual state changes",
17
- },
18
- {
19
- state: "Empty",
20
- visualChange: "Grid container renders with no children; may collapse to zero height or show a minimum height placeholder depending on implementation",
21
- opacity: "1",
22
- cursorWeb: "default",
23
- usage: "No content has been placed in the grid — container remains in the DOM for layout stability",
24
- },
25
- {
26
- state: "Loading",
27
- visualChange: "Grid cells display skeleton placeholders in the configured layout pattern to maintain visual structure during data fetch",
28
- opacity: "0.6",
29
- cursorWeb: "default",
30
- usage: "Child content is being loaded — skeleton cells preview the eventual layout",
31
- },
32
- ],
33
-
34
- propertyDescriptions: {
35
- columns: "Number of equal-width columns in the grid — integer from 1 to 12; maps to CSS grid-template-columns: repeat(N, 1fr)",
36
- gap: "Spacing between grid cells — Small (8px), Medium (16px), or Large (24px); applies equally to row and column gaps",
37
- rowGap: "Overrides the vertical gap between grid rows independently of the column gap; useful for asymmetric spacing",
38
- columnGap: "Overrides the horizontal gap between grid columns independently of the row gap",
39
- alignItems: "Vertical alignment of items within their grid cells — start, center, end, stretch (default stretch)",
40
- justifyItems: "Horizontal alignment of items within their grid cells — start, center, end, stretch (default stretch)",
41
- responsive: "When true the grid automatically reduces columns at smaller breakpoints following the responsive rules",
42
- minColumnWidth: "Minimum width for each column before the grid reflows to fewer columns — alternative to fixed column count",
43
- autoRows: "Height of implicitly created rows — 'auto' (content-sized) or a fixed value like '200px' or 'minmax(100px, auto)'",
44
- templateAreas: "Named grid areas for semantic placement of children — maps to CSS grid-template-areas property",
45
- fullBleed: "When true the grid spans the full viewport width, breaking out of its parent container constraints",
46
- dense: "When true enables CSS grid auto-flow: dense to fill gaps left by items spanning multiple columns",
47
- },
48
-
49
- sizeSpecifications: [
50
- {
51
- size: "Small Gap",
52
- height: "N/A (container)",
53
- paddingLR: "0px",
54
- fontSize: "N/A",
55
- iconSize: "N/A",
56
- borderRadius: "0px",
57
- },
58
- {
59
- size: "Medium Gap",
60
- height: "N/A (container)",
61
- paddingLR: "0px",
62
- fontSize: "N/A",
63
- iconSize: "N/A",
64
- borderRadius: "0px",
65
- },
66
- {
67
- size: "Large Gap",
68
- height: "N/A (container)",
69
- paddingLR: "0px",
70
- fontSize: "N/A",
71
- iconSize: "N/A",
72
- borderRadius: "0px",
73
- },
74
- ],
75
-
76
- designTokenBindings: [
77
- {
78
- property: "Gap Small",
79
- tokenName: "$spacing-sm",
80
- role: "8px gap between grid cells in the small gap preset",
81
- fallback: "8px",
82
- },
83
- {
84
- property: "Gap Medium",
85
- tokenName: "$spacing-md",
86
- role: "16px gap between grid cells in the medium gap preset",
87
- fallback: "16px",
88
- },
89
- {
90
- property: "Gap Large",
91
- tokenName: "$spacing-lg",
92
- role: "24px gap between grid cells in the large gap preset",
93
- fallback: "24px",
94
- },
95
- {
96
- property: "Gap Extra-Large",
97
- tokenName: "$spacing-xl",
98
- role: "32px gap between grid cells for wide-spacing layouts",
99
- fallback: "32px",
100
- },
101
- {
102
- property: "Page Margin",
103
- tokenName: "$grid-page-margin",
104
- role: "Horizontal margin between the grid container and the viewport edge",
105
- fallback: "24px",
106
- },
107
- {
108
- property: "Max Width",
109
- tokenName: "$grid-max-width",
110
- role: "Maximum width of the grid container — prevents overly wide layouts on ultra-wide screens",
111
- fallback: "1280px",
112
- },
113
- {
114
- property: "Breakpoint SM",
115
- tokenName: "$breakpoint-sm",
116
- role: "Small breakpoint threshold for responsive column reduction",
117
- fallback: "640px",
118
- },
119
- {
120
- property: "Breakpoint MD",
121
- tokenName: "$breakpoint-md",
122
- role: "Medium breakpoint threshold for responsive column reduction",
123
- fallback: "768px",
124
- },
125
- {
126
- property: "Breakpoint LG",
127
- tokenName: "$breakpoint-lg",
128
- role: "Large breakpoint threshold for responsive column count",
129
- fallback: "1024px",
130
- },
131
- {
132
- property: "Breakpoint XL",
133
- tokenName: "$breakpoint-xl",
134
- role: "Extra-large breakpoint threshold where the full column count applies",
135
- fallback: "1280px",
136
- },
137
- ],
138
-
139
- structureRules: [
140
- "Grid container is a block-level element using display: grid — never display: flex for grid layouts",
141
- "Columns are defined via grid-template-columns: repeat(N, 1fr) where N is the columns property value",
142
- "Gap applies to both row-gap and column-gap equally unless rowGap or columnGap overrides are provided",
143
- "Grid children can span multiple columns using gridColumn: span N — the grid adjusts row wrapping accordingly",
144
- "Page margin is applied as horizontal padding on the grid container — content stays within the maxWidth boundary",
145
- "The grid container centers itself within its parent when maxWidth is less than available width using margin: 0 auto",
146
- "Full-bleed items break out of the grid margin using negative margins equal to the page margin value",
147
- "When responsive is true, the grid uses CSS clamp() or media queries to reduce columns at smaller viewports",
148
- "Grid does not have visible borders, backgrounds, or decoration — it is purely a structural layout primitive",
149
- ],
150
-
151
- typeHierarchyRules: [
152
- "Grid does not impose typography rules — child components manage their own text styling",
153
- "Headings within grid cells should follow the page's heading hierarchy — do not skip levels (h1 > h2 > h3)",
154
- "Card titles in a grid should all be the same heading level for semantic consistency within the grid",
155
- "Text alignment within grid cells should align with the justifyItems property for visual consistency",
156
- ],
157
-
158
- interactionRules: [
159
- { event: "Resize Viewport", trigger: "Browser window resize event", action: "Reflow grid columns according to responsive breakpoint rules; gap values remain constant" },
160
- { event: "Content Overflow", trigger: "Child content exceeds cell bounds", action: "Cell stretches vertically to accommodate content; sibling cells in the same row align accordingly" },
161
- { event: "Column Span", trigger: "Child element specifies gridColumn: span N", action: "Item spans N columns; subsequent items reflow around it" },
162
- { event: "Dense Packing", trigger: "dense property enabled with variable-span items", action: "Grid auto-placement fills gaps left by spanning items, reducing whitespace" },
163
- { event: "Skeleton Load", trigger: "Data loading for grid children", action: "Skeleton placeholder cells render in the grid layout maintaining the expected visual structure" },
164
- ],
165
-
166
- contentGuidance: [
167
- "Use the grid for page-level layout, card grids, image galleries, and any repeating content arrangement",
168
- "Choose column counts that create comfortable reading widths — 3-4 columns for cards, 2 columns for content-heavy layouts",
169
- "Maintain consistent gap sizes across grids within the same page for visual rhythm",
170
- "Avoid deeply nesting grids inside grids — one level of nesting is acceptable; two levels indicate overengineering",
171
- "Use named grid areas (templateAreas) for complex page layouts where semantic placement is more readable than numeric spans",
172
- "Grid is a layout primitive — it should not contain application logic or manage component state",
173
- "For single-dimension layouts (a row of items or a column of items), prefer Flexbox over Grid",
174
- ],
175
-
176
- responsiveBehaviour: [
177
- { breakpoint: "Mobile (<640px)", behavior: "Grid collapses to 1 column; all items stack vertically; gap remains consistent; page margin reduces to 16px" },
178
- { breakpoint: "Small Tablet (640-767px)", behavior: "Grid uses 2 columns for content that was 3+ columns; gap and alignment maintained" },
179
- { breakpoint: "Tablet (768-1023px)", behavior: "Grid uses approximately half the desktop column count (e.g., 6-column becomes 3-column)" },
180
- { breakpoint: "Desktop (1024-1279px)", behavior: "Grid uses the full specified column count; page margins and max-width apply normally" },
181
- { breakpoint: "Ultra-wide (>=1280px)", behavior: "Grid container width capped at maxWidth; centered on the viewport with auto margins" },
182
- ],
183
-
184
- accessibilitySpec: {
185
- intro:
186
- "Grid is a purely structural layout component with no interactive role. Accessibility concerns are limited to ensuring the DOM order matches visual order and that grid children are properly accessible.",
187
- requirements: [
188
- { requirement: "No ARIA Role", level: "A", notes: "Grid containers should not use role='grid' — that ARIA role is for interactive data grids (tables); layout grids use no role" },
189
- { requirement: "DOM Order", level: "A", notes: "Visual order of grid items must match DOM order — CSS grid ordering (order property) must not break reading/tab sequence" },
190
- { requirement: "Heading Hierarchy", level: "A", notes: "Headings within grid cells must follow the page heading hierarchy — no skipping levels" },
191
- { requirement: "Landmark Nesting", level: "A", notes: "Grid cells containing landmarks (nav, main, aside) must follow proper landmark nesting rules" },
192
- { requirement: "Content Reflow", level: "AA", notes: "At 400% zoom grid must reflow to a single column without horizontal scrolling (WCAG 1.4.10)" },
193
- { requirement: "Focus Order", level: "A", notes: "Tab order through grid children must follow a logical reading sequence (left-to-right, top-to-bottom for LTR)" },
194
- { requirement: "Spacing for Readability", level: "AAA", notes: "Gap spacing should allow clear visual separation between items for users with cognitive disabilities" },
195
- ],
196
- outro: [
197
- "Verify that CSS grid ordering (order, grid-row, grid-column) does not create a disconnect between DOM and visual order",
198
- "Test at 200% and 400% zoom to ensure content reflows gracefully without overflow or overlap",
199
- "Ensure that screen readers traverse grid children in the intended reading order",
200
- ],
201
- },
202
-
203
- qaAcceptanceCriteria: [
204
- { check: "Column Count", platform: "Web", expectedResult: "Grid renders the specified number of equal-width columns with correct fr units" },
205
- { check: "Gap Spacing", platform: "Web", expectedResult: "Row and column gaps match the specified token value (8/16/24px)" },
206
- { check: "Responsive Reflow", platform: "Web", expectedResult: "Grid reduces columns at each breakpoint threshold; single column on mobile" },
207
- { check: "Column Span", platform: "Web", expectedResult: "Items with gridColumn: span N correctly span multiple columns and reflow neighbors" },
208
- { check: "Alignment", platform: "Web", expectedResult: "alignItems and justifyItems correctly position children within their cells" },
209
- { check: "Max Width", platform: "Web", expectedResult: "Grid container does not exceed maxWidth; centers within viewport on ultra-wide screens" },
210
- { check: "Dense Packing", platform: "Web", expectedResult: "With dense enabled, gaps left by spanning items are filled by subsequent items" },
211
- { check: "DOM Order", platform: "Web", expectedResult: "Tab order matches visual order — no visual/DOM order mismatch" },
212
- { check: "Zoom Reflow", platform: "Web", expectedResult: "At 400% zoom grid reflows to single column without horizontal scrollbar" },
213
- { check: "Skeleton Loading", platform: "Web", expectedResult: "Skeleton placeholders render in the correct grid layout positions" },
214
- { check: "RTL Support", platform: "Web", expectedResult: "Grid items flow right-to-left in RTL locales; alignment properties mirror correctly" },
215
- { check: "Empty State", platform: "Web", expectedResult: "Empty grid renders without errors; may show minimum height or collapse gracefully" },
216
- { check: "Visual Regression", platform: "All", expectedResult: "Grid layout renders pixel-perfect against baseline for each column/gap configuration" },
217
- ],
218
-
219
- dos: [
220
- "Use Grid for two-dimensional layouts — rows and columns working together",
221
- "Choose gap sizes from the spacing token scale for visual consistency with the rest of the design system",
222
- "Use responsive breakpoints to reduce column counts progressively on smaller screens",
223
- "Set a maxWidth on the grid container to prevent overly wide layouts on ultra-wide monitors",
224
- "Use named grid areas for complex page-level layouts with semantically meaningful region names",
225
- "Ensure DOM order matches visual order — avoid CSS order property when it breaks the reading sequence",
226
- "Constrain the grid container with page margins that follow the design system spacing scale",
227
- ],
228
-
229
- donts: [
230
- "Do not use role='grid' on layout grids — role='grid' is reserved for interactive data grids and tables",
231
- "Do not nest grids more than one level deep — flatten the layout or reconsider the information architecture",
232
- "Do not use CSS grid for simple single-row or single-column layouts — use Flexbox instead",
233
- "Do not use the CSS order property in ways that create a mismatch between visual and DOM/tab order",
234
- "Do not apply decorative styles (backgrounds, borders, shadows) to the grid container itself — it is invisible chrome",
235
- "Do not hardcode pixel widths for columns — use fractional units (1fr) for fluid, responsive behavior",
236
- "Do not allow grid content to cause horizontal scrolling at any supported viewport width or zoom level",
237
- ],
238
- };
@@ -1,255 +0,0 @@
1
- /**
2
- * icon.ts — Gold-standard design knowledge for Icon components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const iconKnowledge: ComponentKnowledge = {
7
- description:
8
- "Vector graphic primitive | Visual symbol | Non-interactive glyph used across all other components",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Default",
13
- visualChange: "Icon renders at specified size and color with full opacity",
14
- opacity: "1",
15
- cursorWeb: "default",
16
- usage: "Standard icon display — inherits color from parent or uses explicit override",
17
- },
18
- {
19
- state: "Disabled",
20
- visualChange: "Icon color shifts to disabled token; reduced opacity inherited from parent",
21
- opacity: "0.4",
22
- cursorWeb: "not-allowed",
23
- usage: "Parent component is disabled — icon reflects that state passively",
24
- },
25
- {
26
- state: "Decorative",
27
- visualChange: "Visually identical to Default but semantically hidden from assistive technology",
28
- opacity: "1",
29
- cursorWeb: "default",
30
- usage: "Icon is purely ornamental and conveys no meaning beyond the adjacent text",
31
- },
32
- {
33
- state: "Informative",
34
- visualChange: "Visually identical to Default but carries an accessible label for screen readers",
35
- opacity: "1",
36
- cursorWeb: "default",
37
- usage: "Icon conveys meaning on its own without adjacent text — requires aria-label",
38
- },
39
- {
40
- state: "Inherited Hover",
41
- visualChange: "Icon color may shift when parent element enters hover state — not self-triggered",
42
- opacity: "1",
43
- cursorWeb: "pointer",
44
- usage: "Parent interactive element is hovered — icon inherits the color change",
45
- },
46
- {
47
- state: "Inherited Focus",
48
- visualChange: "No visual change on the icon itself — focus ring is on the parent element",
49
- opacity: "1",
50
- cursorWeb: "default",
51
- usage: "Parent interactive element is focused — icon remains visually unchanged",
52
- },
53
- {
54
- state: "High Contrast",
55
- visualChange: "Icon color overridden to system foreground color in forced-colors mode",
56
- opacity: "1",
57
- cursorWeb: "default",
58
- usage: "Windows High Contrast Mode — icon must remain visible against system background",
59
- },
60
- ],
61
-
62
- propertyDescriptions: {
63
- name: "Icon identifier matching the icon library glyph name (e.g., 'close', 'chevron-down', 'search')",
64
- size: "Dimensional preset controlling the icon's width and height — xs through xl",
65
- color: "Explicit color override; when omitted, the icon inherits currentColor from its parent",
66
- decorative: "Boolean flag — when true, icon is aria-hidden and excluded from the accessibility tree",
67
- label: "Accessible label for meaningful (non-decorative) icons — sets aria-label on the SVG element",
68
- type: "Visual style variant — filled (solid shapes) or outlined (stroke-based paths)",
69
- className: "Optional CSS class for custom styling overrides on the SVG wrapper element",
70
- rotate: "Rotation angle in degrees — used for directional icons (chevrons, arrows) without needing separate glyphs",
71
- flip: "Horizontal or vertical mirror — used for RTL layout support or directional variations",
72
- },
73
-
74
- sizeSpecifications: [
75
- {
76
- size: "Extra Small (xs)",
77
- height: "16px",
78
- paddingLR: "0px",
79
- fontSize: "N/A",
80
- iconSize: "16px",
81
- borderRadius: "0px",
82
- },
83
- {
84
- size: "Small (sm)",
85
- height: "20px",
86
- paddingLR: "0px",
87
- fontSize: "N/A",
88
- iconSize: "20px",
89
- borderRadius: "0px",
90
- },
91
- {
92
- size: "Medium (md)",
93
- height: "24px",
94
- paddingLR: "0px",
95
- fontSize: "N/A",
96
- iconSize: "24px",
97
- borderRadius: "0px",
98
- },
99
- {
100
- size: "Large (lg)",
101
- height: "32px",
102
- paddingLR: "0px",
103
- fontSize: "N/A",
104
- iconSize: "32px",
105
- borderRadius: "0px",
106
- },
107
- {
108
- size: "Extra Large (xl)",
109
- height: "40px",
110
- paddingLR: "0px",
111
- fontSize: "N/A",
112
- iconSize: "40px",
113
- borderRadius: "0px",
114
- },
115
- ],
116
-
117
- designTokenBindings: [
118
- {
119
- property: "Default Color",
120
- tokenName: "color/semantic/icon/default",
121
- role: "Inherited icon color when no explicit override is set — maps to currentColor",
122
- fallback: "#1D2939",
123
- },
124
- {
125
- property: "Primary Color",
126
- tokenName: "color/semantic/icon/primary",
127
- role: "Brand-primary icon color for emphasis or active state indicators",
128
- fallback: "#2563EB",
129
- },
130
- {
131
- property: "Secondary Color",
132
- tokenName: "color/semantic/icon/secondary",
133
- role: "Muted icon color for supporting or de-emphasized icons",
134
- fallback: "#667085",
135
- },
136
- {
137
- property: "Disabled Color",
138
- tokenName: "color/semantic/icon/disabled",
139
- role: "Icon color when parent component is in disabled state",
140
- fallback: "#D0D5DD",
141
- },
142
- {
143
- property: "Inverse Color",
144
- tokenName: "color/semantic/icon/inverse",
145
- role: "Icon color on dark backgrounds or inverse surfaces",
146
- fallback: "#FFFFFF",
147
- },
148
- {
149
- property: "Error Color",
150
- tokenName: "color/semantic/icon/error",
151
- role: "Semantic error icon color — used in validation, alerts, and destructive contexts",
152
- fallback: "#F04438",
153
- },
154
- {
155
- property: "Success Color",
156
- tokenName: "color/semantic/icon/success",
157
- role: "Semantic success icon color — used in confirmation and positive feedback",
158
- fallback: "#12B76A",
159
- },
160
- ],
161
-
162
- structureRules: [
163
- "Icon renders as an inline SVG element with width and height matching the size preset",
164
- "SVG viewBox is always 0 0 24 24 (or source viewBox) — size is controlled by the outer width/height attributes",
165
- "Icon aligns vertically with adjacent text using display: inline-flex and align-items: center on the parent",
166
- "No wrapper div is required — the SVG element itself is the top-level node",
167
- "Fill and stroke colors use currentColor by default, allowing CSS color inheritance from the parent",
168
- "Icons must not include embedded text — all glyphs are vector paths for consistent rendering",
169
- "RTL layouts flip horizontally-directional icons (arrows, chevrons) but not symmetric ones (close, search)",
170
- ],
171
-
172
- typeHierarchyRules: [
173
- "Icons are non-textual — they do not participate in the typographic hierarchy",
174
- "When paired with a text label, the icon size should match the text line-height for vertical alignment",
175
- "Icon size xs (16px) pairs with body-small (12-14px text); md (24px) pairs with body (14-16px text)",
176
- "Icons used as standalone glyphs (no adjacent text) should be sized to match the expected visual weight of surrounding content",
177
- ],
178
-
179
- interactionRules: [
180
- { event: "Click", trigger: "pointerup on icon", action: "No action — icons are non-interactive; click events are handled by the parent component" },
181
- { event: "Hover", trigger: "pointerenter on icon", action: "No hover state — icons inherit hover styling from the parent interactive element" },
182
- { event: "Parent Disabled", trigger: "Parent sets disabled state", action: "Icon color transitions to color/semantic/icon/disabled with opacity 0.4" },
183
- { event: "Color Inheritance", trigger: "Parent CSS color changes", action: "Icon fill updates to match currentColor automatically via SVG fill inheritance" },
184
- { event: "RTL Toggle", trigger: "Document direction changes to RTL", action: "Directional icons (arrows, chevrons) apply transform: scaleX(-1)" },
185
- { event: "Theme Change", trigger: "Color mode toggles (light/dark)", action: "Icon color tokens resolve to new theme values; SVG re-renders with updated fills" },
186
- ],
187
-
188
- contentGuidance: [
189
- "Use filled icons for primary actions and emphasis; use outlined icons for secondary or passive contexts",
190
- "Pair every icon with a visible text label unless the icon is universally understood (close ×, search 🔍, home)",
191
- "Maintain a consistent icon style (filled vs outlined) within a single UI surface — do not mix styles arbitrarily",
192
- "Choose icons from the established icon library — do not introduce custom glyphs without design review",
193
- "Use semantic color tokens (error, success) for status icons rather than arbitrary color overrides",
194
- "Ensure icon metaphors are culturally appropriate and universally recognizable for the target audience",
195
- ],
196
-
197
- responsiveBehaviour: [
198
- { breakpoint: "Mobile (<768px)", behavior: "Icons remain at their specified size; do not scale with viewport — touch targets are handled by the parent" },
199
- { breakpoint: "Tablet (768-1023px)", behavior: "Same icon sizes as desktop; no responsive scaling needed for vector graphics" },
200
- { breakpoint: "Desktop (1024-1439px)", behavior: "Standard icon rendering at specified size presets" },
201
- { breakpoint: "Ultra-wide (>=1440px)", behavior: "No scaling — icons are fixed-size elements that do not grow with viewport width" },
202
- ],
203
-
204
- accessibilitySpec: {
205
- intro:
206
- "Icons must be categorized as either decorative (hidden from AT) or informative (labeled for AT). There is no middle ground.",
207
- requirements: [
208
- { requirement: "Decorative aria-hidden", level: "A", notes: "Icons that duplicate adjacent text or are purely ornamental must have aria-hidden='true'" },
209
- { requirement: "Informative aria-label", level: "A", notes: "Icons conveying meaning without adjacent text must have role='img' and a descriptive aria-label" },
210
- { requirement: "Focusable false", level: "A", notes: "SVG elements must have focusable='false' to prevent IE/Edge from adding them to the tab order" },
211
- { requirement: "Title element avoided", level: "A", notes: "Do not use <title> inside SVG for labeling — use aria-label on the SVG element instead for consistent AT support" },
212
- { requirement: "Contrast", level: "AA", notes: "Informative icons must meet 3:1 non-text contrast ratio against their background" },
213
- { requirement: "High Contrast Mode", level: "AA", notes: "Icons must remain visible in Windows High Contrast Mode — use currentColor, not hardcoded fills" },
214
- { requirement: "Reduced Motion", level: "AAA", notes: "If icons have animated transitions (rotation, color fade), they must respect prefers-reduced-motion" },
215
- ],
216
- outro: [
217
- "Screen readers should either skip decorative icons entirely or announce informative icons with their aria-label",
218
- "Never rely on an icon alone to convey critical information — always provide a text alternative or label",
219
- ],
220
- },
221
-
222
- qaAcceptanceCriteria: [
223
- { check: "Size Presets", platform: "All", expectedResult: "Icon renders at correct dimensions for each size preset (16/20/24/32/40px)" },
224
- { check: "Color Inheritance", platform: "All", expectedResult: "Icon inherits currentColor from parent when no explicit color prop is set" },
225
- { check: "Color Override", platform: "All", expectedResult: "Explicit color prop overrides inherited color and maps to correct design token" },
226
- { check: "Filled vs Outlined", platform: "All", expectedResult: "Type prop toggles between filled and outlined glyph variants correctly" },
227
- { check: "Decorative Hiding", platform: "Web", expectedResult: "Decorative icons have aria-hidden='true' and are absent from the accessibility tree" },
228
- { check: "Informative Labeling", platform: "Web", expectedResult: "Informative icons have role='img' and aria-label announced by screen readers" },
229
- { check: "RTL Flip", platform: "Web", expectedResult: "Directional icons (arrows, chevrons) mirror horizontally in RTL; symmetric icons remain unchanged" },
230
- { check: "Disabled State", platform: "All", expectedResult: "Icon color changes to disabled token and opacity reduces when parent is disabled" },
231
- { check: "Dark Mode", platform: "All", expectedResult: "All icon color tokens resolve correctly in dark mode; icons remain visible" },
232
- { check: "High Contrast", platform: "Web", expectedResult: "Icons use currentColor and remain visible in Windows High Contrast Mode" },
233
- { check: "SVG Rendering", platform: "All", expectedResult: "Icons render as crisp vector paths with no anti-aliasing artifacts at all size presets" },
234
- ],
235
-
236
- dos: [
237
- "Set decorative=true for icons that accompany visible text labels — they add no new information",
238
- "Provide an aria-label for every standalone icon that conveys meaning without adjacent text",
239
- "Use currentColor for fills to ensure icons inherit theme and state colors from parents",
240
- "Match icon size to adjacent text line-height for consistent vertical alignment",
241
- "Use the design system's icon library — maintain glyph consistency across the product",
242
- "Apply transform: scaleX(-1) to directional icons in RTL layouts",
243
- "Test all icons in both light and dark modes to verify token resolution",
244
- ],
245
-
246
- donts: [
247
- "Do not make icons interactive — wrap them in a button or link if they need click handling",
248
- "Do not use <img> tags for icons — use inline SVG for color inheritance and scalability",
249
- "Do not hardcode fill colors in SVG paths — use currentColor for theme compatibility",
250
- "Do not mix filled and outlined icon styles within the same UI surface",
251
- "Do not add focusable behavior to decorative icons — they must be invisible to keyboard navigation",
252
- "Do not use icons as the sole means of conveying critical information without a text alternative",
253
- "Do not resize icons with CSS transform: scale — use the size prop to maintain crisp rendering",
254
- ],
255
- };
@@ -1,128 +0,0 @@
1
- /**
2
- * Knowledge base lookup — returns component-type-specific design knowledge
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- import { buttonKnowledge } from "./button.js";
7
- import { checkboxKnowledge } from "./checkbox.js";
8
- import { inputKnowledge } from "./input.js";
9
- import { selectKnowledge } from "./select.js";
10
- import { toggleKnowledge } from "./toggle.js";
11
- import { radioKnowledge } from "./radio.js";
12
- import { modalKnowledge } from "./modal.js";
13
- import { tabsKnowledge } from "./tabs.js";
14
- import { cardKnowledge } from "./card.js";
15
- import { toastKnowledge } from "./toast.js";
16
- import { accordionKnowledge } from "./accordion.js";
17
- import { tooltipKnowledge } from "./tooltip.js";
18
- import { sliderKnowledge } from "./slider.js";
19
- import { alertKnowledge } from "./alert.js";
20
- import { badgeKnowledge } from "./badge.js";
21
- import { avatarKnowledge } from "./avatar.js";
22
- import { chipKnowledge } from "./chip.js";
23
- import { tableKnowledge } from "./table.js";
24
- import { navigationKnowledge } from "./navigation.js";
25
- import { progressKnowledge } from "./progress.js";
26
- import { iconKnowledge } from "./icon.js";
27
- import { linkKnowledge } from "./link.js";
28
- import { menuKnowledge } from "./menu.js";
29
- import { spinnerKnowledge } from "./spinner.js";
30
- import { breadcrumbKnowledge } from "./breadcrumb.js";
31
- import { tagKnowledge } from "./tag.js";
32
- import { navbarKnowledge } from "./navbar.js";
33
- import { textareaKnowledge } from "./textarea.js";
34
- import { searchKnowledge } from "./search.js";
35
- import { comboboxKnowledge } from "./combobox.js";
36
- import { datepickerKnowledge } from "./datepicker.js";
37
- import { numberInputKnowledge } from "./number-input.js";
38
- import { formKnowledge } from "./form.js";
39
- import { paginationKnowledge } from "./pagination.js";
40
- import { listKnowledge } from "./list.js";
41
- import { treeviewKnowledge } from "./treeview.js";
42
- import { typographyKnowledge } from "./typography.js";
43
- import { dividerKnowledge } from "./divider.js";
44
- import { skeletonKnowledge } from "./skeleton.js";
45
- import { popoverKnowledge } from "./popover.js";
46
- import { dropdownMenuKnowledge } from "./dropdown-menu.js";
47
- import { avatarGroupKnowledge } from "./avatar-group.js";
48
- import { gridKnowledge } from "./grid.js";
49
- import { emptyStateKnowledge } from "./empty-state.js";
50
- import { bannerKnowledge } from "./banner.js";
51
- import { drawerKnowledge } from "./drawer.js";
52
- import { segmentedControlKnowledge } from "./segmented-control.js";
53
- import { stepperKnowledge } from "./stepper.js";
54
- import { fileUploaderKnowledge } from "./file-uploader.js";
55
- import { inlineMessageKnowledge } from "./inline-message.js";
56
- import { toolbarKnowledge } from "./toolbar.js";
57
- import { calendarKnowledge } from "./calendar.js";
58
- import { timePickerKnowledge } from "./time-picker.js";
59
- import { rangeSliderKnowledge } from "./range-slider.js";
60
- import { inlineEditKnowledge } from "./inline-edit.js";
61
- import { statusDotKnowledge } from "./status-dot.js";
62
- import { ratingKnowledge } from "./rating.js";
63
- import { defaultKnowledge } from "./_default.js";
64
-
65
- const KNOWLEDGE_MAP: Record<string, ComponentKnowledge> = {
66
- button: buttonKnowledge,
67
- checkbox: checkboxKnowledge,
68
- input: inputKnowledge,
69
- select: selectKnowledge,
70
- toggle: toggleKnowledge,
71
- radio: radioKnowledge,
72
- modal: modalKnowledge,
73
- tabs: tabsKnowledge,
74
- card: cardKnowledge,
75
- toast: toastKnowledge,
76
- accordion: accordionKnowledge,
77
- tooltip: tooltipKnowledge,
78
- slider: sliderKnowledge,
79
- alert: alertKnowledge,
80
- badge: badgeKnowledge,
81
- avatar: avatarKnowledge,
82
- chip: chipKnowledge,
83
- table: tableKnowledge,
84
- navigation: navigationKnowledge,
85
- progress: progressKnowledge,
86
- icon: iconKnowledge,
87
- link: linkKnowledge,
88
- menu: menuKnowledge,
89
- spinner: spinnerKnowledge,
90
- breadcrumb: breadcrumbKnowledge,
91
- tag: tagKnowledge,
92
- navbar: navbarKnowledge,
93
- textarea: textareaKnowledge,
94
- search: searchKnowledge,
95
- combobox: comboboxKnowledge,
96
- datepicker: datepickerKnowledge,
97
- numberinput: numberInputKnowledge,
98
- form: formKnowledge,
99
- pagination: paginationKnowledge,
100
- list: listKnowledge,
101
- treeview: treeviewKnowledge,
102
- typography: typographyKnowledge,
103
- divider: dividerKnowledge,
104
- skeleton: skeletonKnowledge,
105
- popover: popoverKnowledge,
106
- dropdownmenu: dropdownMenuKnowledge,
107
- avatargroup: avatarGroupKnowledge,
108
- grid: gridKnowledge,
109
- emptystate: emptyStateKnowledge,
110
- banner: bannerKnowledge,
111
- drawer: drawerKnowledge,
112
- segmentedcontrol: segmentedControlKnowledge,
113
- stepper: stepperKnowledge,
114
- fileuploader: fileUploaderKnowledge,
115
- inlinemessage: inlineMessageKnowledge,
116
- toolbar: toolbarKnowledge,
117
- calendar: calendarKnowledge,
118
- timepicker: timePickerKnowledge,
119
- rangeslider: rangeSliderKnowledge,
120
- inlineedit: inlineEditKnowledge,
121
- statusdot: statusDotKnowledge,
122
- rating: ratingKnowledge,
123
- };
124
-
125
- export function getComponentKnowledge(type?: string): ComponentKnowledge {
126
- if (!type) return defaultKnowledge;
127
- return KNOWLEDGE_MAP[type] ?? defaultKnowledge;
128
- }