@design-ai/cli 4.55.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/.claude-plugin/plugin.json +164 -0
- package/AGENTS.ko.md +126 -0
- package/AGENTS.md +182 -0
- package/CHANGELOG.md +6883 -0
- package/CLAUDE.md +39 -0
- package/LICENSE +21 -0
- package/README.ko.md +245 -0
- package/README.md +277 -0
- package/agents/README.md +14 -0
- package/agents/a11y-reviewer.md +121 -0
- package/agents/component-architect.md +57 -0
- package/agents/design-critic.md +46 -0
- package/agents/token-extractor.md +63 -0
- package/cli/bin/design-ai-mcp.mjs +6 -0
- package/cli/bin/design-ai.mjs +40 -0
- package/cli/commands/audit.mjs +111 -0
- package/cli/commands/check.mjs +226 -0
- package/cli/commands/doctor.mjs +141 -0
- package/cli/commands/examples.mjs +58 -0
- package/cli/commands/help.mjs +271 -0
- package/cli/commands/install.mjs +161 -0
- package/cli/commands/learn.mjs +1871 -0
- package/cli/commands/list.mjs +143 -0
- package/cli/commands/mcp.mjs +27 -0
- package/cli/commands/pack.mjs +211 -0
- package/cli/commands/prompt.mjs +199 -0
- package/cli/commands/route.mjs +247 -0
- package/cli/commands/search.mjs +60 -0
- package/cli/commands/show.mjs +52 -0
- package/cli/commands/site.mjs +558 -0
- package/cli/commands/status.mjs +161 -0
- package/cli/commands/uninstall.mjs +119 -0
- package/cli/commands/update.mjs +184 -0
- package/cli/commands/version.mjs +94 -0
- package/cli/commands/workspace.mjs +176 -0
- package/cli/lib/brief.mjs +52 -0
- package/cli/lib/check.mjs +642 -0
- package/cli/lib/dispatch.mjs +109 -0
- package/cli/lib/doctor.mjs +505 -0
- package/cli/lib/examples.mjs +258 -0
- package/cli/lib/exec.mjs +63 -0
- package/cli/lib/help-flags.mjs +5 -0
- package/cli/lib/learn.mjs +3694 -0
- package/cli/lib/log.mjs +47 -0
- package/cli/lib/mcp-server.mjs +426 -0
- package/cli/lib/output.mjs +101 -0
- package/cli/lib/pack.mjs +599 -0
- package/cli/lib/paths.mjs +63 -0
- package/cli/lib/prompt.mjs +603 -0
- package/cli/lib/route.mjs +740 -0
- package/cli/lib/search.mjs +158 -0
- package/cli/lib/show.mjs +161 -0
- package/cli/lib/signals.mjs +2337 -0
- package/cli/lib/site.mjs +6617 -0
- package/cli/lib/skill-proposals.mjs +2046 -0
- package/cli/lib/suggest.mjs +66 -0
- package/cli/lib/workspace.mjs +1056 -0
- package/commands/README.md +25 -0
- package/commands/component-spec.md +34 -0
- package/commands/conversational.md +44 -0
- package/commands/design-from-brief.md +141 -0
- package/commands/design-review.md +62 -0
- package/commands/document-from-brief.md +47 -0
- package/commands/extract-tokens.md +38 -0
- package/commands/game-ui.md +40 -0
- package/commands/illustration.md +37 -0
- package/commands/iterate.md +167 -0
- package/commands/motion-design.md +54 -0
- package/commands/palette-from-brand.md +50 -0
- package/commands/print.md +49 -0
- package/commands/slide-deck.md +46 -0
- package/commands/spatial.md +47 -0
- package/commands/stability-review.md +74 -0
- package/commands/video.md +42 -0
- package/commands/website-improvement.md +77 -0
- package/docs/AGENT-DEVELOPMENT.md +658 -0
- package/docs/AI-LEARNING.md +429 -0
- package/docs/AIDER-INTEGRATION.md +224 -0
- package/docs/ARCHITECTURE.ko.md +183 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/CODEX-INTEGRATION.md +311 -0
- package/docs/COMPANY-WEBSITE-DOGFOOD.ko.md +144 -0
- package/docs/COMPANY-WEBSITE-DOGFOOD.md +150 -0
- package/docs/COMPANY-WEBSITE-INTAKE-TEMPLATE.ko.md +153 -0
- package/docs/COMPANY-WEBSITE-INTAKE-TEMPLATE.md +154 -0
- package/docs/CONTRIBUTING.ko.md +203 -0
- package/docs/CONTRIBUTING.md +242 -0
- package/docs/CURSOR-INTEGRATION.md +220 -0
- package/docs/DISTRIBUTION.ko.md +248 -0
- package/docs/DISTRIBUTION.md +253 -0
- package/docs/DOGFOOD-FINDINGS.md +180 -0
- package/docs/DOGFOOD-V4-FINDINGS.md +139 -0
- package/docs/DOGFOOD-V4-MKDOCS-FINDINGS.md +233 -0
- package/docs/DOGFOOD-V4-NPM-FINDINGS.md +157 -0
- package/docs/DOGFOOD-V4-VSCODE-FINDINGS.md +135 -0
- package/docs/FIGMA-INTEGRATION.md +222 -0
- package/docs/MCP-INTEGRATION.md +243 -0
- package/docs/MIGRATION-v4.md +121 -0
- package/docs/PLUGIN-PACKAGING.md +240 -0
- package/docs/PRODUCT-READINESS.md +66 -0
- package/docs/QUICKSTART.ko.md +178 -0
- package/docs/QUICKSTART.md +179 -0
- package/docs/RELEASE-CHECKLIST.md +292 -0
- package/docs/ROADMAP.md +19495 -0
- package/docs/SESSION-LOG.md +940 -0
- package/docs/TOKEN-SYNC.md +237 -0
- package/docs/USING.ko.md +206 -0
- package/docs/USING.md +218 -0
- package/docs/WEBSITE-IMPROVEMENT.ko.md +75 -0
- package/docs/WEBSITE-IMPROVEMENT.md +89 -0
- package/docs/announcements/README.md +56 -0
- package/docs/announcements/dev-to-korea.md +206 -0
- package/docs/announcements/hashnode-post.ko.md +232 -0
- package/docs/announcements/okky-post.ko.md +158 -0
- package/docs/announcements/press-kit.md +101 -0
- package/docs/announcements/reddit-r-korea.md +196 -0
- package/docs/announcements/show-hn.md +114 -0
- package/docs/announcements/twitter-thread.md +255 -0
- package/docs/external-status.md +34 -0
- package/docs/integrations/aider-walkthrough.ko.md +275 -0
- package/docs/integrations/aider-walkthrough.md +274 -0
- package/docs/integrations/codex-walkthrough.ko.md +297 -0
- package/docs/integrations/codex-walkthrough.md +297 -0
- package/docs/integrations/cursor-walkthrough.ko.md +281 -0
- package/docs/integrations/cursor-walkthrough.md +284 -0
- package/docs/integrations/design-ai-mcp-server.md +169 -0
- package/docs/integrations/figma-mcp.md +149 -0
- package/docs/integrations/github-mcp.md +178 -0
- package/docs/integrations/linear-mcp.md +215 -0
- package/docs/integrations/notion-mcp.md +174 -0
- package/docs/integrations/sdk-walkthrough.ko.md +375 -0
- package/docs/integrations/sdk-walkthrough.md +375 -0
- package/docs/integrations/slack-mcp.md +208 -0
- package/docs/integrations/vscode-walkthrough.ko.md +202 -0
- package/docs/integrations/vscode-walkthrough.md +205 -0
- package/docs/requirements.txt +16 -0
- package/docs/site-overrides/extra.css +83 -0
- package/docs/site-overrides/favicon.svg +4 -0
- package/docs/site-overrides/logo.svg +10 -0
- package/docs/site-overrides/main.html +18 -0
- package/docs/website-console/app.js +2540 -0
- package/docs/website-console/index.html +24 -0
- package/docs/website-console/styles.css +975 -0
- package/examples/README.md +252 -0
- package/examples/cases/dogfood-v4-korean-hr-onboarding.md +356 -0
- package/examples/component-accordion-actions.md +153 -0
- package/examples/component-accordion-details.md +147 -0
- package/examples/component-accordion-summary.md +180 -0
- package/examples/component-accordion.md +229 -0
- package/examples/component-account-card.md +284 -0
- package/examples/component-address-input.md +260 -0
- package/examples/component-affix.md +190 -0
- package/examples/component-alert-dialog.md +210 -0
- package/examples/component-alert-title.md +77 -0
- package/examples/component-alert.md +192 -0
- package/examples/component-amount-input.md +278 -0
- package/examples/component-anchor.md +198 -0
- package/examples/component-app-bar.md +249 -0
- package/examples/component-aspect-ratio.md +156 -0
- package/examples/component-auto-complete.md +199 -0
- package/examples/component-avatar-group.md +170 -0
- package/examples/component-avatar.md +191 -0
- package/examples/component-back-top.md +123 -0
- package/examples/component-backdrop.md +148 -0
- package/examples/component-badge.md +181 -0
- package/examples/component-banner.md +237 -0
- package/examples/component-biometric-gate.md +281 -0
- package/examples/component-blockquote.md +153 -0
- package/examples/component-border-beam.md +207 -0
- package/examples/component-bottom-navigation.md +226 -0
- package/examples/component-box.md +112 -0
- package/examples/component-breadcrumb.md +222 -0
- package/examples/component-button-base.md +190 -0
- package/examples/component-button-group.md +117 -0
- package/examples/component-button.md +213 -0
- package/examples/component-calendar.md +280 -0
- package/examples/component-callout.md +131 -0
- package/examples/component-card-actions.md +101 -0
- package/examples/component-card-content.md +90 -0
- package/examples/component-card-header.md +122 -0
- package/examples/component-card-media.md +79 -0
- package/examples/component-card.md +233 -0
- package/examples/component-carousel.md +266 -0
- package/examples/component-cascader.md +135 -0
- package/examples/component-category-picker.md +271 -0
- package/examples/component-chart.md +237 -0
- package/examples/component-chat-interface.md +399 -0
- package/examples/component-checkbox.md +149 -0
- package/examples/component-click-away-listener.md +87 -0
- package/examples/component-code.md +213 -0
- package/examples/component-collapsible.md +219 -0
- package/examples/component-color-picker.md +110 -0
- package/examples/component-combobox.md +267 -0
- package/examples/component-command.md +299 -0
- package/examples/component-config-provider.md +190 -0
- package/examples/component-context-menu.md +179 -0
- package/examples/component-css-baseline.md +148 -0
- package/examples/component-date-picker.md +249 -0
- package/examples/component-descriptions.md +242 -0
- package/examples/component-dialog-actions.md +111 -0
- package/examples/component-dialog-content-text.md +76 -0
- package/examples/component-dialog-content.md +105 -0
- package/examples/component-dialog-title.md +104 -0
- package/examples/component-dialog.md +176 -0
- package/examples/component-divider.md +182 -0
- package/examples/component-doc-page.md +217 -0
- package/examples/component-drawer.md +257 -0
- package/examples/component-dropdown.md +220 -0
- package/examples/component-email-layout.md +253 -0
- package/examples/component-empty-state.md +269 -0
- package/examples/component-empty.md +172 -0
- package/examples/component-fade.md +87 -0
- package/examples/component-feature-grid.md +201 -0
- package/examples/component-field.md +266 -0
- package/examples/component-filled-input.md +114 -0
- package/examples/component-flex.md +117 -0
- package/examples/component-float-button.md +214 -0
- package/examples/component-form-control-label.md +134 -0
- package/examples/component-form-control.md +113 -0
- package/examples/component-form-controls.md +251 -0
- package/examples/component-form-group.md +86 -0
- package/examples/component-form-helper-text.md +95 -0
- package/examples/component-form-label.md +98 -0
- package/examples/component-form.md +291 -0
- package/examples/component-game-hud.md +362 -0
- package/examples/component-game-menu.md +327 -0
- package/examples/component-grid.md +140 -0
- package/examples/component-grow.md +79 -0
- package/examples/component-hero-block.md +252 -0
- package/examples/component-hover-card.md +211 -0
- package/examples/component-icon-button.md +142 -0
- package/examples/component-icon.md +102 -0
- package/examples/component-illustration.md +280 -0
- package/examples/component-image-list.md +107 -0
- package/examples/component-image.md +282 -0
- package/examples/component-input-adornment.md +101 -0
- package/examples/component-input-base.md +134 -0
- package/examples/component-input-number.md +141 -0
- package/examples/component-input-otp.md +271 -0
- package/examples/component-input.md +213 -0
- package/examples/component-item.md +243 -0
- package/examples/component-kbd.md +197 -0
- package/examples/component-krw-amount.md +219 -0
- package/examples/component-label.md +118 -0
- package/examples/component-layout.md +217 -0
- package/examples/component-link.md +223 -0
- package/examples/component-list-item-avatar.md +72 -0
- package/examples/component-list-item-button.md +139 -0
- package/examples/component-list-item-icon.md +82 -0
- package/examples/component-list-item-text.md +98 -0
- package/examples/component-list-item.md +116 -0
- package/examples/component-list-subheader.md +70 -0
- package/examples/component-list.md +198 -0
- package/examples/component-loading-button.md +125 -0
- package/examples/component-loading-sequence.md +254 -0
- package/examples/component-lottie-player.md +279 -0
- package/examples/component-masonry.md +191 -0
- package/examples/component-mentions.md +189 -0
- package/examples/component-menu-item.md +102 -0
- package/examples/component-menu-list.md +98 -0
- package/examples/component-menu.md +139 -0
- package/examples/component-menubar.md +259 -0
- package/examples/component-message.md +162 -0
- package/examples/component-mobile-stepper.md +155 -0
- package/examples/component-modal.md +220 -0
- package/examples/component-navigation-menu.md +295 -0
- package/examples/component-notification.md +166 -0
- package/examples/component-otp-countdown.md +245 -0
- package/examples/component-outlined-input.md +145 -0
- package/examples/component-page-transition.md +281 -0
- package/examples/component-pagination.md +226 -0
- package/examples/component-paper.md +199 -0
- package/examples/component-pass-auth.md +265 -0
- package/examples/component-payment-brand-button.md +253 -0
- package/examples/component-payment-method-selector.md +272 -0
- package/examples/component-payment-receipt.md +277 -0
- package/examples/component-popconfirm.md +144 -0
- package/examples/component-popover.md +239 -0
- package/examples/component-popper.md +129 -0
- package/examples/component-pricing-cards.md +247 -0
- package/examples/component-progress.md +195 -0
- package/examples/component-qr-code.md +201 -0
- package/examples/component-radio.md +167 -0
- package/examples/component-rate.md +202 -0
- package/examples/component-resizable.md +163 -0
- package/examples/component-result.md +270 -0
- package/examples/component-scroll-area.md +199 -0
- package/examples/component-scroll-reveal.md +320 -0
- package/examples/component-segmented.md +178 -0
- package/examples/component-select.md +258 -0
- package/examples/component-separator.md +177 -0
- package/examples/component-sheet.md +277 -0
- package/examples/component-sidebar.md +257 -0
- package/examples/component-skeleton.md +178 -0
- package/examples/component-slide.md +89 -0
- package/examples/component-slider.md +208 -0
- package/examples/component-snackbar-content.md +92 -0
- package/examples/component-snackbar.md +121 -0
- package/examples/component-sonner.md +165 -0
- package/examples/component-space.md +125 -0
- package/examples/component-spatial-locomotion.md +373 -0
- package/examples/component-spatial-panel.md +330 -0
- package/examples/component-speed-dial-action.md +78 -0
- package/examples/component-speed-dial.md +177 -0
- package/examples/component-spin.md +173 -0
- package/examples/component-spinner.md +204 -0
- package/examples/component-splitter.md +210 -0
- package/examples/component-stack.md +130 -0
- package/examples/component-statistic.md +282 -0
- package/examples/component-step-button.md +157 -0
- package/examples/component-step-connector.md +157 -0
- package/examples/component-step-content.md +121 -0
- package/examples/component-step-icon.md +115 -0
- package/examples/component-step-label.md +101 -0
- package/examples/component-step.md +84 -0
- package/examples/component-steps.md +264 -0
- package/examples/component-stock-chart.md +251 -0
- package/examples/component-swipeable-drawer.md +149 -0
- package/examples/component-switch.md +99 -0
- package/examples/component-tab-scroll-button.md +180 -0
- package/examples/component-tab.md +120 -0
- package/examples/component-table-body.md +82 -0
- package/examples/component-table-cell.md +118 -0
- package/examples/component-table-container.md +75 -0
- package/examples/component-table-footer.md +72 -0
- package/examples/component-table-head.md +78 -0
- package/examples/component-table-pagination.md +137 -0
- package/examples/component-table-row.md +113 -0
- package/examples/component-table-sort-label.md +109 -0
- package/examples/component-table.md +202 -0
- package/examples/component-tabs.md +184 -0
- package/examples/component-tag-badge.md +309 -0
- package/examples/component-tag.md +102 -0
- package/examples/component-testimonial-carousel.md +218 -0
- package/examples/component-textarea-autosize.md +114 -0
- package/examples/component-textarea.md +173 -0
- package/examples/component-time-picker.md +205 -0
- package/examples/component-timeline.md +170 -0
- package/examples/component-toast.md +224 -0
- package/examples/component-toggle-button.md +129 -0
- package/examples/component-toggle.md +220 -0
- package/examples/component-toolbar.md +104 -0
- package/examples/component-tooltip.md +178 -0
- package/examples/component-tour.md +176 -0
- package/examples/component-transaction-list-item.md +243 -0
- package/examples/component-transfer.md +156 -0
- package/examples/component-tree-select.md +202 -0
- package/examples/component-tree.md +297 -0
- package/examples/component-typography.md +215 -0
- package/examples/component-upload.md +295 -0
- package/examples/component-video-hero.md +409 -0
- package/examples/component-video-player.md +340 -0
- package/examples/component-voice-input.md +408 -0
- package/examples/component-watermark.md +217 -0
- package/examples/component-zoom.md +92 -0
- package/examples/doc-explanation-example.md +196 -0
- package/examples/doc-how-to-example.md +205 -0
- package/examples/doc-tutorial-example.md +162 -0
- package/examples/dogfood-korean-fintech-system.md +433 -0
- package/examples/email-transactional-example.md +259 -0
- package/examples/palette-saas-violet.md +235 -0
- package/examples/print-business-card-spec.md +205 -0
- package/examples/print-packaging-spec.md +285 -0
- package/examples/report-example.md +228 -0
- package/examples/slide-deck-example.md +237 -0
- package/examples/website-improvement-report.md +128 -0
- package/examples/website-improvement-workspace.json +126 -0
- package/install.sh +189 -0
- package/knowledge/COVERAGE.md +740 -0
- package/knowledge/PRINCIPLES.md +108 -0
- package/knowledge/a11y/contrast.md +70 -0
- package/knowledge/a11y/keyboard-and-focus.md +108 -0
- package/knowledge/colors/color-theory.md +90 -0
- package/knowledge/colors/mui-palette-structure.md +105 -0
- package/knowledge/colors/palettes-by-product-type.md +876 -0
- package/knowledge/components/INDEX.md +231 -0
- package/knowledge/components/index.json +1470 -0
- package/knowledge/components/shadcn-registry.md +159 -0
- package/knowledge/conversational/ai-chat-interfaces.md +323 -0
- package/knowledge/conversational/chatbot-design.md +312 -0
- package/knowledge/conversational/conversational-ui-fundamentals.md +299 -0
- package/knowledge/conversational/korean-voice-conventions.md +281 -0
- package/knowledge/conversational/voice-ui-patterns.md +297 -0
- package/knowledge/design-tokens/ant-design.md +124 -0
- package/knowledge/design-tokens/material-3.md +235 -0
- package/knowledge/design-tokens/polaris-and-carbon.md +231 -0
- package/knowledge/design-tokens/tailwind-v4.md +284 -0
- package/knowledge/game-ui/game-accessibility.md +317 -0
- package/knowledge/game-ui/game-ui-fundamentals.md +281 -0
- package/knowledge/game-ui/hud-design.md +324 -0
- package/knowledge/game-ui/korean-gaming-conventions.md +312 -0
- package/knowledge/game-ui/menu-systems.md +388 -0
- package/knowledge/i18n/korean-app-store-visual.md +223 -0
- package/knowledge/i18n/korean-document-style.md +301 -0
- package/knowledge/i18n/korean-payments.md +211 -0
- package/knowledge/i18n/korean-product-conventions.md +96 -0
- package/knowledge/i18n/korean-publishing.md +139 -0
- package/knowledge/i18n/korean-typography.md +123 -0
- package/knowledge/icons/curated-sets.md +225 -0
- package/knowledge/illustration/hero-illustrations.md +234 -0
- package/knowledge/illustration/illustration-systems.md +221 -0
- package/knowledge/illustration/mascot-design.md +208 -0
- package/knowledge/illustration/spot-illustrations.md +246 -0
- package/knowledge/illustration/svg-optimization.md +308 -0
- package/knowledge/layout/spacing-and-grid.md +119 -0
- package/knowledge/motion/app-loading-sequences.md +277 -0
- package/knowledge/motion/choreography-depth.md +297 -0
- package/knowledge/motion/marketing-motion.md +223 -0
- package/knowledge/motion/micro-interactions.md +266 -0
- package/knowledge/motion/motion-tools.md +281 -0
- package/knowledge/motion/principles.md +126 -0
- package/knowledge/patterns/auth-flow-design.md +316 -0
- package/knowledge/patterns/b2b-onboarding-flows.md +182 -0
- package/knowledge/patterns/brand-identity.md +238 -0
- package/knowledge/patterns/brand-references.md +97 -0
- package/knowledge/patterns/chart-color-encoding.md +269 -0
- package/knowledge/patterns/chart-types.md +344 -0
- package/knowledge/patterns/dashboard-composition.md +299 -0
- package/knowledge/patterns/design-system-qa.md +356 -0
- package/knowledge/patterns/document-typography.md +248 -0
- package/knowledge/patterns/email-design.md +338 -0
- package/knowledge/patterns/empty-states.md +263 -0
- package/knowledge/patterns/error-states.md +318 -0
- package/knowledge/patterns/form-design.md +237 -0
- package/knowledge/patterns/information-architecture.md +341 -0
- package/knowledge/patterns/landing-hero-design.md +283 -0
- package/knowledge/patterns/landing-page-patterns.md +681 -0
- package/knowledge/patterns/list-and-feed.md +371 -0
- package/knowledge/patterns/mobile-navigation.md +278 -0
- package/knowledge/patterns/money-and-amount.md +301 -0
- package/knowledge/patterns/onboarding.md +300 -0
- package/knowledge/patterns/pricing-page-design.md +261 -0
- package/knowledge/patterns/realtime-data.md +280 -0
- package/knowledge/patterns/report-design.md +330 -0
- package/knowledge/patterns/search-ux.md +373 -0
- package/knowledge/patterns/settings-page.md +325 -0
- package/knowledge/patterns/slide-deck-design.md +316 -0
- package/knowledge/patterns/styles-catalog.md +2599 -0
- package/knowledge/patterns/technical-writing.md +306 -0
- package/knowledge/patterns/ui-reasoning.md +1853 -0
- package/knowledge/patterns/ux-guidelines.md +1454 -0
- package/knowledge/platforms/react-native.md +395 -0
- package/knowledge/print/brochures-and-flyers.md +276 -0
- package/knowledge/print/korean-print-conventions.md +284 -0
- package/knowledge/print/packaging.md +321 -0
- package/knowledge/print/print-fundamentals.md +238 -0
- package/knowledge/print/signage-and-posters.md +235 -0
- package/knowledge/print/stationery.md +262 -0
- package/knowledge/spatial/ar-patterns.md +253 -0
- package/knowledge/spatial/comfort-and-accessibility.md +245 -0
- package/knowledge/spatial/spatial-design-fundamentals.md +346 -0
- package/knowledge/spatial/spatial-ui-elements.md +343 -0
- package/knowledge/spatial/vr-patterns.md +302 -0
- package/knowledge/typography/font-pairings.md +332 -0
- package/knowledge/typography/mui-type-scale.md +57 -0
- package/knowledge/typography/type-scale-fundamentals.md +105 -0
- package/knowledge/video/in-product-video.md +277 -0
- package/knowledge/video/korean-video-conventions.md +247 -0
- package/knowledge/video/marketing-video.md +258 -0
- package/knowledge/video/social-and-short-form.md +257 -0
- package/knowledge/video/video-fundamentals.md +296 -0
- package/package.json +106 -0
- package/skills/README.md +39 -0
- package/skills/color-palette/PLAYBOOK.md +175 -0
- package/skills/color-palette/SKILL.md +6 -0
- package/skills/color-palette/TEMPLATE.md +103 -0
- package/skills/component-spec-writer/PLAYBOOK.md +169 -0
- package/skills/component-spec-writer/SKILL.md +6 -0
- package/skills/component-spec-writer/TEMPLATE.md +115 -0
- package/skills/conversational-ui-designer/PLAYBOOK.md +231 -0
- package/skills/conversational-ui-designer/SKILL.md +6 -0
- package/skills/design-broadcast/PLAYBOOK.md +146 -0
- package/skills/design-broadcast/SKILL.md +6 -0
- package/skills/design-critique/PLAYBOOK.md +137 -0
- package/skills/design-critique/SKILL.md +6 -0
- package/skills/design-pr-review/PLAYBOOK.md +171 -0
- package/skills/design-pr-review/SKILL.md +6 -0
- package/skills/design-system-builder/PLAYBOOK.md +218 -0
- package/skills/design-system-builder/SKILL.md +6 -0
- package/skills/design-system-qa/PLAYBOOK.md +163 -0
- package/skills/design-system-qa/SKILL.md +6 -0
- package/skills/document-author/PLAYBOOK.md +167 -0
- package/skills/document-author/SKILL.md +6 -0
- package/skills/figma-token-sync/PLAYBOOK.md +149 -0
- package/skills/figma-token-sync/SKILL.md +6 -0
- package/skills/game-ui-designer/PLAYBOOK.md +209 -0
- package/skills/game-ui-designer/SKILL.md +6 -0
- package/skills/handoff-spec/PLAYBOOK.md +170 -0
- package/skills/handoff-spec/SKILL.md +6 -0
- package/skills/illustration-designer/PLAYBOOK.md +166 -0
- package/skills/illustration-designer/SKILL.md +6 -0
- package/skills/motion-designer/PLAYBOOK.md +223 -0
- package/skills/motion-designer/SKILL.md +6 -0
- package/skills/print-designer/PLAYBOOK.md +209 -0
- package/skills/print-designer/SKILL.md +6 -0
- package/skills/slide-deck-author/PLAYBOOK.md +198 -0
- package/skills/slide-deck-author/SKILL.md +6 -0
- package/skills/spatial-designer/PLAYBOOK.md +238 -0
- package/skills/spatial-designer/SKILL.md +6 -0
- package/skills/ux-audit/PLAYBOOK.md +142 -0
- package/skills/ux-audit/SKILL.md +6 -0
- package/skills/video-designer/PLAYBOOK.md +240 -0
- package/skills/video-designer/SKILL.md +6 -0
- package/skills/website-improvement/PLAYBOOK.md +118 -0
- package/skills/website-improvement/SKILL.md +6 -0
- package/skills/website-improvement/TEMPLATE.md +103 -0
- package/tools/audit/changelog-generate.py +176 -0
- package/tools/audit/check-coverage.py +483 -0
- package/tools/audit/doctor_assertions.py +256 -0
- package/tools/audit/example-qa.py +108 -0
- package/tools/audit/frontmatter-check.py +199 -0
- package/tools/audit/integration-check.py +95 -0
- package/tools/audit/korean-copy-check.py +161 -0
- package/tools/audit/link-check.py +146 -0
- package/tools/audit/local-ci.py +558 -0
- package/tools/audit/package-contents.py +723 -0
- package/tools/audit/package-smoke.py +22443 -0
- package/tools/audit/raw-hex-check.py +252 -0
- package/tools/audit/registry-smoke.py +8188 -0
- package/tools/audit/release-metadata.py +9832 -0
- package/tools/audit/run-all.py +351 -0
- package/tools/audit/smoke_assertions.py +12742 -0
- package/tools/audit/stability-review.py +332 -0
- package/tools/audit/stale-check.py +156 -0
- package/tools/migrations/add-version-frontmatter.py +132 -0
- package/tools/migrations/bump-last-updated.py +131 -0
- package/tools/migrations/promote-stability.py +172 -0
- package/tools/preview/README.md +58 -0
- package/tools/preview/render-tokens.py +454 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# `Anchor` (scrollspy / TOC) — spec
|
|
2
|
+
|
|
3
|
+
> Citing Ant Design `Anchor`, MUI (no built-in), shadcn-ui (no built-in)
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
A side-rail navigation that highlights the current section as the user scrolls through long-form content. Used for: documentation pages, terms of service, long articles, settings sections.
|
|
8
|
+
|
|
9
|
+
## Anatomy
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌──────────────────────────────────────────┐
|
|
13
|
+
│ ┌─────┐ │
|
|
14
|
+
│ Section 1 heading │ §1 │ │
|
|
15
|
+
│ Body text... │ §2 │ │ ← TOC sidebar
|
|
16
|
+
│ │ §3 │ │ (active highlighted)
|
|
17
|
+
│ Section 2 heading │ §4 │ │
|
|
18
|
+
│ Body text... └─────┘ │
|
|
19
|
+
│ │
|
|
20
|
+
│ Section 3 heading (current) │
|
|
21
|
+
│ Body text... │
|
|
22
|
+
└──────────────────────────────────────────┘
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Slot | Required | Notes |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Anchor list | yes | TOC items with hierarchy |
|
|
28
|
+
| Active indicator | yes | Highlights the section the user is reading |
|
|
29
|
+
| Click to scroll | yes | Clicking an item scrolls smoothly to its target |
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<Anchor
|
|
35
|
+
items={[
|
|
36
|
+
{ key: "intro", title: "소개", href: "#intro" },
|
|
37
|
+
{ key: "install", title: "설치", href: "#install" },
|
|
38
|
+
{
|
|
39
|
+
key: "usage",
|
|
40
|
+
title: "사용법",
|
|
41
|
+
href: "#usage",
|
|
42
|
+
children: [
|
|
43
|
+
{ key: "basic", title: "기본 사용", href: "#basic" },
|
|
44
|
+
{ key: "advanced", title: "고급 사용", href: "#advanced" },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
]}
|
|
48
|
+
affix
|
|
49
|
+
offsetTop={64}
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Default | Description |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| `items` | `AnchorItem[]` | — | TOC entries (hierarchical) |
|
|
56
|
+
| `affix` | `boolean` | `true` | Stick to viewport on scroll |
|
|
57
|
+
| `offsetTop` | `number` | `0` | Top offset when sticky (e.g., for header) |
|
|
58
|
+
| `bounds` | `number` | `5` | Threshold for active detection |
|
|
59
|
+
| `targetOffset` | `number` | — | Account for sticky header on click-scroll |
|
|
60
|
+
| `onChange` | `(key: string) => void` | — | Active item changes |
|
|
61
|
+
| `onClick` | `(e, item) => void` | — | |
|
|
62
|
+
| `direction` | `"vertical" \| "horizontal"` | `"vertical"` | |
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
type AnchorItem = {
|
|
66
|
+
key: string;
|
|
67
|
+
title: string;
|
|
68
|
+
href: string; // CSS selector (e.g., "#section-1") or full URL
|
|
69
|
+
children?: AnchorItem[];
|
|
70
|
+
target?: string; // For external links
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Behavior
|
|
75
|
+
|
|
76
|
+
### Active section detection
|
|
77
|
+
|
|
78
|
+
Uses `IntersectionObserver` (modern browsers) or scroll listener:
|
|
79
|
+
- Watch each target section as user scrolls.
|
|
80
|
+
- The "active" section is the one currently in viewport.
|
|
81
|
+
- For overlapping sections: typically the one closest to top (or above the bounds threshold).
|
|
82
|
+
|
|
83
|
+
### Click to scroll
|
|
84
|
+
|
|
85
|
+
Clicking an anchor item scrolls smoothly to its target:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
const target = document.querySelector(item.href);
|
|
89
|
+
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For sticky headers: subtract the header height from scroll position via `scroll-margin-top: <headerHeight>` on target elements.
|
|
93
|
+
|
|
94
|
+
## States
|
|
95
|
+
|
|
96
|
+
| State | Visual |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| Default (inactive) | Light text |
|
|
99
|
+
| Active | Bold + accent color + colored left-border indicator |
|
|
100
|
+
| Hover | Slightly darker text |
|
|
101
|
+
| Focus-visible | 2px ring around item |
|
|
102
|
+
|
|
103
|
+
## Tokens consumed
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
--color-text-secondary (inactive items)
|
|
107
|
+
--color-text-primary (active item)
|
|
108
|
+
--color-primary-default (active indicator border)
|
|
109
|
+
--color-bg-default
|
|
110
|
+
--color-focus-ring
|
|
111
|
+
--space-xs, --space-sm
|
|
112
|
+
--font-size-sm
|
|
113
|
+
--motion-fast (scroll behavior)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Sizes
|
|
117
|
+
|
|
118
|
+
Typical width: 200–280px (desktop). Each item: ~32–40px height.
|
|
119
|
+
|
|
120
|
+
For dense docs with many sections: 240px width, 28px row height.
|
|
121
|
+
|
|
122
|
+
## Accessibility
|
|
123
|
+
|
|
124
|
+
- Container: `<nav aria-label="목차">`.
|
|
125
|
+
- TOC: `<ol>` with hierarchical nesting.
|
|
126
|
+
- Each item: `<a href>` (links).
|
|
127
|
+
- Current section: `aria-current="location"`.
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<nav aria-label="목차">
|
|
131
|
+
<ol>
|
|
132
|
+
<li><a href="#intro">소개</a></li>
|
|
133
|
+
<li><a href="#install" aria-current="location">설치</a></li>
|
|
134
|
+
<li>
|
|
135
|
+
<a href="#usage">사용법</a>
|
|
136
|
+
<ol>
|
|
137
|
+
<li><a href="#basic">기본 사용</a></li>
|
|
138
|
+
</ol>
|
|
139
|
+
</li>
|
|
140
|
+
</ol>
|
|
141
|
+
</nav>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Keyboard
|
|
145
|
+
|
|
146
|
+
| Key | Behavior |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `Tab` | Move through items |
|
|
149
|
+
| `Enter` | Activate (scroll to target) |
|
|
150
|
+
|
|
151
|
+
## Mobile
|
|
152
|
+
|
|
153
|
+
For mobile: typically hide Anchor (long-form on mobile uses different patterns — read top-to-bottom, no jumping). If shown:
|
|
154
|
+
- Render as collapsible drawer ("목차") on the side.
|
|
155
|
+
- Or: button at top "목차 보기" → opens dialog with TOC.
|
|
156
|
+
|
|
157
|
+
## Don't
|
|
158
|
+
|
|
159
|
+
- Don't show Anchor for content that's < 1 page tall.
|
|
160
|
+
- Don't auto-scroll the active item out of view in the rail (use `scroll-behavior: smooth` to keep it visible).
|
|
161
|
+
- Don't break browser back/forward — use URL hash sync.
|
|
162
|
+
- Don't render Anchor without unique `id`s on target sections.
|
|
163
|
+
|
|
164
|
+
## Code example
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
function DocsPage({ headings }: Props) {
|
|
168
|
+
return (
|
|
169
|
+
<div className="grid grid-cols-[1fr_240px] gap-8">
|
|
170
|
+
<article>
|
|
171
|
+
{headings.map(h => (
|
|
172
|
+
<section key={h.id} id={h.id} style={{ scrollMarginTop: 80 }}>
|
|
173
|
+
<h2>{h.title}</h2>
|
|
174
|
+
{h.content}
|
|
175
|
+
</section>
|
|
176
|
+
))}
|
|
177
|
+
</article>
|
|
178
|
+
<Anchor
|
|
179
|
+
affix
|
|
180
|
+
offsetTop={64}
|
|
181
|
+
targetOffset={80}
|
|
182
|
+
items={headings.map(h => ({ key: h.id, title: h.title, href: `#${h.id}` }))}
|
|
183
|
+
/>
|
|
184
|
+
</div>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## References
|
|
190
|
+
|
|
191
|
+
- Ant Design: [`refs/ant-design/components/anchor/`](../refs/ant-design/components/anchor/) — `Anchor`, `Anchor.Link`. Solid implementation.
|
|
192
|
+
- MUI / shadcn-ui: no built-in. Compose with `IntersectionObserver` + custom CSS.
|
|
193
|
+
|
|
194
|
+
## Cross-reference
|
|
195
|
+
|
|
196
|
+
- [`examples/component-affix.md`](component-affix.md) — sticky positioning (Anchor uses)
|
|
197
|
+
- [`knowledge/patterns/list-and-feed.md`](../knowledge/patterns/list-and-feed.md) — sticky section headers
|
|
198
|
+
- [`knowledge/a11y/keyboard-and-focus.md`](../knowledge/a11y/keyboard-and-focus.md)
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# `AppBar` (Top app bar / header) — spec
|
|
2
|
+
|
|
3
|
+
> Citing Ant Design (no dedicated — use Layout.Header), MUI `AppBar`, shadcn-ui (composition)
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The persistent top bar of an app or page. Holds navigation context (back / menu), title, and primary actions (search, notifications, profile).
|
|
8
|
+
|
|
9
|
+
Applicable on web (page header) and mobile (top app bar). Different in shape but same role.
|
|
10
|
+
|
|
11
|
+
## When AppBar (full spec) vs alternatives
|
|
12
|
+
|
|
13
|
+
This is the more detailed primitive that the [mobile-navigation knowledge](../knowledge/patterns/mobile-navigation.md) referenced. Refer to that for **when** to use; this spec covers the **how**.
|
|
14
|
+
|
|
15
|
+
## Anatomy
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Mobile (compact):
|
|
19
|
+
┌──────────────────────────────────────────┐
|
|
20
|
+
│ ← 화면 제목 🔍 ⋮ │
|
|
21
|
+
└──────────────────────────────────────────┘
|
|
22
|
+
|
|
23
|
+
Desktop (wider):
|
|
24
|
+
┌────────────────────────────────────────────────────────────────┐
|
|
25
|
+
│ [logo] Section nav 🔍 [avatar] ⋮ │
|
|
26
|
+
└────────────────────────────────────────────────────────────────┘
|
|
27
|
+
|
|
28
|
+
With tabs:
|
|
29
|
+
┌──────────────────────────────────────────┐
|
|
30
|
+
│ ← Project Aurora ⋮ │
|
|
31
|
+
├──────────────────────────────────────────┤
|
|
32
|
+
│ Overview │ Tasks │ Files │ Settings │ ← in-bar tabs
|
|
33
|
+
└──────────────────────────────────────────┘
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Slot | Required | Notes |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Leading | yes | Back / menu / logo |
|
|
39
|
+
| Title | yes | Page title (mobile) or section nav (desktop) |
|
|
40
|
+
| Trailing actions | optional | 1–3 visible icons + overflow menu |
|
|
41
|
+
| Tabs row | optional | Below the bar for sub-navigation |
|
|
42
|
+
| Search overlay | optional | Replaces title with search input |
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<AppBar
|
|
48
|
+
leading={<BackButton onClick={goBack} />}
|
|
49
|
+
title="설정"
|
|
50
|
+
actions={[
|
|
51
|
+
{ icon: <SearchIcon />, label: "검색", onClick: openSearch },
|
|
52
|
+
{ icon: <BellIcon />, label: "알림", onClick: openNotifications, badge: unreadCount },
|
|
53
|
+
{ type: "menu", items: [...] },
|
|
54
|
+
]}
|
|
55
|
+
variant="standard"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<AppBar
|
|
59
|
+
leading={<Logo />}
|
|
60
|
+
title={<NavLinks />}
|
|
61
|
+
actions={[<Avatar src={user.photoUrl} />]}
|
|
62
|
+
variant="standard"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Default | Description |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `leading` | `ReactNode` | — | Left slot (back/menu/logo) |
|
|
69
|
+
| `title` | `string \| ReactNode` | — | Center or left content |
|
|
70
|
+
| `actions` | `Action[]` | `[]` | Right-aligned actions |
|
|
71
|
+
| `tabs` | `ReactNode` | — | Bottom tabs row |
|
|
72
|
+
| `variant` | `"standard" \| "large" \| "compact" \| "search"` | `"standard"` | |
|
|
73
|
+
| `position` | `"static" \| "sticky" \| "fixed"` | `"sticky"` | |
|
|
74
|
+
| `elevation` | `0 \| 1 \| 2` | `0` | Shadow on scroll |
|
|
75
|
+
| `transparent` | `boolean` | `false` | When over hero image |
|
|
76
|
+
|
|
77
|
+
## Variants
|
|
78
|
+
|
|
79
|
+
### `standard` (default)
|
|
80
|
+
|
|
81
|
+
Single row, 56px (mobile) / 64px (desktop) tall. Title centered (mobile) or left (desktop).
|
|
82
|
+
|
|
83
|
+
### `large` (iOS-native large title)
|
|
84
|
+
|
|
85
|
+
Two rows: standard top + large title below. Collapses to standard on scroll. iOS-coded.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
┌──────────────────────────────────────────┐
|
|
89
|
+
│ ← 🔍 ⋮ │
|
|
90
|
+
│ │
|
|
91
|
+
│ Settings │ ← large 28px title
|
|
92
|
+
│ │
|
|
93
|
+
└──────────────────────────────────────────┘
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
On scroll: collapses to standard with the title moving up.
|
|
97
|
+
|
|
98
|
+
### `compact`
|
|
99
|
+
|
|
100
|
+
40px tall — for desktop dense admin tools.
|
|
101
|
+
|
|
102
|
+
### `search`
|
|
103
|
+
|
|
104
|
+
Title slot replaced with a search input. Common on tap of a search icon.
|
|
105
|
+
|
|
106
|
+
## Sizes
|
|
107
|
+
|
|
108
|
+
| Variant | Mobile height | Desktop height |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `compact` | 48px | 40px |
|
|
111
|
+
| `standard` (default) | 56px | 64px |
|
|
112
|
+
| `large` | 56px + 56px expansion | (rare on desktop) |
|
|
113
|
+
|
|
114
|
+
Plus `env(safe-area-inset-top)` on iOS.
|
|
115
|
+
|
|
116
|
+
## States
|
|
117
|
+
|
|
118
|
+
| State | Visual |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| Default | Resting at top |
|
|
121
|
+
| Scrolled | Optional shadow appears (`elevation > 0`) |
|
|
122
|
+
| Search active | Title replaced with input, search icon → close |
|
|
123
|
+
| Actions overflow | When > 2 actions on mobile, collapses to `⋮` menu |
|
|
124
|
+
|
|
125
|
+
## Tokens consumed
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
--color-bg-default (header surface)
|
|
129
|
+
--color-bg-elevated (when elevated)
|
|
130
|
+
--color-text-primary (title)
|
|
131
|
+
--color-text-secondary (subtitle)
|
|
132
|
+
--color-border-default (bottom border on scroll, alternative to shadow)
|
|
133
|
+
--space-md, --space-base
|
|
134
|
+
--shadow-card (elevation when scrolled)
|
|
135
|
+
--motion-fast (collapse animation)
|
|
136
|
+
--z-app-bar (above content, below modals)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Mobile-specific
|
|
140
|
+
|
|
141
|
+
- **Safe area**: top inset must be respected. `padding-top: env(safe-area-inset-top)`.
|
|
142
|
+
- **Status bar coordination**: `<StatusBar barStyle="dark-content" />` on iOS to match light header.
|
|
143
|
+
- **Back button**: 44×44 pt minimum hit area. Icon (chevron) + optional label ("← Settings").
|
|
144
|
+
- **Title truncation**: 1 line max, truncate with `…`.
|
|
145
|
+
- **System back gesture**: respect Android system back. Don't override.
|
|
146
|
+
|
|
147
|
+
## Tabs in app bar
|
|
148
|
+
|
|
149
|
+
When the bar has secondary tabs:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
┌──────────────────────────────────────────┐
|
|
153
|
+
│ ← Project Aurora ⋮ │
|
|
154
|
+
├──────────────────────────────────────────┤
|
|
155
|
+
│ Overview │ Tasks │ Files │ Settings │
|
|
156
|
+
└──────────────────────────────────────────┘
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Tabs are sticky too — both header + tab row stick. See [`examples/component-tabs.md`](component-tabs.md).
|
|
160
|
+
|
|
161
|
+
## Accessibility
|
|
162
|
+
|
|
163
|
+
- Render as `<header>` with `role="banner"` (or omit role; banner is implicit on `<header>` not nested).
|
|
164
|
+
- Title: `<h1>` for page-level header, `<h2>` for sub-page headers.
|
|
165
|
+
- Action buttons: `aria-label` for icon-only; tooltips on hover (desktop).
|
|
166
|
+
- Back button: `aria-label="뒤로"` or "Back".
|
|
167
|
+
- Skip link: provide "본문으로 건너뛰기" / "Skip to main content" before app bar for keyboard users.
|
|
168
|
+
|
|
169
|
+
### Keyboard
|
|
170
|
+
|
|
171
|
+
- `Tab` reaches actions in order: leading → title (if interactive) → tabs → actions.
|
|
172
|
+
- `Esc` in search-active: cancels search, returns to title view.
|
|
173
|
+
|
|
174
|
+
## Korean considerations
|
|
175
|
+
|
|
176
|
+
Standard back button label: `←` icon, no text (most common). Some apps add "이전" text.
|
|
177
|
+
|
|
178
|
+
Page titles: 1-3 words typical ("설정", "알림 설정", "프로필").
|
|
179
|
+
|
|
180
|
+
For chat/conversation headers: title shows the contact's name + online status:
|
|
181
|
+
```
|
|
182
|
+
← 김민지 ● [📞] [...]
|
|
183
|
+
오전 11:23 활동
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Code example
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
// Settings screen
|
|
190
|
+
<AppBar
|
|
191
|
+
leading={<BackButton aria-label="뒤로" onClick={() => navigate(-1)} />}
|
|
192
|
+
title="설정"
|
|
193
|
+
position="sticky"
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
// Conversation screen
|
|
197
|
+
<AppBar
|
|
198
|
+
leading={<BackButton onClick={() => navigate("/chats")} />}
|
|
199
|
+
title={
|
|
200
|
+
<div className="flex items-center gap-2">
|
|
201
|
+
<Avatar src={contact.photoUrl} alt={contact.name} size="sm" status={contact.online ? "online" : "offline"} />
|
|
202
|
+
<span>{contact.name}</span>
|
|
203
|
+
</div>
|
|
204
|
+
}
|
|
205
|
+
actions={[
|
|
206
|
+
{ icon: <PhoneIcon />, label: "통화", onClick: callContact },
|
|
207
|
+
{ icon: <VideoIcon />, label: "영상통화", onClick: videoCall },
|
|
208
|
+
{ type: "menu", items: chatMenuItems },
|
|
209
|
+
]}
|
|
210
|
+
/>
|
|
211
|
+
|
|
212
|
+
// Desktop with section nav
|
|
213
|
+
<AppBar
|
|
214
|
+
leading={<Logo />}
|
|
215
|
+
title={
|
|
216
|
+
<nav>
|
|
217
|
+
<NavLink to="/dashboard">대시보드</NavLink>
|
|
218
|
+
<NavLink to="/transactions">거래</NavLink>
|
|
219
|
+
<NavLink to="/cards">카드</NavLink>
|
|
220
|
+
</nav>
|
|
221
|
+
}
|
|
222
|
+
actions={[
|
|
223
|
+
{ icon: <SearchIcon />, onClick: openSearch },
|
|
224
|
+
{ icon: <BellIcon />, badge: 3, onClick: openNotifications },
|
|
225
|
+
<Avatar src={user.photoUrl} alt={user.name} />,
|
|
226
|
+
]}
|
|
227
|
+
/>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Don't
|
|
231
|
+
|
|
232
|
+
- Don't put primary CTAs in the app bar (those go in body).
|
|
233
|
+
- Don't hide the back button on inner screens.
|
|
234
|
+
- Don't show 4+ visible action icons on mobile — overflow to ⋮ menu.
|
|
235
|
+
- Don't put long titles. 1 line max.
|
|
236
|
+
- Don't omit safe-area-inset on iOS — content overlaps the notch.
|
|
237
|
+
- Don't make the app bar transparent without ensuring text-on-content contrast.
|
|
238
|
+
|
|
239
|
+
## References
|
|
240
|
+
|
|
241
|
+
- Ant Design: no dedicated AppBar — use `Layout.Header` + custom composition.
|
|
242
|
+
- MUI: [`refs/mui/packages/mui-material/src/AppBar/`](../refs/mui/packages/mui-material/src/AppBar/) — `AppBar` with `position`, `color`, `elevation`. Material-aligned.
|
|
243
|
+
- shadcn-ui: no built-in. Compose with custom header structure.
|
|
244
|
+
|
|
245
|
+
## Cross-reference
|
|
246
|
+
|
|
247
|
+
- [`knowledge/patterns/mobile-navigation.md`](../knowledge/patterns/mobile-navigation.md) — when AppBar is used in nav patterns
|
|
248
|
+
- [`examples/component-tabs.md`](component-tabs.md) — sub-tabs within AppBar
|
|
249
|
+
- [`examples/component-affix.md`](component-affix.md) — sticky positioning
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# `AspectRatio` — spec
|
|
2
|
+
|
|
3
|
+
> Synthesized from shadcn-ui `aspect-ratio` (Radix). A wrapper that locks its child to a specific aspect ratio. The single-purpose primitive for hero images, video embeds, card thumbnails, and any case where you need predictable proportions before content loads.
|
|
4
|
+
|
|
5
|
+
## Why this exists
|
|
6
|
+
|
|
7
|
+
The CSS `aspect-ratio` property handles 90% of cases natively. AspectRatio component is useful when:
|
|
8
|
+
- You need a consistent React API across the codebase.
|
|
9
|
+
- Browser support for `aspect-ratio` is insufficient (rare in 2024+; Safari < 15).
|
|
10
|
+
- You want to compose with other behavior (loading skeleton, fade-in).
|
|
11
|
+
|
|
12
|
+
For new projects targeting modern browsers: just use `aspect-ratio: 16/9` in CSS. AspectRatio component is for cross-browser / design-system consistency.
|
|
13
|
+
|
|
14
|
+
## API
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
<AspectRatio ratio={16 / 9}>
|
|
18
|
+
<img src="/hero.jpg" alt="" className="w-full h-full object-cover" />
|
|
19
|
+
</AspectRatio>
|
|
20
|
+
|
|
21
|
+
<AspectRatio ratio={1}>
|
|
22
|
+
<Avatar src={url} />
|
|
23
|
+
</AspectRatio>
|
|
24
|
+
|
|
25
|
+
<AspectRatio ratio={4 / 5}>
|
|
26
|
+
<ProductImage src={product.image} />
|
|
27
|
+
</AspectRatio>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Prop | Type | Default | Description |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| `ratio` | `number` | `1` | Width / height ratio (16/9 = 1.77, 4/3 = 1.33, 1/1 = 1) |
|
|
33
|
+
| `children` | `ReactNode` | — | Single child; positioned absolute to fill |
|
|
34
|
+
| `className` | `string` | — | Pass-through |
|
|
35
|
+
| `as` | `keyof JSX.IntrinsicElements` | `"div"` | Wrapper element |
|
|
36
|
+
|
|
37
|
+
## Common ratios
|
|
38
|
+
|
|
39
|
+
| Ratio | Use |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `16/9` (1.77) | Video, hero images, widescreen |
|
|
42
|
+
| `4/3` (1.33) | Photography, classic TV |
|
|
43
|
+
| `1/1` (1.0) | Avatars, product thumbnails (Instagram-style) |
|
|
44
|
+
| `4/5` (0.8) | Mobile portrait product |
|
|
45
|
+
| `9/16` (0.56) | Vertical video (Reels / Shorts / TikTok) |
|
|
46
|
+
| `3/2` (1.5) | DSLR photos |
|
|
47
|
+
| `21/9` (2.33) | Ultrawide cinema |
|
|
48
|
+
| `1/2` (0.5) | Tall hero / banner |
|
|
49
|
+
|
|
50
|
+
## Implementation
|
|
51
|
+
|
|
52
|
+
CSS:
|
|
53
|
+
```css
|
|
54
|
+
.aspect-ratio {
|
|
55
|
+
position: relative;
|
|
56
|
+
width: 100%;
|
|
57
|
+
aspect-ratio: var(--ratio); /* modern browsers */
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Fallback for browsers without aspect-ratio support */
|
|
61
|
+
@supports not (aspect-ratio: 1) {
|
|
62
|
+
.aspect-ratio::before {
|
|
63
|
+
content: "";
|
|
64
|
+
display: block;
|
|
65
|
+
padding-bottom: calc(100% / var(--ratio));
|
|
66
|
+
}
|
|
67
|
+
.aspect-ratio > * {
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
React:
|
|
75
|
+
```tsx
|
|
76
|
+
function AspectRatio({ ratio = 1, children, className, as: Tag = "div" }: Props) {
|
|
77
|
+
return (
|
|
78
|
+
<Tag
|
|
79
|
+
className={cn("aspect-ratio", className)}
|
|
80
|
+
style={{ "--ratio": ratio } as React.CSSProperties}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</Tag>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Tokens consumed
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
--radius-md (when used in cards; outer corners rounded)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
That's it. AspectRatio is layout-only; no theming.
|
|
95
|
+
|
|
96
|
+
## States
|
|
97
|
+
|
|
98
|
+
Stateless. The wrapper holds proportions; children control their own visuals.
|
|
99
|
+
|
|
100
|
+
## Accessibility
|
|
101
|
+
|
|
102
|
+
- AspectRatio is layout-only — no role, no semantics.
|
|
103
|
+
- Make sure the children have appropriate alt text / aria labels.
|
|
104
|
+
- `<img>` inside should always have `alt=""` (decorative) or descriptive `alt`.
|
|
105
|
+
- For `<video>` inside: same captions / accessibility as standalone video.
|
|
106
|
+
|
|
107
|
+
## Edge cases
|
|
108
|
+
|
|
109
|
+
- **Multiple children**: only first child is positioned absolute. Wrap in a single container if multiple needed.
|
|
110
|
+
- **Content overflows ratio**: hidden by default. To allow overflow, set `overflow: visible` on the wrapper.
|
|
111
|
+
- **Loading state**: pair with skeleton — skeleton itself can be the AspectRatio child during load.
|
|
112
|
+
- **Object-fit**: image / video child needs `object-fit: cover` (default for filling) or `contain` (letterbox).
|
|
113
|
+
- **No children**: empty wrapper still maintains ratio.
|
|
114
|
+
- **Print**: `aspect-ratio` works in print; ratio preserved.
|
|
115
|
+
|
|
116
|
+
## Code example
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
function ProductCard({ product }: Props) {
|
|
120
|
+
const [imageLoaded, setImageLoaded] = useState(false);
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<article className="product-card">
|
|
124
|
+
<AspectRatio ratio={4 / 5} className="rounded-md overflow-hidden">
|
|
125
|
+
{!imageLoaded && <Skeleton className="absolute inset-0" />}
|
|
126
|
+
<img
|
|
127
|
+
src={product.image}
|
|
128
|
+
alt={product.name}
|
|
129
|
+
onLoad={() => setImageLoaded(true)}
|
|
130
|
+
className="w-full h-full object-cover"
|
|
131
|
+
/>
|
|
132
|
+
</AspectRatio>
|
|
133
|
+
<h3>{product.name}</h3>
|
|
134
|
+
<p className="price">{product.price.toLocaleString()}원</p>
|
|
135
|
+
</article>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Don't
|
|
141
|
+
|
|
142
|
+
- Don't use AspectRatio when CSS `aspect-ratio` alone suffices.
|
|
143
|
+
- Don't put complex layouts inside — it's a single-child wrapper.
|
|
144
|
+
- Don't apply `aspect-ratio` AND fixed height to the same element. Pick one.
|
|
145
|
+
- Don't forget `object-fit` on images inside.
|
|
146
|
+
|
|
147
|
+
## References
|
|
148
|
+
|
|
149
|
+
- shadcn-ui: [`aspect-ratio`](../refs/shadcn-ui/apps/v4/registry/new-york-v4/ui/aspect-ratio.tsx) (Radix)
|
|
150
|
+
- CSS: `aspect-ratio` property (Baseline 2021)
|
|
151
|
+
|
|
152
|
+
## Cross-reference
|
|
153
|
+
|
|
154
|
+
- [`examples/component-image.md`](component-image.md) — image with built-in fallback
|
|
155
|
+
- [`examples/component-video-hero.md`](component-video-hero.md) — uses aspect-ratio for video
|
|
156
|
+
- [`knowledge/layout/spacing-and-grid.md`](../knowledge/layout/spacing-and-grid.md)
|