@sarjallab09/figma-intelligence 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/README.md +67 -36
  2. package/dist/bin/cli.js +2 -0
  3. package/dist/design-bridge/bridge.js +2 -0
  4. package/dist/figma-bridge-plugin/bridge-relay.js +2 -0
  5. package/dist/figma-bridge-plugin/code.js +1 -0
  6. package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package-lock.json +0 -3
  7. package/dist/figma-bridge-plugin/ui.html +4970 -0
  8. package/dist/figma-intelligence-layer/dist/index.js +2 -0
  9. package/dist/scripts/clean-existing-chunks.js +2 -0
  10. package/dist/scripts/connect-ai-tool.js +2 -0
  11. package/dist/scripts/convert-hub-pdfs.js +2 -0
  12. package/dist/scripts/figma-mcp-status.js +2 -0
  13. package/dist/scripts/register-codex-mcp.js +2 -0
  14. package/dist/scripts/test-copilot-chat.js +2 -0
  15. package/package.json +11 -8
  16. package/bin/cli.js +0 -859
  17. package/design-bridge/bridge.js +0 -196
  18. package/design-bridge/lib/assets.js +0 -367
  19. package/design-bridge/lib/prompt.js +0 -85
  20. package/design-bridge/lib/server.js +0 -66
  21. package/design-bridge/lib/stitch.js +0 -37
  22. package/design-bridge/lib/tokens.js +0 -82
  23. package/design-bridge/package-lock.json +0 -579
  24. package/figma-bridge-plugin/README.md +0 -97
  25. package/figma-bridge-plugin/anthropic-chat-runner.js +0 -192
  26. package/figma-bridge-plugin/bridge-relay.js +0 -2363
  27. package/figma-bridge-plugin/chat-runner.js +0 -459
  28. package/figma-bridge-plugin/code.js +0 -1528
  29. package/figma-bridge-plugin/codex-runner.js +0 -505
  30. package/figma-bridge-plugin/component-schemas.js +0 -110
  31. package/figma-bridge-plugin/content-context.js +0 -869
  32. package/figma-bridge-plugin/create-button.js +0 -216
  33. package/figma-bridge-plugin/gemini-cli-runner.js +0 -291
  34. package/figma-bridge-plugin/gemini-runner.js +0 -187
  35. package/figma-bridge-plugin/html-to-figma.js +0 -927
  36. package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
  37. package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +0 -159
  38. package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +0 -162
  39. package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +0 -148
  40. package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +0 -314
  41. package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +0 -175
  42. package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +0 -180
  43. package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +0 -165
  44. package/figma-bridge-plugin/perplexity-runner.js +0 -188
  45. package/figma-bridge-plugin/references/SKILL.md +0 -178
  46. package/figma-bridge-plugin/references/anatomy-spec.md +0 -159
  47. package/figma-bridge-plugin/references/api-spec.md +0 -162
  48. package/figma-bridge-plugin/references/color-spec.md +0 -148
  49. package/figma-bridge-plugin/references/full-spec-template.md +0 -314
  50. package/figma-bridge-plugin/references/property-spec.md +0 -175
  51. package/figma-bridge-plugin/references/screen-reader-spec.md +0 -180
  52. package/figma-bridge-plugin/references/structure-spec.md +0 -165
  53. package/figma-bridge-plugin/shared-prompt-config.js +0 -604
  54. package/figma-bridge-plugin/spec-helpers/build-table.js +0 -269
  55. package/figma-bridge-plugin/spec-helpers/classify-elements.js +0 -189
  56. package/figma-bridge-plugin/spec-helpers/index.js +0 -35
  57. package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +0 -49
  58. package/figma-bridge-plugin/spec-helpers/position-markers.js +0 -158
  59. package/figma-bridge-plugin/stitch-auth.js +0 -322
  60. package/figma-bridge-plugin/stitch-runner.js +0 -1427
  61. package/figma-bridge-plugin/token-resolver.js +0 -107
  62. package/figma-bridge-plugin/ui.html +0 -4467
  63. package/figma-intelligence-layer/.env.example +0 -39
  64. package/figma-intelligence-layer/docs/local-image-generation.md +0 -60
  65. package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +0 -101
  66. package/figma-intelligence-layer/jest.config.js +0 -14
  67. package/figma-intelligence-layer/mcp-config.json +0 -19
  68. package/figma-intelligence-layer/package-lock.json +0 -5892
  69. package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +0 -67
  70. package/figma-intelligence-layer/scripts/start-comfyui.sh +0 -33
  71. package/figma-intelligence-layer/src/index.ts +0 -2233
  72. package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +0 -404
  73. package/figma-intelligence-layer/src/shared/cache.ts +0 -187
  74. package/figma-intelligence-layer/src/shared/color-operations.ts +0 -533
  75. package/figma-intelligence-layer/src/shared/color-utils.ts +0 -138
  76. package/figma-intelligence-layer/src/shared/component-script-builder.ts +0 -413
  77. package/figma-intelligence-layer/src/shared/component-templates.ts +0 -2767
  78. package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +0 -694
  79. package/figma-intelligence-layer/src/shared/decision-log.ts +0 -128
  80. package/figma-intelligence-layer/src/shared/design-system-context.ts +0 -568
  81. package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +0 -131
  82. package/figma-intelligence-layer/src/shared/design-system-matcher.ts +0 -184
  83. package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +0 -196
  84. package/figma-intelligence-layer/src/shared/design-system-tokens.ts +0 -295
  85. package/figma-intelligence-layer/src/shared/dtcg-validator.ts +0 -530
  86. package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +0 -671
  87. package/figma-intelligence-layer/src/shared/figma-bridge.ts +0 -1408
  88. package/figma-intelligence-layer/src/shared/font-config.ts +0 -126
  89. package/figma-intelligence-layer/src/shared/icon-catalog.ts +0 -360
  90. package/figma-intelligence-layer/src/shared/icon-fetch.ts +0 -80
  91. package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +0 -162
  92. package/figma-intelligence-layer/src/shared/response-compression.ts +0 -440
  93. package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +0 -324
  94. package/figma-intelligence-layer/src/shared/token-binder.ts +0 -505
  95. package/figma-intelligence-layer/src/shared/token-math.ts +0 -427
  96. package/figma-intelligence-layer/src/shared/token-naming.ts +0 -468
  97. package/figma-intelligence-layer/src/shared/token-utils.ts +0 -420
  98. package/figma-intelligence-layer/src/shared/types.ts +0 -346
  99. package/figma-intelligence-layer/src/shared/typography-presets.ts +0 -94
  100. package/figma-intelligence-layer/src/shared/unsplash.ts +0 -165
  101. package/figma-intelligence-layer/src/shared/vision-client.ts +0 -607
  102. package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +0 -334
  103. package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +0 -446
  104. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +0 -782
  105. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +0 -496
  106. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +0 -230
  107. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +0 -66
  108. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +0 -810
  109. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +0 -1191
  110. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +0 -1346
  111. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +0 -148
  112. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +0 -499
  113. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +0 -910
  114. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +0 -989
  115. package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +0 -1160
  116. package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +0 -424
  117. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +0 -38
  118. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +0 -111
  119. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +0 -114
  120. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +0 -103
  121. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +0 -1060
  122. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +0 -18
  123. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +0 -39
  124. package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +0 -58
  125. package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +0 -298
  126. package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +0 -197
  127. package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +0 -494
  128. package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +0 -356
  129. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +0 -123
  130. package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +0 -663
  131. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +0 -56
  132. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +0 -614
  133. package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +0 -113
  134. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +0 -178
  135. package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +0 -470
  136. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +0 -429
  137. package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +0 -226
  138. package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +0 -535
  139. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +0 -660
  140. package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +0 -209
  141. package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +0 -540
  142. package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +0 -391
  143. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +0 -2019
  144. package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +0 -131
  145. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +0 -381
  146. package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +0 -565
  147. package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +0 -764
  148. package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +0 -535
  149. package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +0 -84
  150. package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +0 -401
  151. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +0 -68
  152. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +0 -78
  153. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +0 -93
  154. package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +0 -596
  155. package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +0 -462
  156. package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +0 -1470
  157. package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +0 -829
  158. package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +0 -702
  159. package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +0 -483
  160. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +0 -501
  161. package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +0 -106
  162. package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +0 -676
  163. package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +0 -560
  164. package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +0 -1043
  165. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +0 -620
  166. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +0 -331
  167. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +0 -77
  168. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +0 -54
  169. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +0 -287
  170. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +0 -71
  171. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +0 -43
  172. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +0 -71
  173. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +0 -221
  174. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +0 -166
  175. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +0 -232
  176. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +0 -234
  177. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +0 -270
  178. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +0 -249
  179. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +0 -231
  180. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +0 -293
  181. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +0 -240
  182. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +0 -243
  183. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +0 -307
  184. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +0 -143
  185. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +0 -227
  186. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +0 -233
  187. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +0 -282
  188. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +0 -276
  189. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +0 -223
  190. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +0 -255
  191. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +0 -289
  192. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +0 -261
  193. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +0 -290
  194. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +0 -265
  195. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +0 -238
  196. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +0 -255
  197. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +0 -128
  198. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +0 -286
  199. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +0 -255
  200. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +0 -330
  201. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +0 -247
  202. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +0 -250
  203. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +0 -247
  204. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +0 -144
  205. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +0 -264
  206. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +0 -251
  207. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +0 -261
  208. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +0 -248
  209. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +0 -270
  210. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +0 -251
  211. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +0 -142
  212. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +0 -282
  213. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +0 -250
  214. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +0 -258
  215. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +0 -265
  216. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +0 -319
  217. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +0 -256
  218. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +0 -232
  219. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +0 -239
  220. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +0 -252
  221. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +0 -270
  222. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +0 -244
  223. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +0 -143
  224. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +0 -243
  225. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +0 -259
  226. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +0 -293
  227. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +0 -144
  228. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +0 -289
  229. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +0 -267
  230. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +0 -232
  231. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +0 -257
  232. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +0 -319
  233. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +0 -121
  234. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +0 -430
  235. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +0 -312
  236. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +0 -129
  237. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +0 -78
  238. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +0 -2333
  239. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +0 -100
  240. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +0 -32
  241. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +0 -59
  242. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +0 -18
  243. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +0 -53
  244. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +0 -19
  245. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +0 -91
  246. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +0 -71
  247. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +0 -19
  248. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +0 -110
  249. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +0 -19
  250. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +0 -67
  251. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +0 -58
  252. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +0 -79
  253. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +0 -50
  254. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +0 -33
  255. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +0 -55
  256. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +0 -73
  257. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +0 -81
  258. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +0 -409
  259. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +0 -198
  260. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +0 -701
  261. package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +0 -88
  262. package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +0 -135
  263. package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +0 -491
  264. package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +0 -416
  265. package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +0 -722
  266. package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +0 -449
  267. package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +0 -393
  268. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +0 -406
  269. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +0 -292
  270. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +0 -24
  271. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +0 -172
  272. package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +0 -409
  273. package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +0 -594
  274. package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +0 -710
  275. package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +0 -458
  276. package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +0 -134
  277. package/figma-intelligence-layer/tests/apg-doc.test.ts +0 -101
  278. package/figma-intelligence-layer/tests/design-system-context.test.ts +0 -152
  279. package/figma-intelligence-layer/tests/design-system-matcher.test.ts +0 -144
  280. package/figma-intelligence-layer/tests/figma-bridge.test.ts +0 -83
  281. package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +0 -56
  282. package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +0 -69
  283. package/figma-intelligence-layer/tests/smoke.test.ts +0 -174
  284. package/figma-intelligence-layer/tests/spec-generator.test.ts +0 -127
  285. package/figma-intelligence-layer/tests/token-migrate.test.ts +0 -21
  286. package/figma-intelligence-layer/tests/token-naming.test.ts +0 -30
  287. package/figma-intelligence-layer/tsconfig.json +0 -19
  288. package/scripts/clean-existing-chunks.js +0 -179
  289. package/scripts/connect-ai-tool.js +0 -490
  290. package/scripts/convert-hub-pdfs.js +0 -425
  291. package/scripts/figma-mcp-status.js +0 -349
  292. package/scripts/register-codex-mcp.js +0 -96
  293. /package/{design-bridge → dist/design-bridge}/.env.example +0 -0
  294. /package/{design-bridge → dist/design-bridge}/package.json +0 -0
  295. /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/manifest.json +0 -0
  296. /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package.json +0 -0
  297. /package/{figma-intelligence-layer → dist/figma-intelligence-layer}/package.json +0 -0
