@sarjallab09/figma-intelligence 1.0.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/LICENSE +26 -0
- package/README.md +327 -0
- package/bin/cli.js +859 -0
- package/design-bridge/.env.example +5 -0
- package/design-bridge/bridge.js +196 -0
- package/design-bridge/lib/assets.js +367 -0
- package/design-bridge/lib/prompt.js +85 -0
- package/design-bridge/lib/server.js +66 -0
- package/design-bridge/lib/stitch.js +37 -0
- package/design-bridge/lib/tokens.js +82 -0
- package/design-bridge/package-lock.json +579 -0
- package/design-bridge/package.json +19 -0
- package/figma-bridge-plugin/README.md +97 -0
- package/figma-bridge-plugin/anthropic-chat-runner.js +192 -0
- package/figma-bridge-plugin/bridge-relay.js +2363 -0
- package/figma-bridge-plugin/chat-runner.js +459 -0
- package/figma-bridge-plugin/code.js +1528 -0
- package/figma-bridge-plugin/codex-runner.js +505 -0
- package/figma-bridge-plugin/component-schemas.js +110 -0
- package/figma-bridge-plugin/content-context.js +869 -0
- package/figma-bridge-plugin/create-button.js +216 -0
- package/figma-bridge-plugin/gemini-cli-runner.js +291 -0
- package/figma-bridge-plugin/gemini-runner.js +187 -0
- package/figma-bridge-plugin/html-to-figma.js +927 -0
- package/figma-bridge-plugin/knowledge-hub/.gitkeep +0 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/anatomy-spec.md +159 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/api-spec.md +162 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/color-spec.md +148 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/full-spec-template.md +314 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/property-spec.md +175 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/screen-reader-spec.md +180 -0
- package/figma-bridge-plugin/knowledge-hub/uspec-references/structure-spec.md +165 -0
- package/figma-bridge-plugin/manifest.json +21 -0
- package/figma-bridge-plugin/package-lock.json +1936 -0
- package/figma-bridge-plugin/package.json +20 -0
- package/figma-bridge-plugin/perplexity-runner.js +188 -0
- package/figma-bridge-plugin/references/SKILL.md +178 -0
- package/figma-bridge-plugin/references/anatomy-spec.md +159 -0
- package/figma-bridge-plugin/references/api-spec.md +162 -0
- package/figma-bridge-plugin/references/color-spec.md +148 -0
- package/figma-bridge-plugin/references/full-spec-template.md +314 -0
- package/figma-bridge-plugin/references/property-spec.md +175 -0
- package/figma-bridge-plugin/references/screen-reader-spec.md +180 -0
- package/figma-bridge-plugin/references/structure-spec.md +165 -0
- package/figma-bridge-plugin/shared-prompt-config.js +604 -0
- package/figma-bridge-plugin/spec-helpers/build-table.js +269 -0
- package/figma-bridge-plugin/spec-helpers/classify-elements.js +189 -0
- package/figma-bridge-plugin/spec-helpers/index.js +35 -0
- package/figma-bridge-plugin/spec-helpers/parse-figma-link.js +49 -0
- package/figma-bridge-plugin/spec-helpers/position-markers.js +158 -0
- package/figma-bridge-plugin/stitch-auth.js +322 -0
- package/figma-bridge-plugin/stitch-runner.js +1427 -0
- package/figma-bridge-plugin/token-resolver.js +107 -0
- package/figma-bridge-plugin/ui.html +4467 -0
- package/figma-intelligence-layer/.env.example +39 -0
- package/figma-intelligence-layer/docs/local-image-generation.md +60 -0
- package/figma-intelligence-layer/examples/comfyui-workflow-template.example.json +101 -0
- package/figma-intelligence-layer/jest.config.js +14 -0
- package/figma-intelligence-layer/mcp-config.json +19 -0
- package/figma-intelligence-layer/package-lock.json +5892 -0
- package/figma-intelligence-layer/package.json +48 -0
- package/figma-intelligence-layer/scripts/setup-comfyui-local.sh +67 -0
- package/figma-intelligence-layer/scripts/start-comfyui.sh +33 -0
- package/figma-intelligence-layer/src/index.ts +2233 -0
- package/figma-intelligence-layer/src/shared/auto-layout-validator.ts +404 -0
- package/figma-intelligence-layer/src/shared/cache.ts +187 -0
- package/figma-intelligence-layer/src/shared/color-operations.ts +533 -0
- package/figma-intelligence-layer/src/shared/color-utils.ts +138 -0
- package/figma-intelligence-layer/src/shared/component-script-builder.ts +413 -0
- package/figma-intelligence-layer/src/shared/component-templates.ts +2767 -0
- package/figma-intelligence-layer/src/shared/concept-taxonomy.ts +694 -0
- package/figma-intelligence-layer/src/shared/decision-log.ts +128 -0
- package/figma-intelligence-layer/src/shared/design-system-context.ts +568 -0
- package/figma-intelligence-layer/src/shared/design-system-intelligence.ts +131 -0
- package/figma-intelligence-layer/src/shared/design-system-matcher.ts +184 -0
- package/figma-intelligence-layer/src/shared/design-system-normalizers.ts +196 -0
- package/figma-intelligence-layer/src/shared/design-system-tokens.ts +295 -0
- package/figma-intelligence-layer/src/shared/dtcg-validator.ts +530 -0
- package/figma-intelligence-layer/src/shared/enrichment-pipeline.ts +671 -0
- package/figma-intelligence-layer/src/shared/figma-bridge.ts +1408 -0
- package/figma-intelligence-layer/src/shared/font-config.ts +126 -0
- package/figma-intelligence-layer/src/shared/icon-catalog.ts +360 -0
- package/figma-intelligence-layer/src/shared/icon-fetch.ts +80 -0
- package/figma-intelligence-layer/src/shared/prototype-script-builder.ts +162 -0
- package/figma-intelligence-layer/src/shared/response-compression.ts +440 -0
- package/figma-intelligence-layer/src/shared/semantic-token-catalog.ts +324 -0
- package/figma-intelligence-layer/src/shared/token-binder.ts +505 -0
- package/figma-intelligence-layer/src/shared/token-math.ts +427 -0
- package/figma-intelligence-layer/src/shared/token-naming.ts +468 -0
- package/figma-intelligence-layer/src/shared/token-utils.ts +420 -0
- package/figma-intelligence-layer/src/shared/types.ts +346 -0
- package/figma-intelligence-layer/src/shared/typography-presets.ts +94 -0
- package/figma-intelligence-layer/src/shared/unsplash.ts +165 -0
- package/figma-intelligence-layer/src/shared/vision-client.ts +607 -0
- package/figma-intelligence-layer/src/shared/vision-provider-anthropic.ts +334 -0
- package/figma-intelligence-layer/src/shared/vision-provider-openai.ts +446 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-handler.ts +782 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotate-renderer.ts +496 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/a11y-annotation-kit.ts +230 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/colorblind-sim.ts +66 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/index.ts +810 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-analyzer.ts +1191 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-figma-page.ts +1346 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/keyboard-sr-order-handler.ts +148 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-figma-page.ts +499 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/vpat-report.ts +910 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-checker.ts +989 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/a11y-audit/wcag-criteria.ts +1160 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/design-from-ref/index.ts +424 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/component-recognizer.ts +38 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/ds-matcher.ts +111 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/font-matcher.ts +114 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/icon-resolver.ts +103 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/index.ts +1060 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/layout-segmenter.ts +18 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/token-inferencer.ts +39 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/screen-cloner/vision-pipeline.ts +58 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/sketch-to-design/index.ts +298 -0
- package/figma-intelligence-layer/src/tools/phase1-vision/visual-audit/index.ts +197 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/component-audit/index.ts +494 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/intent-translator/index.ts +356 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/container-patterns.ts +123 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/layout-intelligence/index.ts +663 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/built-in-rules.yaml +56 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/index.ts +614 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/lint-rules/rule-engine.ts +113 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/color-theory.ts +178 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/theme-generator/index.ts +470 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/index.ts +429 -0
- package/figma-intelligence-layer/src/tools/phase2-accuracy/variant-expander/token-override-maps.ts +226 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/ai-image-insert/index.ts +535 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/index.ts +660 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/component-archaeologist/pattern-fingerprints.ts +209 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/composition-builder/index.ts +540 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/figma-animated-build.ts +391 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/index.ts +2019 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/page-architect/screen-templates.ts +131 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-map/index.ts +381 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/prototype-wire/index.ts +565 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/swarm-build/index.ts +764 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/system-drift/index.ts +535 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/unsplash-search/index.ts +84 -0
- package/figma-intelligence-layer/src/tools/phase3-generation/url-to-frame/index.ts +401 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/css-animations.ts +68 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/framer-motion.ts +78 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/code-generators/swift-animations.ts +93 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/animation-specifier/index.ts +596 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/ci-check/index.ts +462 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/export-tokens/index.ts +1470 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/generate-component-code/index.ts +829 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/handoff-spec/index.ts +702 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/icon-library-sync/index.ts +483 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/index.ts +501 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/sync-from-code/storybook-parser.ts +106 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/watch-docs/index.ts +676 -0
- package/figma-intelligence-layer/src/tools/phase4-sync/webhook-listener/index.ts +560 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/apg-doc/index.ts +1043 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/component-detection.ts +620 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/anatomy.ts +331 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/color-tokens.ts +77 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/properties.ts +54 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/snapshot.ts +287 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/spacing.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/states.ts +43 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/extractors/typography.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/index.ts +221 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/_default.ts +166 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/accordion.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/alert.ts +234 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar-group.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/avatar.ts +249 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/badge.ts +231 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/banner.ts +293 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/breadcrumb.ts +240 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/button.ts +243 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/calendar.ts +307 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/card.ts +143 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/checkbox.ts +227 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/chip.ts +233 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/combobox.ts +282 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/datepicker.ts +276 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/divider.ts +223 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/drawer.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/dropdown-menu.ts +289 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/empty-state.ts +261 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/file-uploader.ts +290 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/form.ts +265 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/grid.ts +238 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/icon.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/index.ts +128 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-edit.ts +286 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/inline-message.ts +255 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/input.ts +330 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/link.ts +247 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/list.ts +250 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/menu.ts +247 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/modal.ts +144 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navbar.ts +264 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/navigation.ts +251 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/number-input.ts +261 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/pagination.ts +248 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/popover.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/progress.ts +251 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/radio.ts +142 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/range-slider.ts +282 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/rating.ts +250 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/search.ts +258 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/segmented-control.ts +265 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/select.ts +319 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/skeleton.ts +256 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/slider.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/spinner.ts +239 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/status-dot.ts +252 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/stepper.ts +270 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/table.ts +244 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tabs.ts +143 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tag.ts +243 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/textarea.ts +259 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/time-picker.ts +293 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toast.ts +144 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toggle.ts +289 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/toolbar.ts +267 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/tooltip.ts +232 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/treeview.ts +257 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/knowledge/typography.ts +319 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/legacy-compat.ts +121 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/anatomy-diagram.ts +430 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/figma-page.ts +312 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/json.ts +129 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/markdown.ts +78 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/renderers/visual-doc.ts +2333 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/accessibility.ts +100 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/anatomy.ts +32 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/color-tokens.ts +59 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/content-guidance.ts +18 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/design-tokens.ts +53 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/interaction-rules.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/overview.ts +91 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/properties-api.ts +71 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/qa-criteria.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/related-components.ts +110 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/responsive.ts +19 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/size-specs.ts +67 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/spacing-structure.ts +58 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/state-specs.ts +79 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/states.ts +50 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/type-hierarchy.ts +33 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/typography.ts +55 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/usage-guidelines.ts +73 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/sections/variants.ts +81 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec/types.ts +409 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/index.ts +198 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/renderer.ts +701 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/component-spec-sheet/types.ts +88 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/decision-log/index.ts +135 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/design-decision-log/index.ts +491 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-primitives/index.ts +416 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-scaffolder/index.ts +722 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/ds-variables/index.ts +449 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/health-report/index.ts +393 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/index.ts +406 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/figma-page.ts +292 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/json.ts +24 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/markdown.ts +172 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/taxonomy-docs/renderers/naming-guide.ts +409 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-analytics/index.ts +594 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-docs/index.ts +710 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-migrate/index.ts +458 -0
- package/figma-intelligence-layer/src/tools/phase5-governance/token-naming/index.ts +134 -0
- package/figma-intelligence-layer/tests/apg-doc.test.ts +101 -0
- package/figma-intelligence-layer/tests/design-system-context.test.ts +152 -0
- package/figma-intelligence-layer/tests/design-system-matcher.test.ts +144 -0
- package/figma-intelligence-layer/tests/figma-bridge.test.ts +83 -0
- package/figma-intelligence-layer/tests/generate-image-and-insert.test.ts +56 -0
- package/figma-intelligence-layer/tests/screen-cloner-regression.test.ts +69 -0
- package/figma-intelligence-layer/tests/smoke.test.ts +174 -0
- package/figma-intelligence-layer/tests/spec-generator.test.ts +127 -0
- package/figma-intelligence-layer/tests/token-migrate.test.ts +21 -0
- package/figma-intelligence-layer/tests/token-naming.test.ts +30 -0
- package/figma-intelligence-layer/tsconfig.json +19 -0
- package/package.json +35 -0
- package/scripts/clean-existing-chunks.js +179 -0
- package/scripts/connect-ai-tool.js +490 -0
- package/scripts/convert-hub-pdfs.js +425 -0
- package/scripts/figma-mcp-status.js +349 -0
- package/scripts/register-codex-mcp.js +96 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// Semantic Token Catalog
|
|
3
|
+
// Pure data module defining semantic tokens organized by category.
|
|
4
|
+
// Each token maps to light/dark primitive references for automatic alias
|
|
5
|
+
// creation by ds-scaffolder, ds-variables, and token-binder.
|
|
6
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export interface SemanticTokenEntry {
|
|
9
|
+
name: string;
|
|
10
|
+
category: string;
|
|
11
|
+
type: "COLOR" | "FLOAT" | "STRING";
|
|
12
|
+
description: string;
|
|
13
|
+
/** Primitive token name for light mode */
|
|
14
|
+
lightRef: string;
|
|
15
|
+
/** Primitive token name for dark mode */
|
|
16
|
+
darkRef: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// ─── Color semantic tokens ──────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
const ACTIONS: SemanticTokenEntry[] = [
|
|
22
|
+
{ name: "color/semantic/actions/primary/bg/default", category: "actions", type: "COLOR", description: "Primary action background", lightRef: "color/primitive/brand/500", darkRef: "color/primitive/brand/400" },
|
|
23
|
+
{ name: "color/semantic/actions/primary/bg/hover", category: "actions", type: "COLOR", description: "Primary action hover background", lightRef: "color/primitive/brand/600", darkRef: "color/primitive/brand/300" },
|
|
24
|
+
{ name: "color/semantic/actions/primary/bg/pressed", category: "actions", type: "COLOR", description: "Primary action pressed background", lightRef: "color/primitive/brand/700", darkRef: "color/primitive/brand/200" },
|
|
25
|
+
{ name: "color/semantic/actions/primary/bg/disabled", category: "actions", type: "COLOR", description: "Primary action disabled background", lightRef: "color/primitive/brand/200", darkRef: "color/primitive/brand/800" },
|
|
26
|
+
{ name: "color/semantic/actions/primary/text/default", category: "actions", type: "COLOR", description: "Text on primary action", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/950" },
|
|
27
|
+
{ name: "color/semantic/actions/secondary/bg/default", category: "actions", type: "COLOR", description: "Secondary action background", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
28
|
+
{ name: "color/semantic/actions/secondary/bg/hover", category: "actions", type: "COLOR", description: "Secondary action hover background", lightRef: "color/primitive/neutral/200", darkRef: "color/primitive/neutral/700" },
|
|
29
|
+
{ name: "color/semantic/actions/secondary/bg/pressed", category: "actions", type: "COLOR", description: "Secondary action pressed background", lightRef: "color/primitive/neutral/300", darkRef: "color/primitive/neutral/600" },
|
|
30
|
+
{ name: "color/semantic/actions/secondary/bg/disabled", category: "actions", type: "COLOR", description: "Secondary action disabled background", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
31
|
+
{ name: "color/semantic/actions/secondary/border/default", category: "actions", type: "COLOR", description: "Secondary action border", lightRef: "color/primitive/neutral/300", darkRef: "color/primitive/neutral/600" },
|
|
32
|
+
{ name: "color/semantic/actions/destructive/bg/default", category: "actions", type: "COLOR", description: "Destructive action background", lightRef: "color/primitive/danger/500", darkRef: "color/primitive/danger/400" },
|
|
33
|
+
{ name: "color/semantic/actions/destructive/bg/hover", category: "actions", type: "COLOR", description: "Destructive action hover background", lightRef: "color/primitive/danger/600", darkRef: "color/primitive/danger/300" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const SURFACE: SemanticTokenEntry[] = [
|
|
37
|
+
{ name: "color/semantic/surface/default", category: "surface", type: "COLOR", description: "Default surface background", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/950" },
|
|
38
|
+
{ name: "color/semantic/surface/subtle", category: "surface", type: "COLOR", description: "Subtle surface background", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/900" },
|
|
39
|
+
{ name: "color/semantic/surface/raised", category: "surface", type: "COLOR", description: "Raised/card surface", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/900" },
|
|
40
|
+
{ name: "color/semantic/surface/overlay", category: "surface", type: "COLOR", description: "Overlay/modal surface", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/800" },
|
|
41
|
+
{ name: "color/semantic/surface/inverse", category: "surface", type: "COLOR", description: "Inverse surface (dark on light)", lightRef: "color/primitive/neutral/900", darkRef: "color/primitive/neutral/50" },
|
|
42
|
+
{ name: "color/semantic/surface/disabled", category: "surface", type: "COLOR", description: "Disabled surface background", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const TEXT: SemanticTokenEntry[] = [
|
|
46
|
+
{ name: "color/semantic/text/primary", category: "text", type: "COLOR", description: "Primary text color", lightRef: "color/primitive/neutral/900", darkRef: "color/primitive/neutral/50" },
|
|
47
|
+
{ name: "color/semantic/text/secondary", category: "text", type: "COLOR", description: "Secondary text color", lightRef: "color/primitive/neutral/600", darkRef: "color/primitive/neutral/300" },
|
|
48
|
+
{ name: "color/semantic/text/tertiary", category: "text", type: "COLOR", description: "Tertiary/muted text color", lightRef: "color/primitive/neutral/500", darkRef: "color/primitive/neutral/400" },
|
|
49
|
+
{ name: "color/semantic/text/disabled", category: "text", type: "COLOR", description: "Disabled text color", lightRef: "color/primitive/neutral/400", darkRef: "color/primitive/neutral/600" },
|
|
50
|
+
{ name: "color/semantic/text/inverse", category: "text", type: "COLOR", description: "Inverse text (light on dark)", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/900" },
|
|
51
|
+
{ name: "color/semantic/text/on-color", category: "text", type: "COLOR", description: "Text on colored background", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/50" },
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const BORDER: SemanticTokenEntry[] = [
|
|
55
|
+
{ name: "color/semantic/border/default", category: "border", type: "COLOR", description: "Default border color", lightRef: "color/primitive/neutral/200", darkRef: "color/primitive/neutral/700" },
|
|
56
|
+
{ name: "color/semantic/border/strong", category: "border", type: "COLOR", description: "Strong/emphasis border", lightRef: "color/primitive/neutral/400", darkRef: "color/primitive/neutral/500" },
|
|
57
|
+
{ name: "color/semantic/border/subtle", category: "border", type: "COLOR", description: "Subtle border", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
58
|
+
{ name: "color/semantic/border/disabled", category: "border", type: "COLOR", description: "Disabled border", lightRef: "color/primitive/neutral/200", darkRef: "color/primitive/neutral/800" },
|
|
59
|
+
{ name: "color/semantic/border/focus", category: "border", type: "COLOR", description: "Focus ring border", lightRef: "color/primitive/brand/500", darkRef: "color/primitive/brand/400" },
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const FIELD: SemanticTokenEntry[] = [
|
|
63
|
+
{ name: "color/semantic/field/bg/default", category: "field", type: "COLOR", description: "Field background default", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/900" },
|
|
64
|
+
{ name: "color/semantic/field/bg/disabled", category: "field", type: "COLOR", description: "Field background disabled", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
65
|
+
{ name: "color/semantic/field/border/default", category: "field", type: "COLOR", description: "Field border default", lightRef: "color/primitive/neutral/300", darkRef: "color/primitive/neutral/600" },
|
|
66
|
+
{ name: "color/semantic/field/border/focus", category: "field", type: "COLOR", description: "Field border focus", lightRef: "color/primitive/brand/500", darkRef: "color/primitive/brand/400" },
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const FEEDBACK: SemanticTokenEntry[] = [
|
|
70
|
+
{ name: "color/semantic/feedback/success/bg", category: "feedback", type: "COLOR", description: "Success background", lightRef: "color/primitive/success/100", darkRef: "color/primitive/success/900" },
|
|
71
|
+
{ name: "color/semantic/feedback/success/text", category: "feedback", type: "COLOR", description: "Success text", lightRef: "color/primitive/success/700", darkRef: "color/primitive/success/300" },
|
|
72
|
+
{ name: "color/semantic/feedback/warning/bg", category: "feedback", type: "COLOR", description: "Warning background", lightRef: "color/primitive/warning/100", darkRef: "color/primitive/warning/900" },
|
|
73
|
+
{ name: "color/semantic/feedback/warning/text", category: "feedback", type: "COLOR", description: "Warning text", lightRef: "color/primitive/warning/700", darkRef: "color/primitive/warning/300" },
|
|
74
|
+
{ name: "color/semantic/feedback/danger/bg", category: "feedback", type: "COLOR", description: "Danger background", lightRef: "color/primitive/danger/100", darkRef: "color/primitive/danger/900" },
|
|
75
|
+
{ name: "color/semantic/feedback/danger/text", category: "feedback", type: "COLOR", description: "Danger text", lightRef: "color/primitive/danger/700", darkRef: "color/primitive/danger/300" },
|
|
76
|
+
{ name: "color/semantic/feedback/info/bg", category: "feedback", type: "COLOR", description: "Info background", lightRef: "color/primitive/info/100", darkRef: "color/primitive/info/900" },
|
|
77
|
+
{ name: "color/semantic/feedback/info/text", category: "feedback", type: "COLOR", description: "Info text", lightRef: "color/primitive/info/700", darkRef: "color/primitive/info/300" },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const FOCUS: SemanticTokenEntry[] = [
|
|
81
|
+
{ name: "color/semantic/focus/ring", category: "focus", type: "COLOR", description: "Focus ring color", lightRef: "color/primitive/brand/500", darkRef: "color/primitive/brand/400" },
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
const INTERACTIVE: SemanticTokenEntry[] = [
|
|
85
|
+
{ name: "color/semantic/interactive/hover-overlay", category: "interactive", type: "COLOR", description: "Hover overlay tint", lightRef: "color/primitive/neutral/100", darkRef: "color/primitive/neutral/800" },
|
|
86
|
+
{ name: "color/semantic/interactive/pressed-overlay", category: "interactive", type: "COLOR", description: "Pressed overlay tint", lightRef: "color/primitive/neutral/200", darkRef: "color/primitive/neutral/700" },
|
|
87
|
+
{ name: "color/semantic/interactive/selected-bg", category: "interactive", type: "COLOR", description: "Selected item background", lightRef: "color/primitive/brand/50", darkRef: "color/primitive/brand/900" },
|
|
88
|
+
{ name: "color/semantic/interactive/selected-text", category: "interactive", type: "COLOR", description: "Selected item text", lightRef: "color/primitive/brand/700", darkRef: "color/primitive/brand/200" },
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
// ─── Float semantic tokens ──────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
const SPACING_SEMANTIC: SemanticTokenEntry[] = [
|
|
94
|
+
{ name: "space/semantic/inset/control/sm", category: "spacing", type: "FLOAT", description: "Control inset padding small", lightRef: "space/1", darkRef: "space/1" },
|
|
95
|
+
{ name: "space/semantic/inset/control/md", category: "spacing", type: "FLOAT", description: "Control inset padding medium", lightRef: "space/4", darkRef: "space/4" },
|
|
96
|
+
{ name: "space/semantic/inset/control/lg", category: "spacing", type: "FLOAT", description: "Control inset padding large", lightRef: "space/6", darkRef: "space/6" },
|
|
97
|
+
{ name: "space/semantic/inset/page", category: "spacing", type: "FLOAT", description: "Page-level inset padding", lightRef: "space/6", darkRef: "space/6" },
|
|
98
|
+
{ name: "space/semantic/inset/page/compact", category: "spacing", type: "FLOAT", description: "Compact page inset padding", lightRef: "space/4", darkRef: "space/4" },
|
|
99
|
+
{ name: "space/semantic/gap/stack/sm", category: "spacing", type: "FLOAT", description: "Vertical stack gap small", lightRef: "space/2", darkRef: "space/2" },
|
|
100
|
+
{ name: "space/semantic/gap/stack/md", category: "spacing", type: "FLOAT", description: "Vertical stack gap medium", lightRef: "space/4", darkRef: "space/4" },
|
|
101
|
+
{ name: "space/semantic/gap/stack/lg", category: "spacing", type: "FLOAT", description: "Vertical stack gap large", lightRef: "space/8", darkRef: "space/8" },
|
|
102
|
+
{ name: "space/semantic/gap/inline/sm", category: "spacing", type: "FLOAT", description: "Horizontal inline gap small", lightRef: "space/1", darkRef: "space/1" },
|
|
103
|
+
{ name: "space/semantic/gap/inline/md", category: "spacing", type: "FLOAT", description: "Horizontal inline gap medium", lightRef: "space/3", darkRef: "space/3" },
|
|
104
|
+
{ name: "space/semantic/gap/inline/lg", category: "spacing", type: "FLOAT", description: "Horizontal inline gap large", lightRef: "space/6", darkRef: "space/6" },
|
|
105
|
+
{ name: "space/semantic/gap/section", category: "spacing", type: "FLOAT", description: "Section-level vertical gap", lightRef: "space/12", darkRef: "space/12" },
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
const RADIUS_SEMANTIC: SemanticTokenEntry[] = [
|
|
109
|
+
{ name: "radius/semantic/field/default", category: "radius", type: "FLOAT", description: "Field border radius", lightRef: "radius/sm", darkRef: "radius/sm" },
|
|
110
|
+
{ name: "radius/semantic/surface/default", category: "radius", type: "FLOAT", description: "Surface border radius", lightRef: "radius/lg", darkRef: "radius/lg" },
|
|
111
|
+
{ name: "radius/semantic/pill", category: "radius", type: "FLOAT", description: "Pill / full radius", lightRef: "radius/full", darkRef: "radius/full" },
|
|
112
|
+
{ name: "radius/semantic/control/default", category: "radius", type: "FLOAT", description: "Control border radius", lightRef: "radius/md", darkRef: "radius/md" },
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
// ─── Elevation / Shadow tokens ──────────────────────────────────────────────
|
|
116
|
+
|
|
117
|
+
const ELEVATION: SemanticTokenEntry[] = [
|
|
118
|
+
{ name: "elevation/semantic/shadow/xs", category: "elevation", type: "STRING", description: "Extra-small shadow for subtle depth", lightRef: "0 1px 2px rgba(0,0,0,0.05)", darkRef: "0 1px 2px rgba(0,0,0,0.20)" },
|
|
119
|
+
{ name: "elevation/semantic/shadow/sm", category: "elevation", type: "STRING", description: "Small shadow for cards and raised elements", lightRef: "0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)", darkRef: "0 2px 8px rgba(0,0,0,0.24), 0 1px 2px rgba(0,0,0,0.16)" },
|
|
120
|
+
{ name: "elevation/semantic/shadow/md", category: "elevation", type: "STRING", description: "Medium shadow for dropdowns and popovers", lightRef: "0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04)", darkRef: "0 4px 16px rgba(0,0,0,0.32), 0 2px 4px rgba(0,0,0,0.16)" },
|
|
121
|
+
{ name: "elevation/semantic/shadow/lg", category: "elevation", type: "STRING", description: "Large shadow for modals and dialogs", lightRef: "0 8px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04)", darkRef: "0 8px 32px rgba(0,0,0,0.40), 0 4px 8px rgba(0,0,0,0.16)" },
|
|
122
|
+
{ name: "elevation/semantic/shadow/xl", category: "elevation", type: "STRING", description: "Extra-large shadow for notifications", lightRef: "0 24px 64px rgba(0,0,0,0.14)", darkRef: "0 24px 64px rgba(0,0,0,0.56)" },
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
// ─── Motion / Animation tokens ──────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
const MOTION: SemanticTokenEntry[] = [
|
|
128
|
+
// Durations
|
|
129
|
+
{ name: "motion/duration/instant", category: "motion", type: "FLOAT", description: "Instant feedback (0ms)", lightRef: "0", darkRef: "0" },
|
|
130
|
+
{ name: "motion/duration/fast", category: "motion", type: "FLOAT", description: "Micro-interactions (100ms)", lightRef: "100", darkRef: "100" },
|
|
131
|
+
{ name: "motion/duration/normal", category: "motion", type: "FLOAT", description: "Standard transitions (200ms)", lightRef: "200", darkRef: "200" },
|
|
132
|
+
{ name: "motion/duration/slow", category: "motion", type: "FLOAT", description: "Emphasis transitions (300ms)", lightRef: "300", darkRef: "300" },
|
|
133
|
+
{ name: "motion/duration/slower", category: "motion", type: "FLOAT", description: "Complex animations (500ms)", lightRef: "500", darkRef: "500" },
|
|
134
|
+
// Easing curves
|
|
135
|
+
{ name: "motion/easing/productive", category: "motion", type: "STRING", description: "Productive motion curve", lightRef: "cubic-bezier(0.2, 0, 0.38, 0.9)", darkRef: "cubic-bezier(0.2, 0, 0.38, 0.9)" },
|
|
136
|
+
{ name: "motion/easing/expressive", category: "motion", type: "STRING", description: "Expressive motion curve", lightRef: "cubic-bezier(0.4, 0.14, 0.3, 1)", darkRef: "cubic-bezier(0.4, 0.14, 0.3, 1)" },
|
|
137
|
+
{ name: "motion/easing/enter", category: "motion", type: "STRING", description: "Enter/appear easing", lightRef: "cubic-bezier(0, 0, 0.3, 1)", darkRef: "cubic-bezier(0, 0, 0.3, 1)" },
|
|
138
|
+
{ name: "motion/easing/exit", category: "motion", type: "STRING", description: "Exit/disappear easing", lightRef: "cubic-bezier(0.4, 0, 1, 1)", darkRef: "cubic-bezier(0.4, 0, 1, 1)" },
|
|
139
|
+
{ name: "motion/easing/linear", category: "motion", type: "STRING", description: "Linear motion (no easing)", lightRef: "cubic-bezier(0, 0, 1, 1)", darkRef: "cubic-bezier(0, 0, 1, 1)" },
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
// ─── Z-index tokens ─────────────────────────────────────────────────────────
|
|
143
|
+
|
|
144
|
+
const Z_INDEX: SemanticTokenEntry[] = [
|
|
145
|
+
{ name: "z-index/semantic/base", category: "z-index", type: "FLOAT", description: "Base stacking level", lightRef: "0", darkRef: "0" },
|
|
146
|
+
{ name: "z-index/semantic/dropdown", category: "z-index", type: "FLOAT", description: "Dropdown menu layer", lightRef: "1000", darkRef: "1000" },
|
|
147
|
+
{ name: "z-index/semantic/sticky", category: "z-index", type: "FLOAT", description: "Sticky header layer", lightRef: "1100", darkRef: "1100" },
|
|
148
|
+
{ name: "z-index/semantic/modal", category: "z-index", type: "FLOAT", description: "Modal/dialog layer", lightRef: "1300", darkRef: "1300" },
|
|
149
|
+
{ name: "z-index/semantic/popover", category: "z-index", type: "FLOAT", description: "Popover layer", lightRef: "1400", darkRef: "1400" },
|
|
150
|
+
{ name: "z-index/semantic/toast", category: "z-index", type: "FLOAT", description: "Toast notification layer", lightRef: "1500", darkRef: "1500" },
|
|
151
|
+
{ name: "z-index/semantic/tooltip", category: "z-index", type: "FLOAT", description: "Tooltip layer", lightRef: "1600", darkRef: "1600" },
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
// ─── Opacity tokens ─────────────────────────────────────────────────────────
|
|
155
|
+
|
|
156
|
+
const OPACITY: SemanticTokenEntry[] = [
|
|
157
|
+
{ name: "opacity/semantic/disabled", category: "opacity", type: "FLOAT", description: "Disabled element opacity", lightRef: "0.4", darkRef: "0.4" },
|
|
158
|
+
{ name: "opacity/semantic/hover-overlay", category: "opacity", type: "FLOAT", description: "Hover overlay opacity", lightRef: "0.08", darkRef: "0.08" },
|
|
159
|
+
{ name: "opacity/semantic/backdrop", category: "opacity", type: "FLOAT", description: "Modal backdrop opacity", lightRef: "0.5", darkRef: "0.5" },
|
|
160
|
+
{ name: "opacity/semantic/loading", category: "opacity", type: "FLOAT", description: "Loading state opacity", lightRef: "0.6", darkRef: "0.6" },
|
|
161
|
+
];
|
|
162
|
+
|
|
163
|
+
// ─── Border-width tokens ────────────────────────────────────────────────────
|
|
164
|
+
|
|
165
|
+
const BORDER_WIDTH: SemanticTokenEntry[] = [
|
|
166
|
+
{ name: "border-width/semantic/thin", category: "border-width", type: "FLOAT", description: "Thin border (1px)", lightRef: "1", darkRef: "1" },
|
|
167
|
+
{ name: "border-width/semantic/medium", category: "border-width", type: "FLOAT", description: "Medium border (2px)", lightRef: "2", darkRef: "2" },
|
|
168
|
+
{ name: "border-width/semantic/thick", category: "border-width", type: "FLOAT", description: "Thick border (3px)", lightRef: "3", darkRef: "3" },
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
// ─── Typography detail tokens ───────────────────────────────────────────────
|
|
172
|
+
|
|
173
|
+
const TYPOGRAPHY: SemanticTokenEntry[] = [
|
|
174
|
+
// Font weights
|
|
175
|
+
{ name: "typography/font-weight/regular", category: "typography", type: "FLOAT", description: "Regular weight (400)", lightRef: "400", darkRef: "400" },
|
|
176
|
+
{ name: "typography/font-weight/medium", category: "typography", type: "FLOAT", description: "Medium weight (500)", lightRef: "500", darkRef: "500" },
|
|
177
|
+
{ name: "typography/font-weight/semibold", category: "typography", type: "FLOAT", description: "Semibold weight (600)", lightRef: "600", darkRef: "600" },
|
|
178
|
+
{ name: "typography/font-weight/bold", category: "typography", type: "FLOAT", description: "Bold weight (700)", lightRef: "700", darkRef: "700" },
|
|
179
|
+
// Line heights
|
|
180
|
+
{ name: "typography/line-height/tight", category: "typography", type: "FLOAT", description: "Tight line height (1.1)", lightRef: "1.1", darkRef: "1.1" },
|
|
181
|
+
{ name: "typography/line-height/snug", category: "typography", type: "FLOAT", description: "Snug line height (1.3)", lightRef: "1.3", darkRef: "1.3" },
|
|
182
|
+
{ name: "typography/line-height/normal", category: "typography", type: "FLOAT", description: "Normal line height (1.5)", lightRef: "1.5", darkRef: "1.5" },
|
|
183
|
+
{ name: "typography/line-height/relaxed", category: "typography", type: "FLOAT", description: "Relaxed line height (1.6)", lightRef: "1.6", darkRef: "1.6" },
|
|
184
|
+
// Letter spacing
|
|
185
|
+
{ name: "typography/letter-spacing/tight", category: "typography", type: "FLOAT", description: "Tight letter spacing (-0.03em)", lightRef: "-0.03", darkRef: "-0.03" },
|
|
186
|
+
{ name: "typography/letter-spacing/normal", category: "typography", type: "FLOAT", description: "Normal letter spacing (0)", lightRef: "0", darkRef: "0" },
|
|
187
|
+
{ name: "typography/letter-spacing/wide", category: "typography", type: "FLOAT", description: "Wide letter spacing (0.05em)", lightRef: "0.05", darkRef: "0.05" },
|
|
188
|
+
{ name: "typography/letter-spacing/widest", category: "typography", type: "FLOAT", description: "Widest letter spacing (0.1em)", lightRef: "0.1", darkRef: "0.1" },
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
// ─── Icon size tokens ───────────────────────────────────────────────────────
|
|
192
|
+
|
|
193
|
+
const ICON_SIZE: SemanticTokenEntry[] = [
|
|
194
|
+
{ name: "icon-size/semantic/xs", category: "icon-size", type: "FLOAT", description: "Extra-small icon (16px)", lightRef: "16", darkRef: "16" },
|
|
195
|
+
{ name: "icon-size/semantic/sm", category: "icon-size", type: "FLOAT", description: "Small icon (20px)", lightRef: "20", darkRef: "20" },
|
|
196
|
+
{ name: "icon-size/semantic/md", category: "icon-size", type: "FLOAT", description: "Medium icon (24px)", lightRef: "24", darkRef: "24" },
|
|
197
|
+
{ name: "icon-size/semantic/lg", category: "icon-size", type: "FLOAT", description: "Large icon (32px)", lightRef: "32", darkRef: "32" },
|
|
198
|
+
{ name: "icon-size/semantic/xl", category: "icon-size", type: "FLOAT", description: "Extra-large icon (40px)", lightRef: "40", darkRef: "40" },
|
|
199
|
+
];
|
|
200
|
+
|
|
201
|
+
// ─── Icon color tokens ─────────────────────────────────────────────────────
|
|
202
|
+
|
|
203
|
+
const ICON_COLOR: SemanticTokenEntry[] = [
|
|
204
|
+
{ name: "color/semantic/icon/default", category: "icon", type: "COLOR", description: "Default icon color (inherits text)", lightRef: "color/primitive/neutral/900", darkRef: "color/primitive/neutral/50" },
|
|
205
|
+
{ name: "color/semantic/icon/primary", category: "icon", type: "COLOR", description: "Brand primary icon color", lightRef: "color/primitive/brand/500", darkRef: "color/primitive/brand/400" },
|
|
206
|
+
{ name: "color/semantic/icon/secondary", category: "icon", type: "COLOR", description: "Muted/supporting icon color", lightRef: "color/primitive/neutral/500", darkRef: "color/primitive/neutral/400" },
|
|
207
|
+
{ name: "color/semantic/icon/disabled", category: "icon", type: "COLOR", description: "Disabled icon color", lightRef: "color/primitive/neutral/300", darkRef: "color/primitive/neutral/600" },
|
|
208
|
+
{ name: "color/semantic/icon/inverse", category: "icon", type: "COLOR", description: "Icon on dark/inverse backgrounds", lightRef: "color/primitive/neutral/50", darkRef: "color/primitive/neutral/900" },
|
|
209
|
+
{ name: "color/semantic/icon/error", category: "icon", type: "COLOR", description: "Error/destructive icon color", lightRef: "color/primitive/danger/500", darkRef: "color/primitive/danger/400" },
|
|
210
|
+
{ name: "color/semantic/icon/success", category: "icon", type: "COLOR", description: "Success/positive icon color", lightRef: "color/primitive/success/500", darkRef: "color/primitive/success/400" },
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
// ─── Breakpoint tokens ──────────────────────────────────────────────────────
|
|
214
|
+
|
|
215
|
+
const BREAKPOINT: SemanticTokenEntry[] = [
|
|
216
|
+
{ name: "breakpoint/mobile", category: "breakpoint", type: "FLOAT", description: "Mobile breakpoint (480px)", lightRef: "480", darkRef: "480" },
|
|
217
|
+
{ name: "breakpoint/tablet", category: "breakpoint", type: "FLOAT", description: "Tablet breakpoint (768px)", lightRef: "768", darkRef: "768" },
|
|
218
|
+
{ name: "breakpoint/desktop", category: "breakpoint", type: "FLOAT", description: "Desktop breakpoint (1024px)", lightRef: "1024", darkRef: "1024" },
|
|
219
|
+
{ name: "breakpoint/wide", category: "breakpoint", type: "FLOAT", description: "Wide breakpoint (1440px)", lightRef: "1440", darkRef: "1440" },
|
|
220
|
+
];
|
|
221
|
+
|
|
222
|
+
// ─── Grid / Layout tokens ───────────────────────────────────────────────────
|
|
223
|
+
|
|
224
|
+
const GRID: SemanticTokenEntry[] = [
|
|
225
|
+
{ name: "grid/columns/mobile", category: "grid", type: "FLOAT", description: "Grid columns on mobile (4)", lightRef: "4", darkRef: "4" },
|
|
226
|
+
{ name: "grid/columns/tablet", category: "grid", type: "FLOAT", description: "Grid columns on tablet (8)", lightRef: "8", darkRef: "8" },
|
|
227
|
+
{ name: "grid/columns/desktop", category: "grid", type: "FLOAT", description: "Grid columns on desktop (12)", lightRef: "12", darkRef: "12" },
|
|
228
|
+
{ name: "grid/gutter/mobile", category: "grid", type: "FLOAT", description: "Grid gutter on mobile (16px)", lightRef: "16", darkRef: "16" },
|
|
229
|
+
{ name: "grid/gutter/tablet", category: "grid", type: "FLOAT", description: "Grid gutter on tablet (24px)", lightRef: "24", darkRef: "24" },
|
|
230
|
+
{ name: "grid/gutter/desktop", category: "grid", type: "FLOAT", description: "Grid gutter on desktop (32px)", lightRef: "32", darkRef: "32" },
|
|
231
|
+
{ name: "grid/margin/mobile", category: "grid", type: "FLOAT", description: "Grid margin on mobile (16px)", lightRef: "16", darkRef: "16" },
|
|
232
|
+
{ name: "grid/margin/tablet", category: "grid", type: "FLOAT", description: "Grid margin on tablet (32px)", lightRef: "32", darkRef: "32" },
|
|
233
|
+
{ name: "grid/margin/desktop", category: "grid", type: "FLOAT", description: "Grid margin on desktop (64px)", lightRef: "64", darkRef: "64" },
|
|
234
|
+
];
|
|
235
|
+
|
|
236
|
+
// ─── Density tokens ─────────────────────────────────────────────────────────
|
|
237
|
+
|
|
238
|
+
const DENSITY: SemanticTokenEntry[] = [
|
|
239
|
+
{ name: "density/compact", category: "density", type: "FLOAT", description: "Compact control height (32px)", lightRef: "32", darkRef: "32" },
|
|
240
|
+
{ name: "density/normal", category: "density", type: "FLOAT", description: "Normal control height (40px)", lightRef: "40", darkRef: "40" },
|
|
241
|
+
{ name: "density/spacious", category: "density", type: "FLOAT", description: "Spacious control height (48px)", lightRef: "48", darkRef: "48" },
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
// ─── Aggregate catalog ──────────────────────────────────────────────────────
|
|
245
|
+
|
|
246
|
+
export const SEMANTIC_TOKEN_CATALOG: SemanticTokenEntry[] = [
|
|
247
|
+
...ACTIONS,
|
|
248
|
+
...SURFACE,
|
|
249
|
+
...TEXT,
|
|
250
|
+
...BORDER,
|
|
251
|
+
...FIELD,
|
|
252
|
+
...FEEDBACK,
|
|
253
|
+
...FOCUS,
|
|
254
|
+
...INTERACTIVE,
|
|
255
|
+
...SPACING_SEMANTIC,
|
|
256
|
+
...RADIUS_SEMANTIC,
|
|
257
|
+
...ELEVATION,
|
|
258
|
+
...MOTION,
|
|
259
|
+
...Z_INDEX,
|
|
260
|
+
...OPACITY,
|
|
261
|
+
...BORDER_WIDTH,
|
|
262
|
+
...TYPOGRAPHY,
|
|
263
|
+
...ICON_SIZE,
|
|
264
|
+
...ICON_COLOR,
|
|
265
|
+
...BREAKPOINT,
|
|
266
|
+
...GRID,
|
|
267
|
+
...DENSITY,
|
|
268
|
+
];
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Filter catalog entries by category.
|
|
272
|
+
*/
|
|
273
|
+
export function getTokensByCategory(category: string): SemanticTokenEntry[] {
|
|
274
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.category === category);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Get all unique categories in the catalog.
|
|
279
|
+
*/
|
|
280
|
+
export function getCategories(): string[] {
|
|
281
|
+
return [...new Set(SEMANTIC_TOKEN_CATALOG.map((t) => t.category))];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Get only COLOR-type semantic tokens.
|
|
286
|
+
*/
|
|
287
|
+
export function getColorSemanticTokens(): SemanticTokenEntry[] {
|
|
288
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.type === "COLOR");
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Get only FLOAT-type semantic tokens (spacing, radius, z-index, etc.).
|
|
293
|
+
*/
|
|
294
|
+
export function getFloatSemanticTokens(): SemanticTokenEntry[] {
|
|
295
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.type === "FLOAT");
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Get only STRING-type semantic tokens (shadows, easing curves).
|
|
300
|
+
*/
|
|
301
|
+
export function getStringSemanticTokens(): SemanticTokenEntry[] {
|
|
302
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.type === "STRING");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Get elevation/shadow tokens.
|
|
307
|
+
*/
|
|
308
|
+
export function getElevationTokens(): SemanticTokenEntry[] {
|
|
309
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.category === "elevation");
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Get motion tokens (durations and easing curves).
|
|
314
|
+
*/
|
|
315
|
+
export function getMotionTokens(): SemanticTokenEntry[] {
|
|
316
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.category === "motion");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Get typography detail tokens (weights, line-heights, letter-spacing).
|
|
321
|
+
*/
|
|
322
|
+
export function getTypographyTokens(): SemanticTokenEntry[] {
|
|
323
|
+
return SEMANTIC_TOKEN_CATALOG.filter((t) => t.category === "typography");
|
|
324
|
+
}
|