@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
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* inline-edit.ts — Gold-standard design knowledge for Inline Edit (click-to-edit) components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const inlineEditKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Click-to-edit text field | In-place editing | Transforms static text into an editable input on activation",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "ReadMode",
|
|
13
|
-
visualChange: "Text appears as static content with an optional hover indicator (pencil icon or underline) signaling editability",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "pointer",
|
|
16
|
-
usage: "Default state — value is displayed as read-only text; user can click or press Enter to switch to edit mode",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "ReadMode Hover",
|
|
20
|
-
visualChange: "Subtle underline, background tint, or pencil icon appears to signal that the text is editable",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "pointer",
|
|
23
|
-
usage: "Mouse cursor enters the read-mode text area — visual hint reveals the editing affordance",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "EditMode",
|
|
27
|
-
visualChange: "Text transforms into an input field with border, focus ring, and optional confirm/cancel action buttons",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "text",
|
|
30
|
-
usage: "User is actively editing the value — input field is focused and text is editable",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Saving",
|
|
34
|
-
visualChange: "Input field shows a loading spinner or is briefly disabled; confirm button may show a spinner",
|
|
35
|
-
opacity: "1",
|
|
36
|
-
cursorWeb: "wait",
|
|
37
|
-
usage: "Edit has been confirmed and the new value is being persisted asynchronously",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Error",
|
|
41
|
-
visualChange: "Input field border turns red; error message appears below; value reverts or remains for correction",
|
|
42
|
-
opacity: "1",
|
|
43
|
-
cursorWeb: "text",
|
|
44
|
-
usage: "Validation failed or the save operation returned an error — user must correct the value",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
state: "Disabled",
|
|
48
|
-
visualChange: "Read-mode text is displayed without hover affordance; no editing is possible",
|
|
49
|
-
opacity: "0.4",
|
|
50
|
-
cursorWeb: "not-allowed",
|
|
51
|
-
usage: "Editing is not permitted — the value is read-only and cannot be changed",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
state: "Focus (ReadMode)",
|
|
55
|
-
visualChange: "Focus ring appears around the read-mode text; indicates keyboard activation is possible",
|
|
56
|
-
opacity: "1",
|
|
57
|
-
cursorWeb: "pointer",
|
|
58
|
-
usage: "Read-mode element receives keyboard focus via Tab — user can press Enter to switch to edit mode",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
|
|
62
|
-
propertyDescriptions: {
|
|
63
|
-
value: "Current text value displayed in read mode and pre-filled in edit mode; controlled by parent component",
|
|
64
|
-
onConfirm: "Callback invoked when the user confirms the edit (Enter key or confirm button click); receives the new value",
|
|
65
|
-
onCancel: "Callback invoked when the user cancels the edit (Escape key or cancel button click); value reverts to original",
|
|
66
|
-
size: "Dimensional preset — Small, Medium, or Large — controlling text size, input height, and button size",
|
|
67
|
-
validation: "Validation function or schema that runs before onConfirm; returns error message string or null if valid",
|
|
68
|
-
placeholder: "Placeholder text shown in the input field when the value is empty during edit mode",
|
|
69
|
-
disabled: "When true, the inline edit is non-interactive; read-mode text is shown without hover affordance",
|
|
70
|
-
readOnly: "When true, similar to disabled but may have different styling — value is visible but not editable",
|
|
71
|
-
showActions: "When true, shows explicit confirm (checkmark) and cancel (X) buttons beside the input in edit mode",
|
|
72
|
-
multiline: "When true, renders a textarea instead of a single-line input for multi-line text editing",
|
|
73
|
-
maxLength: "Maximum character count allowed in the input; prevents typing beyond this limit",
|
|
74
|
-
autoFocus: "When true, automatically focuses the input and selects all text when entering edit mode",
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
sizeSpecifications: [
|
|
78
|
-
{
|
|
79
|
-
size: "Small",
|
|
80
|
-
height: "28px",
|
|
81
|
-
paddingLR: "8px",
|
|
82
|
-
fontSize: "12px",
|
|
83
|
-
iconSize: "14px",
|
|
84
|
-
borderRadius: "4px",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
size: "Medium",
|
|
88
|
-
height: "36px",
|
|
89
|
-
paddingLR: "10px",
|
|
90
|
-
fontSize: "14px",
|
|
91
|
-
iconSize: "16px",
|
|
92
|
-
borderRadius: "6px",
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
size: "Large",
|
|
96
|
-
height: "44px",
|
|
97
|
-
paddingLR: "12px",
|
|
98
|
-
fontSize: "16px",
|
|
99
|
-
iconSize: "20px",
|
|
100
|
-
borderRadius: "8px",
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
designTokenBindings: [
|
|
105
|
-
{
|
|
106
|
-
property: "Read Text Color",
|
|
107
|
-
tokenName: "$inline-edit-text",
|
|
108
|
-
role: "Text color of the value in read mode",
|
|
109
|
-
fallback: "#101828",
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
property: "Read Hover Background",
|
|
113
|
-
tokenName: "$inline-edit-hover-bg",
|
|
114
|
-
role: "Subtle background tint shown on hover in read mode to indicate editability",
|
|
115
|
-
fallback: "#F2F4F7",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
property: "Read Hover Border",
|
|
119
|
-
tokenName: "$inline-edit-hover-border",
|
|
120
|
-
role: "Subtle underline or bottom border on hover in read mode",
|
|
121
|
-
fallback: "#D0D5DD",
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
property: "Edit Icon",
|
|
125
|
-
tokenName: "$inline-edit-icon",
|
|
126
|
-
role: "Pencil/edit icon color shown on hover in read mode",
|
|
127
|
-
fallback: "#667085",
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
property: "Input Background",
|
|
131
|
-
tokenName: "$inline-edit-input-bg",
|
|
132
|
-
role: "Background fill of the input field in edit mode",
|
|
133
|
-
fallback: "#FFFFFF",
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
property: "Input Border",
|
|
137
|
-
tokenName: "$inline-edit-input-border",
|
|
138
|
-
role: "Border color of the input field in edit mode",
|
|
139
|
-
fallback: "#2563EB",
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
property: "Input Text",
|
|
143
|
-
tokenName: "$inline-edit-input-text",
|
|
144
|
-
role: "Text color inside the input field in edit mode",
|
|
145
|
-
fallback: "#101828",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
property: "Confirm Button",
|
|
149
|
-
tokenName: "$inline-edit-confirm-bg",
|
|
150
|
-
role: "Background of the confirm (checkmark) action button",
|
|
151
|
-
fallback: "#2563EB",
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
property: "Cancel Button",
|
|
155
|
-
tokenName: "$inline-edit-cancel-bg",
|
|
156
|
-
role: "Background of the cancel (X) action button",
|
|
157
|
-
fallback: "#F2F4F7",
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
property: "Error Border",
|
|
161
|
-
tokenName: "$inline-edit-error-border",
|
|
162
|
-
role: "Input border color when validation fails",
|
|
163
|
-
fallback: "#F04438",
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
property: "Error Text",
|
|
167
|
-
tokenName: "$inline-edit-error-text",
|
|
168
|
-
role: "Error message text color below the input",
|
|
169
|
-
fallback: "#D92D20",
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
property: "Focus Ring",
|
|
173
|
-
tokenName: "$focus-ring",
|
|
174
|
-
role: "Keyboard focus indicator around the input field or read-mode text",
|
|
175
|
-
fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
|
|
179
|
-
structureRules: [
|
|
180
|
-
"In read mode, the component renders as a single text element with optional trailing edit icon",
|
|
181
|
-
"In edit mode, the text is replaced by an input field of matching width with optional action buttons",
|
|
182
|
-
"Action buttons (confirm/cancel) are positioned to the right of the input in a horizontal Auto Layout",
|
|
183
|
-
"The input field width should match the read-mode text width to prevent layout shift",
|
|
184
|
-
"Minimum input width is 100px to ensure usability even for short text values",
|
|
185
|
-
"Error messages appear below the input field using the inline-message pattern with $spacing-xs gap",
|
|
186
|
-
"Loading spinner replaces the confirm button or appears inside the input during the saving state",
|
|
187
|
-
"Read-mode text inherits the typography of its surrounding context (heading, body, etc.)",
|
|
188
|
-
"The component should maintain its vertical baseline alignment when switching between read and edit mode",
|
|
189
|
-
],
|
|
190
|
-
|
|
191
|
-
typeHierarchyRules: [
|
|
192
|
-
"Read-mode text inherits the font family, weight, and size from its context — it should look native",
|
|
193
|
-
"Edit-mode input text matches the read-mode typography exactly to prevent jarring visual changes",
|
|
194
|
-
"Action button icons use the configured iconSize for the size preset",
|
|
195
|
-
"Error messages use Regular weight (400) at 12px below the input field",
|
|
196
|
-
"Placeholder text uses Regular weight (400) in a muted color matching the input placeholder token",
|
|
197
|
-
],
|
|
198
|
-
|
|
199
|
-
interactionRules: [
|
|
200
|
-
{ event: "Click (Read Mode)", trigger: "Click/tap on the read-mode text", action: "Switch to edit mode; focus the input; select all text; show action buttons if configured" },
|
|
201
|
-
{ event: "Enter (Read Mode)", trigger: "Enter key while read-mode text is focused", action: "Switch to edit mode; same as click activation" },
|
|
202
|
-
{ event: "Confirm (Enter)", trigger: "Enter key while input is focused (single-line)", action: "Run validation; if valid, fire onConfirm with new value; switch back to read mode" },
|
|
203
|
-
{ event: "Confirm (Button)", trigger: "Click/tap the confirm (checkmark) button", action: "Run validation; if valid, fire onConfirm with new value; switch back to read mode" },
|
|
204
|
-
{ event: "Cancel (Escape)", trigger: "Escape key while input is focused", action: "Revert to original value; fire onCancel; switch back to read mode; return focus to read-mode element" },
|
|
205
|
-
{ event: "Cancel (Button)", trigger: "Click/tap the cancel (X) button", action: "Revert to original value; fire onCancel; switch back to read mode" },
|
|
206
|
-
{ event: "Blur", trigger: "Focus leaves the input (and action buttons)", action: "Either confirm the edit (auto-save pattern) or cancel depending on configuration" },
|
|
207
|
-
{ event: "Validation Error", trigger: "Validation function returns an error", action: "Remain in edit mode; show error state with error message; do not fire onConfirm" },
|
|
208
|
-
{ event: "Save Complete", trigger: "onConfirm resolves (async)", action: "Switch from saving to read mode; display the updated value" },
|
|
209
|
-
{ event: "Save Error", trigger: "onConfirm rejects (async)", action: "Switch from saving to error state; display the error message; remain in edit mode" },
|
|
210
|
-
],
|
|
211
|
-
|
|
212
|
-
contentGuidance: [
|
|
213
|
-
"Make the editable nature of the text discoverable — use hover affordances (underline, pencil icon, background tint)",
|
|
214
|
-
"Select all text when entering edit mode so users can immediately type a replacement",
|
|
215
|
-
"Show a brief saving indicator for async saves to confirm the edit is being processed",
|
|
216
|
-
"Provide clear error messages when validation fails: 'Name must be 2-50 characters' not 'Invalid input'",
|
|
217
|
-
"Use inline edit for short, single-field edits — for multi-field editing, use a form or modal",
|
|
218
|
-
"Placeholder text should hint at the expected content: 'Enter project name' not just 'Enter text'",
|
|
219
|
-
"Consider auto-saving on blur for low-risk fields; use explicit confirm/cancel for important changes",
|
|
220
|
-
],
|
|
221
|
-
|
|
222
|
-
responsiveBehaviour: [
|
|
223
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Input expands to full container width in edit mode; action buttons may stack below input; touch targets 44px minimum" },
|
|
224
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Standard inline layout; action buttons beside the input; comfortable touch targets" },
|
|
225
|
-
{ breakpoint: "Desktop (1024-1439px)", behavior: "Compact inline layout; action buttons beside the input; hover affordance visible on pointer enter" },
|
|
226
|
-
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "No scaling change; component remains at its natural width" },
|
|
227
|
-
],
|
|
228
|
-
|
|
229
|
-
accessibilitySpec: {
|
|
230
|
-
intro:
|
|
231
|
-
"Inline edit components switch between a read-only display and an editable input. The mode change must be communicated to screen readers, and keyboard users must have full control over entering, confirming, and canceling edits.",
|
|
232
|
-
requirements: [
|
|
233
|
-
{ requirement: "Read Mode Role", level: "A", notes: "Read-mode element must have role='button' to indicate it is interactive; or use a native button with styled text" },
|
|
234
|
-
{ requirement: "Accessible Name", level: "A", notes: "Read-mode button needs aria-label describing the action: 'Edit project name, current value: My Project'" },
|
|
235
|
-
{ requirement: "Mode Change Announcement", level: "A", notes: "When switching to edit mode, screen readers must announce the mode change — use aria-live or focus management" },
|
|
236
|
-
{ requirement: "Keyboard Enter to Edit", level: "A", notes: "Enter key on the read-mode element must switch to edit mode and focus the input" },
|
|
237
|
-
{ requirement: "Keyboard Confirm/Cancel", level: "A", notes: "Enter confirms the edit; Escape cancels and reverts; both return to read mode" },
|
|
238
|
-
{ requirement: "Input Label", level: "A", notes: "The edit-mode input must have a label (via aria-label or aria-labelledby) matching the field context" },
|
|
239
|
-
{ requirement: "Error Announcement", level: "A", notes: "Validation errors must be announced via aria-live='assertive'; input must have aria-invalid='true'" },
|
|
240
|
-
{ requirement: "Contrast", level: "AA", notes: "Read-mode text and hover affordances must meet 4.5:1 text contrast; edit-mode input meets standard input contrast requirements" },
|
|
241
|
-
{ requirement: "Focus Management", level: "AA", notes: "Focus must move to the input on edit mode entry and back to the read-mode element on exit" },
|
|
242
|
-
],
|
|
243
|
-
outro: [
|
|
244
|
-
"Test with screen readers that the mode change is announced when entering and exiting edit mode",
|
|
245
|
-
"Verify that Escape always cancels without saving, even during validation errors",
|
|
246
|
-
"Ensure that the read-mode element is in the tab order and activatable via Enter key",
|
|
247
|
-
],
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
qaAcceptanceCriteria: [
|
|
251
|
-
{ check: "Read Mode Render", platform: "All", expectedResult: "Value displays as static text with edit affordance visible on hover" },
|
|
252
|
-
{ check: "Click to Edit", platform: "All", expectedResult: "Clicking read-mode text switches to edit mode with focused input and selected text" },
|
|
253
|
-
{ check: "Enter to Edit", platform: "Web", expectedResult: "Enter key on focused read-mode text switches to edit mode" },
|
|
254
|
-
{ check: "Confirm (Enter)", platform: "Web", expectedResult: "Enter key in input validates and confirms; switches back to read mode with new value" },
|
|
255
|
-
{ check: "Confirm (Button)", platform: "All", expectedResult: "Clicking confirm button validates and saves; switches back to read mode" },
|
|
256
|
-
{ check: "Cancel (Escape)", platform: "Web", expectedResult: "Escape key reverts value and switches back to read mode; focus returns to read-mode element" },
|
|
257
|
-
{ check: "Cancel (Button)", platform: "All", expectedResult: "Clicking cancel button reverts value and switches back to read mode" },
|
|
258
|
-
{ check: "Validation Error", platform: "All", expectedResult: "Invalid input shows error state with message; remains in edit mode; does not save" },
|
|
259
|
-
{ check: "Saving State", platform: "All", expectedResult: "Spinner appears during async save; input is temporarily non-interactive" },
|
|
260
|
-
{ check: "Save Error", platform: "All", expectedResult: "Failed save shows error state; remains in edit mode for user to retry or cancel" },
|
|
261
|
-
{ check: "Disabled State", platform: "All", expectedResult: "Read-mode text is shown without hover affordance; click does not activate edit mode" },
|
|
262
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Read mode announced as button with current value; mode change announced; errors announced" },
|
|
263
|
-
{ check: "Layout Stability", platform: "All", expectedResult: "Switching between read and edit mode does not cause significant layout shift" },
|
|
264
|
-
{ check: "RTL Support", platform: "Web", expectedResult: "Action buttons position correctly; text alignment follows RTL direction" },
|
|
265
|
-
],
|
|
266
|
-
|
|
267
|
-
dos: [
|
|
268
|
-
"Provide a visible hover affordance (underline, pencil icon, background tint) so users discover editability",
|
|
269
|
-
"Select all text automatically when entering edit mode for easy replacement",
|
|
270
|
-
"Support both Enter-to-confirm and Escape-to-cancel keyboard shortcuts",
|
|
271
|
-
"Show a saving indicator for asynchronous save operations to confirm the edit is being processed",
|
|
272
|
-
"Match the edit-mode input typography exactly to the read-mode text to prevent visual jarring",
|
|
273
|
-
"Return focus to the read-mode element after confirming or canceling an edit",
|
|
274
|
-
"Use validation to prevent invalid saves and show clear error messages",
|
|
275
|
-
],
|
|
276
|
-
|
|
277
|
-
donts: [
|
|
278
|
-
"Do not use inline edit for fields that require complex input (date pickers, file uploads, rich text)",
|
|
279
|
-
"Do not silently save on blur without any visual feedback — users need confirmation",
|
|
280
|
-
"Do not make the edit mode input significantly different in size from the read-mode text",
|
|
281
|
-
"Do not omit the cancel mechanism — users must always be able to revert without saving",
|
|
282
|
-
"Do not use inline edit in data-dense tables where accidental edits are likely",
|
|
283
|
-
"Do not use inline edit without any hover or focus affordance — it must be discoverable",
|
|
284
|
-
"Do not allow inline edit on non-text content like images, dates, or complex structures",
|
|
285
|
-
],
|
|
286
|
-
};
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* inline-message.ts — Gold-standard design knowledge for Inline Message components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const inlineMessageKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Contextual helper or validation message | Form field companion | Provides feedback, guidance, or error details inline",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "Info",
|
|
13
|
-
visualChange: "Neutral or blue icon with standard text color; no background fill or subtle blue tint",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "default",
|
|
16
|
-
usage: "Provides supplementary guidance or contextual help for a form field or content area",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "Success",
|
|
20
|
-
visualChange: "Green checkmark icon; text may remain standard or shift to success color; optional green tint background",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "default",
|
|
23
|
-
usage: "Confirms that a field value is valid or an action succeeded",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "Warning",
|
|
27
|
-
visualChange: "Yellow/amber triangle icon; text in warning color or standard; optional amber tint background",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "default",
|
|
30
|
-
usage: "Alerts the user to a potential issue that does not prevent submission but warrants attention",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Error",
|
|
34
|
-
visualChange: "Red circle-exclamation icon; text in error color; optional red tint background; associated field border turns red",
|
|
35
|
-
opacity: "1",
|
|
36
|
-
cursorWeb: "default",
|
|
37
|
-
usage: "Indicates a validation failure — the associated field must be corrected before submission",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Hidden",
|
|
41
|
-
visualChange: "Message is not rendered in the DOM or has display:none; no space is reserved",
|
|
42
|
-
opacity: "0",
|
|
43
|
-
cursorWeb: "default",
|
|
44
|
-
usage: "No message is needed — field is in a neutral state without feedback",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
propertyDescriptions: {
|
|
49
|
-
type: "Message severity variant — 'info', 'success', 'warning', or 'error' — controls icon, color, and ARIA behavior",
|
|
50
|
-
message: "The text content of the inline message — should be concise and actionable",
|
|
51
|
-
icon: "Optional override for the default type-based icon; accepts an icon component or icon name string",
|
|
52
|
-
showIcon: "When true, displays the type-appropriate icon before the message text; defaults to true",
|
|
53
|
-
id: "HTML id attribute — used with aria-describedby on the associated form field for programmatic association",
|
|
54
|
-
role: "ARIA role override — defaults to 'status' for info/success/warning and 'alert' for error messages",
|
|
55
|
-
visible: "Controlled boolean to show/hide the message; when false, message is removed from the DOM",
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
sizeSpecifications: [
|
|
59
|
-
{
|
|
60
|
-
size: "Small",
|
|
61
|
-
height: "16px (line height)",
|
|
62
|
-
paddingLR: "0px",
|
|
63
|
-
fontSize: "12px",
|
|
64
|
-
iconSize: "14px",
|
|
65
|
-
borderRadius: "0px",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
size: "Medium",
|
|
69
|
-
height: "20px (line height)",
|
|
70
|
-
paddingLR: "0px",
|
|
71
|
-
fontSize: "14px",
|
|
72
|
-
iconSize: "16px",
|
|
73
|
-
borderRadius: "0px",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
size: "With Background",
|
|
77
|
-
height: "auto (padding based)",
|
|
78
|
-
paddingLR: "12px",
|
|
79
|
-
fontSize: "12px",
|
|
80
|
-
iconSize: "16px",
|
|
81
|
-
borderRadius: "4px",
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
designTokenBindings: [
|
|
86
|
-
{
|
|
87
|
-
property: "Info Icon",
|
|
88
|
-
tokenName: "$inline-message-info-icon",
|
|
89
|
-
role: "Icon color for info-type messages",
|
|
90
|
-
fallback: "#2563EB",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
property: "Info Text",
|
|
94
|
-
tokenName: "$inline-message-info-text",
|
|
95
|
-
role: "Text color for info-type messages (often same as standard text)",
|
|
96
|
-
fallback: "#667085",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
property: "Success Icon",
|
|
100
|
-
tokenName: "$inline-message-success-icon",
|
|
101
|
-
role: "Icon color for success-type messages",
|
|
102
|
-
fallback: "#12B76A",
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
property: "Success Text",
|
|
106
|
-
tokenName: "$inline-message-success-text",
|
|
107
|
-
role: "Text color for success-type messages",
|
|
108
|
-
fallback: "#027A48",
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
property: "Warning Icon",
|
|
112
|
-
tokenName: "$inline-message-warning-icon",
|
|
113
|
-
role: "Icon color for warning-type messages",
|
|
114
|
-
fallback: "#F79009",
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
property: "Warning Text",
|
|
118
|
-
tokenName: "$inline-message-warning-text",
|
|
119
|
-
role: "Text color for warning-type messages",
|
|
120
|
-
fallback: "#B54708",
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
property: "Error Icon",
|
|
124
|
-
tokenName: "$inline-message-error-icon",
|
|
125
|
-
role: "Icon color for error-type messages",
|
|
126
|
-
fallback: "#F04438",
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
property: "Error Text",
|
|
130
|
-
tokenName: "$inline-message-error-text",
|
|
131
|
-
role: "Text color for error-type messages",
|
|
132
|
-
fallback: "#D92D20",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
property: "Background (Info)",
|
|
136
|
-
tokenName: "$inline-message-info-bg",
|
|
137
|
-
role: "Optional background tint for info messages with background variant",
|
|
138
|
-
fallback: "#EFF8FF",
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
property: "Background (Error)",
|
|
142
|
-
tokenName: "$inline-message-error-bg",
|
|
143
|
-
role: "Optional background tint for error messages with background variant",
|
|
144
|
-
fallback: "#FEF3F2",
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
property: "Font Family",
|
|
148
|
-
tokenName: "$font-family-sans",
|
|
149
|
-
role: "Typeface for message text",
|
|
150
|
-
fallback: "Inter, system-ui, sans-serif",
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
|
|
154
|
-
structureRules: [
|
|
155
|
-
"Container uses horizontal Auto Layout: icon (optional) → message text, vertically centered",
|
|
156
|
-
"Spacing between icon and text is $spacing-xs (4px default)",
|
|
157
|
-
"Message is positioned directly below the associated form field with $spacing-xs vertical gap",
|
|
158
|
-
"Message text wraps naturally — no truncation; multi-line messages are acceptable",
|
|
159
|
-
"When showIcon is false, only the text is rendered; icon space is not reserved",
|
|
160
|
-
"Background variant adds horizontal padding and a subtle rounded background fill",
|
|
161
|
-
"Message container width matches the associated form field width — no wider, no narrower",
|
|
162
|
-
"Multiple messages for the same field stack vertically with $spacing-2xs (2px) gap",
|
|
163
|
-
"Error messages should appear immediately below the field, above any helper text",
|
|
164
|
-
],
|
|
165
|
-
|
|
166
|
-
typeHierarchyRules: [
|
|
167
|
-
"Message text uses Regular weight (400) — never bold to avoid competing with field labels",
|
|
168
|
-
"Font size is typically one step smaller than the field label (12px when label is 14px)",
|
|
169
|
-
"Text uses sentence case — 'Password must be at least 8 characters', not title case",
|
|
170
|
-
"Error messages start with the issue, not 'Error:' — say 'Must be at least 8 characters' not 'Error: Too short'",
|
|
171
|
-
"Line height is 1.4-1.5 for comfortable multi-line readability",
|
|
172
|
-
],
|
|
173
|
-
|
|
174
|
-
interactionRules: [
|
|
175
|
-
{ event: "Field Validation", trigger: "User blurs a form field or submits the form", action: "Inline message appears or updates based on validation result; type changes to match severity" },
|
|
176
|
-
{ event: "Field Change", trigger: "User modifies the associated field value", action: "Error message may clear or update in real-time if live validation is enabled" },
|
|
177
|
-
{ event: "Form Submit", trigger: "Form submission attempt with validation errors", action: "All error messages appear simultaneously; first error field receives focus" },
|
|
178
|
-
{ event: "Appear", trigger: "Message becomes visible (e.g. validation triggers)", action: "Message fades in or slides down; screen reader announces via aria-live" },
|
|
179
|
-
{ event: "Disappear", trigger: "Validation error is resolved", action: "Message fades out or is removed from DOM; screen reader may announce clearance" },
|
|
180
|
-
{ event: "Link Click", trigger: "User clicks an inline link within the message text", action: "Navigate to help content or perform the suggested action" },
|
|
181
|
-
],
|
|
182
|
-
|
|
183
|
-
contentGuidance: [
|
|
184
|
-
"Keep messages concise — one short sentence is ideal; two sentences maximum",
|
|
185
|
-
"Error messages should tell users what to do, not just what went wrong: 'Enter a valid email address' not 'Invalid email'",
|
|
186
|
-
"Warning messages should explain the consequence: 'This action cannot be undone'",
|
|
187
|
-
"Success messages should confirm the specific action: 'Username is available'",
|
|
188
|
-
"Info messages should provide helpful context: 'Password must contain at least one number'",
|
|
189
|
-
"Avoid technical jargon — use language that all users can understand",
|
|
190
|
-
"Do not include the field label in the message — context is clear from the field association",
|
|
191
|
-
"Use specific guidance over generic messages: 'Must be between 8-64 characters' not 'Invalid length'",
|
|
192
|
-
],
|
|
193
|
-
|
|
194
|
-
responsiveBehaviour: [
|
|
195
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Messages span the full field width; font size remains 12px; icon may be hidden to save space" },
|
|
196
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Standard inline layout below the field; messages wrap at field width" },
|
|
197
|
-
{ breakpoint: "Desktop (1024-1439px)", behavior: "Messages display below the field; width matches field width" },
|
|
198
|
-
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "No change from desktop; messages remain tied to their associated field width" },
|
|
199
|
-
],
|
|
200
|
-
|
|
201
|
-
accessibilitySpec: {
|
|
202
|
-
intro:
|
|
203
|
-
"Inline messages provide critical feedback for form validation and contextual help. Proper ARIA associations and live region announcements ensure screen reader users receive timely and accurate feedback.",
|
|
204
|
-
requirements: [
|
|
205
|
-
{ requirement: "Programmatic Association", level: "A", notes: "Message element id must be referenced by aria-describedby on the associated form field" },
|
|
206
|
-
{ requirement: "Error Role", level: "A", notes: "Error messages should use role='alert' or aria-live='assertive' to immediately announce to screen readers" },
|
|
207
|
-
{ requirement: "Status Role", level: "A", notes: "Info, success, and warning messages should use role='status' or aria-live='polite' for non-intrusive announcement" },
|
|
208
|
-
{ requirement: "Error State on Field", level: "A", notes: "When an error message is shown, the associated field must have aria-invalid='true'" },
|
|
209
|
-
{ requirement: "Contrast", level: "AA", notes: "Message text must meet 4.5:1 contrast ratio against its background; icon color must meet 3:1 non-text contrast" },
|
|
210
|
-
{ requirement: "Not Color Alone", level: "A", notes: "Do not rely solely on color to convey message type — include an icon and descriptive text" },
|
|
211
|
-
{ requirement: "Visible on Focus", level: "AA", notes: "When a field receives focus, its associated inline message should remain visible and not be obscured" },
|
|
212
|
-
],
|
|
213
|
-
outro: [
|
|
214
|
-
"Test that screen readers announce error messages when they appear and when the associated field is focused",
|
|
215
|
-
"Verify that clearing an error (e.g. correcting the input) removes aria-invalid from the field",
|
|
216
|
-
"Ensure multiple messages for the same field are all referenced in aria-describedby (space-separated ids)",
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
qaAcceptanceCriteria: [
|
|
221
|
-
{ check: "Info Type", platform: "All", expectedResult: "Blue icon with neutral text; optional background tint renders correctly" },
|
|
222
|
-
{ check: "Success Type", platform: "All", expectedResult: "Green checkmark icon with success text color" },
|
|
223
|
-
{ check: "Warning Type", platform: "All", expectedResult: "Amber triangle icon with warning text color" },
|
|
224
|
-
{ check: "Error Type", platform: "All", expectedResult: "Red exclamation icon with error text color; associated field border turns red" },
|
|
225
|
-
{ check: "Field Association", platform: "Web", expectedResult: "Message id matches aria-describedby on the form field" },
|
|
226
|
-
{ check: "aria-invalid", platform: "Web", expectedResult: "Associated field has aria-invalid='true' when error message is shown" },
|
|
227
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Error messages announced immediately; info/success/warning announced politely" },
|
|
228
|
-
{ check: "Appear Animation", platform: "Web", expectedResult: "Message fades in smoothly without layout jump" },
|
|
229
|
-
{ check: "Multi-line", platform: "All", expectedResult: "Long messages wrap correctly within field width; no horizontal overflow" },
|
|
230
|
-
{ check: "Icon Toggle", platform: "All", expectedResult: "Setting showIcon to false hides the icon; text shifts left to fill space" },
|
|
231
|
-
{ check: "Contrast", platform: "All", expectedResult: "All type variants pass 4.5:1 text contrast requirements" },
|
|
232
|
-
{ check: "Responsive Width", platform: "Mobile", expectedResult: "Message width matches field width on all viewport sizes" },
|
|
233
|
-
{ check: "Multiple Messages", platform: "All", expectedResult: "Multiple messages stack vertically with consistent spacing" },
|
|
234
|
-
],
|
|
235
|
-
|
|
236
|
-
dos: [
|
|
237
|
-
"Always associate inline messages with their form field using aria-describedby",
|
|
238
|
-
"Use the correct message type for the severity: error for validation failures, warning for cautions, info for help",
|
|
239
|
-
"Make error messages actionable — tell users how to fix the problem",
|
|
240
|
-
"Show messages immediately after validation, not just on form submission",
|
|
241
|
-
"Include icons to reinforce the message type — do not rely on color alone",
|
|
242
|
-
"Keep messages under two sentences for quick scanning during form completion",
|
|
243
|
-
"Clear error messages as soon as the user corrects the field value",
|
|
244
|
-
],
|
|
245
|
-
|
|
246
|
-
donts: [
|
|
247
|
-
"Do not use inline messages for system-level alerts — use a toast or alert banner instead",
|
|
248
|
-
"Do not use all caps or bold text in inline messages — they should be subtle, not alarming",
|
|
249
|
-
"Do not prefix messages with the type name ('Error:', 'Warning:') — the icon communicates severity",
|
|
250
|
-
"Do not show generic messages like 'This field is required' — be specific to the field content",
|
|
251
|
-
"Do not make messages wider than their associated form field",
|
|
252
|
-
"Do not use inline messages for instructional content that should be in a label or helper text",
|
|
253
|
-
"Do not remove error messages without the user taking corrective action",
|
|
254
|
-
],
|
|
255
|
-
};
|