@sarjallab09/figma-intelligence 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -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 -2363
- package/figma-bridge-plugin/chat-runner.js +0 -459
- package/figma-bridge-plugin/code.js +0 -1528
- 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 -604
- 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 -4467
- 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 -1408
- 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,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.
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
# Structure Spec Reference
|
|
2
|
-
|
|
3
|
-
Generate dimensional properties documentation — spacing, padding, heights, widths, and gaps across size and density variants.
|
|
4
|
-
|
|
5
|
-
## What This Spec Produces
|
|
6
|
-
|
|
7
|
-
1. **Dimension tables** — Organized by component section (container, leading, labels, trailing)
|
|
8
|
-
2. **Size/density columns** — Values shown across all variants so engineers see how dimensions change
|
|
9
|
-
3. **Token references** — Values linked to design tokens when bound to variables
|
|
10
|
-
4. **Composition mapping** — How parent sizes map to sub-component sizes
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Step-by-Step Pipeline
|
|
15
|
-
|
|
16
|
-
### Phase 1: Identify Dimensional Axes
|
|
17
|
-
|
|
18
|
-
Determine which variant axes and variable modes affect dimensions:
|
|
19
|
-
|
|
20
|
-
**Common dimensional axes:**
|
|
21
|
-
- **Size**: Large, Medium, Small, XSmall → changes heights, padding, icon sizes, font sizes
|
|
22
|
-
- **Density**: Compact, Default, Spacious → changes vertical padding, gaps
|
|
23
|
-
- **Shape**: Rounded, Square, Pill → changes border-radius (not spacing, but sometimes affects padding)
|
|
24
|
-
|
|
25
|
-
Read from two sources:
|
|
26
|
-
1. Variant axes from component set variants
|
|
27
|
-
2. Variable mode collections (density, size often come from variable modes)
|
|
28
|
-
|
|
29
|
-
### Phase 2: Extract Measurements (Deterministic)
|
|
30
|
-
|
|
31
|
-
For each dimensional variant combination, measure the component:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
// For each size/density variant:
|
|
35
|
-
get_node_dimensions(instance_id) → {
|
|
36
|
-
width, height,
|
|
37
|
-
paddingTop, paddingBottom, paddingLeft, paddingRight,
|
|
38
|
-
itemSpacing, // gap between children in auto-layout
|
|
39
|
-
counterAxisSpacing, // gap in the cross-axis (if wrap)
|
|
40
|
-
borderRadius,
|
|
41
|
-
strokeWeight
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Traverse child layers and measure each section:
|
|
46
|
-
```
|
|
47
|
-
Container
|
|
48
|
-
├── Leading Content → width, height, gap from label section
|
|
49
|
-
│ └── Icon/Avatar → width, height
|
|
50
|
-
├── Label Section → vertical layout
|
|
51
|
-
│ ├── Primary Label → fontSize, lineHeight
|
|
52
|
-
│ ├── Secondary Label → fontSize, lineHeight
|
|
53
|
-
│ └── Gap between labels
|
|
54
|
-
├── Trailing Content → width, height
|
|
55
|
-
│ └── Icon/Button → width, height
|
|
56
|
-
└── Internal gaps between all sections
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Token resolution**: For each measured value, check if it's bound to a variable:
|
|
60
|
-
```
|
|
61
|
-
get_bound_variables(node_id, "paddingLeft") → "spacing/component/md" (16)
|
|
62
|
-
get_bound_variables(node_id, "height") → "sizing/button/lg" (56)
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Report as: `token-name (resolved-value)` e.g., `spacing-md (16)` or just the raw number if hardcoded.
|
|
66
|
-
|
|
67
|
-
### Phase 3: Plan Documentation Sections (AI Reasoning)
|
|
68
|
-
|
|
69
|
-
Group measurements into logical sections based on the component's structure:
|
|
70
|
-
|
|
71
|
-
| Section | What to Document |
|
|
72
|
-
|---------|-----------------|
|
|
73
|
-
| **Container** | Height, min-width, max-width, border-radius, stroke-weight |
|
|
74
|
-
| **Padding** | Top, bottom, left, right (or horizontal/vertical if symmetric) |
|
|
75
|
-
| **Internal Gaps** | Spacing between leading→labels, labels→trailing, label→sublabel |
|
|
76
|
-
| **Leading Content** | Icon/avatar dimensions, gap from content |
|
|
77
|
-
| **Labels** | Font sizes, line heights (note: these may go in a Typography spec instead) |
|
|
78
|
-
| **Trailing Content** | Button/icon dimensions, gap from content |
|
|
79
|
-
| **Touch Target** | Minimum touch area if different from visual bounds |
|
|
80
|
-
|
|
81
|
-
**Section planning rules:**
|
|
82
|
-
- Only create sections for parts that exist in the component
|
|
83
|
-
- If a section has identical values across all variants, collapse it into a single-column note
|
|
84
|
-
- If values vary across density but not size (or vice versa), use the varying axis as columns
|
|
85
|
-
- Add a "Design Intent" note for non-obvious values (e.g., "Min-width ensures the button is tappable even with a single character label")
|
|
86
|
-
|
|
87
|
-
### Phase 4: Render the Documentation Frame
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Main Frame (1440px wide, auto-layout vertical, padding 60px, gap 40px)
|
|
91
|
-
├── Header Section
|
|
92
|
-
│ ├── Title: "[Component Name] — Structure" (24px bold)
|
|
93
|
-
│ └── Subtitle: "Dimensions, spacing, and padding reference" (14px, #6B7280)
|
|
94
|
-
│
|
|
95
|
-
├── Section: "Container"
|
|
96
|
-
│ ├── Section Header (18px bold)
|
|
97
|
-
│ └── Table:
|
|
98
|
-
│ Header: Property | Large | Medium | Small | XSmall
|
|
99
|
-
│ Row: Height | sizing-lg (56) | sizing-md (48) | sizing-sm (40) | sizing-xs (32)
|
|
100
|
-
│ Row: Border Radius | radius-md (8) | radius-md (8) | radius-sm (6) | radius-sm (6)
|
|
101
|
-
│ Row: Stroke | 1 | 1 | 1 | 1
|
|
102
|
-
│
|
|
103
|
-
├── Section: "Padding"
|
|
104
|
-
│ └── Table:
|
|
105
|
-
│ Header: Property | Large | Medium | Small | XSmall
|
|
106
|
-
│ Row: Horizontal | spacing-lg (24) | spacing-md (16) | spacing-sm (12) | spacing-xs (8)
|
|
107
|
-
│ Row: Vertical | spacing-md (16) | spacing-sm (12) | spacing-xs (8) | spacing-2xs (4)
|
|
108
|
-
│
|
|
109
|
-
├── Section: "Leading Content"
|
|
110
|
-
│ └── Table:
|
|
111
|
-
│ Header: Property | Large | Medium | Small | XSmall
|
|
112
|
-
│ Row: Icon Size | 24 | 24 | 20 | 16
|
|
113
|
-
│ Row: Gap to Labels | spacing-sm (12) | spacing-sm (12) | spacing-xs (8) | spacing-xs (8)
|
|
114
|
-
│
|
|
115
|
-
├── Section: "Composition Mapping" (if component contains sub-components with their own sizes)
|
|
116
|
-
│ └── Table:
|
|
117
|
-
│ Header: Parent Size | Icon Size | Badge Size
|
|
118
|
-
│ Row: Large | Medium | Small
|
|
119
|
-
│ Row: Medium | Small | XSmall
|
|
120
|
-
│ Row: Small | XSmall | —
|
|
121
|
-
│
|
|
122
|
-
└── Notes Section (optional)
|
|
123
|
-
└── Design intent notes, edge cases, responsive behavior
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**Table formatting for structure specs:**
|
|
127
|
-
- Values with tokens: Show as `token-name (value)` e.g., `spacing-md (16)`
|
|
128
|
-
- Hardcoded values: Show as plain number e.g., `16`
|
|
129
|
-
- Units: Always in pixels (px), but omit the "px" suffix in tables for cleanliness
|
|
130
|
-
- Identical values across columns: Show the value (don't use "—" for same values in structure specs; engineers need explicit numbers)
|
|
131
|
-
|
|
132
|
-
### Phase 5: Validate
|
|
133
|
-
|
|
134
|
-
Checklist:
|
|
135
|
-
- [ ] All size/density variants are represented as columns
|
|
136
|
-
- [ ] Container dimensions are documented (height, width constraints, border-radius)
|
|
137
|
-
- [ ] Padding values are documented (all four sides or horizontal/vertical)
|
|
138
|
-
- [ ] Internal gaps between sections are documented
|
|
139
|
-
- [ ] Sub-component dimensions are documented
|
|
140
|
-
- [ ] Token names match actual Figma variable names
|
|
141
|
-
- [ ] Resolved values match actual measured pixel values
|
|
142
|
-
- [ ] Composition mapping exists for nested size relationships
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Density vs. Size
|
|
147
|
-
|
|
148
|
-
**Size** changes the overall scale: heights, icon dimensions, padding, font sizes, and minimum widths all change together.
|
|
149
|
-
|
|
150
|
-
**Density** changes only vertical rhythm: vertical padding and gaps change, but heights, icon sizes, and horizontal values stay the same.
|
|
151
|
-
|
|
152
|
-
If both axes exist, render size as primary columns and density as separate table sections:
|
|
153
|
-
```
|
|
154
|
-
## Container — Default Density
|
|
155
|
-
Property | Large | Medium | Small
|
|
156
|
-
Height | 56 | 48 | 40
|
|
157
|
-
|
|
158
|
-
## Container — Compact Density
|
|
159
|
-
Property | Large | Medium | Small
|
|
160
|
-
Height | 48 | 40 | 32
|
|
161
|
-
|
|
162
|
-
## Container — Spacious Density
|
|
163
|
-
Property | Large | Medium | Small
|
|
164
|
-
Height | 64 | 56 | 48
|
|
165
|
-
```
|