@sarjallab09/figma-intelligence 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -36
- package/dist/bin/cli.js +2 -0
- package/dist/design-bridge/bridge.js +2 -0
- package/dist/figma-bridge-plugin/bridge-relay.js +2 -0
- package/dist/figma-bridge-plugin/code.js +1 -0
- package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package-lock.json +0 -3
- package/dist/figma-bridge-plugin/ui.html +4970 -0
- package/dist/figma-intelligence-layer/dist/index.js +2 -0
- package/dist/scripts/clean-existing-chunks.js +2 -0
- package/dist/scripts/connect-ai-tool.js +2 -0
- package/dist/scripts/convert-hub-pdfs.js +2 -0
- package/dist/scripts/figma-mcp-status.js +2 -0
- package/dist/scripts/register-codex-mcp.js +2 -0
- package/dist/scripts/test-copilot-chat.js +2 -0
- package/package.json +11 -8
- package/bin/cli.js +0 -859
- package/design-bridge/bridge.js +0 -196
- package/design-bridge/lib/assets.js +0 -367
- package/design-bridge/lib/prompt.js +0 -85
- package/design-bridge/lib/server.js +0 -66
- package/design-bridge/lib/stitch.js +0 -37
- package/design-bridge/lib/tokens.js +0 -82
- package/design-bridge/package-lock.json +0 -579
- package/figma-bridge-plugin/README.md +0 -97
- package/figma-bridge-plugin/anthropic-chat-runner.js +0 -192
- package/figma-bridge-plugin/bridge-relay.js +0 -2505
- package/figma-bridge-plugin/chat-runner.js +0 -485
- package/figma-bridge-plugin/code.js +0 -1534
- package/figma-bridge-plugin/codex-runner.js +0 -505
- package/figma-bridge-plugin/component-schemas.js +0 -110
- package/figma-bridge-plugin/content-context.js +0 -869
- package/figma-bridge-plugin/create-button.js +0 -216
- package/figma-bridge-plugin/gemini-cli-runner.js +0 -291
- package/figma-bridge-plugin/gemini-runner.js +0 -187
- package/figma-bridge-plugin/html-to-figma.js +0 -927
- package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +0 -159
- package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +0 -162
- package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +0 -148
- package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +0 -314
- package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +0 -175
- package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +0 -180
- package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +0 -165
- package/figma-bridge-plugin/perplexity-runner.js +0 -188
- package/figma-bridge-plugin/references/SKILL.md +0 -178
- package/figma-bridge-plugin/references/anatomy-spec.md +0 -159
- package/figma-bridge-plugin/references/api-spec.md +0 -162
- package/figma-bridge-plugin/references/color-spec.md +0 -148
- package/figma-bridge-plugin/references/full-spec-template.md +0 -314
- package/figma-bridge-plugin/references/property-spec.md +0 -175
- package/figma-bridge-plugin/references/screen-reader-spec.md +0 -180
- package/figma-bridge-plugin/references/structure-spec.md +0 -165
- package/figma-bridge-plugin/shared-prompt-config.js +0 -645
- package/figma-bridge-plugin/spec-helpers/build-table.js +0 -269
- package/figma-bridge-plugin/spec-helpers/classify-elements.js +0 -189
- package/figma-bridge-plugin/spec-helpers/index.js +0 -35
- package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +0 -49
- package/figma-bridge-plugin/spec-helpers/position-markers.js +0 -158
- package/figma-bridge-plugin/stitch-auth.js +0 -322
- package/figma-bridge-plugin/stitch-runner.js +0 -1427
- package/figma-bridge-plugin/token-resolver.js +0 -107
- package/figma-bridge-plugin/ui.html +0 -4542
- package/figma-intelligence-layer/.env.example +0 -39
- package/figma-intelligence-layer/docs/local-image-generation.md +0 -60
- package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +0 -101
- package/figma-intelligence-layer/jest.config.js +0 -14
- package/figma-intelligence-layer/mcp-config.json +0 -19
- package/figma-intelligence-layer/package-lock.json +0 -5892
- package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +0 -67
- package/figma-intelligence-layer/scripts/start-comfyui.sh +0 -33
- package/figma-intelligence-layer/src/index.ts +0 -2233
- package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +0 -404
- package/figma-intelligence-layer/src/shared/cache.ts +0 -187
- package/figma-intelligence-layer/src/shared/color-operations.ts +0 -533
- package/figma-intelligence-layer/src/shared/color-utils.ts +0 -138
- package/figma-intelligence-layer/src/shared/component-script-builder.ts +0 -413
- package/figma-intelligence-layer/src/shared/component-templates.ts +0 -2767
- package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +0 -694
- package/figma-intelligence-layer/src/shared/decision-log.ts +0 -128
- package/figma-intelligence-layer/src/shared/design-system-context.ts +0 -568
- package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +0 -131
- package/figma-intelligence-layer/src/shared/design-system-matcher.ts +0 -184
- package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +0 -196
- package/figma-intelligence-layer/src/shared/design-system-tokens.ts +0 -295
- package/figma-intelligence-layer/src/shared/dtcg-validator.ts +0 -530
- package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +0 -671
- package/figma-intelligence-layer/src/shared/figma-bridge.ts +0 -1418
- package/figma-intelligence-layer/src/shared/font-config.ts +0 -126
- package/figma-intelligence-layer/src/shared/icon-catalog.ts +0 -360
- package/figma-intelligence-layer/src/shared/icon-fetch.ts +0 -80
- package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +0 -162
- package/figma-intelligence-layer/src/shared/response-compression.ts +0 -440
- package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +0 -324
- package/figma-intelligence-layer/src/shared/token-binder.ts +0 -505
- package/figma-intelligence-layer/src/shared/token-math.ts +0 -427
- package/figma-intelligence-layer/src/shared/token-naming.ts +0 -468
- package/figma-intelligence-layer/src/shared/token-utils.ts +0 -420
- package/figma-intelligence-layer/src/shared/types.ts +0 -346
- package/figma-intelligence-layer/src/shared/typography-presets.ts +0 -94
- package/figma-intelligence-layer/src/shared/unsplash.ts +0 -165
- package/figma-intelligence-layer/src/shared/vision-client.ts +0 -607
- package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +0 -334
- package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +0 -446
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +0 -782
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +0 -496
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +0 -230
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +0 -66
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +0 -810
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +0 -1191
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +0 -1346
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +0 -148
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +0 -499
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +0 -910
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +0 -989
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +0 -1160
- package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +0 -424
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +0 -38
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +0 -111
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +0 -114
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +0 -103
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +0 -1060
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +0 -18
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +0 -39
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +0 -58
- package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +0 -298
- package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +0 -197
- package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +0 -494
- package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +0 -356
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +0 -123
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +0 -663
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +0 -56
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +0 -614
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +0 -113
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +0 -178
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +0 -470
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +0 -429
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +0 -226
- package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +0 -535
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +0 -660
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +0 -209
- package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +0 -540
- package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +0 -391
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +0 -2019
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +0 -131
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +0 -381
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +0 -565
- package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +0 -764
- package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +0 -535
- package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +0 -84
- package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +0 -401
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +0 -68
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +0 -78
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +0 -93
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +0 -596
- package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +0 -462
- package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +0 -1470
- package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +0 -829
- package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +0 -702
- package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +0 -483
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +0 -501
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +0 -106
- package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +0 -676
- package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +0 -560
- package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +0 -1043
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +0 -620
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +0 -331
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +0 -77
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +0 -54
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +0 -287
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +0 -43
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +0 -221
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +0 -166
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +0 -234
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +0 -249
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +0 -231
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +0 -293
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +0 -240
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +0 -243
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +0 -307
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +0 -143
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +0 -227
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +0 -233
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +0 -282
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +0 -276
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +0 -223
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +0 -289
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +0 -261
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +0 -290
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +0 -265
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +0 -238
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +0 -128
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +0 -286
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +0 -255
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +0 -330
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +0 -247
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +0 -250
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +0 -247
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +0 -144
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +0 -264
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +0 -251
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +0 -261
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +0 -248
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +0 -251
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +0 -142
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +0 -282
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +0 -250
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +0 -258
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +0 -265
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +0 -319
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +0 -256
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +0 -239
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +0 -252
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +0 -270
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +0 -244
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +0 -143
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +0 -243
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +0 -259
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +0 -293
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +0 -144
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +0 -289
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +0 -267
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +0 -232
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +0 -257
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +0 -319
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +0 -121
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +0 -430
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +0 -312
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +0 -129
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +0 -78
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +0 -2333
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +0 -100
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +0 -32
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +0 -59
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +0 -18
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +0 -53
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +0 -91
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +0 -71
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +0 -110
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +0 -19
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +0 -67
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +0 -58
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +0 -79
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +0 -50
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +0 -33
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +0 -55
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +0 -73
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +0 -81
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +0 -409
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +0 -198
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +0 -701
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +0 -88
- package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +0 -135
- package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +0 -491
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +0 -416
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +0 -722
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +0 -449
- package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +0 -393
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +0 -406
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +0 -292
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +0 -24
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +0 -172
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +0 -409
- package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +0 -594
- package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +0 -710
- package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +0 -458
- package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +0 -134
- package/figma-intelligence-layer/tests/apg-doc.test.ts +0 -101
- package/figma-intelligence-layer/tests/design-system-context.test.ts +0 -152
- package/figma-intelligence-layer/tests/design-system-matcher.test.ts +0 -144
- package/figma-intelligence-layer/tests/figma-bridge.test.ts +0 -83
- package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +0 -56
- package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +0 -69
- package/figma-intelligence-layer/tests/smoke.test.ts +0 -174
- package/figma-intelligence-layer/tests/spec-generator.test.ts +0 -127
- package/figma-intelligence-layer/tests/token-migrate.test.ts +0 -21
- package/figma-intelligence-layer/tests/token-naming.test.ts +0 -30
- package/figma-intelligence-layer/tsconfig.json +0 -19
- package/scripts/clean-existing-chunks.js +0 -179
- package/scripts/connect-ai-tool.js +0 -490
- package/scripts/convert-hub-pdfs.js +0 -425
- package/scripts/figma-mcp-status.js +0 -349
- package/scripts/register-codex-mcp.js +0 -96
- /package/{design-bridge → dist/design-bridge}/.env.example +0 -0
- /package/{design-bridge → dist/design-bridge}/package.json +0 -0
- /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/manifest.json +0 -0
- /package/{figma-bridge-plugin → dist/figma-bridge-plugin}/package.json +0 -0
- /package/{figma-intelligence-layer → dist/figma-intelligence-layer}/package.json +0 -0
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
2
|
-
|
|
3
|
-
export const tabsKnowledge: ComponentKnowledge = {
|
|
4
|
-
description:
|
|
5
|
-
"Content organizer | Sectioned view switcher | Tabbed navigation pattern",
|
|
6
|
-
|
|
7
|
-
stateSpecifications: [
|
|
8
|
-
{ state: "Default-Unselected", visualChange: "Label in secondary color, no indicator bar", opacity: "1", cursorWeb: "pointer", usage: "Tab is available but not currently active" },
|
|
9
|
-
{ state: "Hover-Unselected", visualChange: "Background tint appears behind label", opacity: "1", cursorWeb: "pointer", usage: "Pointer hovering over an inactive tab" },
|
|
10
|
-
{ state: "Focus-Unselected", visualChange: "Focus ring around tab, no indicator", opacity: "1", cursorWeb: "default", usage: "Keyboard focus on an inactive tab" },
|
|
11
|
-
{ state: "Selected", visualChange: "Bold label, indicator bar on bottom edge, primary text color", opacity: "1", cursorWeb: "default", usage: "Currently active tab showing its panel content" },
|
|
12
|
-
{ state: "Selected-Focus", visualChange: "Focus ring around active tab with indicator bar", opacity: "1", cursorWeb: "default", usage: "Keyboard focus on the active tab" },
|
|
13
|
-
{ state: "Disabled", visualChange: "Label dimmed, no hover/focus effects", opacity: "0.4", cursorWeb: "not-allowed", usage: "Tab content is unavailable or locked" },
|
|
14
|
-
{ state: "Overflow", visualChange: "Scroll arrows or 'more' button visible at tab bar edges", opacity: "1", cursorWeb: "pointer", usage: "Too many tabs to fit in available width" },
|
|
15
|
-
],
|
|
16
|
-
|
|
17
|
-
propertyDescriptions: {
|
|
18
|
-
selectedIndex: "Zero-based index of the currently active tab",
|
|
19
|
-
variant: "Visual style — line (underline indicator), contained (filled background), or vertical (sidebar tabs)",
|
|
20
|
-
size: "Height variant affecting padding and font size of tab labels",
|
|
21
|
-
label: "Visible text for each individual tab trigger",
|
|
22
|
-
icon: "Optional leading icon displayed before the tab label",
|
|
23
|
-
badge: "Notification badge (dot or count) on a tab for unread/new content",
|
|
24
|
-
disabled: "Prevents a specific tab from being selected",
|
|
25
|
-
dismissible: "Shows a close icon on the tab allowing removal from the tab bar",
|
|
26
|
-
scrollable: "Enables horizontal scrolling when tabs overflow container width",
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
sizeSpecifications: [
|
|
30
|
-
{ size: "sm", height: "32px", paddingLR: "12px", fontSize: "12px", iconSize: "16px", borderRadius: "0px" },
|
|
31
|
-
{ size: "md", height: "40px", paddingLR: "16px", fontSize: "14px", iconSize: "16px", borderRadius: "0px" },
|
|
32
|
-
{ size: "lg", height: "48px", paddingLR: "16px", fontSize: "14px", iconSize: "20px", borderRadius: "0px" },
|
|
33
|
-
{ size: "xl", height: "56px", paddingLR: "20px", fontSize: "16px", iconSize: "20px", borderRadius: "0px" },
|
|
34
|
-
{ size: "contained-md", height: "40px", paddingLR: "16px", fontSize: "14px", iconSize: "16px", borderRadius: "4px 4px 0 0" },
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
designTokenBindings: [
|
|
38
|
-
{ property: "indicator-bar", tokenName: "color/border/interactive", role: "Bottom border of the selected tab", fallback: "#0F62FE" },
|
|
39
|
-
{ property: "label-selected", tokenName: "color/text/primary", role: "Text color of the active tab", fallback: "#161616" },
|
|
40
|
-
{ property: "label-unselected", tokenName: "color/text/secondary", role: "Text color of inactive tabs", fallback: "#525252" },
|
|
41
|
-
{ property: "hover-bg", tokenName: "color/layer/hover/01", role: "Background tint on hover for unselected tab", fallback: "rgba(141,141,141,0.12)" },
|
|
42
|
-
{ property: "divider", tokenName: "color/border/subtle/01", role: "Bottom border of the entire tab bar", fallback: "#E0E0E0" },
|
|
43
|
-
{ property: "focus-ring", tokenName: "color/focus", role: "Keyboard focus outline color", fallback: "#0F62FE" },
|
|
44
|
-
{ property: "badge-bg", tokenName: "color/support/error", role: "Notification badge background", fallback: "#DA1E28" },
|
|
45
|
-
],
|
|
46
|
-
|
|
47
|
-
structureRules: [
|
|
48
|
-
"Tab bar uses role='tablist' with individual tabs using role='tab'",
|
|
49
|
-
"Each tab must have a corresponding panel with role='tabpanel' linked via aria-controls/aria-labelledby",
|
|
50
|
-
"The indicator bar is 2–3px tall and positioned at the bottom edge of the selected tab",
|
|
51
|
-
"Indicator animates horizontally to slide from the previous tab to the newly selected tab",
|
|
52
|
-
"Contained variant wraps each tab in a filled rectangle; selected tab shares background with the panel",
|
|
53
|
-
"Overflow tabs are accessible via scroll buttons or a dropdown 'more' menu at the end",
|
|
54
|
-
"Tab panels must be direct siblings or linked via IDREF; only the active panel is visible",
|
|
55
|
-
],
|
|
56
|
-
|
|
57
|
-
typeHierarchyRules: [
|
|
58
|
-
"Tab labels use body-compact-01 (14px) for md/lg and label-01 (12px) for sm",
|
|
59
|
-
"Selected tab label may use semibold weight to reinforce active state",
|
|
60
|
-
"Badge count uses caption-01 (12px) with inverse text on the badge background",
|
|
61
|
-
"Tab labels should be single-line; truncate with ellipsis at max-width",
|
|
62
|
-
"Vertical tab labels use body-01 (14px/20px) with left alignment",
|
|
63
|
-
"Label width is content-driven with min-width of 64px and max-width of 200px",
|
|
64
|
-
"If icons are used, all tabs in the bar must have icons for visual consistency",
|
|
65
|
-
],
|
|
66
|
-
|
|
67
|
-
interactionRules: [
|
|
68
|
-
{ event: "click", trigger: "User clicks an unselected tab", action: "Activate the tab, show its panel, update indicator position" },
|
|
69
|
-
{ event: "keydown:ArrowRight", trigger: "Focus is on a tab in horizontal tablist", action: "Move focus to the next tab; wrap to first if at end" },
|
|
70
|
-
{ event: "keydown:ArrowLeft", trigger: "Focus is on a tab in horizontal tablist", action: "Move focus to the previous tab; wrap to last if at start" },
|
|
71
|
-
{ event: "keydown:Home", trigger: "Focus is on any tab", action: "Move focus to the first tab in the list" },
|
|
72
|
-
{ event: "keydown:End", trigger: "Focus is on any tab", action: "Move focus to the last tab in the list" },
|
|
73
|
-
{ event: "keydown:Enter/Space", trigger: "Focus is on an unselected tab (manual activation mode)", action: "Activate the focused tab and reveal its panel" },
|
|
74
|
-
{ event: "keydown:Delete", trigger: "Focus is on a dismissible tab", action: "Remove the tab and move focus to the nearest remaining tab" },
|
|
75
|
-
],
|
|
76
|
-
|
|
77
|
-
contentGuidance: [
|
|
78
|
-
"Tab labels should be 1–2 words; think nouns like 'Overview', 'Settings', 'Activity'",
|
|
79
|
-
"Do not use verbs for tab labels — tabs are not actions, they are content sections",
|
|
80
|
-
"Keep the number of tabs between 2 and 8; consider a different pattern for more sections",
|
|
81
|
-
"Order tabs by user priority — most-used section first",
|
|
82
|
-
"Avoid mixing tabs with icons and tabs without icons in the same bar",
|
|
83
|
-
"Badge counts should use compact number formatting (e.g. '99+' not '143')",
|
|
84
|
-
"If tabs control unrelated content, consider using top-level navigation instead",
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
-
responsiveBehaviour: [
|
|
88
|
-
{ breakpoint: "≥ 1056px (lg)", behavior: "All tabs visible inline; indicator animates between tabs" },
|
|
89
|
-
{ breakpoint: "672–1055px (md)", behavior: "Tabs that overflow become scrollable with arrow buttons" },
|
|
90
|
-
{ breakpoint: "< 672px (sm)", behavior: "Consider collapsing to a dropdown select or accordion pattern" },
|
|
91
|
-
{ breakpoint: "Touch devices", behavior: "Support horizontal swipe gesture to switch between tab panels" },
|
|
92
|
-
{ breakpoint: "Vertical variant", behavior: "Sidebar tabs remain visible; panels fill remaining width" },
|
|
93
|
-
],
|
|
94
|
-
|
|
95
|
-
accessibilitySpec: {
|
|
96
|
-
intro:
|
|
97
|
-
"Tabs must implement the WAI-ARIA tabs pattern with proper roles, relationships, and keyboard support. Users must be able to discover and switch between tab panels using keyboard alone.",
|
|
98
|
-
requirements: [
|
|
99
|
-
{ requirement: "Container must have role='tablist'", level: "A", notes: "Group all tab triggers inside the tablist" },
|
|
100
|
-
{ requirement: "Each trigger must have role='tab' with aria-selected indicating active state", level: "A", notes: "aria-selected='true' on active tab, 'false' on others" },
|
|
101
|
-
{ requirement: "Each panel must have role='tabpanel' and be labelled by its tab via aria-labelledby", level: "A", notes: "Tab uses aria-controls pointing to panel id" },
|
|
102
|
-
{ requirement: "Only the selected tab should have tabindex='0'; others get tabindex='-1'", level: "A", notes: "Roving tabindex enables arrow key navigation" },
|
|
103
|
-
{ requirement: "Arrow keys must move focus between tabs (left/right for horizontal, up/down for vertical)", level: "A", notes: "Focus wraps from last to first and vice versa" },
|
|
104
|
-
{ requirement: "Disabled tabs must have aria-disabled='true' and be skipped by arrow key navigation", level: "A", notes: "Alternatively, disabled tabs can receive focus but not activate" },
|
|
105
|
-
{ requirement: "Panels must be discoverable — hidden panels should use hidden attribute, not display:none with no aria", level: "AA", notes: "Ensures assistive tech can identify available panels" },
|
|
106
|
-
],
|
|
107
|
-
outro: [
|
|
108
|
-
"Test that screen readers announce 'tab, 1 of 5, selected' pattern on focus",
|
|
109
|
-
"Verify arrow keys skip disabled tabs when navigating",
|
|
110
|
-
"Confirm Tab key moves focus from the tablist into the active panel content",
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
qaAcceptanceCriteria: [
|
|
115
|
-
{ check: "Clicking a tab shows its panel and hides others", platform: "All", expectedResult: "Only active panel is visible; indicator moves to clicked tab" },
|
|
116
|
-
{ check: "Arrow keys navigate between tabs", platform: "Web", expectedResult: "Focus moves; wrap at boundaries; disabled tabs skipped" },
|
|
117
|
-
{ check: "Tab key moves focus into the panel", platform: "Web", expectedResult: "Focus leaves tablist and enters active panel's first focusable element" },
|
|
118
|
-
{ check: "Indicator animates between tabs", platform: "Web", expectedResult: "Smooth 200ms slide transition for the indicator bar" },
|
|
119
|
-
{ check: "Overflow tabs are accessible", platform: "Web", expectedResult: "Scroll buttons appear; all tabs reachable via keyboard" },
|
|
120
|
-
{ check: "Dismissible tab can be removed", platform: "Web", expectedResult: "Tab removed, focus moves to nearest sibling, panel removed" },
|
|
121
|
-
{ check: "Badge renders correctly on tab", platform: "All", expectedResult: "Badge positioned top-right of label, count visible" },
|
|
122
|
-
],
|
|
123
|
-
|
|
124
|
-
dos: [
|
|
125
|
-
"Use semantic tablist/tab/tabpanel roles for all tab implementations",
|
|
126
|
-
"Animate the indicator bar for clear visual feedback during tab changes",
|
|
127
|
-
"Provide a scroll mechanism when tabs overflow the container",
|
|
128
|
-
"Keep tab labels short and descriptive — one or two words",
|
|
129
|
-
"Set aria-orientation='vertical' on vertical tablists",
|
|
130
|
-
"Load tab panel content eagerly if SEO matters; lazy-load for performance",
|
|
131
|
-
"Use the contained variant when tabs sit above a card-like content area",
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
donts: [
|
|
135
|
-
"Don't use tabs for sequential steps — use a stepper/wizard pattern instead",
|
|
136
|
-
"Don't nest tabs within tabs — it creates confusing navigation hierarchy",
|
|
137
|
-
"Don't change the page URL when switching tabs unless tabs represent distinct routes",
|
|
138
|
-
"Don't mix tab variants (line and contained) in the same interface",
|
|
139
|
-
"Don't auto-rotate through tabs like a carousel — tabs are user-driven",
|
|
140
|
-
"Don't hide critical content in later tabs — users may never discover it",
|
|
141
|
-
"Don't make the tab panel height change dramatically between tabs without transition",
|
|
142
|
-
],
|
|
143
|
-
};
|
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tag.ts — Gold-standard design knowledge for Tag components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const tagKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Categorization label | Conveys metadata or status | Distinct from Chip (selection/input)",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "Default",
|
|
13
|
-
visualChange: "Solid or tinted background fill with label text in contrasting color; subtle border",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "default",
|
|
16
|
-
usage: "Resting state — tag is visible and communicates its category or status",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "Hover",
|
|
20
|
-
visualChange: "Background darkens slightly; if removable, the dismiss icon gains emphasis",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "default",
|
|
23
|
-
usage: "Mouse cursor enters the tag's area (interactive only if removable or clickable)",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "Active",
|
|
27
|
-
visualChange: "Background shifts an additional step darker; slight scale-down (0.98) on press",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "pointer",
|
|
30
|
-
usage: "Tag is being pressed — applies only to removable or interactive tag variants",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Focus",
|
|
34
|
-
visualChange: "2px focus ring offset by 2px from the tag edge, using $focus-ring token",
|
|
35
|
-
opacity: "1",
|
|
36
|
-
cursorWeb: "default",
|
|
37
|
-
usage: "Tag or its dismiss button receives keyboard focus via Tab key",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Disabled",
|
|
41
|
-
visualChange: "Background and text switch to muted/disabled tokens; dismiss icon hidden",
|
|
42
|
-
opacity: "0.4",
|
|
43
|
-
cursorWeb: "not-allowed",
|
|
44
|
-
usage: "Tag is present but non-interactive — removal or click actions are unavailable",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
propertyDescriptions: {
|
|
49
|
-
label: "Visible text rendered inside the tag; should be a concise noun or short phrase (e.g. 'Beta', 'High Priority')",
|
|
50
|
-
type: "Semantic color variant — Neutral, Info, Success, Warning, or Error — controls background and border treatment",
|
|
51
|
-
size: "Dimensional preset controlling height, padding, font-size, and icon-size (Small, Medium, Large)",
|
|
52
|
-
removable: "When true, a dismiss/close icon is appended to the tag allowing the user to remove it",
|
|
53
|
-
icon: "Optional icon slot rendered before the label text; expects an icon component instance or icon name string",
|
|
54
|
-
disabled: "When true the tag is non-interactive: muted visuals, pointer-events none, aria-disabled='true'",
|
|
55
|
-
onRemove: "Callback fired when the dismiss button is activated; receives the tag's identifier or label",
|
|
56
|
-
onClick: "Optional callback that makes the entire tag clickable — adds pointer cursor and hover states",
|
|
57
|
-
maxWidth: "Maximum width before the label text truncates with ellipsis; defaults to 200px",
|
|
58
|
-
outlined: "When true, the tag renders with a transparent background and visible border instead of a solid fill",
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
sizeSpecifications: [
|
|
62
|
-
{
|
|
63
|
-
size: "Small",
|
|
64
|
-
height: "20px",
|
|
65
|
-
paddingLR: "6px",
|
|
66
|
-
fontSize: "11px",
|
|
67
|
-
iconSize: "12px",
|
|
68
|
-
borderRadius: "4px",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
size: "Medium",
|
|
72
|
-
height: "24px",
|
|
73
|
-
paddingLR: "8px",
|
|
74
|
-
fontSize: "12px",
|
|
75
|
-
iconSize: "14px",
|
|
76
|
-
borderRadius: "6px",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
size: "Large",
|
|
80
|
-
height: "32px",
|
|
81
|
-
paddingLR: "12px",
|
|
82
|
-
fontSize: "14px",
|
|
83
|
-
iconSize: "16px",
|
|
84
|
-
borderRadius: "8px",
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
|
|
88
|
-
designTokenBindings: [
|
|
89
|
-
{
|
|
90
|
-
property: "Neutral Background",
|
|
91
|
-
tokenName: "$tag-neutral-bg",
|
|
92
|
-
role: "Background fill for the neutral/default tag variant",
|
|
93
|
-
fallback: "#F2F4F7",
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
property: "Info Background",
|
|
97
|
-
tokenName: "$tag-info-bg",
|
|
98
|
-
role: "Background fill for the informational tag variant",
|
|
99
|
-
fallback: "#EFF8FF",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
property: "Success Background",
|
|
103
|
-
tokenName: "$tag-success-bg",
|
|
104
|
-
role: "Background fill for the success/positive tag variant",
|
|
105
|
-
fallback: "#ECFDF3",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
property: "Warning Background",
|
|
109
|
-
tokenName: "$tag-warning-bg",
|
|
110
|
-
role: "Background fill for the warning/caution tag variant",
|
|
111
|
-
fallback: "#FFFAEB",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
property: "Error Background",
|
|
115
|
-
tokenName: "$tag-error-bg",
|
|
116
|
-
role: "Background fill for the error/destructive tag variant",
|
|
117
|
-
fallback: "#FEF3F2",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
property: "Text Color",
|
|
121
|
-
tokenName: "$tag-text",
|
|
122
|
-
role: "Label and icon color — adjusts per semantic type for contrast",
|
|
123
|
-
fallback: "#344054",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
property: "Border",
|
|
127
|
-
tokenName: "$tag-border",
|
|
128
|
-
role: "Subtle border color applied to all tag variants for definition",
|
|
129
|
-
fallback: "#D0D5DD",
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
property: "Focus Ring",
|
|
133
|
-
tokenName: "$focus-ring",
|
|
134
|
-
role: "Keyboard focus indicator ring for interactive tags and dismiss buttons",
|
|
135
|
-
fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
property: "Font Family",
|
|
139
|
-
tokenName: "$font-family-sans",
|
|
140
|
-
role: "Tag label typeface",
|
|
141
|
-
fallback: "Inter, system-ui, sans-serif",
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
|
|
145
|
-
structureRules: [
|
|
146
|
-
"Container uses horizontal Auto Layout with center alignment on both axes",
|
|
147
|
-
"Icon, label, and dismiss button are direct children of the container — no intermediate wrappers",
|
|
148
|
-
"Spacing between icon and label uses the $spacing-xxs token (2px default)",
|
|
149
|
-
"Dismiss button is a separate focusable element within the tag, not a decoration on the label",
|
|
150
|
-
"Tag groups wrap using flex-wrap with $spacing-xs (4px) gap between tags",
|
|
151
|
-
"Minimum width ensures the tag never collapses below the icon + dismiss button width",
|
|
152
|
-
"Outlined variant uses a 1px border with transparent background; border color matches the semantic type",
|
|
153
|
-
],
|
|
154
|
-
|
|
155
|
-
typeHierarchyRules: [
|
|
156
|
-
"Font weight is Medium (500) — provides readable emphasis at small sizes",
|
|
157
|
-
"Text uses sentence case for labels ('High priority', not 'HIGH PRIORITY' or 'High Priority')",
|
|
158
|
-
"No underline on label text — tags are not links",
|
|
159
|
-
"Single-line only; truncate with ellipsis if text exceeds maxWidth",
|
|
160
|
-
"Dismiss icon uses the same color token as the label text for visual consistency",
|
|
161
|
-
],
|
|
162
|
-
|
|
163
|
-
interactionRules: [
|
|
164
|
-
{ event: "Click Dismiss", trigger: "pointerup on dismiss button", action: "Fire onRemove callback; remove tag from DOM or notify parent" },
|
|
165
|
-
{ event: "Hover Tag", trigger: "pointerenter on tag container", action: "Transition to hover background if tag is interactive (removable or clickable)" },
|
|
166
|
-
{ event: "Hover Dismiss", trigger: "pointerenter on dismiss icon", action: "Dismiss icon gains emphasis (darker fill or background circle)" },
|
|
167
|
-
{ event: "Focus Dismiss", trigger: "Tab key reaches dismiss button", action: "Show focus ring on the dismiss button specifically" },
|
|
168
|
-
{ event: "Keydown Enter/Space", trigger: "Enter or Space on dismiss button", action: "Fire onRemove callback (same as click dismiss)" },
|
|
169
|
-
{ event: "Keydown Backspace", trigger: "Backspace while tag is focused", action: "If removable, fire onRemove — common keyboard shortcut for tag removal" },
|
|
170
|
-
{ event: "Click Tag", trigger: "pointerup on tag body (when onClick is set)", action: "Fire onClick handler; typically used for filtering or detail expansion" },
|
|
171
|
-
{ event: "Focus Tag", trigger: "Tab key or focus()", action: "Show focus ring around entire tag if tag-level interaction is enabled" },
|
|
172
|
-
],
|
|
173
|
-
|
|
174
|
-
contentGuidance: [
|
|
175
|
-
"Labels should be concise nouns or short phrases — one to three words maximum",
|
|
176
|
-
"Use semantic types consistently: Info for informational, Success for positive, Warning for caution, Error for critical",
|
|
177
|
-
"Do not use tags as action buttons — they represent metadata, not actions",
|
|
178
|
-
"Icons should reinforce the semantic meaning (e.g. checkmark for success, warning triangle for warning)",
|
|
179
|
-
"Avoid duplicate tags in the same context — each tag should convey unique information",
|
|
180
|
-
"When removable, ensure users understand what removing the tag will do (filter change, category removal, etc.)",
|
|
181
|
-
],
|
|
182
|
-
|
|
183
|
-
responsiveBehaviour: [
|
|
184
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Tag groups wrap naturally; tags maintain minimum size; dismiss targets remain 44x44px touch area" },
|
|
185
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Tags render inline; groups may scroll horizontally if space is constrained" },
|
|
186
|
-
{ breakpoint: "Desktop (1024-1439px)", behavior: "Full tag groups visible; wrapping follows natural content flow with consistent gap tokens" },
|
|
187
|
-
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "Tag sizes and spacing remain fixed — do not scale proportionally with viewport width" },
|
|
188
|
-
],
|
|
189
|
-
|
|
190
|
-
accessibilitySpec: {
|
|
191
|
-
intro:
|
|
192
|
-
"Tags communicate categorical or status information. Semantic tags must be perceivable by assistive technology, and removable tags must be fully keyboard-operable.",
|
|
193
|
-
requirements: [
|
|
194
|
-
{ requirement: "Semantic Role", level: "A", notes: "Use role='status' for semantic tags that convey live status; static labels need no special role" },
|
|
195
|
-
{ requirement: "Accessible Name", level: "A", notes: "Each tag must expose its label text as its accessible name; icon-only tags need aria-label" },
|
|
196
|
-
{ requirement: "Dismiss Button", level: "A", notes: "Removable tags must have a focusable dismiss button with aria-label='Remove [tag label]'" },
|
|
197
|
-
{ requirement: "Removal Announcement", level: "AA", notes: "When a tag is removed, announce the removal via aria-live='polite' region" },
|
|
198
|
-
{ requirement: "Contrast Ratio", level: "AA", notes: "Text-to-background: 4.5:1 minimum for all semantic type variants" },
|
|
199
|
-
{ requirement: "Keyboard Operable", level: "A", notes: "Dismiss button reachable via Tab; activated by Enter, Space, or Backspace" },
|
|
200
|
-
{ requirement: "Color Not Sole Indicator", level: "A", notes: "Semantic type must not rely on color alone — include icon or text to differentiate types" },
|
|
201
|
-
],
|
|
202
|
-
outro: [
|
|
203
|
-
"When tags are dynamically added or removed, manage focus to the nearest remaining tag or a logical fallback",
|
|
204
|
-
"Ensure tag groups have a descriptive label (e.g. aria-label='Applied filters') for screen reader context",
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
qaAcceptanceCriteria: [
|
|
209
|
-
{ check: "Visual Regression", platform: "All", expectedResult: "Tag renders pixel-perfect against baseline for each type, size, and removable variant" },
|
|
210
|
-
{ check: "Semantic Colors", platform: "All", expectedResult: "All five semantic types (Neutral, Info, Success, Warning, Error) display correct background and text tokens" },
|
|
211
|
-
{ check: "Hover State", platform: "Web", expectedResult: "Interactive tags transition smoothly on mouse enter/leave; static tags show no hover change" },
|
|
212
|
-
{ check: "Focus State", platform: "Web", expectedResult: "Focus ring visible on Tab for dismiss button; visible on tag body if clickable" },
|
|
213
|
-
{ check: "Dismiss Functionality", platform: "All", expectedResult: "Clicking dismiss removes tag; onRemove callback fires with correct identifier" },
|
|
214
|
-
{ check: "Keyboard Dismiss", platform: "Web", expectedResult: "Enter, Space, and Backspace on dismiss button fire onRemove; no double-fire" },
|
|
215
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces tag label, semantic type if role='status', and 'Remove' button for removable tags" },
|
|
216
|
-
{ check: "Truncation", platform: "All", expectedResult: "Long labels truncate with ellipsis at maxWidth; full text available via tooltip on hover" },
|
|
217
|
-
{ check: "Disabled State", platform: "All", expectedResult: "Muted visuals; dismiss hidden; pointer-events none; aria-disabled='true'" },
|
|
218
|
-
{ check: "Contrast", platform: "All", expectedResult: "All semantic variants pass 4.5:1 text contrast in both light and dark themes" },
|
|
219
|
-
{ check: "RTL Support", platform: "Web", expectedResult: "Icon and dismiss positions swap; padding mirrors; text alignment correct in RTL locales" },
|
|
220
|
-
{ check: "Touch Target", platform: "Mobile", expectedResult: "Dismiss button hit area is at least 44x44px even for Small size tags" },
|
|
221
|
-
],
|
|
222
|
-
|
|
223
|
-
dos: [
|
|
224
|
-
"Use semantic type variants consistently across the application to convey meaning",
|
|
225
|
-
"Keep labels short and descriptive — prefer single words or two-word phrases",
|
|
226
|
-
"Provide a clear dismiss affordance for removable tags (visible icon, not just hover-revealed)",
|
|
227
|
-
"Group related tags together with consistent sizing and spacing",
|
|
228
|
-
"Use the outlined variant for lower-emphasis or secondary tag groups",
|
|
229
|
-
"Announce tag removal to screen readers via an aria-live region",
|
|
230
|
-
"Ensure all semantic type colors meet contrast requirements in both light and dark themes",
|
|
231
|
-
],
|
|
232
|
-
|
|
233
|
-
donts: [
|
|
234
|
-
"Do not use tags as action buttons — use a Button or Chip component instead",
|
|
235
|
-
"Do not use color as the only differentiator between semantic types — pair with icons or labels",
|
|
236
|
-
"Do not allow tag labels to wrap to multiple lines — truncate with ellipsis instead",
|
|
237
|
-
"Do not nest interactive elements (links, buttons) inside a tag besides the dismiss button",
|
|
238
|
-
"Do not use more than one semantic type on the same tag — each tag has a single type",
|
|
239
|
-
"Do not override design token colors with hard-coded hex values",
|
|
240
|
-
"Do not hide the dismiss button behind a hover reveal — it must be always visible for discoverability",
|
|
241
|
-
"Do not use tags for user-generated content input — use Chip or Input with tokenization instead",
|
|
242
|
-
],
|
|
243
|
-
};
|
package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* textarea.ts — Gold-standard design knowledge for Textarea components
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentKnowledge } from "../types.js";
|
|
5
|
-
|
|
6
|
-
export const textareaKnowledge: ComponentKnowledge = {
|
|
7
|
-
description:
|
|
8
|
-
"Multi-line text input | Collects free-form content | Supports resizing, character limits, and validation",
|
|
9
|
-
|
|
10
|
-
stateSpecifications: [
|
|
11
|
-
{
|
|
12
|
-
state: "Default",
|
|
13
|
-
visualChange: "Field shows border, optional placeholder text in muted color",
|
|
14
|
-
opacity: "1",
|
|
15
|
-
cursorWeb: "text",
|
|
16
|
-
usage: "Resting state — textarea is interactive and ready for input",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
state: "Focused",
|
|
20
|
-
visualChange: "Border transitions to focus color; 2px focus ring appears offset by 2px from the field edge",
|
|
21
|
-
opacity: "1",
|
|
22
|
-
cursorWeb: "text",
|
|
23
|
-
usage: "User clicks into the field or navigates via Tab key",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
state: "Filled",
|
|
27
|
-
visualChange: "User-entered text replaces placeholder; border remains default color",
|
|
28
|
-
opacity: "1",
|
|
29
|
-
cursorWeb: "text",
|
|
30
|
-
usage: "Field contains user-entered content and is not currently focused",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
state: "Error",
|
|
34
|
-
visualChange: "Border switches to error token; error message appears below the field in error color",
|
|
35
|
-
opacity: "1",
|
|
36
|
-
cursorWeb: "text",
|
|
37
|
-
usage: "Validation has failed — field value does not meet requirements",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
state: "Disabled",
|
|
41
|
-
visualChange: "Background and border switch to disabled tokens; text is muted; no interaction possible",
|
|
42
|
-
opacity: "0.4",
|
|
43
|
-
cursorWeb: "not-allowed",
|
|
44
|
-
usage: "Field is unavailable due to form state, permissions, or prerequisites",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
state: "ReadOnly",
|
|
48
|
-
visualChange: "Border is removed or reduced to a subtle bottom line; background becomes transparent or tinted",
|
|
49
|
-
opacity: "1",
|
|
50
|
-
cursorWeb: "default",
|
|
51
|
-
usage: "Content is visible and selectable but not editable — used for review or confirmation views",
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
propertyDescriptions: {
|
|
56
|
-
label: "Visible text label rendered above the textarea; describes the expected input (e.g. 'Description', 'Comments')",
|
|
57
|
-
placeholder: "Hint text displayed inside the field when empty; disappears on input; should not replace the label",
|
|
58
|
-
value: "The current text content of the textarea; controlled or uncontrolled depending on framework usage",
|
|
59
|
-
helperText: "Optional instructional text below the field providing guidance on expected input format or constraints",
|
|
60
|
-
errorMessage: "Validation error message displayed below the field when the field is in an error state; replaces helperText when visible",
|
|
61
|
-
rows: "Number of visible text rows determining the initial height of the textarea; defaults to 3 for medium size",
|
|
62
|
-
maxLength: "Maximum number of characters allowed; when set, a character counter is rendered showing current/max count",
|
|
63
|
-
resize: "CSS resize behavior — 'vertical' (default), 'horizontal', 'both', or 'none'; controls user-resizable handle",
|
|
64
|
-
required: "When true, the field must have a value before form submission; adds a required indicator to the label",
|
|
65
|
-
disabled: "When true, the textarea is non-interactive: muted visuals, pointer-events none, aria-disabled='true'",
|
|
66
|
-
readOnly: "When true, the content is visible and selectable but cannot be modified; uses readOnly visual treatment",
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
sizeSpecifications: [
|
|
70
|
-
{
|
|
71
|
-
size: "Small",
|
|
72
|
-
height: "80px (min-height)",
|
|
73
|
-
paddingLR: "12px",
|
|
74
|
-
fontSize: "12px",
|
|
75
|
-
iconSize: "16px",
|
|
76
|
-
borderRadius: "6px",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
size: "Medium",
|
|
80
|
-
height: "120px (min-height)",
|
|
81
|
-
paddingLR: "12px",
|
|
82
|
-
fontSize: "14px",
|
|
83
|
-
iconSize: "20px",
|
|
84
|
-
borderRadius: "8px",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
size: "Large",
|
|
88
|
-
height: "160px (min-height)",
|
|
89
|
-
paddingLR: "12px",
|
|
90
|
-
fontSize: "16px",
|
|
91
|
-
iconSize: "24px",
|
|
92
|
-
borderRadius: "10px",
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
|
|
96
|
-
designTokenBindings: [
|
|
97
|
-
{
|
|
98
|
-
property: "Background",
|
|
99
|
-
tokenName: "$field-bg",
|
|
100
|
-
role: "Default field background color",
|
|
101
|
-
fallback: "#FFFFFF",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
property: "Border",
|
|
105
|
-
tokenName: "$field-border",
|
|
106
|
-
role: "Default field border color",
|
|
107
|
-
fallback: "#D0D5DD",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
property: "Text Color",
|
|
111
|
-
tokenName: "$field-text",
|
|
112
|
-
role: "User-entered text color inside the field",
|
|
113
|
-
fallback: "#1D2939",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
property: "Placeholder",
|
|
117
|
-
tokenName: "$field-placeholder",
|
|
118
|
-
role: "Placeholder hint text color",
|
|
119
|
-
fallback: "#98A2B3",
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
property: "Error Text",
|
|
123
|
-
tokenName: "$field-error-text",
|
|
124
|
-
role: "Error message text color below the field",
|
|
125
|
-
fallback: "#D92D20",
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
property: "Error Border",
|
|
129
|
-
tokenName: "$field-error-border",
|
|
130
|
-
role: "Border color when field is in error state",
|
|
131
|
-
fallback: "#FDA29B",
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
property: "Focus Ring",
|
|
135
|
-
tokenName: "$focus-ring",
|
|
136
|
-
role: "Keyboard and click focus indicator ring",
|
|
137
|
-
fallback: "0 0 0 2px #FFFFFF, 0 0 0 4px #2E90FA",
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
property: "Counter Text",
|
|
141
|
-
tokenName: "$field-helper-text",
|
|
142
|
-
role: "Character counter and helper text color",
|
|
143
|
-
fallback: "#667085",
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
property: "Label Color",
|
|
147
|
-
tokenName: "$field-label",
|
|
148
|
-
role: "Label text color above the field",
|
|
149
|
-
fallback: "#344054",
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
property: "Font Family",
|
|
153
|
-
tokenName: "$font-family-sans",
|
|
154
|
-
role: "Textarea content and label typeface",
|
|
155
|
-
fallback: "Inter, system-ui, sans-serif",
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
|
|
159
|
-
structureRules: [
|
|
160
|
-
"Container uses vertical Auto Layout: label on top, field in the middle, helper/error text at the bottom",
|
|
161
|
-
"Label is a direct child of the container, positioned above the field with $spacing-xs (4px) gap",
|
|
162
|
-
"Field element uses vertical Auto Layout with top-left text alignment and padding on all four sides",
|
|
163
|
-
"Helper text and error message occupy the same slot — error message replaces helper text when visible",
|
|
164
|
-
"Character counter is right-aligned within the helper text row; format is 'current / max'",
|
|
165
|
-
"Resize handle is visible in the bottom-right corner unless resize is set to 'none'",
|
|
166
|
-
"Textarea width defaults to fill-container on the horizontal axis; never uses fixed width in standard usage",
|
|
167
|
-
"Minimum height is enforced per size spec; field grows vertically as content exceeds visible rows",
|
|
168
|
-
],
|
|
169
|
-
|
|
170
|
-
typeHierarchyRules: [
|
|
171
|
-
"Label uses font weight Medium (500) at one step smaller than the field font size",
|
|
172
|
-
"Field text uses Regular (400) weight for comfortable long-form reading",
|
|
173
|
-
"Helper and error text use font size 12px regardless of field size",
|
|
174
|
-
"Placeholder text uses the same font size and weight as field text but in the placeholder color token",
|
|
175
|
-
"Character counter uses tabular-nums font feature for stable width as numbers change",
|
|
176
|
-
],
|
|
177
|
-
|
|
178
|
-
interactionRules: [
|
|
179
|
-
{ event: "Click", trigger: "pointerdown inside field bounds", action: "Place cursor at click position; enter focused state" },
|
|
180
|
-
{ event: "Focus", trigger: "Tab key or focus()", action: "Show focus ring; place cursor at end of content" },
|
|
181
|
-
{ event: "Blur", trigger: "Focus moves away", action: "Remove focus ring; run validation if configured" },
|
|
182
|
-
{ event: "Input", trigger: "Keypress while focused", action: "Update value; increment character counter; fire onChange handler" },
|
|
183
|
-
{ event: "Paste", trigger: "Ctrl/Cmd+V while focused", action: "Insert clipboard text; truncate to maxLength if exceeded" },
|
|
184
|
-
{ event: "Max Length Reached", trigger: "Character count equals maxLength", action: "Prevent further input; counter text transitions to warning color" },
|
|
185
|
-
{ event: "Resize", trigger: "User drags resize handle", action: "Adjust field dimensions within min/max constraints" },
|
|
186
|
-
],
|
|
187
|
-
|
|
188
|
-
contentGuidance: [
|
|
189
|
-
"Labels should clearly describe the expected content: 'Description', 'Additional notes', 'Feedback'",
|
|
190
|
-
"Placeholder text should provide an example or hint, not repeat the label verbatim",
|
|
191
|
-
"Helper text should explain constraints: 'Maximum 500 characters' or 'Markdown is supported'",
|
|
192
|
-
"Error messages should be specific and actionable: 'Description is required' instead of 'Invalid input'",
|
|
193
|
-
"Keep placeholder text concise — one short sentence or phrase maximum",
|
|
194
|
-
"Use sentence case for labels, placeholders, and helper text — never all-caps",
|
|
195
|
-
],
|
|
196
|
-
|
|
197
|
-
responsiveBehaviour: [
|
|
198
|
-
{ breakpoint: "Mobile (<768px)", behavior: "Textarea expands to full width; minimum height increases to 120px for comfortable touch input" },
|
|
199
|
-
{ breakpoint: "Tablet (768-1023px)", behavior: "Textarea fills available column width; resize handle remains active" },
|
|
200
|
-
{ breakpoint: "Desktop (1024-1439px)", behavior: "Standard sizing applies; textarea respects container width constraints" },
|
|
201
|
-
{ breakpoint: "Ultra-wide (>=1440px)", behavior: "Max-width cap of 720px prevents overly wide fields that reduce readability" },
|
|
202
|
-
],
|
|
203
|
-
|
|
204
|
-
accessibilitySpec: {
|
|
205
|
-
intro:
|
|
206
|
-
"Textareas must be fully accessible for screen reader users, keyboard-only users, and voice control users. Proper labeling and live regions are critical for character counters.",
|
|
207
|
-
requirements: [
|
|
208
|
-
{ requirement: "Role", level: "A", notes: "Use native <textarea> element which provides implicit role='textbox' with aria-multiline='true'" },
|
|
209
|
-
{ requirement: "Label Association", level: "A", notes: "Label must be programmatically associated via for/id pairing or aria-labelledby" },
|
|
210
|
-
{ requirement: "Describedby", level: "A", notes: "Helper text and error messages must be linked via aria-describedby for screen reader announcement" },
|
|
211
|
-
{ requirement: "Required State", level: "A", notes: "Required fields must use aria-required='true' and display a visual required indicator" },
|
|
212
|
-
{ requirement: "Error Identification", level: "A", notes: "Error state must set aria-invalid='true' and reference the error message via aria-errormessage or aria-describedby" },
|
|
213
|
-
{ requirement: "Character Counter", level: "AA", notes: "Counter updates must use aria-live='polite' to announce remaining characters without interrupting the user" },
|
|
214
|
-
{ requirement: "Contrast Ratio", level: "AA", notes: "Text-to-background: 4.5:1 minimum; field border to surrounding surface: 3:1" },
|
|
215
|
-
{ requirement: "Resize Accessible", level: "AA", notes: "Resize functionality must not break reflow; content must remain visible after resizing" },
|
|
216
|
-
],
|
|
217
|
-
outro: [
|
|
218
|
-
"Ensure focus is clearly visible with a high-contrast focus ring that meets WCAG 2.4.7",
|
|
219
|
-
"Do not rely solely on color to convey error state — include an error icon or text indicator",
|
|
220
|
-
"Screen readers should announce the label, current value, helper text, and error state in a logical order",
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
qaAcceptanceCriteria: [
|
|
225
|
-
{ check: "Visual Regression", platform: "All", expectedResult: "Textarea renders pixel-perfect against baseline for each size and state" },
|
|
226
|
-
{ check: "Focus State", platform: "Web", expectedResult: "Focus ring visible on Tab; hidden on mouse click (focus-visible); cursor blinks inside field" },
|
|
227
|
-
{ check: "Placeholder Display", platform: "Web", expectedResult: "Placeholder visible when empty; hidden as soon as first character is typed" },
|
|
228
|
-
{ check: "Error State", platform: "All", expectedResult: "Error border, error message visible; helper text replaced; aria-invalid='true'" },
|
|
229
|
-
{ check: "Character Counter", platform: "Web", expectedResult: "Counter updates on each keystroke; prevents input beyond maxLength; announces via aria-live" },
|
|
230
|
-
{ check: "Disabled State", platform: "All", expectedResult: "Muted visuals; pointer-events none; aria-disabled='true'; not focusable via Tab" },
|
|
231
|
-
{ check: "ReadOnly State", platform: "All", expectedResult: "Content is selectable but not editable; no border or reduced border; aria-readonly='true'" },
|
|
232
|
-
{ check: "Resize Handle", platform: "Web", expectedResult: "Handle visible in bottom-right; dragging resizes field within min/max bounds" },
|
|
233
|
-
{ check: "Screen Reader", platform: "Web", expectedResult: "Announces role 'textbox', accessible name from label, helper text, and error state" },
|
|
234
|
-
{ check: "Keyboard Navigation", platform: "Web", expectedResult: "Tab moves focus in/out; all text editing keys work; no focus traps" },
|
|
235
|
-
{ check: "Paste Handling", platform: "Web", expectedResult: "Pasted text is truncated to maxLength; counter updates; no overflow" },
|
|
236
|
-
{ check: "Contrast", platform: "All", expectedResult: "All text passes 4.5:1 contrast; border passes 3:1 non-text contrast" },
|
|
237
|
-
{ check: "RTL Support", platform: "Web", expectedResult: "Text aligns right; resize handle moves to bottom-left; label alignment mirrors" },
|
|
238
|
-
],
|
|
239
|
-
|
|
240
|
-
dos: [
|
|
241
|
-
"Always pair the textarea with a visible label — never rely on placeholder alone",
|
|
242
|
-
"Provide a character counter when maxLength is set so users know their remaining allowance",
|
|
243
|
-
"Use helper text to communicate formatting expectations or constraints",
|
|
244
|
-
"Set an appropriate initial height via rows to match the expected content length",
|
|
245
|
-
"Use the error state with a specific, actionable error message for validation failures",
|
|
246
|
-
"Allow vertical resizing by default so users can expand the field for longer content",
|
|
247
|
-
"Maintain consistent padding tokens across all textarea sizes",
|
|
248
|
-
],
|
|
249
|
-
|
|
250
|
-
donts: [
|
|
251
|
-
"Do not use a textarea for single-line inputs — use a text input instead",
|
|
252
|
-
"Do not hide the label and rely solely on placeholder text for field identification",
|
|
253
|
-
"Do not allow horizontal resizing that breaks page layout — prefer vertical-only resize",
|
|
254
|
-
"Do not use vague error messages like 'Invalid' — be specific about what needs to change",
|
|
255
|
-
"Do not set maxLength without showing a character counter — users need visibility into limits",
|
|
256
|
-
"Do not override design token colors with hard-coded hex values",
|
|
257
|
-
"Do not disable the field without explaining why via a tooltip or adjacent helper text",
|
|
258
|
-
],
|
|
259
|
-
};
|