@sarjallab09/figma-intelligence 1.1.0 → 1.2.1
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/README.md +69 -36
- package/dist/bin/cli.js +2 -0
- package/dist/design-bridge/bridge.js +2 -0
- package/dist/figma-bridge-plugin/bridge-relay.js +2 -0
- package/dist/figma-bridge-plugin/code.js +1 -0
- package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package-lock.json +0 -3
- package/dist/figma-bridge-plugin/ui.html +4970 -0
- package/dist/figma-intelligence-layer/dist/index.js +2 -0
- package/dist/scripts/clean-existing-chunks.js +2 -0
- package/dist/scripts/connect-ai-tool.js +2 -0
- package/dist/scripts/convert-hub-pdfs.js +2 -0
- package/dist/scripts/figma-mcp-status.js +2 -0
- package/dist/scripts/register-codex-mcp.js +2 -0
- package/dist/scripts/test-copilot-chat.js +2 -0
- package/package.json +11 -8
- package/bin/cli.js +0 -859
- package/design-bridge/bridge.js +0 -196
- package/design-bridge/lib/assets.js +0 -367
- package/design-bridge/lib/prompt.js +0 -85
- package/design-bridge/lib/server.js +0 -66
- package/design-bridge/lib/stitch.js +0 -37
- package/design-bridge/lib/tokens.js +0 -82
- package/design-bridge/package-lock.json +0 -579
- package/figma-bridge-plugin/README.md +0 -97
- package/figma-bridge-plugin/anthropic-chat-runner.js +0 -192
- package/figma-bridge-plugin/bridge-relay.js +0 -2505
- package/figma-bridge-plugin/chat-runner.js +0 -485
- package/figma-bridge-plugin/code.js +0 -1534
- package/figma-bridge-plugin/codex-runner.js +0 -505
- package/figma-bridge-plugin/component-schemas.js +0 -110
- package/figma-bridge-plugin/content-context.js +0 -869
- package/figma-bridge-plugin/create-button.js +0 -216
- package/figma-bridge-plugin/gemini-cli-runner.js +0 -291
- package/figma-bridge-plugin/gemini-runner.js +0 -187
- package/figma-bridge-plugin/html-to-figma.js +0 -927
- package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +0 -159
- package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +0 -162
- package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +0 -148
- package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +0 -314
- package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +0 -175
- package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +0 -180
- package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +0 -165
- package/figma-bridge-plugin/perplexity-runner.js +0 -188
- package/figma-bridge-plugin/references/SKILL.md +0 -178
- package/figma-bridge-plugin/references/anatomy-spec.md +0 -159
- package/figma-bridge-plugin/references/api-spec.md +0 -162
- package/figma-bridge-plugin/references/color-spec.md +0 -148
- package/figma-bridge-plugin/references/full-spec-template.md +0 -314
- package/figma-bridge-plugin/references/property-spec.md +0 -175
- package/figma-bridge-plugin/references/screen-reader-spec.md +0 -180
- package/figma-bridge-plugin/references/structure-spec.md +0 -165
- package/figma-bridge-plugin/shared-prompt-config.js +0 -645
- package/figma-bridge-plugin/spec-helpers/build-table.js +0 -269
- package/figma-bridge-plugin/spec-helpers/classify-elements.js +0 -189
- package/figma-bridge-plugin/spec-helpers/index.js +0 -35
- package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +0 -49
- package/figma-bridge-plugin/spec-helpers/position-markers.js +0 -158
- package/figma-bridge-plugin/stitch-auth.js +0 -322
- package/figma-bridge-plugin/stitch-runner.js +0 -1427
- package/figma-bridge-plugin/token-resolver.js +0 -107
- package/figma-bridge-plugin/ui.html +0 -4542
- package/figma-intelligence-layer/.env.example +0 -39
- package/figma-intelligence-layer/docs/local-image-generation.md +0 -60
- package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +0 -101
- package/figma-intelligence-layer/jest.config.js +0 -14
- package/figma-intelligence-layer/mcp-config.json +0 -19
- package/figma-intelligence-layer/package-lock.json +0 -5892
- package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +0 -67
- package/figma-intelligence-layer/scripts/start-comfyui.sh +0 -33
- package/figma-intelligence-layer/src/index.ts +0 -2233
- package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +0 -404
- package/figma-intelligence-layer/src/shared/cache.ts +0 -187
- package/figma-intelligence-layer/src/shared/color-operations.ts +0 -533
- package/figma-intelligence-layer/src/shared/color-utils.ts +0 -138
- package/figma-intelligence-layer/src/shared/component-script-builder.ts +0 -413
- package/figma-intelligence-layer/src/shared/component-templates.ts +0 -2767
- package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +0 -694
- package/figma-intelligence-layer/src/shared/decision-log.ts +0 -128
- package/figma-intelligence-layer/src/shared/design-system-context.ts +0 -568
- package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +0 -131
- package/figma-intelligence-layer/src/shared/design-system-matcher.ts +0 -184
- package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +0 -196
- package/figma-intelligence-layer/src/shared/design-system-tokens.ts +0 -295
- package/figma-intelligence-layer/src/shared/dtcg-validator.ts +0 -530
- package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +0 -671
- package/figma-intelligence-layer/src/shared/figma-bridge.ts +0 -1418
- package/figma-intelligence-layer/src/shared/font-config.ts +0 -126
- package/figma-intelligence-layer/src/shared/icon-catalog.ts +0 -360
- package/figma-intelligence-layer/src/shared/icon-fetch.ts +0 -80
- package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +0 -162
- package/figma-intelligence-layer/src/shared/response-compression.ts +0 -440
- package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +0 -324
- package/figma-intelligence-layer/src/shared/token-binder.ts +0 -505
- package/figma-intelligence-layer/src/shared/token-math.ts +0 -427
- package/figma-intelligence-layer/src/shared/token-naming.ts +0 -468
- package/figma-intelligence-layer/src/shared/token-utils.ts +0 -420
- package/figma-intelligence-layer/src/shared/types.ts +0 -346
- package/figma-intelligence-layer/src/shared/typography-presets.ts +0 -94
- package/figma-intelligence-layer/src/shared/unsplash.ts +0 -165
- package/figma-intelligence-layer/src/shared/vision-client.ts +0 -607
- package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +0 -334
- package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +0 -446
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +0 -782
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +0 -496
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +0 -230
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +0 -66
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +0 -810
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +0 -1191
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +0 -1346
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +0 -148
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +0 -499
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +0 -910
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +0 -989
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +0 -1160
- package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +0 -424
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +0 -38
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +0 -111
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +0 -114
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +0 -103
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +0 -1060
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +0 -18
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +0 -39
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +0 -58
- package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +0 -298
- package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +0 -197
- package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +0 -494
- package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +0 -356
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +0 -123
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +0 -663
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +0 -56
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +0 -614
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +0 -113
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +0 -178
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +0 -470
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +0 -429
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +0 -226
- package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +0 -535
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +0 -660
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +0 -209
- package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +0 -540
- package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +0 -391
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +0 -2019
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +0 -131
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +0 -381
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +0 -565
- package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +0 -764
- package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +0 -535
- package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +0 -84
- package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +0 -401
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +0 -68
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +0 -78
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +0 -93
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +0 -596
- package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +0 -462
- package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +0 -1470
- package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +0 -829
- package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +0 -702
- package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +0 -483
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +0 -501
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +0 -106
- package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +0 -676
- package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +0 -560
- package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +0 -1043
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +0 -620
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +0 -331
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +0 -77
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +0 -54
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +0 -287
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +0 -43
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +0 -221
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +0 -166
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +0 -234
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +0 -249
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +0 -231
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +0 -293
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +0 -240
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +0 -243
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +0 -307
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +0 -143
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +0 -227
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +0 -233
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +0 -282
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +0 -276
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +0 -223
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +0 -289
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +0 -261
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +0 -290
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +0 -265
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +0 -238
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +0 -128
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +0 -286
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +0 -330
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +0 -247
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +0 -250
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +0 -247
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +0 -144
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +0 -264
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +0 -251
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +0 -261
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +0 -248
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +0 -251
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +0 -142
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +0 -282
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +0 -250
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +0 -258
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +0 -265
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +0 -319
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +0 -256
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +0 -239
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +0 -252
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +0 -244
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +0 -143
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +0 -243
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +0 -259
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +0 -293
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +0 -144
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +0 -289
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +0 -267
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +0 -257
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +0 -319
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +0 -121
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +0 -430
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +0 -312
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +0 -129
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +0 -78
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +0 -2333
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +0 -100
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +0 -32
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +0 -59
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +0 -18
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +0 -53
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +0 -91
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +0 -110
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +0 -67
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +0 -58
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +0 -79
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +0 -50
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +0 -33
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +0 -55
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +0 -73
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +0 -81
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +0 -409
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +0 -198
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +0 -701
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +0 -88
- package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +0 -135
- package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +0 -491
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +0 -416
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +0 -722
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +0 -449
- package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +0 -393
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +0 -406
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +0 -292
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +0 -24
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +0 -172
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +0 -409
- package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +0 -594
- package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +0 -710
- package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +0 -458
- package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +0 -134
- package/figma-intelligence-layer/tests/apg-doc.test.ts +0 -101
- package/figma-intelligence-layer/tests/design-system-context.test.ts +0 -152
- package/figma-intelligence-layer/tests/design-system-matcher.test.ts +0 -144
- package/figma-intelligence-layer/tests/figma-bridge.test.ts +0 -83
- package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +0 -56
- package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +0 -69
- package/figma-intelligence-layer/tests/smoke.test.ts +0 -174
- package/figma-intelligence-layer/tests/spec-generator.test.ts +0 -127
- package/figma-intelligence-layer/tests/token-migrate.test.ts +0 -21
- package/figma-intelligence-layer/tests/token-naming.test.ts +0 -30
- package/figma-intelligence-layer/tsconfig.json +0 -19
- package/scripts/clean-existing-chunks.js +0 -179
- package/scripts/connect-ai-tool.js +0 -490
- package/scripts/convert-hub-pdfs.js +0 -425
- package/scripts/figma-mcp-status.js +0 -349
- package/scripts/register-codex-mcp.js +0 -96
- /package/{design-bridge → dist/design-bridge}/.env.example +0 -0
- /package/{design-bridge → dist/design-bridge}/package.json +0 -0
- /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/manifest.json +0 -0
- /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package.json +0 -0
- /package/{figma-intelligence-layer → dist/figma-intelligence-layer}/package.json +0 -0
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
# Component Specification Template
|
|
2
|
-
|
|
3
|
-
> This is the gold-standard reference for what a complete component spec should look like.
|
|
4
|
-
> When generating a spec with `figma_component_spec`, the output should match this quality,
|
|
5
|
-
> tone, and depth. Use this as a writing guide — adapt the content to the actual component
|
|
6
|
-
> but maintain the same level of detail and structure.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Example: Button Component Specification
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
### 1. Overview
|
|
15
|
-
|
|
16
|
-
Component: Button
|
|
17
|
-
Type: COMPONENT_SET (24 variants)
|
|
18
|
-
Node ID: 1:234
|
|
19
|
-
Dimensions: 160 × 44 px (default variant)
|
|
20
|
-
Layout: HORIZONTAL auto layout, 8px gap, padding 12/16/12/16
|
|
21
|
-
Description: Button is a primary interactive component used to trigger actions
|
|
22
|
-
and submit forms. It supports 3 hierarchy levels (Primary, Secondary,
|
|
23
|
-
Tertiary), 4 sizes (XSmall, Small, Medium, Large), and full state
|
|
24
|
-
coverage (Default, Hover, Pressed, Focused, Disabled). Composed of
|
|
25
|
-
5 elements including 2 optional icon slots controlled by boolean toggles.
|
|
26
|
-
All 8 color fills are bound to design tokens for full theme support.
|
|
27
|
-
States: Default, Hover, Pressed, Focused, Disabled
|
|
28
|
-
Detected pattern: button
|
|
29
|
-
Direct children: Leading Icon, Label, Trailing Icon, Loader, Focus Ring
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
### 2. Anatomy
|
|
34
|
-
|
|
35
|
-
# Element Type Role Visible Controlled By
|
|
36
|
-
──────────────────────────────────────────────────────────────────────────────────
|
|
37
|
-
1 Leading Icon INSTANCE optional-slot true Show Leading Icon
|
|
38
|
-
2 Label TEXT content-element true —
|
|
39
|
-
3 Trailing Icon INSTANCE optional-slot false Show Trailing Icon
|
|
40
|
-
4 Loader INSTANCE optional-slot false Is Loading
|
|
41
|
-
5 Focus Ring FRAME decorative false —
|
|
42
|
-
|
|
43
|
-
Anatomy notes:
|
|
44
|
-
- Leading Icon and Trailing Icon are optional slots controlled by boolean toggles.
|
|
45
|
-
When hidden, the button auto-resizes due to auto layout.
|
|
46
|
-
- Label is the primary content element and must always remain visible.
|
|
47
|
-
- Loader replaces the label content during async operations when Is Loading = true.
|
|
48
|
-
- Focus Ring is a decorative element rendered on keyboard focus via the Focused state variant.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
### 3. Variants
|
|
53
|
-
|
|
54
|
-
Axis Values Default Count
|
|
55
|
-
──────────────────────────────────────────────────────────────────
|
|
56
|
-
Hierarchy Primary, Secondary, Tertiary Primary 3
|
|
57
|
-
Size XSmall, Small, Medium, Large Medium 4
|
|
58
|
-
State Default, Hover, Pressed, Focused, Default 5
|
|
59
|
-
Disabled
|
|
60
|
-
|
|
61
|
-
Toggle Default Controls
|
|
62
|
-
──────────────────────────────────────────────
|
|
63
|
-
Show Leading Icon false Leading Icon
|
|
64
|
-
Show Trailing Icon false Trailing Icon
|
|
65
|
-
Is Loading false Loader
|
|
66
|
-
|
|
67
|
-
Swap Slot Current Component
|
|
68
|
-
──────────────────────────────────────────
|
|
69
|
-
Leading Icon Swap Icon / Arrow Left
|
|
70
|
-
Trailing Icon Swap Icon / Chevron Right
|
|
71
|
-
|
|
72
|
-
Total possible configurations: 60 (3 hierarchy × 4 size × 5 state).
|
|
73
|
-
Boolean multiplier: ×8 (3 toggles). Defined variants in file: 24.
|
|
74
|
-
|
|
75
|
-
Defined variant names:
|
|
76
|
-
- Hierarchy=Primary, Size=Large, State=Default
|
|
77
|
-
- Hierarchy=Primary, Size=Large, State=Hover
|
|
78
|
-
- Hierarchy=Primary, Size=Large, State=Pressed
|
|
79
|
-
- Hierarchy=Primary, Size=Large, State=Focused
|
|
80
|
-
- Hierarchy=Primary, Size=Medium, State=Default
|
|
81
|
-
- ... and 19 more
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
### 4. States
|
|
86
|
-
|
|
87
|
-
State Source Axis / Property
|
|
88
|
-
───────────────────────────────────────────
|
|
89
|
-
Default variant-axis State
|
|
90
|
-
Hover variant-axis State
|
|
91
|
-
Pressed variant-axis State
|
|
92
|
-
Focused variant-axis State
|
|
93
|
-
Disabled variant-axis State
|
|
94
|
-
|
|
95
|
-
State behavior notes:
|
|
96
|
-
- Default: Normal idle state with standard fill colors and cursor: pointer.
|
|
97
|
-
- Hover: Background shifts to a lighter/darker tint (token: button/primary/hover).
|
|
98
|
-
Triggered on mouse enter. Transition: 150ms ease-out.
|
|
99
|
-
- Pressed: Background shifts further. Active fill token: button/primary/pressed.
|
|
100
|
-
Applied on mousedown, released on mouseup.
|
|
101
|
-
- Focused: Visible focus ring (2px offset, brand color) for keyboard navigation.
|
|
102
|
-
Must meet WCAG 2.4.7 — 3:1 contrast against adjacent colors.
|
|
103
|
-
- Disabled: Reduced opacity (0.4) or muted fill. Remove from tab order.
|
|
104
|
-
Use aria-disabled="true" rather than the disabled attribute when possible
|
|
105
|
-
to maintain focus for screen reader discoverability.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### 5. Properties / API
|
|
110
|
-
|
|
111
|
-
Property Type Values / Default Required
|
|
112
|
-
────────────────────────────────────────────────────────────────────────────────────
|
|
113
|
-
Hierarchy Variant Primary, Secondary, Tertiary Yes
|
|
114
|
-
(default: Primary)
|
|
115
|
-
Size Variant XSmall, Small, Medium, Large Yes
|
|
116
|
-
(default: Medium)
|
|
117
|
-
State Variant Default, Hover, Pressed, Focused, Yes
|
|
118
|
-
Disabled (default: Default)
|
|
119
|
-
Show Leading Icon Boolean true / false (default: false) No
|
|
120
|
-
Show Trailing Icon Boolean true / false (default: false) No
|
|
121
|
-
Is Loading Boolean true / false (default: false) No
|
|
122
|
-
Leading Icon Swap Instance Swap Any icon component No
|
|
123
|
-
Trailing Icon Swap Instance Swap Any icon component No
|
|
124
|
-
Label Text Text Override "Button" (editable) No
|
|
125
|
-
|
|
126
|
-
Total properties: 9 (3 variants, 3 booleans, 2 instance swaps, 1 text override).
|
|
127
|
-
|
|
128
|
-
Implementation notes:
|
|
129
|
-
- Variant properties (Hierarchy, Size, State) are required and must always be set.
|
|
130
|
-
- Boolean toggles control child visibility — they do not add/remove DOM elements,
|
|
131
|
-
only toggle display.
|
|
132
|
-
- Instance swap slots accept any component from the Icon library. Ensure swapped
|
|
133
|
-
icons maintain the same bounding box (20×20 for Medium size) to avoid layout shift.
|
|
134
|
-
- Label Text supports single-line text only. Truncation with ellipsis should be
|
|
135
|
-
handled if text overflows the maximum width.
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
### 6. Spacing & Structure
|
|
140
|
-
|
|
141
|
-
Root layout: HORIZONTAL auto layout
|
|
142
|
-
Dimensions: 160 × 44 px (Medium)
|
|
143
|
-
Padding: 12 / 16 / 12 / 16 (T/R/B/L)
|
|
144
|
-
Item spacing: 8px
|
|
145
|
-
|
|
146
|
-
Element Layout W × H Padding (T/R/B/L) Gap Sizing (H/V)
|
|
147
|
-
──────────────────────────────────────────────────────────────────────────────────────
|
|
148
|
-
Button (root) HORIZONTAL 160 × 44 12/16/12/16 8px HUG / FIXED
|
|
149
|
-
Leading Icon — 20 × 20 — — FIXED / FIXED
|
|
150
|
-
Label — auto × 20 — — HUG / HUG
|
|
151
|
-
Trailing Icon — 20 × 20 — — FIXED / FIXED
|
|
152
|
-
|
|
153
|
-
Size scale:
|
|
154
|
-
- XSmall: 28px height, 8/12 padding, 6px gap, 14px font
|
|
155
|
-
- Small: 32px height, 8/12 padding, 6px gap, 14px font
|
|
156
|
-
- Medium: 44px height, 12/16 padding, 8px gap, 16px font
|
|
157
|
-
- Large: 52px height, 16/20 padding, 8px gap, 18px font
|
|
158
|
-
|
|
159
|
-
Touch target compliance:
|
|
160
|
-
- XSmall (28px): Below 44×44 WCAG minimum — ensure adequate spacing or hit area padding.
|
|
161
|
-
- Small (32px): Below 44×44 — same concern.
|
|
162
|
-
- Medium (44px): Meets 44×44 minimum touch target.
|
|
163
|
-
- Large (52px): Exceeds minimum. Recommended for primary CTAs on mobile.
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
### 7. Color Tokens
|
|
168
|
-
|
|
169
|
-
Element Property Hex Value Token Name
|
|
170
|
-
────────────────────────────────────────────────────────────────
|
|
171
|
-
Button (root) fill #0F62FE color/interactive/primary
|
|
172
|
-
Button (root) fill #0043CE color/interactive/primary/hover
|
|
173
|
-
Button (root) fill #002D9C color/interactive/primary/pressed
|
|
174
|
-
Label fill #FFFFFF color/text/on-color
|
|
175
|
-
Leading Icon fill #FFFFFF color/icon/on-color
|
|
176
|
-
Focus Ring stroke #0F62FE color/focus/outline
|
|
177
|
-
Disabled fill fill #C6C6C6 color/interactive/disabled
|
|
178
|
-
Disabled text fill #8D8D8D color/text/disabled
|
|
179
|
-
|
|
180
|
-
Token coverage: 8/8 colors are bound to design tokens. Fully theme-ready.
|
|
181
|
-
|
|
182
|
-
Token architecture notes:
|
|
183
|
-
- All interactive colors use the `color/interactive/*` namespace.
|
|
184
|
-
- Text and icon colors on filled backgrounds use `color/*/on-color` tokens
|
|
185
|
-
which automatically invert in dark mode.
|
|
186
|
-
- The Disabled state uses dedicated disabled tokens — do not use opacity
|
|
187
|
-
reduction as it creates inconsistent results across themes.
|
|
188
|
-
- Focus ring uses `color/focus/outline` which must maintain 3:1 contrast
|
|
189
|
-
against any background.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### 8. Typography
|
|
194
|
-
|
|
195
|
-
Element Content Font Size Line Height Token
|
|
196
|
-
────────────────────────────────────────────────────────────────────────
|
|
197
|
-
Label "Button" Inter SemiBold 16px 20px type/body/semibold/md
|
|
198
|
-
|
|
199
|
-
Font families used: Inter SemiBold. Size range: 14px–18px across 4 size variants.
|
|
200
|
-
|
|
201
|
-
Typography scale by size variant:
|
|
202
|
-
- XSmall / Small: Inter SemiBold 14px / 18px line height
|
|
203
|
-
- Medium: Inter SemiBold 16px / 20px line height
|
|
204
|
-
- Large: Inter SemiBold 18px / 24px line height
|
|
205
|
-
|
|
206
|
-
Accessibility notes:
|
|
207
|
-
- Minimum font size (14px) meets readability guidelines.
|
|
208
|
-
- All text uses SemiBold weight for adequate legibility on colored backgrounds.
|
|
209
|
-
- Line height ratio (1.25–1.33) is within WCAG recommended range.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
### 9. Accessibility
|
|
214
|
-
|
|
215
|
-
Touch target:
|
|
216
|
-
- Medium (44×44px) and Large (52×52px) variants meet WCAG 2.5.8 minimum.
|
|
217
|
-
- XSmall (28px) and Small (32px) are below minimum — add padding or spacing.
|
|
218
|
-
|
|
219
|
-
Typography:
|
|
220
|
-
- Label: Inter SemiBold 16px / 20px line height
|
|
221
|
-
- All text sizes ≥ 14px — meets readability guidelines.
|
|
222
|
-
|
|
223
|
-
Keyboard interaction:
|
|
224
|
-
- Component must be focusable and operable via keyboard.
|
|
225
|
-
- Focus state detected — visible focus indicator (2px ring) meets 3:1 contrast.
|
|
226
|
-
- Disabled state: use aria-disabled="true" rather than removing from tab order.
|
|
227
|
-
- Expected keyboard behavior: Enter/Space activates the button.
|
|
228
|
-
|
|
229
|
-
Screen reader:
|
|
230
|
-
- Role: button (native HTML or role="button" for custom elements)
|
|
231
|
-
- Label: Computed from visible text content. If icon-only, provide aria-label.
|
|
232
|
-
- State: Announce disabled state. Announce loading state with aria-busy="true"
|
|
233
|
-
and aria-live="polite" on the status region.
|
|
234
|
-
|
|
235
|
-
Color contrast:
|
|
236
|
-
- Primary: White text (#FFF) on blue (#0F62FE) = 4.66:1 ratio (passes AA)
|
|
237
|
-
- Disabled: Gray text (#8D8D8D) on light gray (#C6C6C6) — verify ≥ 3:1 for
|
|
238
|
-
decorative non-text contrast.
|
|
239
|
-
|
|
240
|
-
Structure:
|
|
241
|
-
- 8 token aliases bound — supports theming.
|
|
242
|
-
- Drop shadow: none on default. If added for elevation, verify contrast in all themes.
|
|
243
|
-
- Expected ARIA pattern: WAI-ARIA Button pattern
|
|
244
|
-
- Minimum contrast requirement: 4.5:1 for normal text, 3:1 for large text
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
### 10. Usage Guidelines
|
|
249
|
-
|
|
250
|
-
✓ DO:
|
|
251
|
-
✓ Use the variant properties (Hierarchy, Size, State) to configure the button.
|
|
252
|
-
Don't detach instances to create custom variations.
|
|
253
|
-
✓ Use boolean toggles (Show Leading Icon, Show Trailing Icon, Is Loading) to
|
|
254
|
-
show/hide optional elements instead of deleting layers.
|
|
255
|
-
✓ Keep required elements intact: Label.
|
|
256
|
-
✓ Support all defined states (Default, Hover, Pressed, Focused, Disabled).
|
|
257
|
-
✓ Use Primary hierarchy for the most important action on the page.
|
|
258
|
-
Only one Primary button per view/section.
|
|
259
|
-
✓ Use Secondary for supporting actions, Tertiary for low-emphasis actions.
|
|
260
|
-
✓ Preserve auto layout settings — don't switch to absolute positioning.
|
|
261
|
-
✓ Maintain the 8px gap between icon and label.
|
|
262
|
-
✓ Use instance swap properties for icons — only swap in compatible 20×20 icons.
|
|
263
|
-
✓ Test the component in both light and dark themes before publishing.
|
|
264
|
-
|
|
265
|
-
✗ DON'T:
|
|
266
|
-
✗ Don't remove or hide the Label element — this breaks semantic structure.
|
|
267
|
-
✗ Don't create undocumented state variations — extend the variant set formally.
|
|
268
|
-
✗ Don't use buttons for navigation — use Link component instead.
|
|
269
|
-
✗ Don't replace icon swap slots with non-icon components.
|
|
270
|
-
✗ Don't override internal padding or spacing values.
|
|
271
|
-
✗ Don't use opacity to create disabled appearance — use the Disabled state variant.
|
|
272
|
-
✗ Don't place more than one Primary button in the same section.
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
### 11. Related Components
|
|
277
|
-
|
|
278
|
-
Related Component When to Use Instead
|
|
279
|
-
──────────────────────────────────────────────────────────────────
|
|
280
|
-
Link / Anchor Use for navigation instead of triggering actions
|
|
281
|
-
Icon Button Use for icon-only actions with a tooltip
|
|
282
|
-
FAB (Floating Action) Use for the primary page-level action on mobile
|
|
283
|
-
Split Button Use when the button needs a dropdown for secondary actions
|
|
284
|
-
Toggle Button Use when the button represents an on/off state
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## Template Usage Notes
|
|
289
|
-
|
|
290
|
-
This template demonstrates the expected quality bar:
|
|
291
|
-
|
|
292
|
-
1. **Every section has content** — even when data is sparse, provide guidance,
|
|
293
|
-
recommendations, or explain what's missing and why it matters.
|
|
294
|
-
|
|
295
|
-
2. **Tables are clean and aligned** — use consistent column widths, separator
|
|
296
|
-
lines, and clear headers.
|
|
297
|
-
|
|
298
|
-
3. **Descriptive prose accompanies data** — don't just dump a table. Explain
|
|
299
|
-
what the data means, why it matters, and what to do about it.
|
|
300
|
-
|
|
301
|
-
4. **Accessibility is specific** — mention exact WCAG criteria, contrast ratios,
|
|
302
|
-
keyboard patterns, and screen reader behavior.
|
|
303
|
-
|
|
304
|
-
5. **Usage guidelines are actionable** — each do/don't references a specific
|
|
305
|
-
component feature or behavior, not generic advice.
|
|
306
|
-
|
|
307
|
-
6. **Token architecture is explained** — don't just list token names. Explain
|
|
308
|
-
the naming pattern, theme behavior, and contrast requirements.
|
|
309
|
-
|
|
310
|
-
7. **States include behavior notes** — describe transitions, timing, cursor
|
|
311
|
-
changes, and ARIA state management.
|
|
312
|
-
|
|
313
|
-
8. **Spacing includes size scale** — if the component has size variants, show
|
|
314
|
-
how spacing/typography scales across all sizes.
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Property Spec Reference
|
|
2
|
-
|
|
3
|
-
Generate visual property annotations with live instance previews for every configurable property — variant axes, boolean toggles, variable modes, and child component properties.
|
|
4
|
-
|
|
5
|
-
## What This Spec Produces
|
|
6
|
-
|
|
7
|
-
1. **Variant axis exhibits** — One section per axis with instance previews for every value
|
|
8
|
-
2. **Boolean toggle exhibits** — On/off states shown side by side, defaults labeled
|
|
9
|
-
3. **Variable mode exhibits** — Shape, density, and other mode-driven properties as visual chapters
|
|
10
|
-
4. **Child component chapters** — Nested component properties shown in-context on parent instances
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Step-by-Step Pipeline
|
|
15
|
-
|
|
16
|
-
### Phase 1: Extract All Properties
|
|
17
|
-
|
|
18
|
-
Read `componentPropertyDefinitions` from the component set:
|
|
19
|
-
```
|
|
20
|
-
get_component_property_definitions(node_id)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Collect four categories:
|
|
24
|
-
|
|
25
|
-
**1. Variant Axes** — From variant names (e.g., Size=Large, Hierarchy=Primary)
|
|
26
|
-
- Property name
|
|
27
|
-
- All values
|
|
28
|
-
- Default value
|
|
29
|
-
|
|
30
|
-
**2. Boolean Toggles** — From component property definitions
|
|
31
|
-
- Property name (e.g., "Show Leading Icon")
|
|
32
|
-
- Default state (true/false)
|
|
33
|
-
- Which child layer it controls
|
|
34
|
-
|
|
35
|
-
**3. Variable Mode Collections** — Check for component-scoped variable collections
|
|
36
|
-
```
|
|
37
|
-
get_local_variable_collections()
|
|
38
|
-
```
|
|
39
|
-
- Collection name (e.g., "Button Shape", "Density")
|
|
40
|
-
- Mode names (e.g., ["Rounded", "Square", "Pill"])
|
|
41
|
-
|
|
42
|
-
**4. Child Component Properties** — For each INSTANCE child layer:
|
|
43
|
-
- Resolve to source component
|
|
44
|
-
- Read its `componentPropertyDefinitions`
|
|
45
|
-
- Group by child component name
|
|
46
|
-
|
|
47
|
-
### Phase 2: Normalize Properties (AI Reasoning)
|
|
48
|
-
|
|
49
|
-
Consolidation rules to avoid redundant exhibits:
|
|
50
|
-
|
|
51
|
-
- **Coupled axes**: If two variant axes always change together (e.g., "Icon Size" always matches "Button Size"), merge them into a single exhibit showing the coupling
|
|
52
|
-
- **Container-gated booleans**: If a boolean only matters when a specific variant value is active, show it within that variant's context rather than as a standalone exhibit
|
|
53
|
-
- **Unified slots**: If multiple instance swap properties represent the same conceptual slot (e.g., "Leading Content" accepts both Icon and Avatar), combine into one exhibit
|
|
54
|
-
- **Sibling booleans**: If two booleans are mutually exclusive (toggling one forces the other off), show them as a single either/or exhibit
|
|
55
|
-
|
|
56
|
-
### Phase 3: Plan Exhibits
|
|
57
|
-
|
|
58
|
-
For each property, determine the exhibit type:
|
|
59
|
-
|
|
60
|
-
| Property Type | Exhibit Layout |
|
|
61
|
-
|--------------|----------------|
|
|
62
|
-
| Variant axis (≤6 values) | Horizontal row of instances, one per value |
|
|
63
|
-
| Variant axis (>6 values) | 2-column or 3-column grid |
|
|
64
|
-
| Boolean toggle | Side-by-side: OFF (default labeled) and ON |
|
|
65
|
-
| Variable mode | Row of instances, one per mode value |
|
|
66
|
-
| Child component | Show on parent instance with callout arrows |
|
|
67
|
-
|
|
68
|
-
**Instance creation for exhibits:**
|
|
69
|
-
- Start from the **default variant** of the component
|
|
70
|
-
- Change ONLY the property being exhibited (keep everything else at defaults)
|
|
71
|
-
- For variant axes: create one instance per value, changing only that axis
|
|
72
|
-
- For booleans: create two instances — one with false, one with true
|
|
73
|
-
- For modes: create one instance per mode, applying the mode via variable binding
|
|
74
|
-
|
|
75
|
-
### Phase 4: Render the Documentation Frame
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
Main Frame (1440px wide, auto-layout vertical, padding 60px, gap 40px)
|
|
79
|
-
├── Header Section
|
|
80
|
-
│ ├── Title: "[Component Name] — Properties" (24px bold)
|
|
81
|
-
│ └── Subtitle: "Configurable properties and visual reference" (14px, #6B7280)
|
|
82
|
-
│
|
|
83
|
-
├── Variant Axis Chapter(s)
|
|
84
|
-
│ ├── Chapter Header: "[Axis Name]" (20px bold)
|
|
85
|
-
│ ├── Values label: "Values: Large | Medium | Small | XSmall" (13px, #6B7280)
|
|
86
|
-
│ ├── Default label: "Default: Medium" (13px, bold tag on value)
|
|
87
|
-
│ └── Exhibit Row (horizontal auto-layout, gap 24px)
|
|
88
|
-
│ ├── [Instance: value 1] + Value Label below
|
|
89
|
-
│ ├── [Instance: value 2] + Value Label below (DEFAULT badge if applicable)
|
|
90
|
-
│ └── ...
|
|
91
|
-
│
|
|
92
|
-
├── Boolean Toggle Chapter(s)
|
|
93
|
-
│ ├── Chapter Header: "[Boolean Name]" (20px bold)
|
|
94
|
-
│ ├── Default label: "Default: false"
|
|
95
|
-
│ └── Exhibit Row (horizontal, gap 40px)
|
|
96
|
-
│ ├── [Instance: OFF state] + "Off" label + (DEFAULT badge)
|
|
97
|
-
│ └── [Instance: ON state] + "On" label
|
|
98
|
-
│
|
|
99
|
-
├── Variable Mode Chapter(s)
|
|
100
|
-
│ ├── Chapter Header: "[Collection Name]" (20px bold)
|
|
101
|
-
│ ├── Modes: "Rounded | Square | Pill"
|
|
102
|
-
│ └── Exhibit Row
|
|
103
|
-
│ ├── [Instance: Mode 1] + Mode Label
|
|
104
|
-
│ ├── [Instance: Mode 2] + Mode Label
|
|
105
|
-
│ └── ...
|
|
106
|
-
│
|
|
107
|
-
└── Child Component Chapter(s) (if applicable)
|
|
108
|
-
├── Chapter Header: "[Child Name] Properties" (20px bold)
|
|
109
|
-
├── Context note: "Shown in context on [Parent Name]"
|
|
110
|
-
└── Sub-exhibits for each child property
|
|
111
|
-
└── Same exhibit format but instances are parent component
|
|
112
|
-
with the child property varied
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Exhibit instance sizing:**
|
|
116
|
-
- Use the default variant size for all exhibits within a chapter
|
|
117
|
-
- Exception: Size axis exhibits obviously show each size at its actual dimensions
|
|
118
|
-
- Maximum instance width: 300px (scale down if needed, maintaining aspect ratio)
|
|
119
|
-
- Minimum gap between instances: 24px
|
|
120
|
-
|
|
121
|
-
**Default badges:**
|
|
122
|
-
- Small rounded rectangle: 4px padding, #E5E7EB background, "DEFAULT" text 10px bold #6B7280
|
|
123
|
-
- Placed below the instance, centered
|
|
124
|
-
|
|
125
|
-
### Phase 5: Validate
|
|
126
|
-
|
|
127
|
-
Checklist:
|
|
128
|
-
- [ ] Every variant axis has an exhibit with an instance per value
|
|
129
|
-
- [ ] Every boolean toggle has a side-by-side OFF/ON exhibit
|
|
130
|
-
- [ ] Variable mode collections are rendered (if present)
|
|
131
|
-
- [ ] Child component properties are shown in-context on parent
|
|
132
|
-
- [ ] Default values are labeled on every exhibit
|
|
133
|
-
- [ ] No duplicate or redundant exhibits (normalization applied)
|
|
134
|
-
- [ ] Instances render correctly (no broken components)
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Example: Button Properties
|
|
139
|
-
|
|
140
|
-
### Size (Variant Axis)
|
|
141
|
-
```
|
|
142
|
-
Values: Large | Medium | Small | XSmall
|
|
143
|
-
Default: Medium
|
|
144
|
-
|
|
145
|
-
[Large instance] [Medium instance] [Small instance] [XSmall instance]
|
|
146
|
-
Large Medium Small XSmall
|
|
147
|
-
DEFAULT
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Show Leading Icon (Boolean)
|
|
151
|
-
```
|
|
152
|
-
Default: false
|
|
153
|
-
|
|
154
|
-
[Button without icon] [Button with icon]
|
|
155
|
-
Off On
|
|
156
|
-
DEFAULT
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Shape (Variable Mode)
|
|
160
|
-
```
|
|
161
|
-
Modes: Rounded | Square | Pill
|
|
162
|
-
Default: Rounded
|
|
163
|
-
|
|
164
|
-
[Rounded button] [Square button] [Pill button]
|
|
165
|
-
Rounded Square Pill
|
|
166
|
-
DEFAULT
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Trailing Content — Icon Button Properties (Child Component)
|
|
170
|
-
```
|
|
171
|
-
Shown in context on Button
|
|
172
|
-
|
|
173
|
-
[Button with small icon] [Button with medium icon]
|
|
174
|
-
Icon Size: Small Icon Size: Medium
|
|
175
|
-
```
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# Screen Reader Spec Reference
|
|
2
|
-
|
|
3
|
-
Generate accessibility specifications for VoiceOver (iOS), TalkBack (Android), and ARIA (Web).
|
|
4
|
-
|
|
5
|
-
## What This Spec Produces
|
|
6
|
-
|
|
7
|
-
1. **Focus order diagram** — Visual showing the tab/swipe order through interactive elements
|
|
8
|
-
2. **Per-platform tables** — VoiceOver, TalkBack, and ARIA properties for each focus stop
|
|
9
|
-
3. **State-specific announcements** — How announcements change across enabled, disabled, selected, etc.
|
|
10
|
-
4. **Merge analysis** — Which visual elements combine into a single focus stop vs. independent stops
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Step-by-Step Pipeline
|
|
15
|
-
|
|
16
|
-
### Phase 1: Extract Component Elements
|
|
17
|
-
|
|
18
|
-
1. Read all child layers from the component:
|
|
19
|
-
```
|
|
20
|
-
get_node_children(node_id, recursive=true)
|
|
21
|
-
```
|
|
22
|
-
2. Classify each element:
|
|
23
|
-
- **Interactive**: buttons, toggles, inputs, links (elements users can act on)
|
|
24
|
-
- **Informational**: labels, helper text, badges, icons (content that informs but isn't interactive)
|
|
25
|
-
- **Decorative**: backgrounds, shadows, dividers (invisible to screen readers)
|
|
26
|
-
|
|
27
|
-
### Phase 2: Merge Analysis (Critical AI Step)
|
|
28
|
-
|
|
29
|
-
The merge analysis determines which visual parts become independent **focus stops** and which get merged into a parent element's announcement.
|
|
30
|
-
|
|
31
|
-
**Rules for merging:**
|
|
32
|
-
|
|
33
|
-
| Visual Part | Merge Behavior |
|
|
34
|
-
|-------------|---------------|
|
|
35
|
-
| Label text adjacent to a control | **Merge** into the control's accessibility label |
|
|
36
|
-
| Helper/hint text below a control | **Merge** as the accessibility hint/description |
|
|
37
|
-
| Decorative icons (bullets, arrows) | **Hide** from screen readers entirely |
|
|
38
|
-
| Functional icons (clear, search, edit) | **Separate** focus stop if independently tappable |
|
|
39
|
-
| Action buttons within a compound control | **Separate** focus stop |
|
|
40
|
-
| Static content (read-only text, images) | **Merge** into nearest logical container |
|
|
41
|
-
| Error messages | **Live region** announcement, not a focus stop |
|
|
42
|
-
| Badges/counts | **Merge** into parent element's value announcement |
|
|
43
|
-
|
|
44
|
-
**Decision framework:**
|
|
45
|
-
1. Is this element independently interactive (tappable/clickable)? → **Separate focus stop**
|
|
46
|
-
2. Does this element add information to an adjacent interactive element? → **Merge** into that element
|
|
47
|
-
3. Is this element purely visual? → **Hide** (decorative)
|
|
48
|
-
4. Is this element dynamic content that changes without user action? → **Live region**
|
|
49
|
-
|
|
50
|
-
### Phase 3: Determine Focus Order
|
|
51
|
-
|
|
52
|
-
For compound components with multiple focus stops:
|
|
53
|
-
|
|
54
|
-
1. List all independent focus stops in their natural reading/tab order
|
|
55
|
-
2. Default order: **left-to-right, top-to-bottom** (LTR layouts)
|
|
56
|
-
3. Note any exceptions requested by the user (e.g., "input should focus before clear button")
|
|
57
|
-
4. For each focus stop, note:
|
|
58
|
-
- Focus stop number
|
|
59
|
-
- Element name
|
|
60
|
-
- Which visual parts merge into this stop
|
|
61
|
-
|
|
62
|
-
**Example — Text Field:**
|
|
63
|
-
```
|
|
64
|
-
Focus Stop 1: Input Field
|
|
65
|
-
Merges: Label text, Placeholder text, Helper text
|
|
66
|
-
|
|
67
|
-
Focus Stop 2: Clear Button (only when text is entered)
|
|
68
|
-
Merges: Clear icon
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Phase 4: Build Per-Platform Specifications
|
|
72
|
-
|
|
73
|
-
For each focus stop, document platform-specific properties:
|
|
74
|
-
|
|
75
|
-
#### iOS (VoiceOver)
|
|
76
|
-
|
|
77
|
-
| Property | Description | Example |
|
|
78
|
-
|----------|-------------|---------|
|
|
79
|
-
| `accessibilityLabel` | What VoiceOver announces as the element's name | "Search" |
|
|
80
|
-
| `accessibilityTraits` | Element type: `.button`, `.textField`, `.staticText`, `.header`, `.adjustable`, `.selected` | `.button` |
|
|
81
|
-
| `accessibilityHint` | Action description, read after a pause | "Double tap to activate" |
|
|
82
|
-
| `accessibilityValue` | Current value for adjustable elements | "3 of 5" |
|
|
83
|
-
| `isAccessibilityElement` | Whether this is a single focus stop (true) or a container (false) | `true` |
|
|
84
|
-
|
|
85
|
-
#### Android (TalkBack)
|
|
86
|
-
|
|
87
|
-
| Property | Description | Example |
|
|
88
|
-
|----------|-------------|---------|
|
|
89
|
-
| `contentDescription` | What TalkBack announces | "Search, Edit field" |
|
|
90
|
-
| `role` | Android role: `Button`, `EditText`, `CheckBox`, `Switch`, `Tab` | `Button` |
|
|
91
|
-
| `stateDescription` | Current state in human-readable form | "Disabled" |
|
|
92
|
-
| `importantForAccessibility` | Whether element is visible to TalkBack | `yes` |
|
|
93
|
-
| `liveRegion` | For dynamic content: `polite` or `assertive` | — |
|
|
94
|
-
|
|
95
|
-
#### Web (ARIA)
|
|
96
|
-
|
|
97
|
-
| Property | Description | Example |
|
|
98
|
-
|----------|-------------|---------|
|
|
99
|
-
| `role` | ARIA role: `button`, `textbox`, `checkbox`, `tab`, `tabpanel`, `alert` | `button` |
|
|
100
|
-
| `aria-label` | Accessible name (when visual text is insufficient) | "Close dialog" |
|
|
101
|
-
| `aria-labelledby` | ID reference to visible label element | `"label-email"` |
|
|
102
|
-
| `aria-describedby` | ID reference to description/hint element | `"hint-email"` |
|
|
103
|
-
| `aria-expanded` | For expandable elements: `true` or `false` | `false` |
|
|
104
|
-
| `aria-selected` | For selectable elements | `true` |
|
|
105
|
-
| `aria-disabled` | Disabled state | `true` |
|
|
106
|
-
| `aria-live` | For live regions: `polite` or `assertive` | — |
|
|
107
|
-
| `tabindex` | Tab order: `0` (natural), `-1` (programmatic only) | `0` |
|
|
108
|
-
|
|
109
|
-
### Phase 5: Document State Variations
|
|
110
|
-
|
|
111
|
-
For each state the component can be in, document how announcements change:
|
|
112
|
-
|
|
113
|
-
| State | What Changes |
|
|
114
|
-
|-------|-------------|
|
|
115
|
-
| **Enabled** | Base announcement — label, role, hint |
|
|
116
|
-
| **Disabled** | Add "dimmed" (VoiceOver) / "disabled" (TalkBack) / `aria-disabled="true"` (ARIA) |
|
|
117
|
-
| **Selected** | Add "selected" trait/state |
|
|
118
|
-
| **Loading** | Announce "loading" via live region, disable interaction |
|
|
119
|
-
| **Error** | Announce error message via live region or `aria-invalid` + `aria-errormessage` |
|
|
120
|
-
| **Expanded** | Toggle `aria-expanded`, announce "expanded"/"collapsed" |
|
|
121
|
-
|
|
122
|
-
### Phase 6: Render the Documentation Frame
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
Main Frame (1440px wide, auto-layout vertical, padding 60px, gap 40px)
|
|
126
|
-
├── Header Section
|
|
127
|
-
│ ├── Title: "[Component Name] — Screen Reader" (24px bold)
|
|
128
|
-
│ └── Subtitle: "VoiceOver, TalkBack, and ARIA specifications" (14px, #6B7280)
|
|
129
|
-
│
|
|
130
|
-
├── Focus Order Section (only for compound components)
|
|
131
|
-
│ ├── Section Header: "Focus Order" (20px bold)
|
|
132
|
-
│ ├── Component Artwork with numbered focus indicators
|
|
133
|
-
│ ├── Focus sequence: "1 → 2 → 3" with element names
|
|
134
|
-
│ └── Notes about conditional focus stops
|
|
135
|
-
│
|
|
136
|
-
├── Platform Section: "iOS — VoiceOver"
|
|
137
|
-
│ ├── Section Header (20px bold)
|
|
138
|
-
│ ├── Per-Focus-Stop Tables:
|
|
139
|
-
│ │ ├── Focus Stop 1: [Element Name]
|
|
140
|
-
│ │ │ └── State Table:
|
|
141
|
-
│ │ │ Header: Property | Enabled | Disabled | Selected
|
|
142
|
-
│ │ │ Row: accessibilityLabel | "Save" | "Save" | "Save"
|
|
143
|
-
│ │ │ Row: accessibilityTraits | .button | .button, .notEnabled | .button, .selected
|
|
144
|
-
│ │ └── Focus Stop 2: [Element Name]
|
|
145
|
-
│ │ └── ...
|
|
146
|
-
│
|
|
147
|
-
├── Platform Section: "Android — TalkBack"
|
|
148
|
-
│ └── (same structure, Android properties)
|
|
149
|
-
│
|
|
150
|
-
└── Platform Section: "Web — ARIA"
|
|
151
|
-
└── (same structure, ARIA properties)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Phase 7: Validate
|
|
155
|
-
|
|
156
|
-
Checklist:
|
|
157
|
-
- [ ] All interactive elements have a focus stop
|
|
158
|
-
- [ ] Non-interactive informational elements are merged into appropriate focus stops
|
|
159
|
-
- [ ] Decorative elements are marked as hidden from screen readers
|
|
160
|
-
- [ ] All three platforms (VoiceOver, TalkBack, ARIA) are documented
|
|
161
|
-
- [ ] State variations are documented (at minimum: enabled, disabled)
|
|
162
|
-
- [ ] Focus order is specified for compound components
|
|
163
|
-
- [ ] Error messages and dynamic content use live regions
|
|
164
|
-
- [ ] Merge analysis is consistent across platforms
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Component Complexity Guide
|
|
169
|
-
|
|
170
|
-
**Simple components (1 focus stop):**
|
|
171
|
-
Button, Checkbox, Switch, Toggle, Badge, Tag, Avatar
|
|
172
|
-
→ Single focus stop, all visual parts merged. Document state changes.
|
|
173
|
-
|
|
174
|
-
**Compound components (2–5 focus stops):**
|
|
175
|
-
Text Field + Clear Button, Chip + Dismiss, Search Bar, Stepper
|
|
176
|
-
→ Focus order section + per-stop tables. Document conditional stops.
|
|
177
|
-
|
|
178
|
-
**Complex components (5+ focus stops):**
|
|
179
|
-
Tab Bar, Navigation Bar, Data Table Row, Form Section
|
|
180
|
-
→ Full focus order diagram. Consider documenting as a composite of simpler components with cross-references.
|