@sarjallab09/figma-intelligence 1.0.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.
- package/LICENSE +26 -0
- package/README.md +327 -0
- package/bin/cli.js +859 -0
- package/design-bridge/.env.example +5 -0
- package/design-bridge/bridge.js +196 -0
- package/design-bridge/lib/assets.js +367 -0
- package/design-bridge/lib/prompt.js +85 -0
- package/design-bridge/lib/server.js +66 -0
- package/design-bridge/lib/stitch.js +37 -0
- package/design-bridge/lib/tokens.js +82 -0
- package/design-bridge/package-lock.json +579 -0
- package/design-bridge/package.json +19 -0
- package/figma-bridge-plugin/README.md +97 -0
- package/figma-bridge-plugin/anthropic-chat-runner.js +192 -0
- package/figma-bridge-plugin/bridge-relay.js +2363 -0
- package/figma-bridge-plugin/chat-runner.js +459 -0
- package/figma-bridge-plugin/code.js +1528 -0
- package/figma-bridge-plugin/codex-runner.js +505 -0
- package/figma-bridge-plugin/component-schemas.js +110 -0
- package/figma-bridge-plugin/content-context.js +869 -0
- package/figma-bridge-plugin/create-button.js +216 -0
- package/figma-bridge-plugin/gemini-cli-runner.js +291 -0
- package/figma-bridge-plugin/gemini-runner.js +187 -0
- package/figma-bridge-plugin/html-to-figma.js +927 -0
- package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +159 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +162 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +148 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +314 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +175 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +180 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +165 -0
- package/figma-bridge-plugin/manifest.json +21 -0
- package/figma-bridge-plugin/package-lock.json +1936 -0
- package/figma-bridge-plugin/package.json +20 -0
- package/figma-bridge-plugin/perplexity-runner.js +188 -0
- package/figma-bridge-plugin/references/SKILL.md +178 -0
- package/figma-bridge-plugin/references/anatomy-spec.md +159 -0
- package/figma-bridge-plugin/references/api-spec.md +162 -0
- package/figma-bridge-plugin/references/color-spec.md +148 -0
- package/figma-bridge-plugin/references/full-spec-template.md +314 -0
- package/figma-bridge-plugin/references/property-spec.md +175 -0
- package/figma-bridge-plugin/references/screen-reader-spec.md +180 -0
- package/figma-bridge-plugin/references/structure-spec.md +165 -0
- package/figma-bridge-plugin/shared-prompt-config.js +604 -0
- package/figma-bridge-plugin/spec-helpers/build-table.js +269 -0
- package/figma-bridge-plugin/spec-helpers/classify-elements.js +189 -0
- package/figma-bridge-plugin/spec-helpers/index.js +35 -0
- package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +49 -0
- package/figma-bridge-plugin/spec-helpers/position-markers.js +158 -0
- package/figma-bridge-plugin/stitch-auth.js +322 -0
- package/figma-bridge-plugin/stitch-runner.js +1427 -0
- package/figma-bridge-plugin/token-resolver.js +107 -0
- package/figma-bridge-plugin/ui.html +4467 -0
- package/figma-intelligence-layer/.env.example +39 -0
- package/figma-intelligence-layer/docs/local-image-generation.md +60 -0
- package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +101 -0
- package/figma-intelligence-layer/jest.config.js +14 -0
- package/figma-intelligence-layer/mcp-config.json +19 -0
- package/figma-intelligence-layer/package-lock.json +5892 -0
- package/figma-intelligence-layer/package.json +48 -0
- package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +67 -0
- package/figma-intelligence-layer/scripts/start-comfyui.sh +33 -0
- package/figma-intelligence-layer/src/index.ts +2233 -0
- package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +404 -0
- package/figma-intelligence-layer/src/shared/cache.ts +187 -0
- package/figma-intelligence-layer/src/shared/color-operations.ts +533 -0
- package/figma-intelligence-layer/src/shared/color-utils.ts +138 -0
- package/figma-intelligence-layer/src/shared/component-script-builder.ts +413 -0
- package/figma-intelligence-layer/src/shared/component-templates.ts +2767 -0
- package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +694 -0
- package/figma-intelligence-layer/src/shared/decision-log.ts +128 -0
- package/figma-intelligence-layer/src/shared/design-system-context.ts +568 -0
- package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +131 -0
- package/figma-intelligence-layer/src/shared/design-system-matcher.ts +184 -0
- package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +196 -0
- package/figma-intelligence-layer/src/shared/design-system-tokens.ts +295 -0
- package/figma-intelligence-layer/src/shared/dtcg-validator.ts +530 -0
- package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +671 -0
- package/figma-intelligence-layer/src/shared/figma-bridge.ts +1408 -0
- package/figma-intelligence-layer/src/shared/font-config.ts +126 -0
- package/figma-intelligence-layer/src/shared/icon-catalog.ts +360 -0
- package/figma-intelligence-layer/src/shared/icon-fetch.ts +80 -0
- package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +162 -0
- package/figma-intelligence-layer/src/shared/response-compression.ts +440 -0
- package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +324 -0
- package/figma-intelligence-layer/src/shared/token-binder.ts +505 -0
- package/figma-intelligence-layer/src/shared/token-math.ts +427 -0
- package/figma-intelligence-layer/src/shared/token-naming.ts +468 -0
- package/figma-intelligence-layer/src/shared/token-utils.ts +420 -0
- package/figma-intelligence-layer/src/shared/types.ts +346 -0
- package/figma-intelligence-layer/src/shared/typography-presets.ts +94 -0
- package/figma-intelligence-layer/src/shared/unsplash.ts +165 -0
- package/figma-intelligence-layer/src/shared/vision-client.ts +607 -0
- package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +334 -0
- package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +446 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +782 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +496 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +230 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +66 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +810 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +1191 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +1346 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +148 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +499 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +910 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +989 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +1160 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +424 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +38 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +111 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +114 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +103 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +1060 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +18 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +39 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +58 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +298 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +197 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +494 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +356 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +123 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +663 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +56 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +614 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +113 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +178 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +470 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +429 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +226 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +535 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +660 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +209 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +540 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +391 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +2019 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +131 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +381 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +565 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +764 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +535 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +84 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +401 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +68 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +78 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +93 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +596 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +462 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +1470 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +829 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +702 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +483 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +501 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +106 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +676 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +560 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +1043 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +620 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +331 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +77 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +54 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +287 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +43 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +221 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +166 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +234 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +249 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +231 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +293 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +240 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +243 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +307 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +143 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +227 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +233 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +282 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +276 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +223 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +289 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +261 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +290 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +265 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +238 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +128 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +286 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +330 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +247 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +250 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +247 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +144 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +264 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +251 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +261 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +248 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +251 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +142 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +282 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +250 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +258 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +265 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +319 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +256 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +239 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +252 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +244 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +143 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +243 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +259 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +293 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +144 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +289 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +267 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +257 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +319 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +121 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +430 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +312 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +129 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +78 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +2333 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +100 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +32 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +59 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +18 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +53 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +91 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +110 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +67 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +58 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +79 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +50 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +33 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +55 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +73 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +81 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +409 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +198 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +701 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +88 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +135 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +491 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +416 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +722 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +449 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +393 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +406 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +292 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +24 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +172 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +409 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +594 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +710 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +458 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +134 -0
- package/figma-intelligence-layer/tests/apg-doc.test.ts +101 -0
- package/figma-intelligence-layer/tests/design-system-context.test.ts +152 -0
- package/figma-intelligence-layer/tests/design-system-matcher.test.ts +144 -0
- package/figma-intelligence-layer/tests/figma-bridge.test.ts +83 -0
- package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +56 -0
- package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +69 -0
- package/figma-intelligence-layer/tests/smoke.test.ts +174 -0
- package/figma-intelligence-layer/tests/spec-generator.test.ts +127 -0
- package/figma-intelligence-layer/tests/token-migrate.test.ts +21 -0
- package/figma-intelligence-layer/tests/token-naming.test.ts +30 -0
- package/figma-intelligence-layer/tsconfig.json +19 -0
- package/package.json +35 -0
- package/scripts/clean-existing-chunks.js +179 -0
- package/scripts/connect-ai-tool.js +490 -0
- package/scripts/convert-hub-pdfs.js +425 -0
- package/scripts/figma-mcp-status.js +349 -0
- package/scripts/register-codex-mcp.js +96 -0
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,270 @@
|
|
|
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
|
+
};
|