@@ -1,234 +0,0 @@
1
- /**
2
- * alert.ts — Gold-standard design knowledge for Alert components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const alertKnowledge: ComponentKnowledge = {
7
- description:
8
- "Status notification | Inline feedback message | Contextual information banner",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Info",
13
- visualChange: "Blue-tinted background with info circle icon; neutral informational tone",
14
- opacity: "1",
15
- cursorWeb: "default",
16
- usage: "General information or tips that do not require immediate action",
17
- },
18
- {
19
- state: "Success",
20
- visualChange: "Green-tinted background with checkmark circle icon; positive confirmation tone",
21
- opacity: "1",
22
- cursorWeb: "default",
23
- usage: "Operation completed successfully — confirms the user's action",
24
- },
25
- {
26
- state: "Warning",
27
- visualChange: "Yellow/amber-tinted background with triangle exclamation icon; cautionary tone",
28
- opacity: "1",
29
- cursorWeb: "default",
30
- usage: "Potential issue that the user should be aware of but can proceed",
31
- },
32
- {
33
- state: "Error",
34
- visualChange: "Red-tinted background with circle X icon; urgent negative tone",
35
- opacity: "1",
36
- cursorWeb: "default",
37
- usage: "Critical failure or validation error requiring user attention or correction",
38
- },
39
- {
40
- state: "Dismissing",
41
- visualChange: "Alert fades out over 200ms and collapses height to 0; surrounding content reflows",
42
- opacity: "1 → 0",
43
- cursorWeb: "default",
44
- usage: "User clicks the dismiss/close button to remove the alert",
45
- },
46
- {
47
- state: "Hover (Dismiss Button)",
48
- visualChange: "Close icon background shifts to hover token; icon color darkens",
49
- opacity: "1",
50
- cursorWeb: "pointer",
51
- usage: "Mouse enters the dismiss button hit area",
52
- },
53
- ],
54
-
55
- propertyDescriptions: {
56
- severity: "Visual tone and icon selection — info, success, warning, or error — controls background tint and icon",
57
- title: "Optional bold heading text displayed above the description for quick scanning",
58
- description: "Body text explaining the alert message in detail; supports plain text or rich content",
59
- dismissible: "When true, a close button appears allowing the user to remove the alert from view",
60
- icon: "Severity-specific icon rendered at the leading edge; auto-selected by severity or overridden manually",
61
- action: "Optional action button or link rendered at the trailing edge or below the description",
62
- onDismiss: "Callback fired when the dismiss button is clicked; used to remove the alert from state",
63
- },
64
-
65
- sizeSpecifications: [
66
- {
67
- size: "Compact",
68
- height: "40px",
69
- paddingLR: "12px",
70
- fontSize: "13px",
71
- iconSize: "16px",
72
- borderRadius: "6px",
73
- },
74
- {
75
- size: "Standard",
76
- height: "auto",
77
- paddingLR: "16px",
78
- fontSize: "14px",
79
- iconSize: "20px",
80
- borderRadius: "8px",
81
- },
82
- {
83
- size: "Large",
84
- height: "auto",
85
- paddingLR: "20px",
86
- fontSize: "14px",
87
- iconSize: "24px",
88
- borderRadius: "10px",
89
- },
90
- ],
91
-
92
- designTokenBindings: [
93
- {
94
- property: "Info Background",
95
- tokenName: "$alert-info-bg",
96
- role: "Light blue tinted background for informational alerts",
97
- fallback: "#EFF8FF",
98
- },
99
- {
100
- property: "Success Background",
101
- tokenName: "$alert-success-bg",
102
- role: "Light green tinted background for success alerts",
103
- fallback: "#ECFDF3",
104
- },
105
- {
106
- property: "Warning Background",
107
- tokenName: "$alert-warning-bg",
108
- role: "Light amber tinted background for warning alerts",
109
- fallback: "#FFFAEB",
110
- },
111
- {
112
- property: "Error Background",
113
- tokenName: "$alert-error-bg",
114
- role: "Light red tinted background for error alerts",
115
- fallback: "#FEF3F2",
116
- },
117
- {
118
- property: "Border",
119
- tokenName: "$alert-border",
120
- role: "Left accent border or full border matching severity color at medium intensity",
121
- fallback: "currentColor at 40% opacity",
122
- },
123
- {
124
- property: "Title Text",
125
- tokenName: "$alert-title-text",
126
- role: "Heading text color — darker shade of the severity color for hierarchy",
127
- fallback: "#101828",
128
- },
129
- {
130
- property: "Icon Color",
131
- tokenName: "$alert-icon",
132
- role: "Severity icon fill color — matches the severity's primary color",
133
- fallback: "severity-dependent",
134
- },
135
- ],
136
-
137
- structureRules: [
138
- "Container uses horizontal Auto Layout: icon on the left, content area fills, dismiss button on the right",
139
- "Content area uses vertical Auto Layout: title (optional) above description, with $spacing-xs gap",
140
- "A 3-4px accent border on the left edge (or full border) uses the severity color at medium intensity",
141
- "Icon is vertically aligned to the first line of text, not centered to the full container height",
142
- "Dismiss button is a small icon button (16-20px) positioned in the top-right corner of the container",
143
- "Action buttons or links are placed below the description with $spacing-sm top margin",
144
- "Alert container fills the available width of its parent — never fixed width",
145
- ],
146
-
147
- typeHierarchyRules: [
148
- "Title uses Semi-Bold (600) at the same font-size as description for emphasis without size change",
149
- "Description uses Regular weight (400) at the component's base font-size",
150
- "Action link text uses Medium weight (500) with underline on hover",
151
- "Text uses sentence case throughout — no all-caps severity labels",
152
- "Title and description can be combined on a single line for compact alerts",
153
- "Line height is 1.5 for comfortable reading of multi-line descriptions",
154
- ],
155
-
156
- interactionRules: [
157
- { event: "Dismiss Click", trigger: "pointerup on close button", action: "Fire onDismiss callback; animate alert out with fade and height collapse" },
158
- { event: "Action Click", trigger: "pointerup on action button/link", action: "Fire the action handler; alert may remain or dismiss based on context" },
159
- { event: "Focus Dismiss", trigger: "Tab key to close button", action: "Show focus ring on dismiss button" },
160
- { event: "Keydown Enter", trigger: "Enter on focused dismiss button", action: "Dismiss alert (same as click)" },
161
- { event: "Keydown Escape", trigger: "Escape while alert or its children are focused", action: "Dismiss alert if dismissible; otherwise no action" },
162
- { event: "Auto-Dismiss", trigger: "Timer expires (if configured)", action: "Fade out and remove alert after specified duration (e.g., 5000ms)" },
163
- { event: "Hover Dismiss", trigger: "pointerenter on close button", action: "Show hover state on the dismiss icon button" },
164
- ],
165
-
166
- contentGuidance: [
167
- "Write clear, actionable alert messages — tell users what happened and what to do next",
168
- "Use the title for a concise summary (3-8 words) and the description for details",
169
- "Match severity to the actual urgency: info for tips, success for confirmations, warning for caution, error for failures",
170
- "Include an action button or link when the user can take a specific corrective step",
171
- "Avoid stacking more than 2-3 alerts simultaneously — prioritize the most important message",
172
- "Error alerts should explain the cause and suggest a resolution, not just state the failure",
173
- "Do not use alerts for marketing or promotional content — use banners instead",
174
- ],
175
-
176
- responsiveBehaviour: [
177
- { breakpoint: "Mobile (<768px)", behavior: "Alert fills full width; action button stacks below description; dismiss button touch target 44px" },
178
- { breakpoint: "Tablet (768-1023px)", behavior: "Alert spans container width; inline action button if space allows" },
179
- { breakpoint: "Desktop (1024-1439px)", behavior: "Standard layout with icon, content, and dismiss button in a single row" },
180
- { breakpoint: "Ultra-wide (>=1440px)", behavior: "Alert max-width may be capped by parent container; does not stretch infinitely" },
181
- ],
182
-
183
- accessibilitySpec: {
184
- intro:
185
- "Alerts must communicate their severity and content to assistive technology. Persistent alerts use role='alert'; status updates use role='status'.",
186
- requirements: [
187
- { requirement: "role='alert'", level: "A", notes: "Error and warning alerts use role='alert' to trigger assertive announcements by screen readers" },
188
- { requirement: "role='status'", level: "A", notes: "Info and success alerts use role='status' for polite announcements that do not interrupt" },
189
- { requirement: "aria-live", level: "A", notes: "Dynamically injected alerts must use aria-live='assertive' (errors) or 'polite' (info/success)" },
190
- { requirement: "Icon + Text", level: "A", notes: "Severity must be conveyed by both color AND icon/text — never by color alone" },
191
- { requirement: "Dismiss Label", level: "A", notes: "Close button must have aria-label='Dismiss' or 'Close alert' for screen readers" },
192
- { requirement: "Contrast", level: "AA", notes: "Text-to-background: 4.5:1; icon and border to background: 3:1 for each severity" },
193
- { requirement: "Focus Management", level: "AA", notes: "After dismissal, focus moves to a logical next element — not lost in the void" },
194
- ],
195
- outro: [
196
- "Screen readers should announce severity, title, and description when the alert appears",
197
- "Auto-dismissing alerts must remain visible long enough for screen reader users to hear the full message",
198
- ],
199
- },
200
-
201
- qaAcceptanceCriteria: [
202
- { check: "Severity Variants", platform: "All", expectedResult: "Each severity (info, success, warning, error) renders correct background, icon, and border color" },
203
- { check: "Dismiss Animation", platform: "Web", expectedResult: "Alert fades out over 200ms and collapses height; surrounding content reflows smoothly" },
204
- { check: "Dismiss Focus", platform: "Web", expectedResult: "After dismissal, focus moves to the next focusable element in the DOM" },
205
- { check: "Action Button", platform: "All", expectedResult: "Action button renders inline or below description; fires handler on click" },
206
- { check: "Icon Alignment", platform: "All", expectedResult: "Severity icon aligns to the first line of text, not vertically centered" },
207
- { check: "Screen Reader", platform: "Web", expectedResult: "Announces severity and message via role='alert' or role='status' appropriately" },
208
- { check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab reaches dismiss button and action link; Enter activates them" },
209
- { check: "Auto-Dismiss", platform: "Web", expectedResult: "When configured, alert disappears after timeout; mouse hover pauses the timer" },
210
- { check: "Title + Description", platform: "All", expectedResult: "Title renders bold above description; omitting title still renders correctly" },
211
- { check: "Full Width", platform: "All", expectedResult: "Alert spans the full width of its container without horizontal overflow" },
212
- { check: "Contrast per Severity", platform: "All", expectedResult: "All four severity variants pass 4.5:1 text and 3:1 non-text contrast" },
213
- ],
214
-
215
- dos: [
216
- "Use the appropriate severity level that matches the actual urgency of the message",
217
- "Include a specific icon for each severity to reinforce the meaning beyond color alone",
218
- "Write actionable descriptions that tell users what happened and what to do next",
219
- "Allow users to dismiss non-critical alerts (info, success) with a close button",
220
- "Keep error alerts persistent until the underlying issue is resolved",
221
- "Place alerts near the relevant content or at the top of the page for global messages",
222
- "Use a left accent border to reinforce the severity color and visual grouping",
223
- ],
224
-
225
- donts: [
226
- "Do not use color alone to communicate severity — always pair with an icon and text",
227
- "Do not stack more than 3 alerts at once — consolidate or prioritize messages",
228
- "Do not auto-dismiss error alerts — they require user attention and action",
229
- "Do not use alerts for lengthy content — keep messages under 3 sentences",
230
- "Do not place alerts inside other alerts or inside modals unless contextually appropriate",
231
- "Do not use warning severity for informational messages — match the tone to the content",
232
- "Do not remove the alert from the DOM without an exit animation — sudden disappearance is jarring",
233
- ],
234
- };
@@ -1,270 +0,0 @@
1
- /**
2
- * avatar-group.ts — Gold-standard design knowledge for Avatar Group components
3
- */
4
- import type { ComponentKnowledge } from "../types.js";
5
-
6
- export const avatarGroupKnowledge: ComponentKnowledge = {
7
- description:
8
- "Overlapping row of avatars | Displays multiple users or entities | Shows overflow count for truncated members",
9
-
10
- stateSpecifications: [
11
- {
12
- state: "Default",
13
- visualChange: "Avatars render in an overlapping horizontal row with a consistent negative margin; overflow indicator shows '+N' count",
14
- opacity: "1",
15
- cursorWeb: "default",
16
- usage: "Resting state displaying the visible set of avatars and the overflow count if applicable",
17
- },
18
- {
19
- state: "Hover (Avatar)",
20
- visualChange: "Individual avatar scales up slightly (1.05) and gains a subtle elevation shadow; z-index raises above siblings",
21
- opacity: "1",
22
- cursorWeb: "pointer",
23
- usage: "Mouse cursor enters an individual avatar within the group to preview identity",
24
- },
25
- {
26
- state: "Hover (Overflow)",
27
- visualChange: "Overflow indicator background darkens one step; cursor changes to pointer to indicate clickability",
28
- opacity: "1",
29
- cursorWeb: "pointer",
30
- usage: "Mouse cursor enters the '+N' overflow indicator — typically opens a popover with the full member list",
31
- },
32
- {
33
- state: "Focus (Avatar)",
34
- visualChange: "2px focus ring offset by 2px from the avatar's circular edge, using $focus-ring token",
35
- opacity: "1",
36
- cursorWeb: "pointer",
37
- usage: "Individual avatar receives keyboard focus via Tab for interaction (profile link, tooltip, etc.)",
38
- },
39
- {
40
- state: "Focus (Overflow)",
41
- visualChange: "2px focus ring on the overflow indicator circle; background shifts to focus state",
42
- opacity: "1",
43
- cursorWeb: "pointer",
44
- usage: "Overflow indicator receives keyboard focus via Tab key navigation",
45
- },
46
- {
47
- state: "Loading",
48
- visualChange: "Avatar circles display a skeleton pulse animation; images have not yet loaded",
49
- opacity: "0.6",
50
- cursorWeb: "default",
51
- usage: "Avatar images are being fetched; placeholder skeletons indicate loading progress",
52
- },
53
- ],
54
-
55
- propertyDescriptions: {
56
- avatars: "Array of avatar data objects, each containing src (image URL), alt (accessible name), fallback (initials or icon), and optional href",
57
- maxVisible: "Maximum number of avatars to render before truncating with an overflow indicator — common values are 3, 4, or 5",
58
- size: "Dimensional preset controlling avatar diameter, font size for initials, and overlap offset (Small, Medium, Large, X-Large)",
59
- total: "Total count of members represented by the group; used to calculate the overflow indicator count (total - maxVisible)",
60
- onOverflowClick: "Callback fired when the '+N' overflow indicator is clicked; typically opens a popover or modal with the full list",
61
- spacing: "Negative margin between adjacent avatars controlling the overlap amount; defaults to -8px for Medium size",
62
- borderColor: "Color of the ring/border around each avatar that separates overlapping avatars visually; typically matches the page background",
63
- borderWidth: "Width of the separator ring around each avatar; default is 2px",
64
- direction: "Stack direction for the overlap — 'left' (default) means later avatars overlap to the left; 'right' reverses the stack",
65
- tooltip: "When true, hovering an individual avatar shows a tooltip with the person's name",
66
- interactive: "When true, individual avatars are clickable/focusable and fire an onClick handler; default is false",
67
- },
68
-
69
- sizeSpecifications: [
70
- {
71
- size: "Small",
72
- height: "24px",
73
- paddingLR: "0px",
74
- fontSize: "10px",
75
- iconSize: "12px",
76
- borderRadius: "12px (full circle)",
77
- },
78
- {
79
- size: "Medium",
80
- height: "32px",
81
- paddingLR: "0px",
82
- fontSize: "12px",
83
- iconSize: "16px",
84
- borderRadius: "16px (full circle)",
85
- },
86
- {
87
- size: "Large",
88
- height: "40px",
89
- paddingLR: "0px",
90
- fontSize: "14px",
91
- iconSize: "20px",
92
- borderRadius: "20px (full circle)",
93
- },
94
- {
95
- size: "X-Large",
96
- height: "48px",
97
- paddingLR: "0px",
98
- fontSize: "16px",
99
- iconSize: "24px",
100
- borderRadius: "24px (full circle)",
101
- },
102
- ],
103
-
104
- designTokenBindings: [
105
- {
106
- property: "Avatar Background",
107
- tokenName: "$avatar-bg",
108
- role: "Fallback background color when no image is provided — initials are rendered on this fill",
109
- fallback: "#E5E7EB",
110
- },
111
- {
112
- property: "Avatar Text",
113
- tokenName: "$avatar-initials-text",
114
- role: "Text color for initials rendered inside the avatar circle",
115
- fallback: "#374151",
116
- },
117
- {
118
- property: "Border Ring",
119
- tokenName: "$avatar-group-ring",
120
- role: "Ring color separating overlapping avatars — matches the underlying page surface",
121
- fallback: "#FFFFFF",
122
- },
123
- {
124
- property: "Overflow Background",
125
- tokenName: "$avatar-overflow-bg",
126
- role: "Background fill for the '+N' overflow indicator circle",
127
- fallback: "#F3F4F6",
128
- },
129
- {
130
- property: "Overflow Text",
131
- tokenName: "$avatar-overflow-text",
132
- role: "Text color for the '+N' count inside the overflow indicator",
133
- fallback: "#374151",
134
- },
135
- {
136
- property: "Overflow Hover Background",
137
- tokenName: "$avatar-overflow-hover-bg",
138
- role: "Background fill for the overflow indicator on hover",
139
- fallback: "#E5E7EB",
140
- },
141
- {
142
- property: "Image Object Fit",
143
- tokenName: "$avatar-image-fit",
144
- role: "Object-fit value for avatar images — cover ensures the image fills the circle without distortion",
145
- fallback: "cover",
146
- },
147
- {
148
- property: "Skeleton Pulse",
149
- tokenName: "$skeleton-pulse",
150
- role: "Animation for loading skeleton state of avatar circles",
151
- fallback: "pulse 1.5s ease-in-out infinite",
152
- },
153
- {
154
- property: "Focus Ring",
155
- tokenName: "$focus-ring",
156
- role: "Keyboard focus indicator ring for interactive avatars and overflow indicator",
157
- fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
158
- },
159
- {
160
- property: "Transition",
161
- tokenName: "$transition-avatar",
162
- role: "Smooth transition for hover scale and shadow effects on individual avatars",
163
- fallback: "150ms ease-in-out",
164
- },
165
- ],
166
-
167
- structureRules: [
168
- "Avatar group uses horizontal Auto Layout with negative spacing (overlap) between avatar items",
169
- "Each avatar is a circular container with overflow hidden clipping the image or initials to a circle",
170
- "A 2px solid border ring in the page background color is applied to each avatar to visually separate overlapping circles",
171
- "Avatars are stacked with increasing z-index from left to right — the rightmost avatar appears on top",
172
- "The overflow indicator is the last element in the row, styled as a circle with the same diameter as the avatars",
173
- "Overflow indicator renders '+N' text centered within the circle where N is (total - maxVisible)",
174
- "If total equals maxVisible or fewer, the overflow indicator is not rendered",
175
- "When interactive is true, each avatar is wrapped in a focusable button or anchor element",
176
- "Tooltip containers are absolutely positioned above/below each avatar and appear on hover with a short delay",
177
- ],
178
-
179
- typeHierarchyRules: [
180
- "Initials text uses font-weight Semi-Bold (600) and is sized proportionally to the avatar diameter",
181
- "Overflow count text uses font-weight Medium (500) at the same font size as initials",
182
- "Tooltip text uses Regular (400) weight at the Small body font size (12px)",
183
- "All text within avatars is uppercase for initials — single or double character maximum",
184
- "Overflow count always uses the plus symbol followed by the number — '+3', not '3 more'",
185
- ],
186
-
187
- interactionRules: [
188
- { event: "Hover Avatar", trigger: "pointerenter on individual avatar", action: "Scale avatar to 1.05, raise z-index, and show tooltip with name if tooltip is enabled" },
189
- { event: "Click Avatar", trigger: "pointerup on individual avatar", action: "Fire the avatar's onClick handler if interactive is true; typically navigates to profile" },
190
- { event: "Hover Overflow", trigger: "pointerenter on overflow indicator", action: "Darken background to hover token; show cursor pointer" },
191
- { event: "Click Overflow", trigger: "pointerup on overflow indicator", action: "Fire onOverflowClick callback; typically opens a popover or modal with the full member list" },
192
- { event: "Focus Avatar", trigger: "Tab key focuses an interactive avatar", action: "Show focus ring around the avatar circle; announce the person's name" },
193
- { event: "Focus Overflow", trigger: "Tab key focuses the overflow indicator", action: "Show focus ring; announce 'N more members' to screen readers" },
194
- { event: "Enter / Space", trigger: "Enter or Space on a focused avatar or overflow", action: "Fire the same action as a click on that element" },
195
- { event: "Image Error", trigger: "Avatar image fails to load", action: "Fall back to initials or default icon placeholder" },
196
- ],
197
-
198
- contentGuidance: [
199
- "Always provide meaningful alt text for each avatar — use the person's full name, not just initials",
200
- "Overflow indicator should clearly communicate the additional count — use '+N' format consistently",
201
- "When displaying teams or groups, order avatars by relevance (most recently active or most relevant first)",
202
- "Limit maxVisible to 3-5 avatars — more than 5 visible avatars creates visual clutter",
203
- "Provide a tooltip or popover on the overflow indicator so users can discover who else is included",
204
- "Initials fallback should use first and last name initials — 'JD' for John Doe, not just 'J'",
205
- "Avatar images should be appropriately sized for the avatar diameter — avoid loading full-resolution photos",
206
- ],
207
-
208
- responsiveBehaviour: [
209
- { breakpoint: "Mobile (<768px)", behavior: "Reduce maxVisible to 3; use Small size; overflow indicator is touch-friendly at 44px minimum" },
210
- { breakpoint: "Tablet (768-1023px)", behavior: "Display up to 4 visible avatars at Medium size; overflow opens a bottom sheet on tap" },
211
- { breakpoint: "Desktop (1024-1439px)", behavior: "Display up to 5 visible avatars at Medium or Large size; overflow opens a popover" },
212
- { breakpoint: "Ultra-wide (>=1440px)", behavior: "Avatar sizes remain capped at X-Large — do not scale proportionally with viewport" },
213
- ],
214
-
215
- accessibilitySpec: {
216
- intro:
217
- "Avatar groups must convey group membership and count to assistive technologies, with individual avatars identified by name and the overflow count clearly announced.",
218
- requirements: [
219
- { requirement: "Group Role", level: "A", notes: "The container must use role='group' with an aria-label describing the group (e.g., 'Team members')" },
220
- { requirement: "Avatar Alt Text", level: "A", notes: "Each avatar image must have meaningful alt text — the person's name, not 'avatar' or 'user'" },
221
- { requirement: "Overflow Announcement", level: "A", notes: "Overflow indicator must have an aria-label like 'Show 5 more members' — not just '+5'" },
222
- { requirement: "Focusable Elements", level: "A", notes: "When interactive, each avatar and the overflow indicator must be focusable via Tab key" },
223
- { requirement: "Keyboard Activation", level: "A", notes: "Enter and Space must activate the focused avatar or overflow indicator" },
224
- { requirement: "Contrast Ratio", level: "AA", notes: "Initials text and overflow count must meet 4.5:1 contrast against their background fills" },
225
- { requirement: "Touch Target", level: "AA", notes: "Interactive avatars and overflow indicator must have 44x44px minimum touch area" },
226
- { requirement: "Decorative Images", level: "A", notes: "If avatars are purely decorative (non-interactive, no tooltip), use aria-hidden='true' on images" },
227
- ],
228
- outro: [
229
- "Verify with screen readers that the group label, individual avatar names, and overflow count are all announced in sequence",
230
- "Ensure that the focus order follows the visual order — left to right for LTR, right to left for RTL",
231
- "Test that image load failures gracefully fall back to initials with correct alt text preserved",
232
- ],
233
- },
234
-
235
- qaAcceptanceCriteria: [
236
- { check: "Overlap Rendering", platform: "All", expectedResult: "Avatars overlap with consistent negative margin; border rings separate each circle" },
237
- { check: "Overflow Count", platform: "All", expectedResult: "'+N' indicator shows correct count based on total minus maxVisible" },
238
- { check: "Image Fallback", platform: "All", expectedResult: "Failed image loads fall back to initials or default icon without layout shift" },
239
- { check: "Hover Scale", platform: "Web", expectedResult: "Hovered avatar scales to 1.05 and raises above siblings smoothly" },
240
- { check: "Tooltip Display", platform: "Web", expectedResult: "Hovering an avatar shows the person's name in a tooltip after a short delay" },
241
- { check: "Overflow Click", platform: "Web", expectedResult: "Clicking '+N' fires onOverflowClick callback; typically opens a member list popover" },
242
- { check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab moves focus through interactive avatars and overflow; Enter/Space activates" },
243
- { check: "Screen Reader", platform: "Web", expectedResult: "Announces group label, each avatar name, and overflow count with meaningful text" },
244
- { check: "RTL Support", platform: "Web", expectedResult: "Overlap direction reverses; focus order matches visual right-to-left layout" },
245
- { check: "Skeleton Loading", platform: "All", expectedResult: "Loading state shows pulsing skeleton circles in the correct layout positions" },
246
- { check: "Size Variants", platform: "All", expectedResult: "Each size (sm/md/lg/xl) renders correct diameter, font size, and overlap amount" },
247
- { check: "Contrast", platform: "All", expectedResult: "Initials and overflow text pass 4.5:1 contrast against their background fills" },
248
- { check: "Touch Target", platform: "Mobile", expectedResult: "Interactive avatars have 44x44px minimum touch area even at Small size" },
249
- ],
250
-
251
- dos: [
252
- "Use avatar groups to represent team membership, collaborators, or participants in a shared context",
253
- "Always provide a border ring that matches the page background to visually separate overlapping avatars",
254
- "Include an overflow indicator with a clickable action to reveal the full member list",
255
- "Order avatars by relevance — most recently active or most relevant members should appear first",
256
- "Provide meaningful alt text for each avatar using the person's full name",
257
- "Use consistent avatar sizes within a single group — never mix sizes",
258
- "Implement image fallback to initials or a default icon for failed or missing image loads",
259
- ],
260
-
261
- donts: [
262
- "Do not display more than 5 visible avatars — use the overflow indicator for additional members",
263
- "Do not omit the overflow indicator when the total exceeds maxVisible — users need to know more exist",
264
- "Do not use random or auto-generated colors for initials backgrounds — use consistent, accessible tokens",
265
- "Do not remove the border ring between overlapping avatars — they become visually indistinguishable",
266
- "Do not use vague alt text like 'avatar' or 'user' — always use the person's name",
267
- "Do not make avatars interactive without providing keyboard focus management and ARIA roles",
268
- "Do not load full-resolution photos for small avatar circles — serve appropriately sized thumbnails",
269
- ],
270
- };