@sarjallab09/figma-intelligence 1.1.0 → 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 -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
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
2
|
-
|
|
3
|
-
export const cardKnowledge: ComponentKnowledge = {
|
|
4
|
-
description:
|
|
5
|
-
"Content container | Grouped information surface | Scannable content unit",
|
|
6
|
-
|
|
7
|
-
stateSpecifications: [
|
|
8
|
-
{ state: "Default", visualChange: "Elevated surface with content zones, resting shadow", opacity: "1", cursorWeb: "default", usage: "Static content display card" },
|
|
9
|
-
{ state: "Hover (clickable)", visualChange: "Shadow increases, subtle lift transform", opacity: "1", cursorWeb: "pointer", usage: "User hovers over an interactive card" },
|
|
10
|
-
{ state: "Focus (clickable)", visualChange: "Focus ring around entire card boundary", opacity: "1", cursorWeb: "pointer", usage: "Keyboard focus on an interactive card" },
|
|
11
|
-
{ state: "Pressed (clickable)", visualChange: "Shadow decreases, card presses down slightly", opacity: "1", cursorWeb: "pointer", usage: "Card is being actively clicked or tapped" },
|
|
12
|
-
{ state: "Selected", visualChange: "Border changes to primary color, optional checkmark overlay", opacity: "1", cursorWeb: "pointer", usage: "Card has been chosen in a selection context" },
|
|
13
|
-
{ state: "Disabled", visualChange: "Content and surface dimmed, no interaction", opacity: "0.5", cursorWeb: "not-allowed", usage: "Card content is unavailable" },
|
|
14
|
-
{ state: "Loading/Skeleton", visualChange: "Placeholder shimmer blocks replace text and image areas", opacity: "1", cursorWeb: "default", usage: "Card data is being fetched asynchronously" },
|
|
15
|
-
],
|
|
16
|
-
|
|
17
|
-
propertyDescriptions: {
|
|
18
|
-
variant: "Visual style — elevated (shadow), outlined (border), or filled (background tint)",
|
|
19
|
-
clickable: "When true, the entire card surface is an interactive click target",
|
|
20
|
-
mediaPosition: "Where the image/media sits relative to content — top, left, right, or background",
|
|
21
|
-
title: "Primary heading text for the card",
|
|
22
|
-
subtitle: "Secondary text below the title providing context or metadata",
|
|
23
|
-
body: "Main descriptive content inside the card",
|
|
24
|
-
mediaSlot: "Image, illustration, or video displayed in the media zone",
|
|
25
|
-
actionsSlot: "Footer area for buttons, links, or icon actions",
|
|
26
|
-
badge: "Optional status indicator overlaid on the card (e.g. 'New', 'Sale')",
|
|
27
|
-
selected: "Whether the card is in a selected state within a selectable group",
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
sizeSpecifications: [
|
|
31
|
-
{ size: "compact", height: "auto (min 120px)", paddingLR: "12px", fontSize: "12px", iconSize: "16px", borderRadius: "8px" },
|
|
32
|
-
{ size: "sm", height: "auto (min 160px)", paddingLR: "16px", fontSize: "14px", iconSize: "16px", borderRadius: "8px" },
|
|
33
|
-
{ size: "md", height: "auto (min 200px)", paddingLR: "16px", fontSize: "14px", iconSize: "20px", borderRadius: "12px" },
|
|
34
|
-
{ size: "lg", height: "auto (min 280px)", paddingLR: "24px", fontSize: "16px", iconSize: "20px", borderRadius: "12px" },
|
|
35
|
-
{ size: "horizontal", height: "auto (min 140px)", paddingLR: "16px", fontSize: "14px", iconSize: "20px", borderRadius: "12px" },
|
|
36
|
-
],
|
|
37
|
-
|
|
38
|
-
designTokenBindings: [
|
|
39
|
-
{ property: "surface-bg", tokenName: "color/layer/01", role: "Card background fill", fallback: "#FFFFFF" },
|
|
40
|
-
{ property: "border", tokenName: "color/border/subtle/01", role: "Outline variant border", fallback: "#E0E0E0" },
|
|
41
|
-
{ property: "shadow-resting", tokenName: "shadow/raised/02", role: "Elevation shadow at rest", fallback: "0 2px 6px rgba(0,0,0,0.1)" },
|
|
42
|
-
{ property: "shadow-hover", tokenName: "shadow/raised/04", role: "Elevated shadow on hover for clickable cards", fallback: "0 6px 16px rgba(0,0,0,0.15)" },
|
|
43
|
-
{ property: "title-text", tokenName: "color/text/primary", role: "Card title color", fallback: "#161616" },
|
|
44
|
-
{ property: "body-text", tokenName: "color/text/secondary", role: "Body and subtitle text color", fallback: "#525252" },
|
|
45
|
-
{ property: "selected-border", tokenName: "color/border/interactive", role: "Border on selected cards", fallback: "#0F62FE" },
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
structureRules: [
|
|
49
|
-
"Cards follow a vertical stack: media zone → content zone (title, subtitle, body) → action zone",
|
|
50
|
-
"Horizontal cards place the media zone on the left (LTR) or right (RTL) with content beside it",
|
|
51
|
-
"The media zone has no padding; images bleed to the card edges with overflow:hidden and border-radius",
|
|
52
|
-
"Content zone applies internal padding; title comes first, followed by subtitle, then body",
|
|
53
|
-
"Action zone sits at the bottom with a top divider and horizontal button layout aligned to the end",
|
|
54
|
-
"Clickable cards wrap the entire surface in an <a> or <button>; actions inside use stopPropagation",
|
|
55
|
-
"Card aspect ratio is content-driven by default; media zone can enforce a fixed aspect ratio (16:9, 4:3)",
|
|
56
|
-
],
|
|
57
|
-
|
|
58
|
-
typeHierarchyRules: [
|
|
59
|
-
"Title uses heading-compact-02 (16px/22px semibold) for md size and heading-compact-01 for sm",
|
|
60
|
-
"Subtitle uses body-compact-01 (14px) in text-secondary color",
|
|
61
|
-
"Body text uses body-01 (14px/20px) for comfortable reading within the card",
|
|
62
|
-
"Metadata (date, author, category) uses label-01 (12px) in text-helper color",
|
|
63
|
-
"Action button labels use body-compact-01 (14px) matching the design system button spec",
|
|
64
|
-
"Badge text uses label-01 (12px) with inverse text on a filled background",
|
|
65
|
-
"Title is limited to 2 lines with line-clamp; body limited to 3 lines",
|
|
66
|
-
],
|
|
67
|
-
|
|
68
|
-
interactionRules: [
|
|
69
|
-
{ event: "click", trigger: "User clicks anywhere on a clickable card", action: "Navigate to the card's detail view or trigger onSelect callback" },
|
|
70
|
-
{ event: "keydown:Enter/Space", trigger: "Focus is on a clickable card", action: "Activate the card (same as click)" },
|
|
71
|
-
{ event: "hover", trigger: "Pointer enters card boundary", action: "Increase shadow elevation and apply subtle scale transform" },
|
|
72
|
-
{ event: "click:action-button", trigger: "User clicks a button inside the action zone", action: "Execute button action; stopPropagation prevents card-level click" },
|
|
73
|
-
{ event: "long-press", trigger: "Touch user holds on card (mobile)", action: "Show context menu or enter selection mode" },
|
|
74
|
-
{ event: "swipe", trigger: "Horizontal swipe on card (mobile)", action: "Reveal quick actions (archive, delete) from the side" },
|
|
75
|
-
],
|
|
76
|
-
|
|
77
|
-
contentGuidance: [
|
|
78
|
-
"Use a clear, specific title — 'Q3 Revenue Report' not 'Report'",
|
|
79
|
-
"Limit body text to 2–3 sentences; cards are for scanning, not deep reading",
|
|
80
|
-
"Use high-quality images with consistent aspect ratios across a card grid",
|
|
81
|
-
"Place the most important information (title, key metric) at the top of the content zone",
|
|
82
|
-
"Action buttons should use ghost or tertiary style to avoid competing with card-level click",
|
|
83
|
-
"Metadata like dates and authors belong below the body text or in the subtitle",
|
|
84
|
-
"Badge labels should be 1–2 words: 'New', 'Featured', 'Sold out'",
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
-
responsiveBehaviour: [
|
|
88
|
-
{ breakpoint: "≥ 1056px (lg)", behavior: "Cards in a 3–4 column grid; horizontal variant available" },
|
|
89
|
-
{ breakpoint: "672–1055px (md)", behavior: "Cards reflow to 2 column grid; horizontal cards stack vertically" },
|
|
90
|
-
{ breakpoint: "< 672px (sm)", behavior: "Single column stack; cards fill full width; media aspect ratio may shift to 16:9" },
|
|
91
|
-
{ breakpoint: "Touch devices", behavior: "Hover states replaced by active/pressed feedback; swipe actions enabled" },
|
|
92
|
-
{ breakpoint: "Container queries", behavior: "Card adapts internal layout based on its own width, not viewport" },
|
|
93
|
-
],
|
|
94
|
-
|
|
95
|
-
accessibilitySpec: {
|
|
96
|
-
intro:
|
|
97
|
-
"Cards must be perceivable as distinct content units and, when interactive, operable via keyboard. Clickable cards require careful handling to avoid nested interactive element issues.",
|
|
98
|
-
requirements: [
|
|
99
|
-
{ requirement: "Clickable cards must be focusable and activated via Enter or Space", level: "A", notes: "Use <a> for navigation or <button> for actions" },
|
|
100
|
-
{ requirement: "Card images must have descriptive alt text or be marked decorative (alt='')", level: "A", notes: "If the image is essential to understanding the card, alt text is required" },
|
|
101
|
-
{ requirement: "Nested interactive elements (buttons, links) must not be inside the card's primary <a>/<button>", level: "A", notes: "Use CSS pseudo-element technique to make card clickable without nesting" },
|
|
102
|
-
{ requirement: "Card groups should use <ul>/<li> structure for list semantics", level: "A", notes: "Screen readers announce 'list of 12 items' providing context" },
|
|
103
|
-
{ requirement: "Selected cards must convey state via aria-selected or aria-pressed", level: "A", notes: "Also provide visual indicator beyond color (checkmark, border)" },
|
|
104
|
-
{ requirement: "Text must maintain 4.5:1 contrast against the card surface", level: "AA", notes: "Check both light and dark theme values" },
|
|
105
|
-
{ requirement: "Skeleton loading state should use aria-busy='true' on the card region", level: "AA", notes: "Announce 'loading' to screen readers" },
|
|
106
|
-
],
|
|
107
|
-
outro: [
|
|
108
|
-
"Test keyboard navigation through a grid of clickable cards using Tab key",
|
|
109
|
-
"Verify that nested action buttons are independently focusable and do not trigger card navigation",
|
|
110
|
-
"Ensure card groups announce the count and position (e.g. 'item 3 of 12')",
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
qaAcceptanceCriteria: [
|
|
115
|
-
{ check: "Clickable card navigates on click and Enter key", platform: "All", expectedResult: "Detail view opens; URL updates if applicable" },
|
|
116
|
-
{ check: "Hover shadow elevation increases", platform: "Web", expectedResult: "Smooth transition from resting to hover shadow" },
|
|
117
|
-
{ check: "Action buttons work independently of card click", platform: "Web", expectedResult: "Button action fires; card navigation does not trigger" },
|
|
118
|
-
{ check: "Image maintains aspect ratio", platform: "All", expectedResult: "No stretching or cropping beyond intended bounds" },
|
|
119
|
-
{ check: "Cards reflow to single column on mobile", platform: "Mobile", expectedResult: "Full width cards stacked vertically with consistent spacing" },
|
|
120
|
-
{ check: "Selected state is visually distinct", platform: "All", expectedResult: "Border color changes, checkmark visible, aria-selected is true" },
|
|
121
|
-
{ check: "Skeleton state renders placeholder blocks", platform: "Web", expectedResult: "Shimmer animation on text and media placeholders" },
|
|
122
|
-
],
|
|
123
|
-
|
|
124
|
-
dos: [
|
|
125
|
-
"Maintain consistent card heights within a row using CSS grid alignment",
|
|
126
|
-
"Use the outlined variant on busy backgrounds to provide clear boundaries",
|
|
127
|
-
"Apply the pseudo-element click technique to avoid nested interactive elements",
|
|
128
|
-
"Use skeleton loading when card data loads asynchronously",
|
|
129
|
-
"Group related cards with consistent metadata placement across the set",
|
|
130
|
-
"Provide alt text for card images that convey meaningful content",
|
|
131
|
-
"Use container queries to make card layout adapt to its allocated space",
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
donts: [
|
|
135
|
-
"Don't nest links inside a clickable card element — it creates invalid HTML",
|
|
136
|
-
"Don't use cards for single pieces of unrelated data — use a list instead",
|
|
137
|
-
"Don't make every card clickable if the action is ambiguous or undefined",
|
|
138
|
-
"Don't vary card heights dramatically in a grid — use line-clamp for consistency",
|
|
139
|
-
"Don't place too many action buttons in the footer — limit to 2–3 maximum",
|
|
140
|
-
"Don't use card shadows in a flat design system that avoids elevation",
|
|
141
|
-
"Don't omit loading states — empty cards with no content look broken",
|
|
142
|
-
],
|
|
143
|
-
};
|
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* checkbox.ts — Design knowledge for Checkbox components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const checkboxKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Selection control | Binary or tri-state choice | Form input element",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "Unchecked",
|
|
13
|
-
visualChange: "Empty box with visible border; no fill or checkmark",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "pointer",
|
|
16
|
-
usage: "Option is available but not selected",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "Checked",
|
|
20
|
-
visualChange: "Box filled with brand color; white checkmark icon visible",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "pointer",
|
|
23
|
-
usage: "Option has been selected by the user",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "Indeterminate",
|
|
27
|
-
visualChange: "Box filled with brand color; horizontal dash icon replaces checkmark",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "pointer",
|
|
30
|
-
usage: "Parent checkbox when only some child options are selected",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Disabled",
|
|
34
|
-
visualChange: "Border and fill switch to muted/disabled tokens; label text dimmed",
|
|
35
|
-
opacity: "0.4",
|
|
36
|
-
cursorWeb: "not-allowed",
|
|
37
|
-
usage: "Option is non-interactive due to permissions or current context",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Focus",
|
|
41
|
-
visualChange: "2px focus ring offset by 2px around the checkbox box",
|
|
42
|
-
opacity: "1",
|
|
43
|
-
cursorWeb: "pointer",
|
|
44
|
-
usage: "Checkbox receives keyboard focus via Tab key",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
state: "Hover",
|
|
48
|
-
visualChange: "Box border darkens or background shows a subtle highlight",
|
|
49
|
-
opacity: "1",
|
|
50
|
-
cursorWeb: "pointer",
|
|
51
|
-
usage: "Mouse cursor enters the checkbox or its label area",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
state: "Error",
|
|
55
|
-
visualChange: "Box border switches to error/red token; error message appears below",
|
|
56
|
-
opacity: "1",
|
|
57
|
-
cursorWeb: "pointer",
|
|
58
|
-
usage: "Validation has failed — typically a required checkbox left unchecked",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
|
|
62
|
-
propertyDescriptions: {
|
|
63
|
-
checked: "Boolean indicating whether the checkbox is currently selected",
|
|
64
|
-
indeterminate: "When true the checkbox displays a dash instead of a checkmark, representing a mixed/partial selection",
|
|
65
|
-
disabled: "When true the checkbox is non-interactive: muted visuals, no event firing, aria-disabled='true'",
|
|
66
|
-
label: "Descriptive text rendered adjacent to the checkbox box; also serves as the accessible name",
|
|
67
|
-
error: "Error message string displayed below the checkbox when validation fails",
|
|
68
|
-
required: "When true the checkbox must be checked before the form can be submitted; adds aria-required='true'",
|
|
69
|
-
name: "Form field name used when submitting the checkbox value",
|
|
70
|
-
value: "The value submitted with the form when the checkbox is checked",
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
sizeSpecifications: [
|
|
74
|
-
{
|
|
75
|
-
size: "Small",
|
|
76
|
-
height: "16px",
|
|
77
|
-
paddingLR: "0px",
|
|
78
|
-
fontSize: "12px",
|
|
79
|
-
iconSize: "12px",
|
|
80
|
-
borderRadius: "3px",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
size: "Medium",
|
|
84
|
-
height: "20px",
|
|
85
|
-
paddingLR: "0px",
|
|
86
|
-
fontSize: "14px",
|
|
87
|
-
iconSize: "14px",
|
|
88
|
-
borderRadius: "4px",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
size: "Large",
|
|
92
|
-
height: "24px",
|
|
93
|
-
paddingLR: "0px",
|
|
94
|
-
fontSize: "16px",
|
|
95
|
-
iconSize: "16px",
|
|
96
|
-
borderRadius: "6px",
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
-
designTokenBindings: [
|
|
101
|
-
{
|
|
102
|
-
property: "Box Border",
|
|
103
|
-
tokenName: "$checkbox-border",
|
|
104
|
-
role: "Border color of the unchecked checkbox box",
|
|
105
|
-
fallback: "#D0D5DD",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
property: "Box Background (checked)",
|
|
109
|
-
tokenName: "$checkbox-checked-bg",
|
|
110
|
-
role: "Fill color when checkbox is checked or indeterminate",
|
|
111
|
-
fallback: "#2563EB",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
property: "Checkmark Color",
|
|
115
|
-
tokenName: "$checkbox-checkmark",
|
|
116
|
-
role: "Color of the checkmark or dash icon inside the box",
|
|
117
|
-
fallback: "#FFFFFF",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
property: "Label Color",
|
|
121
|
-
tokenName: "$text-primary",
|
|
122
|
-
role: "Label text color in default state",
|
|
123
|
-
fallback: "#101828",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
property: "Focus Ring",
|
|
127
|
-
tokenName: "$focus-ring",
|
|
128
|
-
role: "Keyboard focus indicator around the checkbox box",
|
|
129
|
-
fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
property: "Error Border",
|
|
133
|
-
tokenName: "$border-error",
|
|
134
|
-
role: "Border color when checkbox is in an error state",
|
|
135
|
-
fallback: "#F04438",
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
|
|
139
|
-
structureRules: [
|
|
140
|
-
"Checkbox box and label are arranged in a horizontal Auto Layout with center vertical alignment",
|
|
141
|
-
"Checkmark or dash icon is centered within the checkbox box using absolute positioning or Auto Layout",
|
|
142
|
-
"The entire label area is clickable and toggles the checkbox — not just the box itself",
|
|
143
|
-
"Group spacing between stacked checkboxes uses $spacing-sm (8px) for vertical separation",
|
|
144
|
-
"Touch target for the checkbox extends to at least 44x44px including the label hit area",
|
|
145
|
-
"Checkbox groups are wrapped in a fieldset with a visible legend for screen readers",
|
|
146
|
-
],
|
|
147
|
-
|
|
148
|
-
typeHierarchyRules: [
|
|
149
|
-
"Label text uses Regular weight (400) — never Bold — to maintain visual parity within groups",
|
|
150
|
-
"Line height matches the design system's body text scale for consistent vertical rhythm",
|
|
151
|
-
"Label text is left-aligned (or right-aligned in RTL) adjacent to the checkbox box",
|
|
152
|
-
"Description or helper text below the label uses a smaller font size and secondary color token",
|
|
153
|
-
],
|
|
154
|
-
|
|
155
|
-
interactionRules: [
|
|
156
|
-
{ event: "Click / Tap", trigger: "pointerup on box or label", action: "Toggle checked state; fire onChange handler" },
|
|
157
|
-
{ event: "Space Key", trigger: "Space key while checkbox is focused", action: "Toggle checked state (same as click)" },
|
|
158
|
-
{ event: "Focus", trigger: "Tab key or focus()", action: "Show focus ring around the checkbox box" },
|
|
159
|
-
{ event: "Blur", trigger: "Focus moves away", action: "Remove focus ring; trigger validation if required" },
|
|
160
|
-
{ event: "Label Click", trigger: "pointerup on the label text", action: "Toggle checkbox — label acts as an extended hit area" },
|
|
161
|
-
],
|
|
162
|
-
|
|
163
|
-
contentGuidance: [
|
|
164
|
-
"Frame labels positively: 'Send me updates' instead of 'Do not send me updates'",
|
|
165
|
-
"Use parallel grammatical structure when checkboxes appear in a group",
|
|
166
|
-
"Limit checkbox groups to 7-10 items; beyond that, consider a different pattern (search, filter, or multi-select)",
|
|
167
|
-
"Each checkbox label should make sense independently — avoid labels that only work in context of the group heading",
|
|
168
|
-
"Required checkboxes (e.g. terms acceptance) should clearly state the obligation in the label",
|
|
169
|
-
],
|
|
170
|
-
|
|
171
|
-
responsiveBehaviour: [
|
|
172
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Touch target expands to 48px height; labels may wrap to a second line" },
|
|
173
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Checkbox groups may display in 2-column grid layout" },
|
|
174
|
-
{ breakpoint: "Desktop (>=1024px)", behavior: "Standard single-column or multi-column layout; compact sizing allowed" },
|
|
175
|
-
],
|
|
176
|
-
|
|
177
|
-
accessibilitySpec: {
|
|
178
|
-
intro:
|
|
179
|
-
"Checkboxes must communicate their role, checked state, and any group context to assistive technology. Tri-state behavior requires careful ARIA handling.",
|
|
180
|
-
requirements: [
|
|
181
|
-
{ requirement: "Role", level: "A", notes: "Use native <input type='checkbox'> or role='checkbox' with full ARIA support" },
|
|
182
|
-
{ requirement: "aria-checked (tri-state)", level: "A", notes: "Values: 'true', 'false', or 'mixed' for indeterminate state" },
|
|
183
|
-
{ requirement: "aria-required", level: "A", notes: "Set to 'true' on required checkboxes; pair with visible required indicator" },
|
|
184
|
-
{ requirement: "Fieldset / Legend", level: "A", notes: "Wrap checkbox groups in <fieldset> with <legend> for group label context" },
|
|
185
|
-
{ requirement: "Keyboard Operable", level: "A", notes: "Space key toggles state; Tab moves between checkboxes; no Enter activation" },
|
|
186
|
-
{ requirement: "Contrast Ratio", level: "AA", notes: "Box border: 3:1 against background; checkmark: 3:1 against box fill; label: 4.5:1" },
|
|
187
|
-
{ requirement: "Error Announcement", level: "A", notes: "Error messages linked via aria-describedby; announced on validation failure" },
|
|
188
|
-
],
|
|
189
|
-
outro: [
|
|
190
|
-
"Test indeterminate state announcement with multiple screen readers — behavior varies across AT",
|
|
191
|
-
"Ensure label click correctly toggles the checkbox in all browsers",
|
|
192
|
-
],
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
qaAcceptanceCriteria: [
|
|
196
|
-
{ check: "Toggle Behavior", platform: "All", expectedResult: "Clicking checkbox or label toggles between checked and unchecked" },
|
|
197
|
-
{ check: "Indeterminate State", platform: "All", expectedResult: "Dash icon visible; aria-checked='mixed'; clicking resolves to checked" },
|
|
198
|
-
{ check: "Disabled State", platform: "All", expectedResult: "Muted visuals; no toggle on click; aria-disabled='true'" },
|
|
199
|
-
{ check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab moves focus between checkboxes; Space toggles; Enter does not toggle" },
|
|
200
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces role 'checkbox', label, and checked/unchecked/mixed state" },
|
|
201
|
-
{ check: "Error State", platform: "All", expectedResult: "Red border on box; error text visible below; error linked via aria-describedby" },
|
|
202
|
-
{ check: "Group Behavior", platform: "All", expectedResult: "Fieldset and legend announced; parent checkbox reflects child selection state" },
|
|
203
|
-
{ check: "Touch Target", platform: "Mobile", expectedResult: "Hit area at least 44x44px including label" },
|
|
204
|
-
{ check: "Contrast", platform: "All", expectedResult: "Box, checkmark, and label meet WCAG AA contrast requirements" },
|
|
205
|
-
{ check: "RTL Support", platform: "Web", expectedResult: "Box position mirrors to right side; label alignment flips correctly" },
|
|
206
|
-
],
|
|
207
|
-
|
|
208
|
-
dos: [
|
|
209
|
-
"Use checkboxes for independent, non-mutually-exclusive selections",
|
|
210
|
-
"Provide a visible label for every checkbox — never use a standalone unlabeled box",
|
|
211
|
-
"Use indeterminate state only for parent checkboxes that summarize child selections",
|
|
212
|
-
"Group related checkboxes inside a fieldset with a descriptive legend",
|
|
213
|
-
"Allow users to check and uncheck freely before submitting — validate on submit, not on change",
|
|
214
|
-
"Maintain consistent vertical spacing between grouped checkboxes",
|
|
215
|
-
"Pair required checkboxes with clear helper text explaining the obligation",
|
|
216
|
-
],
|
|
217
|
-
|
|
218
|
-
donts: [
|
|
219
|
-
"Do not use checkboxes for mutually exclusive choices — use radio buttons instead",
|
|
220
|
-
"Do not pre-check optional checkboxes (e.g. marketing opt-ins) — respect user intent",
|
|
221
|
-
"Do not mix checkbox sizes within the same group",
|
|
222
|
-
"Do not place checkboxes in a horizontal row if there are more than 3 options",
|
|
223
|
-
"Do not rely on color alone to indicate the checked state — the checkmark icon is essential",
|
|
224
|
-
"Do not disable a checkbox without providing context about why it is unavailable",
|
|
225
|
-
"Do not use negative framing in labels (e.g. 'Do not contact me') — rephrase positively",
|
|
226
|
-
],
|
|
227
|
-
};
|
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* chip.ts — Gold-standard design knowledge for Chip / Tag / Pill components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const chipKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Compact label | Filterable tag | Dismissible metadata token",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "Default",
|
|
13
|
-
visualChange: "Subtle fill or outlined container with label text and optional icon/avatar",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "default",
|
|
16
|
-
usage: "Resting state displaying metadata or a category label",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "Hover",
|
|
20
|
-
visualChange: "Background darkens slightly; close icon (if removable) gains emphasis",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "pointer",
|
|
23
|
-
usage: "Cursor enters the chip hit area on interactive chips",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "Selected",
|
|
27
|
-
visualChange: "Filled background with contrasting text; checkmark icon may appear",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "pointer",
|
|
30
|
-
usage: "Chip is actively selected in a filter or choice group",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Disabled",
|
|
34
|
-
visualChange: "Muted background and text; close icon hidden or non-interactive",
|
|
35
|
-
opacity: "0.4",
|
|
36
|
-
cursorWeb: "not-allowed",
|
|
37
|
-
usage: "Chip cannot be selected, removed, or interacted with",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Focus",
|
|
41
|
-
visualChange: "2px focus ring offset by 2px from the chip edge using $focus-ring token",
|
|
42
|
-
opacity: "1",
|
|
43
|
-
cursorWeb: "pointer",
|
|
44
|
-
usage: "Chip receives keyboard focus via Tab key",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
state: "Active",
|
|
48
|
-
visualChange: "Background shifts one step darker; slight scale-down (0.97) on press",
|
|
49
|
-
opacity: "1",
|
|
50
|
-
cursorWeb: "pointer",
|
|
51
|
-
usage: "Mouse button held down or touch press in progress on the chip",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
state: "Removing",
|
|
55
|
-
visualChange: "Chip shrinks horizontally with opacity fade-out animation before removal from DOM",
|
|
56
|
-
opacity: "0",
|
|
57
|
-
cursorWeb: "default",
|
|
58
|
-
usage: "User clicked the close icon or triggered deletion via Backspace/Delete key",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
|
|
62
|
-
propertyDescriptions: {
|
|
63
|
-
label: "Text content displayed inside the chip; should be short (1-3 words)",
|
|
64
|
-
type: "Chip behavior variant — Filter (toggleable), Input (removable user entry), Choice (single-select), or Assist (action suggestion)",
|
|
65
|
-
removable: "When true, a close/dismiss icon is rendered on the trailing edge of the chip",
|
|
66
|
-
selected: "When true, the chip shows its selected visual state with filled background",
|
|
67
|
-
disabled: "When true, the chip is non-interactive with muted visuals and aria-disabled",
|
|
68
|
-
icon: "Optional leading icon rendered before the label text",
|
|
69
|
-
avatar: "Optional leading avatar thumbnail rendered before the label, typically 20px circular",
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
sizeSpecifications: [
|
|
73
|
-
{
|
|
74
|
-
size: "Small",
|
|
75
|
-
height: "24px",
|
|
76
|
-
paddingLR: "8px",
|
|
77
|
-
fontSize: "11px",
|
|
78
|
-
iconSize: "14px",
|
|
79
|
-
borderRadius: "12px",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
size: "Medium",
|
|
83
|
-
height: "32px",
|
|
84
|
-
paddingLR: "12px",
|
|
85
|
-
fontSize: "13px",
|
|
86
|
-
iconSize: "16px",
|
|
87
|
-
borderRadius: "16px",
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
size: "Large",
|
|
91
|
-
height: "40px",
|
|
92
|
-
paddingLR: "16px",
|
|
93
|
-
fontSize: "14px",
|
|
94
|
-
iconSize: "20px",
|
|
95
|
-
borderRadius: "20px",
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
|
|
99
|
-
designTokenBindings: [
|
|
100
|
-
{
|
|
101
|
-
property: "Background",
|
|
102
|
-
tokenName: "$chip-bg",
|
|
103
|
-
role: "Default chip fill color — subtle neutral tone",
|
|
104
|
-
fallback: "#F3F4F6",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
property: "Background Selected",
|
|
108
|
-
tokenName: "$chip-bg-selected",
|
|
109
|
-
role: "Fill color when chip is in selected state",
|
|
110
|
-
fallback: "#2563EB",
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
property: "Text Color",
|
|
114
|
-
tokenName: "$chip-text",
|
|
115
|
-
role: "Label and icon color in default state",
|
|
116
|
-
fallback: "#374151",
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
property: "Text Color Selected",
|
|
120
|
-
tokenName: "$chip-text-selected",
|
|
121
|
-
role: "Label and icon color in selected state",
|
|
122
|
-
fallback: "#FFFFFF",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
property: "Border",
|
|
126
|
-
tokenName: "$chip-border",
|
|
127
|
-
role: "Outlined variant border color",
|
|
128
|
-
fallback: "#D1D5DB",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
property: "Close Icon Color",
|
|
132
|
-
tokenName: "$chip-close-icon",
|
|
133
|
-
role: "Color of the trailing dismiss/close icon",
|
|
134
|
-
fallback: "#6B7280",
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
property: "Focus Ring",
|
|
138
|
-
tokenName: "$focus-ring",
|
|
139
|
-
role: "Keyboard focus indicator ring",
|
|
140
|
-
fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
|
|
144
|
-
structureRules: [
|
|
145
|
-
"Container uses horizontal Auto Layout with center vertical alignment and hug-contents width",
|
|
146
|
-
"Leading icon or avatar is an optional first child; label text is the center child; close icon is the trailing child",
|
|
147
|
-
"Border-radius is set to 50% of the height to create the pill/capsule shape",
|
|
148
|
-
"Close icon has its own 4px hit area padding to meet the 24x24px minimum interactive target",
|
|
149
|
-
"Chip groups use horizontal Auto Layout with wrap enabled and $spacing-xs (4px) gap",
|
|
150
|
-
"When chips overflow their container, the group wraps to the next line — no horizontal scrolling by default",
|
|
151
|
-
"Selected chips with a checkmark prepend the check icon before the label, shifting content right",
|
|
152
|
-
],
|
|
153
|
-
|
|
154
|
-
typeHierarchyRules: [
|
|
155
|
-
"Font weight is Medium (500) for all chip states",
|
|
156
|
-
"Text uses sentence case — 'New arrival', not 'New Arrival' or 'NEW ARRIVAL'",
|
|
157
|
-
"Labels are single-line only; truncate with ellipsis at a configurable max-width",
|
|
158
|
-
"Maximum label length is 25 characters — longer values should be truncated",
|
|
159
|
-
"Close icon (x) uses a slightly smaller size than the leading icon",
|
|
160
|
-
],
|
|
161
|
-
|
|
162
|
-
interactionRules: [
|
|
163
|
-
{ event: "Click / Tap", trigger: "pointerup on chip body", action: "Toggle selected state for Filter/Choice chips; no action for Input chips" },
|
|
164
|
-
{ event: "Close Click", trigger: "pointerup on close icon", action: "Fire onRemove handler; animate chip out; remove from DOM" },
|
|
165
|
-
{ event: "Hover", trigger: "pointerenter", action: "Transition to hover background; close icon gains emphasis" },
|
|
166
|
-
{ event: "Focus", trigger: "Tab key or focus()", action: "Show focus ring; arrow keys navigate between chips in a group" },
|
|
167
|
-
{ event: "Backspace / Delete", trigger: "Key pressed while chip is focused", action: "Remove the focused chip if removable; move focus to the next chip" },
|
|
168
|
-
{ event: "Arrow Keys", trigger: "Left/Right arrows while chip group is focused", action: "Move focus between sibling chips in the group" },
|
|
169
|
-
],
|
|
170
|
-
|
|
171
|
-
contentGuidance: [
|
|
172
|
-
"Chip labels should be 1-3 words maximum — they represent metadata, not sentences",
|
|
173
|
-
"Use nouns or short noun phrases: 'JavaScript', 'In Progress', 'Priority: High'",
|
|
174
|
-
"Avoid action verbs in chip labels — chips represent state, not actions",
|
|
175
|
-
"Leading icons should reinforce the category (e.g. calendar icon for date chips)",
|
|
176
|
-
"In filter groups, include an 'All' or 'Clear filters' option to reset selections",
|
|
177
|
-
"Removable chips should confirm destructive removal if the chip represents important data",
|
|
178
|
-
],
|
|
179
|
-
|
|
180
|
-
responsiveBehaviour: [
|
|
181
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Chip groups wrap freely; use Small size; max 2 lines visible with 'Show more' toggle" },
|
|
182
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Medium size default; groups may show 3 lines before overflow" },
|
|
183
|
-
{ breakpoint: "Desktop (1024-1439px)", behavior: "All sizes available; horizontal chip groups with wrap at container edge" },
|
|
184
|
-
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "Chip sizes remain capped — do not scale with viewport" },
|
|
185
|
-
{ breakpoint: "Input Field Context", behavior: "Chips inside text inputs use Small size and compress to fit available width" },
|
|
186
|
-
],
|
|
187
|
-
|
|
188
|
-
accessibilitySpec: {
|
|
189
|
-
intro:
|
|
190
|
-
"Chips serve as compact interactive elements that must be fully operable by keyboard and announced correctly by screen readers.",
|
|
191
|
-
requirements: [
|
|
192
|
-
{ requirement: "Role", level: "A", notes: "Filter/Choice chips use role='option' within a listbox; Input chips use role='button' with aria-label" },
|
|
193
|
-
{ requirement: "Focusable", level: "A", notes: "Each chip must be focusable via Tab; within groups, arrow keys navigate between chips" },
|
|
194
|
-
{ requirement: "Keyboard Removal", level: "A", notes: "Backspace or Delete removes a focused removable chip; focus moves to the next sibling" },
|
|
195
|
-
{ requirement: "Selected State", level: "A", notes: "Selected chips must announce aria-selected='true' and convey state change" },
|
|
196
|
-
{ requirement: "Contrast Ratio", level: "AA", notes: "Text-to-background: 4.5:1 minimum in both default and selected states" },
|
|
197
|
-
{ requirement: "Touch Target", level: "AA", notes: "Chip and close icon must each have a minimum 44x24px touch area" },
|
|
198
|
-
],
|
|
199
|
-
outro: [
|
|
200
|
-
"Chip groups should use role='listbox' or role='group' with an aria-label describing the filter category",
|
|
201
|
-
"Announce removal actions to screen readers via aria-live polite region",
|
|
202
|
-
],
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
qaAcceptanceCriteria: [
|
|
206
|
-
{ check: "Visual Regression", platform: "All", expectedResult: "Chip renders pixel-perfect against baseline for each type and state" },
|
|
207
|
-
{ check: "Selection Toggle", platform: "All", expectedResult: "Filter/Choice chips toggle between default and selected states on click" },
|
|
208
|
-
{ check: "Removal Animation", platform: "Web", expectedResult: "Chip animates out smoothly on close; remaining chips reflow without jank" },
|
|
209
|
-
{ check: "Keyboard Navigation", platform: "Web", expectedResult: "Arrow keys move focus between chips; Backspace removes focused chip" },
|
|
210
|
-
{ check: "Truncation", platform: "All", expectedResult: "Labels exceeding max-width truncate with ellipsis; tooltip shows full text" },
|
|
211
|
-
{ check: "Wrap Behavior", platform: "All", expectedResult: "Chip groups wrap to next line at container boundary; no horizontal scroll" },
|
|
212
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces chip label, type, selected state, and removable status" },
|
|
213
|
-
],
|
|
214
|
-
|
|
215
|
-
dos: [
|
|
216
|
-
"Use Filter chips for multi-select category filtering in search interfaces",
|
|
217
|
-
"Use Input chips for user-entered tags (email addresses, categories) in form fields",
|
|
218
|
-
"Use Choice chips for single-select options where radio buttons feel too heavy",
|
|
219
|
-
"Keep labels concise — 1-3 words that clearly communicate the metadata",
|
|
220
|
-
"Provide keyboard navigation within chip groups using arrow keys",
|
|
221
|
-
"Animate chip removal for smooth visual feedback",
|
|
222
|
-
],
|
|
223
|
-
|
|
224
|
-
donts: [
|
|
225
|
-
"Do not use chips for primary actions — use buttons instead",
|
|
226
|
-
"Do not allow chip labels to wrap to multiple lines",
|
|
227
|
-
"Do not mix chip types (Filter, Input, Choice) within the same group",
|
|
228
|
-
"Do not use chips as a replacement for navigation tabs",
|
|
229
|
-
"Do not place more than 20 chips in a single visible group without pagination or 'Show more'",
|
|
230
|
-
"Do not remove the close icon hit area padding — it must remain easily tappable",
|
|
231
|
-
"Do not use chips for long-form content or sentences",
|
|
232
|
-
],
|
|
233
|
-
};
|