@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/spinner.ts
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spinner.ts — Gold-standard design knowledge for Spinner / Loader components
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
+
|
|
6
|
+
export const spinnerKnowledge: ComponentKnowledge = {
|
|
7
|
+
description:
|
|
8
|
+
"Indeterminate loading indicator | Circular progress spinner | Asynchronous status feedback",
|
|
9
|
+
|
|
10
|
+
stateSpecifications: [
|
|
11
|
+
{
|
|
12
|
+
state: "Active",
|
|
13
|
+
visualChange: "Circular track visible with animated indicator arc rotating continuously at a steady cadence",
|
|
14
|
+
opacity: "1",
|
|
15
|
+
cursorWeb: "default",
|
|
16
|
+
usage: "An asynchronous operation is in progress — data is loading, processing, or being fetched",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
state: "Complete",
|
|
20
|
+
visualChange: "Indicator arc fills to 100% and transitions into a checkmark icon over 300ms; optional success color shift",
|
|
21
|
+
opacity: "1",
|
|
22
|
+
cursorWeb: "default",
|
|
23
|
+
usage: "The asynchronous operation has finished successfully; provides completion feedback before the spinner is removed",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
state: "Overlay",
|
|
27
|
+
visualChange: "Semi-transparent backdrop covers the parent container or viewport; spinner is centered on the backdrop",
|
|
28
|
+
opacity: "1",
|
|
29
|
+
cursorWeb: "wait",
|
|
30
|
+
usage: "Blocking loading state — prevents interaction with underlying content while the operation completes",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
state: "Inline",
|
|
34
|
+
visualChange: "Small spinner renders inline with text or within a button; no backdrop or blocking behavior",
|
|
35
|
+
opacity: "1",
|
|
36
|
+
cursorWeb: "default",
|
|
37
|
+
usage: "Lightweight loading indicator within a component (e.g., inside a button or adjacent to a label)",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
state: "Hidden",
|
|
41
|
+
visualChange: "Spinner is removed from the DOM or set to display:none; aria-busy removed from parent",
|
|
42
|
+
opacity: "0",
|
|
43
|
+
cursorWeb: "default",
|
|
44
|
+
usage: "Loading is complete and the spinner is no longer needed; content is now fully rendered",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
propertyDescriptions: {
|
|
49
|
+
size: "Dimensional preset controlling the spinner diameter and stroke width (Extra Small, Small, Medium, Large, Extra Large)",
|
|
50
|
+
label: "Screen-reader-only text describing the loading context (e.g., 'Loading search results'); visually hidden but announced by assistive technology",
|
|
51
|
+
overlay: "When true, renders a semi-transparent backdrop behind the spinner that blocks interaction with underlying content",
|
|
52
|
+
color: "Color variant for the indicator arc — primary (default brand color), inverse (for dark backgrounds), or inherit (matches parent text color)",
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
sizeSpecifications: [
|
|
56
|
+
{
|
|
57
|
+
size: "Extra Small",
|
|
58
|
+
height: "16px",
|
|
59
|
+
paddingLR: "0px",
|
|
60
|
+
fontSize: "N/A",
|
|
61
|
+
iconSize: "16px",
|
|
62
|
+
borderRadius: "0px",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
size: "Small",
|
|
66
|
+
height: "24px",
|
|
67
|
+
paddingLR: "0px",
|
|
68
|
+
fontSize: "N/A",
|
|
69
|
+
iconSize: "24px",
|
|
70
|
+
borderRadius: "0px",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
size: "Medium",
|
|
74
|
+
height: "32px",
|
|
75
|
+
paddingLR: "0px",
|
|
76
|
+
fontSize: "N/A",
|
|
77
|
+
iconSize: "32px",
|
|
78
|
+
borderRadius: "0px",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
size: "Large",
|
|
82
|
+
height: "48px",
|
|
83
|
+
paddingLR: "0px",
|
|
84
|
+
fontSize: "N/A",
|
|
85
|
+
iconSize: "48px",
|
|
86
|
+
borderRadius: "0px",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
size: "Extra Large",
|
|
90
|
+
height: "64px",
|
|
91
|
+
paddingLR: "0px",
|
|
92
|
+
fontSize: "N/A",
|
|
93
|
+
iconSize: "64px",
|
|
94
|
+
borderRadius: "0px",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
|
|
98
|
+
designTokenBindings: [
|
|
99
|
+
{
|
|
100
|
+
property: "Track Color",
|
|
101
|
+
tokenName: "$spinner-track",
|
|
102
|
+
role: "Background circular track visible behind the animated indicator arc",
|
|
103
|
+
fallback: "#E4E7EC",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
property: "Indicator Color",
|
|
107
|
+
tokenName: "$spinner-indicator",
|
|
108
|
+
role: "Animated arc color — the primary visual element of the spinner",
|
|
109
|
+
fallback: "#2563EB",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
property: "Inverse Indicator",
|
|
113
|
+
tokenName: "$spinner-indicator-inverse",
|
|
114
|
+
role: "Indicator color for use on dark or colored backgrounds",
|
|
115
|
+
fallback: "#FFFFFF",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
property: "Overlay Background",
|
|
119
|
+
tokenName: "$spinner-overlay-bg",
|
|
120
|
+
role: "Semi-transparent backdrop color for the overlay variant",
|
|
121
|
+
fallback: "rgba(255,255,255,0.7)",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
property: "Animation Duration",
|
|
125
|
+
tokenName: "$transition-spinner",
|
|
126
|
+
role: "Duration of one full rotation cycle of the indicator arc",
|
|
127
|
+
fallback: "800ms",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
property: "Animation Easing",
|
|
131
|
+
tokenName: "$easing-spinner",
|
|
132
|
+
role: "Easing curve for the rotation animation — linear for steady cadence",
|
|
133
|
+
fallback: "linear",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
property: "Z-Index Overlay",
|
|
137
|
+
tokenName: "$z-spinner-overlay",
|
|
138
|
+
role: "Stacking order for the overlay variant — above content but below modals",
|
|
139
|
+
fallback: "1050",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
|
|
143
|
+
structureRules: [
|
|
144
|
+
"Spinner uses an SVG circle element with stroke-dasharray and stroke-dashoffset for the animated arc, or equivalent CSS animation on a bordered div",
|
|
145
|
+
"Track is a full circle with the $spinner-track color; indicator arc covers approximately 75% of the circumference",
|
|
146
|
+
"Stroke width scales proportionally with spinner size — 2px for xs/sm, 3px for md, 4px for lg/xl",
|
|
147
|
+
"Overlay variant renders a full-coverage backdrop div with flexbox centering for the spinner element",
|
|
148
|
+
"Spinner container has equal width and height (square aspect ratio) with no internal padding",
|
|
149
|
+
"Inline spinners must not alter the line height or layout flow of their parent container",
|
|
150
|
+
"The animation uses CSS @keyframes rotate or SVG animateTransform — no JavaScript interval timers",
|
|
151
|
+
],
|
|
152
|
+
|
|
153
|
+
typeHierarchyRules: [
|
|
154
|
+
"Spinners have no visible text — the label property is screen-reader-only using visually-hidden utility class",
|
|
155
|
+
"When paired with a visible loading message, the message text uses body font size and Regular (400) weight",
|
|
156
|
+
"Visible loading text is centered below the spinner with $spacing-sm (8px) gap",
|
|
157
|
+
"Never display percentage text alongside an indeterminate spinner — use a progress bar for determinate loading",
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
interactionRules: [
|
|
161
|
+
{ event: "Appear", trigger: "Loading operation begins", action: "Render spinner with fade-in over 100ms; set aria-busy='true' on parent container" },
|
|
162
|
+
{ event: "Disappear", trigger: "Loading operation completes", action: "Fade out over 150ms; remove aria-busy; optionally show completion checkmark for 500ms" },
|
|
163
|
+
{ event: "Overlay Block", trigger: "Overlay variant is active", action: "Prevent pointer events on underlying content; set cursor to wait on the backdrop" },
|
|
164
|
+
{ event: "Escape (Overlay)", trigger: "Escape key while overlay spinner is visible", action: "Cancel the loading operation if cancellation is supported; otherwise no action" },
|
|
165
|
+
{ event: "Reduced Motion", trigger: "prefers-reduced-motion media query matches", action: "Replace rotation animation with a pulsing opacity animation or static indicator" },
|
|
166
|
+
{ event: "Long Wait", trigger: "Loading exceeds a configurable timeout threshold", action: "Optionally display a 'Still loading...' message or a cancel/retry action below the spinner" },
|
|
167
|
+
],
|
|
168
|
+
|
|
169
|
+
contentGuidance: [
|
|
170
|
+
"Always provide a descriptive label for screen readers — 'Loading' alone is insufficient; specify what is loading (e.g., 'Loading search results')",
|
|
171
|
+
"Use the smallest spinner size that remains clearly visible in context — xs for inline/button, md for section, xl for full-page",
|
|
172
|
+
"Prefer skeleton screens over spinners for content-heavy layouts where the structure of the content is predictable",
|
|
173
|
+
"Do not display spinners for operations that complete in under 300ms — use a 300ms delay before showing the spinner to avoid flash",
|
|
174
|
+
"When using the overlay variant, ensure the backdrop does not completely obscure critical context the user may need to reference",
|
|
175
|
+
"For long-running operations, pair the spinner with a text message explaining what is happening and estimated wait time",
|
|
176
|
+
],
|
|
177
|
+
|
|
178
|
+
responsiveBehaviour: [
|
|
179
|
+
{ breakpoint: "Mobile (<768px)", behavior: "Full-page spinners use the lg size (48px); inline spinners use xs (16px) or sm (24px); overlay covers the entire viewport" },
|
|
180
|
+
{ breakpoint: "Tablet (768-1023px)", behavior: "Section-level spinners use md (32px); page-level spinners use lg (48px); overlay scoped to the loading region" },
|
|
181
|
+
{ breakpoint: "Desktop (1024-1439px)", behavior: "Standard sizing applies; overlay can be scoped to a panel or the full viewport depending on context" },
|
|
182
|
+
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "Spinner sizes remain fixed — no proportional scaling with viewport; xl (64px) reserved for full-page loading" },
|
|
183
|
+
],
|
|
184
|
+
|
|
185
|
+
accessibilitySpec: {
|
|
186
|
+
intro:
|
|
187
|
+
"Spinners are non-interactive but must communicate loading status to assistive technology users who cannot perceive the visual animation.",
|
|
188
|
+
requirements: [
|
|
189
|
+
{ requirement: "role='status'", level: "A", notes: "Spinner container must use role='status' to create a live region that announces loading state changes" },
|
|
190
|
+
{ requirement: "aria-live='polite'", level: "A", notes: "The live region should use polite priority to avoid interrupting the user's current screen reader output" },
|
|
191
|
+
{ requirement: "aria-label", level: "A", notes: "Spinner must have a descriptive aria-label explaining what is loading (e.g., 'Loading user profile')" },
|
|
192
|
+
{ requirement: "aria-busy", level: "A", notes: "The parent container being loaded must set aria-busy='true' while loading and remove it on completion" },
|
|
193
|
+
{ requirement: "Contrast", level: "AA", notes: "Indicator arc to track must meet 3:1 non-text contrast ratio; indicator to background must also meet 3:1" },
|
|
194
|
+
{ requirement: "Reduced Motion", level: "AAA", notes: "Rotation animation must be replaced with a non-motion alternative when prefers-reduced-motion is active" },
|
|
195
|
+
{ requirement: "Completion Announcement", level: "A", notes: "When loading completes, the live region must announce completion (e.g., 'Search results loaded')" },
|
|
196
|
+
],
|
|
197
|
+
outro: [
|
|
198
|
+
"Ensure the spinner does not create a keyboard focus trap — spinners are not focusable elements",
|
|
199
|
+
"Screen readers should announce the loading state once on appearance, not repeatedly during the animation cycle",
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
qaAcceptanceCriteria: [
|
|
204
|
+
{ check: "Animation Smoothness", platform: "Web", expectedResult: "Spinner rotates at a steady 800ms cycle with no jank or frame drops at 60fps" },
|
|
205
|
+
{ check: "Size Variants", platform: "All", expectedResult: "All five sizes (xs/sm/md/lg/xl) render at correct dimensions with proportional stroke width" },
|
|
206
|
+
{ check: "Color Variants", platform: "All", expectedResult: "Primary, inverse, and inherit color variants render correct indicator colors" },
|
|
207
|
+
{ check: "Overlay Blocking", platform: "Web", expectedResult: "Overlay backdrop prevents clicks on underlying content; cursor shows wait" },
|
|
208
|
+
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces loading state via role='status'; announces completion when spinner is removed" },
|
|
209
|
+
{ check: "aria-busy", platform: "Web", expectedResult: "Parent container has aria-busy='true' during loading; attribute removed on completion" },
|
|
210
|
+
{ check: "Delay Threshold", platform: "Web", expectedResult: "Spinner does not appear for operations completing in under 300ms — no visual flash" },
|
|
211
|
+
{ check: "Reduced Motion", platform: "Web", expectedResult: "Rotation replaced with pulsing opacity or static indicator when prefers-reduced-motion is set" },
|
|
212
|
+
{ check: "Inline Layout", platform: "All", expectedResult: "Inline spinner does not alter line height or cause layout shift in the parent container" },
|
|
213
|
+
{ check: "Completion Transition", platform: "Web", expectedResult: "Optional checkmark transition plays for 500ms before spinner is removed" },
|
|
214
|
+
{ check: "Visual Regression", platform: "All", expectedResult: "Spinner renders pixel-perfect against baseline for each size and color variant" },
|
|
215
|
+
{ check: "Dark Mode", platform: "All", expectedResult: "Inverse variant provides sufficient contrast on dark backgrounds; track color adjusts accordingly" },
|
|
216
|
+
],
|
|
217
|
+
|
|
218
|
+
dos: [
|
|
219
|
+
"Always provide a descriptive aria-label specific to the loading context, not just 'Loading'",
|
|
220
|
+
"Use the delay pattern (300ms) before showing the spinner to avoid flash on fast operations",
|
|
221
|
+
"Set aria-busy='true' on the parent container being loaded to inform assistive technology",
|
|
222
|
+
"Use the overlay variant for blocking operations where user interaction must be prevented",
|
|
223
|
+
"Scale the spinner size appropriately for the loading context — inline, section, or page level",
|
|
224
|
+
"Support prefers-reduced-motion by providing a non-rotation animation alternative",
|
|
225
|
+
"Remove the spinner and announce completion to screen readers when loading finishes",
|
|
226
|
+
"Center the spinner both horizontally and vertically within its loading region",
|
|
227
|
+
],
|
|
228
|
+
|
|
229
|
+
donts: [
|
|
230
|
+
"Do not use a spinner for determinate progress — use a progress bar with percentage instead",
|
|
231
|
+
"Do not display the spinner immediately — add a 300ms delay to prevent visual flash on fast operations",
|
|
232
|
+
"Do not leave aria-busy='true' on the parent container after loading completes",
|
|
233
|
+
"Do not use JavaScript setInterval for animation — rely on CSS animations or SVG for smooth rendering",
|
|
234
|
+
"Do not make the spinner focusable or add it to the tab order — it is a presentational status element",
|
|
235
|
+
"Do not use spinners as the only indicator of loading — pair with status text for screen reader users",
|
|
236
|
+
"Do not display percentage text alongside an indeterminate spinner — this creates a misleading experience",
|
|
237
|
+
"Do not override spinner token colors with hard-coded values — use the design token system consistently",
|
|
238
|
+
],
|
|
239
|
+
};
|
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* status-dot.ts — Gold-standard design knowledge for Status Dot components
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
+
|
|
6
|
+
export const statusDotKnowledge: ComponentKnowledge = {
|
|
7
|
+
description:
|
|
8
|
+
"Simple colored dot indicator | Conveys status at a glance | Paired with text label for accessibility",
|
|
9
|
+
|
|
10
|
+
stateSpecifications: [
|
|
11
|
+
{
|
|
12
|
+
state: "Default",
|
|
13
|
+
visualChange: "Solid filled circle in the corresponding status color with optional text label",
|
|
14
|
+
opacity: "1",
|
|
15
|
+
cursorWeb: "default",
|
|
16
|
+
usage: "Resting state — dot displays current status; not interactive",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
state: "Success",
|
|
20
|
+
visualChange: "Dot fill uses $status-dot-success token (green); communicates positive or completed status",
|
|
21
|
+
opacity: "1",
|
|
22
|
+
cursorWeb: "default",
|
|
23
|
+
usage: "Operation succeeded, service is healthy, or item is approved",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
state: "Warning",
|
|
27
|
+
visualChange: "Dot fill uses $status-dot-warning token (amber/yellow); communicates caution or degraded state",
|
|
28
|
+
opacity: "1",
|
|
29
|
+
cursorWeb: "default",
|
|
30
|
+
usage: "Service is degraded, approaching a limit, or requires attention",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
state: "Error",
|
|
34
|
+
visualChange: "Dot fill uses $status-dot-error token (red); communicates failure or critical issue",
|
|
35
|
+
opacity: "1",
|
|
36
|
+
cursorWeb: "default",
|
|
37
|
+
usage: "Operation failed, service is down, or item has a blocking issue",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
state: "Info",
|
|
41
|
+
visualChange: "Dot fill uses $status-dot-info token (blue); communicates neutral informational status",
|
|
42
|
+
opacity: "1",
|
|
43
|
+
cursorWeb: "default",
|
|
44
|
+
usage: "General informational status — neither positive nor negative",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
state: "Neutral",
|
|
48
|
+
visualChange: "Dot fill uses $status-dot-neutral token (gray); communicates inactive or unknown status",
|
|
49
|
+
opacity: "1",
|
|
50
|
+
cursorWeb: "default",
|
|
51
|
+
usage: "No status determined, pending, or not yet started",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
state: "Offline",
|
|
55
|
+
visualChange: "Dot fill uses $status-dot-neutral token with a hollow ring style or muted gray",
|
|
56
|
+
opacity: "0.6",
|
|
57
|
+
cursorWeb: "default",
|
|
58
|
+
usage: "User or service is offline or unavailable",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
state: "Online",
|
|
62
|
+
visualChange: "Dot fill uses $status-dot-online token (green); may include pulse animation",
|
|
63
|
+
opacity: "1",
|
|
64
|
+
cursorWeb: "default",
|
|
65
|
+
usage: "User or service is actively online and available",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
|
|
69
|
+
propertyDescriptions: {
|
|
70
|
+
status: "Status variant controlling the dot color — success, warning, error, info, neutral, offline, or online",
|
|
71
|
+
size: "Dimensional preset controlling dot diameter and optional label font-size (sm, md, lg)",
|
|
72
|
+
label: "Visible text rendered beside the dot providing accessible context for the status color",
|
|
73
|
+
pulse: "When true a subtle radial pulse animation plays on the dot to indicate live/active status",
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
sizeSpecifications: [
|
|
77
|
+
{
|
|
78
|
+
size: "Small",
|
|
79
|
+
height: "16px",
|
|
80
|
+
paddingLR: "0px",
|
|
81
|
+
fontSize: "12px",
|
|
82
|
+
iconSize: "8px",
|
|
83
|
+
borderRadius: "50%",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
size: "Medium",
|
|
87
|
+
height: "20px",
|
|
88
|
+
paddingLR: "0px",
|
|
89
|
+
fontSize: "14px",
|
|
90
|
+
iconSize: "10px",
|
|
91
|
+
borderRadius: "50%",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
size: "Large",
|
|
95
|
+
height: "24px",
|
|
96
|
+
paddingLR: "0px",
|
|
97
|
+
fontSize: "16px",
|
|
98
|
+
iconSize: "12px",
|
|
99
|
+
borderRadius: "50%",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
|
|
103
|
+
designTokenBindings: [
|
|
104
|
+
{
|
|
105
|
+
property: "Fill (Success)",
|
|
106
|
+
tokenName: "$status-dot-success",
|
|
107
|
+
role: "Dot fill color for success/healthy status",
|
|
108
|
+
fallback: "#12B76A",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
property: "Fill (Warning)",
|
|
112
|
+
tokenName: "$status-dot-warning",
|
|
113
|
+
role: "Dot fill color for warning/degraded status",
|
|
114
|
+
fallback: "#F79009",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
property: "Fill (Error)",
|
|
118
|
+
tokenName: "$status-dot-error",
|
|
119
|
+
role: "Dot fill color for error/critical status",
|
|
120
|
+
fallback: "#F04438",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
property: "Fill (Info)",
|
|
124
|
+
tokenName: "$status-dot-info",
|
|
125
|
+
role: "Dot fill color for informational status",
|
|
126
|
+
fallback: "#2E90FA",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
property: "Fill (Neutral)",
|
|
130
|
+
tokenName: "$status-dot-neutral",
|
|
131
|
+
role: "Dot fill color for inactive/unknown status",
|
|
132
|
+
fallback: "#98A2B3",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
property: "Fill (Online)",
|
|
136
|
+
tokenName: "$status-dot-online",
|
|
137
|
+
role: "Dot fill color for online/available status",
|
|
138
|
+
fallback: "#12B76A",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
property: "Label Color",
|
|
142
|
+
tokenName: "$text-secondary",
|
|
143
|
+
role: "Text color for the accompanying label",
|
|
144
|
+
fallback: "#344054",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
property: "Font Family",
|
|
148
|
+
tokenName: "$font-family-sans",
|
|
149
|
+
role: "Label typeface",
|
|
150
|
+
fallback: "Inter, system-ui, sans-serif",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
property: "Pulse Animation",
|
|
154
|
+
tokenName: "$animation-pulse-duration",
|
|
155
|
+
role: "Duration of the radial pulse keyframe animation",
|
|
156
|
+
fallback: "1.5s ease-in-out infinite",
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
structureRules: [
|
|
161
|
+
"Container uses horizontal Auto Layout with center vertical alignment",
|
|
162
|
+
"Dot is a circle frame with equal width and height; border-radius is always 50%",
|
|
163
|
+
"Label text is a direct sibling of the dot — no intermediate wrappers",
|
|
164
|
+
"Spacing between dot and label uses the $spacing-xs token (4px default)",
|
|
165
|
+
"When label is hidden, container collapses to dot size only",
|
|
166
|
+
"Pulse animation uses a pseudo-element or separate layer behind the dot with opacity fade",
|
|
167
|
+
"Dot must never be the sole indicator — always pair with a text label or tooltip",
|
|
168
|
+
],
|
|
169
|
+
|
|
170
|
+
typeHierarchyRules: [
|
|
171
|
+
"Label font weight is Regular (400) — status context comes from color and text, not weight",
|
|
172
|
+
"Text uses sentence case ('Service healthy', not 'SERVICE HEALTHY')",
|
|
173
|
+
"Label font size scales with the size prop; always one step smaller than body text",
|
|
174
|
+
"No underline or decoration on label text",
|
|
175
|
+
],
|
|
176
|
+
|
|
177
|
+
interactionRules: [
|
|
178
|
+
{ event: "None", trigger: "N/A", action: "Status dot is a non-interactive indicator; no pointer events by default" },
|
|
179
|
+
{ event: "Hover (optional)", trigger: "pointerenter on container", action: "If wrapped in a tooltip, show tooltip with full status description" },
|
|
180
|
+
{ event: "Pulse Start", trigger: "pulse prop set to true", action: "Begin radial pulse animation on the dot layer" },
|
|
181
|
+
{ event: "Pulse Stop", trigger: "pulse prop set to false", action: "Stop pulse animation; dot returns to static fill" },
|
|
182
|
+
{ event: "Status Change", trigger: "status prop updates", action: "Dot fill transitions smoothly to new status color using $transition-interactive" },
|
|
183
|
+
],
|
|
184
|
+
|
|
185
|
+
contentGuidance: [
|
|
186
|
+
"Always provide a text label next to the dot — color alone must never convey meaning (WCAG 1.4.1)",
|
|
187
|
+
"Labels should describe the status concisely: 'Online', 'Degraded', 'Offline', 'Healthy'",
|
|
188
|
+
"Avoid using status dots without context — always clarify what the status refers to",
|
|
189
|
+
"For tables or lists, keep labels consistent across rows (e.g. all use the same vocabulary)",
|
|
190
|
+
"Use the pulse animation sparingly — only for truly live/active indicators to avoid visual noise",
|
|
191
|
+
],
|
|
192
|
+
|
|
193
|
+
responsiveBehaviour: [
|
|
194
|
+
{ breakpoint: "Mobile (<768px)", behavior: "Dot and label render inline; label may truncate in tight table cells" },
|
|
195
|
+
{ breakpoint: "Tablet (768-1023px)", behavior: "Standard rendering; no size changes" },
|
|
196
|
+
{ breakpoint: "Desktop (1024-1439px)", behavior: "Standard rendering; status dots commonly appear in tables, sidebars, and dashboards" },
|
|
197
|
+
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "No scaling — dot sizes remain fixed at their size-prop values" },
|
|
198
|
+
],
|
|
199
|
+
|
|
200
|
+
accessibilitySpec: {
|
|
201
|
+
intro:
|
|
202
|
+
"Status dots rely on color to convey meaning, which is invisible to colorblind and screen-reader users. Accessible implementation is non-negotiable.",
|
|
203
|
+
requirements: [
|
|
204
|
+
{ requirement: "Color Independence", level: "A", notes: "WCAG 1.4.1 — Color must not be the only visual means of conveying status; always include a text label" },
|
|
205
|
+
{ requirement: "ARIA Role", level: "A", notes: "Container should use role='status' so assistive tech announces changes as a live region" },
|
|
206
|
+
{ requirement: "Accessible Name", level: "A", notes: "The dot element itself needs aria-label (e.g. 'Status: Online') or be marked aria-hidden with the label providing context" },
|
|
207
|
+
{ requirement: "Contrast Ratio", level: "AA", notes: "Dot color against its background must meet 3:1 non-text contrast; label text must meet 4.5:1" },
|
|
208
|
+
{ requirement: "Live Region", level: "AA", notes: "When status changes dynamically, the container should be an aria-live='polite' region to announce updates" },
|
|
209
|
+
{ requirement: "Motion Sensitivity", level: "AAA", notes: "Pulse animation must respect prefers-reduced-motion and stop when the user preference is set" },
|
|
210
|
+
],
|
|
211
|
+
outro: [
|
|
212
|
+
"Never use a standalone dot without text — screen readers cannot perceive color",
|
|
213
|
+
"When status dots appear in a table, ensure the column header clearly labels the data as 'Status'",
|
|
214
|
+
"Test with high-contrast mode to verify dots remain visible against forced backgrounds",
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
qaAcceptanceCriteria: [
|
|
219
|
+
{ check: "Visual Regression", platform: "All", expectedResult: "Dot renders at correct size and color for each status variant" },
|
|
220
|
+
{ check: "Label Pairing", platform: "All", expectedResult: "Text label is always present and accurately describes the status" },
|
|
221
|
+
{ check: "Color Tokens", platform: "All", expectedResult: "Each status maps to its correct design token; no hard-coded hex values" },
|
|
222
|
+
{ check: "Pulse Animation", platform: "Web", expectedResult: "Pulse plays when pulse=true; stops when false; respects prefers-reduced-motion" },
|
|
223
|
+
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces status text via role='status' or aria-label; dot alone is not announced" },
|
|
224
|
+
{ check: "Color Blindness", platform: "All", expectedResult: "Status is distinguishable without color via the text label" },
|
|
225
|
+
{ check: "Contrast", platform: "All", expectedResult: "Dot meets 3:1 non-text contrast; label meets 4.5:1 text contrast" },
|
|
226
|
+
{ check: "Dynamic Update", platform: "Web", expectedResult: "Changing status prop updates dot color and label; aria-live region announces change" },
|
|
227
|
+
{ check: "Size Variants", platform: "All", expectedResult: "sm=8px dot, md=10px dot, lg=12px dot with proportional label sizing" },
|
|
228
|
+
{ check: "High Contrast Mode", platform: "Web", expectedResult: "Dot remains visible with a border or alternate indicator in forced-colors mode" },
|
|
229
|
+
{ check: "Tooltip Fallback", platform: "Web", expectedResult: "If label is hidden for space, tooltip provides full status description on hover/focus" },
|
|
230
|
+
{ check: "RTL Support", platform: "Web", expectedResult: "Label renders on the correct side of the dot in RTL layouts" },
|
|
231
|
+
],
|
|
232
|
+
|
|
233
|
+
dos: [
|
|
234
|
+
"Always pair the status dot with a visible text label for accessibility",
|
|
235
|
+
"Use the pulse animation only for live/active indicators like 'Online' or 'Recording'",
|
|
236
|
+
"Map each status type to its corresponding design token — never hard-code colors",
|
|
237
|
+
"Use role='status' on the container for dynamic status updates",
|
|
238
|
+
"Respect prefers-reduced-motion by disabling the pulse animation when set",
|
|
239
|
+
"Keep label text concise and consistent across the interface",
|
|
240
|
+
"Ensure sufficient contrast between the dot color and its background surface",
|
|
241
|
+
],
|
|
242
|
+
|
|
243
|
+
donts: [
|
|
244
|
+
"Do not use a status dot without a text label — color alone is not accessible (WCAG 1.4.1)",
|
|
245
|
+
"Do not make the dot interactive — use a separate button or link for actions",
|
|
246
|
+
"Do not use more than 6-7 status types in a single interface to avoid cognitive overload",
|
|
247
|
+
"Do not hard-code hex values — always reference status design tokens",
|
|
248
|
+
"Do not use the pulse animation on multiple dots simultaneously — it creates visual noise",
|
|
249
|
+
"Do not resize dots outside the defined size presets (sm, md, lg)",
|
|
250
|
+
"Do not rely on the dot as the primary content — it is a supplementary indicator only",
|
|
251
|
+
],
|
|
252
|
+
};
|