@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,162 +0,0 @@
1
- # API Spec Reference
2
-
3
- Generate component property documentation with values, defaults, required/optional status, and configuration examples.
4
-
5
- ## What This Spec Produces
6
-
7
- 1. **Main property table** — All top-level properties with values, required status, defaults, and notes
8
- 2. **Sub-component tables** — Separate tables for configurable nested elements
9
- 3. **Configuration examples** — 1–4 annotated instances showing common setups
10
-
11
- ---
12
-
13
- ## Step-by-Step Pipeline
14
-
15
- ### Phase 1: Extract All Properties
16
-
17
- Properties come from **three sources** in Figma. You must check all three.
18
-
19
- #### Source 1: Variant Axes
20
- Read from the component set's variant names:
21
- ```
22
- get_component_set_variants(node_id)
23
- ```
24
- Parse variant names (formatted as "Property1=Value1, Property2=Value2") to extract:
25
- - Property name (e.g., "Size", "Type", "State", "Hierarchy")
26
- - All possible values (e.g., ["Large", "Medium", "Small", "XSmall"])
27
- - Default value (the first variant listed, or the one matching the default instance)
28
-
29
- #### Source 2: Instance (Boolean & Slot) Properties
30
- Read from `componentPropertyDefinitions` on the component set:
31
- ```
32
- get_component_property_definitions(node_id)
33
- ```
34
- This returns:
35
- - **Boolean properties**: Toggle-controlled elements (e.g., "Show Leading Icon": true/false)
36
- - **Instance swap properties**: Slots that accept different components (e.g., "Trailing Content": [IconButton, TextButton, None])
37
- - **Text properties**: Editable text content (e.g., "Label Text": string)
38
-
39
- #### Source 3: Variable Mode Collections
40
- Check for variable collections scoped to this component:
41
- ```
42
- get_local_variable_collections()
43
- ```
44
- Look for collections named after the component or containing modes like:
45
- - Shape: `Rounded`, `Square`, `Pill`
46
- - Density: `Compact`, `Default`, `Spacious`
47
- - Color/Style: `Default`, `Danger`, `Success`
48
-
49
- ### Phase 2: Classify Properties (AI Reasoning)
50
-
51
- For each discovered property, determine:
52
-
53
- | Field | Description |
54
- |-------|-------------|
55
- | `name` | Property name as it appears in Figma |
56
- | `type` | `variant`, `boolean`, `instance-swap`, `text`, `variable-mode` |
57
- | `values` | All possible values |
58
- | `default` | The default value |
59
- | `required` | Whether the property must be explicitly set |
60
- | `notes` | Description of what this property controls |
61
-
62
- **Classification rules for required vs. optional:**
63
- - Variant axes that affect layout/appearance → **Required** (Size, Type)
64
- - State properties (enabled, disabled, selected) → **Required**
65
- - Boolean toggles → **Optional** (they have a default on/off state)
66
- - Instance swap slots → **Optional** (they have a default or "None")
67
- - Text content properties → Depends on context (Label usually required, Helper Text optional)
68
-
69
- **Exclude transient interactive states:**
70
- - `hover`, `pressed`, `focused`, `hovered` → These are runtime states, NOT API properties
71
- - Only include **persistent** states: `disabled`, `selected`, `loading`, `error`, `active`
72
-
73
- ### Phase 3: Identify Sub-Component Configurations
74
-
75
- For each instance swap slot or fixed nested component:
76
- 1. Check if the nested component has its own configurable properties
77
- 2. If yes, create a separate sub-component table
78
- 3. In the main table, add a note: "See [Sub-component Name] configuration below"
79
-
80
- Example: A Section Heading with a trailing slot that accepts IconButton or TextButton:
81
- - Main table lists "Trailing Content" with values: "Icon Button | Text Button | None"
82
- - Sub-table for "Icon Button Configuration" lists the icon button's own properties
83
- - Sub-table for "Text Button Configuration" lists the text button's own properties
84
-
85
- ### Phase 4: Generate Configuration Examples
86
-
87
- Create 1–4 examples showing common real-world setups:
88
-
89
- **Example selection strategy:**
90
- 1. **Minimal** — Required properties only, all optionals at defaults
91
- 2. **Common** — The most frequently used configuration
92
- 3. **Full** — All optional elements enabled
93
- 4. **Specialized** — A specific variant (e.g., "Error state with helper text")
94
-
95
- For each example:
96
- - Create a component instance with the specific properties set
97
- - Add a label below: Example name + brief description
98
- - Add a property callout listing which properties differ from default
99
-
100
- ### Phase 5: Render the Documentation Frame
101
-
102
- ```
103
- Main Frame (1440px wide, auto-layout vertical, padding 60px, gap 40px)
104
- ├── Header Section
105
- │ ├── Title: "[Component Name] — API" (24px bold)
106
- │ └── Subtitle: "Properties and configuration reference" (14px, #6B7280)
107
- ├── Main Property Table
108
- │ ├── Header: Property | Type | Values | Default | Required | Notes
109
- │ └── Rows: One per property (grouped by source: variants first, then booleans, then slots)
110
- ├── Sub-Component Table(s) (if applicable)
111
- │ ├── Section Header: "[Sub-component] Configuration"
112
- │ └── Table with same column structure
113
- ├── Configuration Examples Section
114
- │ ├── Section Header: "Configuration Examples"
115
- │ └── Example Grid (2-column layout)
116
- │ ├── Example 1: [Instance] + [Label + Property List]
117
- │ ├── Example 2: [Instance] + [Label + Property List]
118
- │ └── ...
119
- ```
120
-
121
- **Main Property Table columns:**
122
- | Column | Width | Content |
123
- |--------|-------|---------|
124
- | Property | 160px | Property name |
125
- | Type | 100px | `variant` / `boolean` / `slot` / `text` / `mode` |
126
- | Values | 200px | All possible values, pipe-separated |
127
- | Default | 120px | Default value, **bold** |
128
- | Required | 80px | ✓ or — |
129
- | Notes | Fill | Description of what this property controls |
130
-
131
- ### Phase 6: Validate
132
-
133
- Checklist:
134
- - [ ] All variant axes are listed
135
- - [ ] All boolean properties are listed
136
- - [ ] All instance swap slots are listed
137
- - [ ] All variable mode properties are listed
138
- - [ ] Transient states (hover, pressed) are NOT listed
139
- - [ ] Default values are correctly identified
140
- - [ ] Sub-component tables exist for configurable nested components
141
- - [ ] Configuration examples render correctly with the right property combinations
142
-
143
- ---
144
-
145
- ## Example: Button API
146
-
147
- **Main Property Table:**
148
- | Property | Type | Values | Default | Required | Notes |
149
- |----------|------|--------|---------|----------|-------|
150
- | Size | variant | Large \| Medium \| Small \| XSmall | Medium | ✓ | Controls button height and padding |
151
- | Hierarchy | variant | Primary \| Secondary \| Tertiary | Primary | ✓ | Visual emphasis level |
152
- | State | variant | Enabled \| Disabled \| Loading | Enabled | ✓ | Interaction state |
153
- | Show Leading Icon | boolean | true \| false | false | — | Displays an icon before the label |
154
- | Show Trailing Icon | boolean | true \| false | false | — | Displays an icon after the label |
155
- | Label | text | string | "Button" | ✓ | Button text content |
156
- | Color | mode | Default \| Danger \| Success | Default | — | Color scheme via variable mode |
157
-
158
- **Configuration Examples:**
159
- 1. **Default** — Medium, Primary, Enabled, no icons → The basic button
160
- 2. **Icon + Label** — Medium, Primary, Leading Icon visible → Common CTA pattern
161
- 3. **Danger Action** — Medium, Primary, Danger color, "Delete" label → Destructive action
162
- 4. **Loading** — Medium, Primary, Loading state → Async operation in progress
@@ -1,148 +0,0 @@
1
- # Color Annotation Spec Reference
2
-
3
- Generate design token specifications mapping every UI element to its color token across states and variants.
4
-
5
- ## What This Spec Produces
6
-
7
- 1. **Color-annotated artwork** — Component instances with numbered markers pointing to color-bearing elements
8
- 2. **Token mapping tables** — Element name → Token name → Resolved hex value, organized by state
9
- 3. **Variant sections** — Separate sections for each color-affecting variant (Default, Danger, etc.)
10
- 4. **Variable mode sections** — Sections for variable-mode-controlled color variants (Tag color, Badge style)
11
-
12
- ---
13
-
14
- ## Step-by-Step Pipeline
15
-
16
- ### Phase 1: Determine Rendering Strategy
17
-
18
- Before extracting data, analyze which variant axes affect color:
19
-
20
- **Strategy A — Section-per-variant** (simpler components):
21
- Use when the component has ≤3 color-affecting variant values (e.g., Default + Danger).
22
- Render: One section per variant, each containing state tables.
23
-
24
- **Strategy B — States-as-columns** (complex components):
25
- Use when the component has many variant combinations (e.g., 4 types × 4 states).
26
- Render: One table per variant type, with states as columns.
27
-
28
- **Strategy C — Variable-mode sections**:
29
- Use when color is controlled by a Figma variable collection (e.g., "Tag Color" with Default, Success, Warning, Error modes).
30
- Render: One section per mode value.
31
-
32
- **Decision logic:**
33
- 1. Count variant axes that affect fill/stroke colors
34
- 2. If only "State" axis changes colors → Strategy A (sections for other axes, states within each)
35
- 3. If multiple axes × multiple states → Strategy B (states as columns)
36
- 4. If color comes from variable modes → Strategy C
37
-
38
- ### Phase 2: Extract Color Data
39
-
40
- For each variant/state combination that needs documentation:
41
-
42
- 1. Create or navigate to the appropriate variant instance
43
- 2. For every child layer (recursive), extract:
44
- ```
45
- get_node_fills(child_id) → fill color(s)
46
- get_node_strokes(child_id) → stroke/border color(s)
47
- get_bound_variables(child_id) → variable bindings (token references)
48
- ```
49
-
50
- 3. For each color-bearing property, collect:
51
- - **Element name**: Layer name (e.g., "Container", "Label Text", "Icon")
52
- - **Property**: `fill`, `stroke`, `text-fill`
53
- - **Token name**: The variable/token name if bound (e.g., `color/button/primary/bg`)
54
- - **Resolved value**: The actual hex color value (e.g., `#6D28D9`)
55
- - **Opacity**: If not 100%, include it
56
-
57
- 4. **Enable hidden boolean elements** before extracting:
58
- ```
59
- set_component_properties(instance_id, { "Show Leading Icon": true, ... })
60
- ```
61
- Hidden elements may have color bindings that only appear when visible.
62
-
63
- ### Phase 3: Classify Color Roles (AI Reasoning)
64
-
65
- Group elements by their color role:
66
-
67
- | Role | Elements | Example Tokens |
68
- |------|----------|----------------|
69
- | Background | Container fills, surface fills | `color/bg/primary`, `color/surface/default` |
70
- | Text | Label, helper text, placeholder | `color/text/primary`, `color/text/secondary` |
71
- | Icon | Leading icon, trailing icon fills | `color/icon/primary`, `color/icon/on-color` |
72
- | Border | Container strokes, input outlines | `color/border/default`, `color/border/focus` |
73
- | State Layer | Hover overlay, pressed overlay | `color/state-layer/hover`, `color/state-layer/pressed` |
74
- | Indicator | Error icon, success badge | `color/indicator/error`, `color/indicator/success` |
75
-
76
- ### Phase 4: Render the Documentation Frame
77
-
78
- #### Strategy A Layout (Section-per-variant):
79
- ```
80
- Main Frame (1440px wide)
81
- ├── Header: "[Component Name] — Color Annotation"
82
- ├── Variant Section: "Default"
83
- │ ├── State: "Enabled"
84
- │ │ ├── Annotated Artwork (instance + numbered markers)
85
- │ │ └── Token Table: Element | Property | Token | Value
86
- │ ├── State: "Hover"
87
- │ │ ├── Annotated Artwork
88
- │ │ └── Token Table (highlight changed values in bold)
89
- │ ├── State: "Pressed"
90
- │ │ └── ...
91
- │ └── State: "Disabled"
92
- │ └── ...
93
- ├── Variant Section: "Danger"
94
- │ └── (same structure)
95
- ```
96
-
97
- #### Strategy B Layout (States-as-columns):
98
- ```
99
- Main Frame (1440px wide)
100
- ├── Header: "[Component Name] — Color Annotation"
101
- ├── Artwork Strip: [Enabled] [Hover] [Pressed] [Disabled]
102
- ├── Token Table:
103
- │ Header: Element | Property | Enabled | Hover | Pressed | Disabled
104
- │ Row: Container | fill | token/bg/default | token/bg/hover | ... | ...
105
- │ Row: Label | text | token/text/primary | (same) | ... | token/text/disabled
106
- ```
107
-
108
- #### Strategy C Layout (Variable modes):
109
- ```
110
- Main Frame (1440px wide)
111
- ├── Header: "[Component Name] — Color Annotation"
112
- ├── Mode Section: "Default"
113
- │ ├── Annotated Artwork
114
- │ └── Token Table
115
- ├── Mode Section: "Success"
116
- │ └── ...
117
- ├── Mode Section: "Warning"
118
- │ └── ...
119
- ```
120
-
121
- ### Marker Placement for Color Specs
122
-
123
- Color markers differ from anatomy markers:
124
- - Use **same marker style** (24px circle, #D946EF)
125
- - Place markers pointing to the specific **color-bearing surface** (not the element in general)
126
- - For elements with both fill and stroke, use two markers (one for each)
127
- - Number markers per-section (restart numbering for each state/variant section)
128
-
129
- ### Phase 5: Validate
130
-
131
- Checklist:
132
- - [ ] All color-bearing elements are documented (fills, strokes, text colors)
133
- - [ ] Token names match actual Figma variable names
134
- - [ ] Resolved hex values are correct
135
- - [ ] All relevant states are covered (enabled, hover, pressed, disabled at minimum)
136
- - [ ] All relevant variants are covered
137
- - [ ] Variable mode sections exist for mode-controlled colors
138
- - [ ] Light/dark themes are NOT duplicated (semantic tokens handle this)
139
- - [ ] Hidden elements' colors are captured (booleans toggled on during extraction)
140
-
141
- ---
142
-
143
- ## Notes
144
-
145
- - **Semantic tokens only**: Document the semantic token names, not raw color primitives. If an element is bound to `color/text/primary` which resolves to `gray/900` which resolves to `#111827`, document `color/text/primary → #111827`.
146
- - **State layers**: Hover and pressed often use a semi-transparent overlay. Document both the overlay token and its opacity.
147
- - **Unchanged values**: When a token stays the same across states, you can use "—" or "(same)" in the table to reduce noise. Only highlight values that actually change.
148
- - **Sub-component reference**: If a nested component (e.g., Icon Button inside Section Heading) has its own color spec, add a note "See [Component] color annotation" rather than duplicating all its tokens.
@@ -1,314 +0,0 @@
1
- # Component Specification Template
2
-
3
- > This is the gold-standard reference for what a complete component spec should look like.
4
- > When generating a spec with `figma_component_spec`, the output should match this quality,
5
- > tone, and depth. Use this as a writing guide — adapt the content to the actual component
6
- > but maintain the same level of detail and structure.
7
-
8
- ---
9
-
10
- ## Example: Button Component Specification
11
-
12
- ---
13
-
14
- ### 1. Overview
15
-
16
- Component: Button
17
- Type: COMPONENT_SET (24 variants)
18
- Node ID: 1:234
19
- Dimensions: 160 × 44 px (default variant)
20
- Layout: HORIZONTAL auto layout, 8px gap, padding 12/16/12/16
21
- Description: Button is a primary interactive component used to trigger actions
22
- and submit forms. It supports 3 hierarchy levels (Primary, Secondary,
23
- Tertiary), 4 sizes (XSmall, Small, Medium, Large), and full state
24
- coverage (Default, Hover, Pressed, Focused, Disabled). Composed of
25
- 5 elements including 2 optional icon slots controlled by boolean toggles.
26
- All 8 color fills are bound to design tokens for full theme support.
27
- States: Default, Hover, Pressed, Focused, Disabled
28
- Detected pattern: button
29
- Direct children: Leading Icon, Label, Trailing Icon, Loader, Focus Ring
30
-
31
- ---
32
-
33
- ### 2. Anatomy
34
-
35
- # Element Type Role Visible Controlled By
36
- ──────────────────────────────────────────────────────────────────────────────────
37
- 1 Leading Icon INSTANCE optional-slot true Show Leading Icon
38
- 2 Label TEXT content-element true —
39
- 3 Trailing Icon INSTANCE optional-slot false Show Trailing Icon
40
- 4 Loader INSTANCE optional-slot false Is Loading
41
- 5 Focus Ring FRAME decorative false —
42
-
43
- Anatomy notes:
44
- - Leading Icon and Trailing Icon are optional slots controlled by boolean toggles.
45
- When hidden, the button auto-resizes due to auto layout.
46
- - Label is the primary content element and must always remain visible.
47
- - Loader replaces the label content during async operations when Is Loading = true.
48
- - Focus Ring is a decorative element rendered on keyboard focus via the Focused state variant.
49
-
50
- ---
51
-
52
- ### 3. Variants
53
-
54
- Axis Values Default Count
55
- ──────────────────────────────────────────────────────────────────
56
- Hierarchy Primary, Secondary, Tertiary Primary 3
57
- Size XSmall, Small, Medium, Large Medium 4
58
- State Default, Hover, Pressed, Focused, Default 5
59
- Disabled
60
-
61
- Toggle Default Controls
62
- ──────────────────────────────────────────────
63
- Show Leading Icon false Leading Icon
64
- Show Trailing Icon false Trailing Icon
65
- Is Loading false Loader
66
-
67
- Swap Slot Current Component
68
- ──────────────────────────────────────────
69
- Leading Icon Swap Icon / Arrow Left
70
- Trailing Icon Swap Icon / Chevron Right
71
-
72
- Total possible configurations: 60 (3 hierarchy × 4 size × 5 state).
73
- Boolean multiplier: ×8 (3 toggles). Defined variants in file: 24.
74
-
75
- Defined variant names:
76
- - Hierarchy=Primary, Size=Large, State=Default
77
- - Hierarchy=Primary, Size=Large, State=Hover
78
- - Hierarchy=Primary, Size=Large, State=Pressed
79
- - Hierarchy=Primary, Size=Large, State=Focused
80
- - Hierarchy=Primary, Size=Medium, State=Default
81
- - ... and 19 more
82
-
83
- ---
84
-
85
- ### 4. States
86
-
87
- State Source Axis / Property
88
- ───────────────────────────────────────────
89
- Default variant-axis State
90
- Hover variant-axis State
91
- Pressed variant-axis State
92
- Focused variant-axis State
93
- Disabled variant-axis State
94
-
95
- State behavior notes:
96
- - Default: Normal idle state with standard fill colors and cursor: pointer.
97
- - Hover: Background shifts to a lighter/darker tint (token: button/primary/hover).
98
- Triggered on mouse enter. Transition: 150ms ease-out.
99
- - Pressed: Background shifts further. Active fill token: button/primary/pressed.
100
- Applied on mousedown, released on mouseup.
101
- - Focused: Visible focus ring (2px offset, brand color) for keyboard navigation.
102
- Must meet WCAG 2.4.7 — 3:1 contrast against adjacent colors.
103
- - Disabled: Reduced opacity (0.4) or muted fill. Remove from tab order.
104
- Use aria-disabled="true" rather than the disabled attribute when possible
105
- to maintain focus for screen reader discoverability.
106
-
107
- ---
108
-
109
- ### 5. Properties / API
110
-
111
- Property Type Values / Default Required
112
- ────────────────────────────────────────────────────────────────────────────────────
113
- Hierarchy Variant Primary, Secondary, Tertiary Yes
114
- (default: Primary)
115
- Size Variant XSmall, Small, Medium, Large Yes
116
- (default: Medium)
117
- State Variant Default, Hover, Pressed, Focused, Yes
118
- Disabled (default: Default)
119
- Show Leading Icon Boolean true / false (default: false) No
120
- Show Trailing Icon Boolean true / false (default: false) No
121
- Is Loading Boolean true / false (default: false) No
122
- Leading Icon Swap Instance Swap Any icon component No
123
- Trailing Icon Swap Instance Swap Any icon component No
124
- Label Text Text Override "Button" (editable) No
125
-
126
- Total properties: 9 (3 variants, 3 booleans, 2 instance swaps, 1 text override).
127
-
128
- Implementation notes:
129
- - Variant properties (Hierarchy, Size, State) are required and must always be set.
130
- - Boolean toggles control child visibility — they do not add/remove DOM elements,
131
- only toggle display.
132
- - Instance swap slots accept any component from the Icon library. Ensure swapped
133
- icons maintain the same bounding box (20×20 for Medium size) to avoid layout shift.
134
- - Label Text supports single-line text only. Truncation with ellipsis should be
135
- handled if text overflows the maximum width.
136
-
137
- ---
138
-
139
- ### 6. Spacing & Structure
140
-
141
- Root layout: HORIZONTAL auto layout
142
- Dimensions: 160 × 44 px (Medium)
143
- Padding: 12 / 16 / 12 / 16 (T/R/B/L)
144
- Item spacing: 8px
145
-
146
- Element Layout W × H Padding (T/R/B/L) Gap Sizing (H/V)
147
- ──────────────────────────────────────────────────────────────────────────────────────
148
- Button (root) HORIZONTAL 160 × 44 12/16/12/16 8px HUG / FIXED
149
- Leading Icon — 20 × 20 — — FIXED / FIXED
150
- Label — auto × 20 — — HUG / HUG
151
- Trailing Icon — 20 × 20 — — FIXED / FIXED
152
-
153
- Size scale:
154
- - XSmall: 28px height, 8/12 padding, 6px gap, 14px font
155
- - Small: 32px height, 8/12 padding, 6px gap, 14px font
156
- - Medium: 44px height, 12/16 padding, 8px gap, 16px font
157
- - Large: 52px height, 16/20 padding, 8px gap, 18px font
158
-
159
- Touch target compliance:
160
- - XSmall (28px): Below 44×44 WCAG minimum — ensure adequate spacing or hit area padding.
161
- - Small (32px): Below 44×44 — same concern.
162
- - Medium (44px): Meets 44×44 minimum touch target.
163
- - Large (52px): Exceeds minimum. Recommended for primary CTAs on mobile.
164
-
165
- ---
166
-
167
- ### 7. Color Tokens
168
-
169
- Element Property Hex Value Token Name
170
- ────────────────────────────────────────────────────────────────
171
- Button (root) fill #0F62FE color/interactive/primary
172
- Button (root) fill #0043CE color/interactive/primary/hover
173
- Button (root) fill #002D9C color/interactive/primary/pressed
174
- Label fill #FFFFFF color/text/on-color
175
- Leading Icon fill #FFFFFF color/icon/on-color
176
- Focus Ring stroke #0F62FE color/focus/outline
177
- Disabled fill fill #C6C6C6 color/interactive/disabled
178
- Disabled text fill #8D8D8D color/text/disabled
179
-
180
- Token coverage: 8/8 colors are bound to design tokens. Fully theme-ready.
181
-
182
- Token architecture notes:
183
- - All interactive colors use the `color/interactive/*` namespace.
184
- - Text and icon colors on filled backgrounds use `color/*/on-color` tokens
185
- which automatically invert in dark mode.
186
- - The Disabled state uses dedicated disabled tokens — do not use opacity
187
- reduction as it creates inconsistent results across themes.
188
- - Focus ring uses `color/focus/outline` which must maintain 3:1 contrast
189
- against any background.
190
-
191
- ---
192
-
193
- ### 8. Typography
194
-
195
- Element Content Font Size Line Height Token
196
- ────────────────────────────────────────────────────────────────────────
197
- Label "Button" Inter SemiBold 16px 20px type/body/semibold/md
198
-
199
- Font families used: Inter SemiBold. Size range: 14px–18px across 4 size variants.
200
-
201
- Typography scale by size variant:
202
- - XSmall / Small: Inter SemiBold 14px / 18px line height
203
- - Medium: Inter SemiBold 16px / 20px line height
204
- - Large: Inter SemiBold 18px / 24px line height
205
-
206
- Accessibility notes:
207
- - Minimum font size (14px) meets readability guidelines.
208
- - All text uses SemiBold weight for adequate legibility on colored backgrounds.
209
- - Line height ratio (1.25–1.33) is within WCAG recommended range.
210
-
211
- ---
212
-
213
- ### 9. Accessibility
214
-
215
- Touch target:
216
- - Medium (44×44px) and Large (52×52px) variants meet WCAG 2.5.8 minimum.
217
- - XSmall (28px) and Small (32px) are below minimum — add padding or spacing.
218
-
219
- Typography:
220
- - Label: Inter SemiBold 16px / 20px line height
221
- - All text sizes ≥ 14px — meets readability guidelines.
222
-
223
- Keyboard interaction:
224
- - Component must be focusable and operable via keyboard.
225
- - Focus state detected — visible focus indicator (2px ring) meets 3:1 contrast.
226
- - Disabled state: use aria-disabled="true" rather than removing from tab order.
227
- - Expected keyboard behavior: Enter/Space activates the button.
228
-
229
- Screen reader:
230
- - Role: button (native HTML or role="button" for custom elements)
231
- - Label: Computed from visible text content. If icon-only, provide aria-label.
232
- - State: Announce disabled state. Announce loading state with aria-busy="true"
233
- and aria-live="polite" on the status region.
234
-
235
- Color contrast:
236
- - Primary: White text (#FFF) on blue (#0F62FE) = 4.66:1 ratio (passes AA)
237
- - Disabled: Gray text (#8D8D8D) on light gray (#C6C6C6) — verify ≥ 3:1 for
238
- decorative non-text contrast.
239
-
240
- Structure:
241
- - 8 token aliases bound — supports theming.
242
- - Drop shadow: none on default. If added for elevation, verify contrast in all themes.
243
- - Expected ARIA pattern: WAI-ARIA Button pattern
244
- - Minimum contrast requirement: 4.5:1 for normal text, 3:1 for large text
245
-
246
- ---
247
-
248
- ### 10. Usage Guidelines
249
-
250
- ✓ DO:
251
- ✓ Use the variant properties (Hierarchy, Size, State) to configure the button.
252
- Don't detach instances to create custom variations.
253
- ✓ Use boolean toggles (Show Leading Icon, Show Trailing Icon, Is Loading) to
254
- show/hide optional elements instead of deleting layers.
255
- ✓ Keep required elements intact: Label.
256
- ✓ Support all defined states (Default, Hover, Pressed, Focused, Disabled).
257
- ✓ Use Primary hierarchy for the most important action on the page.
258
- Only one Primary button per view/section.
259
- ✓ Use Secondary for supporting actions, Tertiary for low-emphasis actions.
260
- ✓ Preserve auto layout settings — don't switch to absolute positioning.
261
- ✓ Maintain the 8px gap between icon and label.
262
- ✓ Use instance swap properties for icons — only swap in compatible 20×20 icons.
263
- ✓ Test the component in both light and dark themes before publishing.
264
-
265
- ✗ DON'T:
266
- ✗ Don't remove or hide the Label element — this breaks semantic structure.
267
- ✗ Don't create undocumented state variations — extend the variant set formally.
268
- ✗ Don't use buttons for navigation — use Link component instead.
269
- ✗ Don't replace icon swap slots with non-icon components.
270
- ✗ Don't override internal padding or spacing values.
271
- ✗ Don't use opacity to create disabled appearance — use the Disabled state variant.
272
- ✗ Don't place more than one Primary button in the same section.
273
-
274
- ---
275
-
276
- ### 11. Related Components
277
-
278
- Related Component When to Use Instead
279
- ──────────────────────────────────────────────────────────────────
280
- Link / Anchor Use for navigation instead of triggering actions
281
- Icon Button Use for icon-only actions with a tooltip
282
- FAB (Floating Action) Use for the primary page-level action on mobile
283
- Split Button Use when the button needs a dropdown for secondary actions
284
- Toggle Button Use when the button represents an on/off state
285
-
286
- ---
287
-
288
- ## Template Usage Notes
289
-
290
- This template demonstrates the expected quality bar:
291
-
292
- 1. **Every section has content** — even when data is sparse, provide guidance,
293
- recommendations, or explain what's missing and why it matters.
294
-
295
- 2. **Tables are clean and aligned** — use consistent column widths, separator
296
- lines, and clear headers.
297
-
298
- 3. **Descriptive prose accompanies data** — don't just dump a table. Explain
299
- what the data means, why it matters, and what to do about it.
300
-
301
- 4. **Accessibility is specific** — mention exact WCAG criteria, contrast ratios,
302
- keyboard patterns, and screen reader behavior.
303
-
304
- 5. **Usage guidelines are actionable** — each do/don't references a specific
305
- component feature or behavior, not generic advice.
306
-
307
- 6. **Token architecture is explained** — don't just list token names. Explain
308
- the naming pattern, theme behavior, and contrast requirements.
309
-
310
- 7. **States include behavior notes** — describe transitions, timing, cursor
311
- changes, and ARIA state management.
312
-
313
- 8. **Spacing includes size scale** — if the component has size variants, show
314
- how spacing/typography scales across all sizes.