@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,149 @@
|
|
|
1
|
+
# `Checkbox` — spec
|
|
2
|
+
|
|
3
|
+
> Synthesized from Ant Design `Checkbox`, MUI `Checkbox`, shadcn-ui `checkbox`. Form selection control. See also [`component-form-controls.md`](component-form-controls.md) for Switch + Radio comparisons.
|
|
4
|
+
|
|
5
|
+
## Checkbox vs Switch vs Radio
|
|
6
|
+
|
|
7
|
+
| | Checkbox | Switch | Radio |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| Use | Multi-select; binary form input | Setting toggle (immediate effect) | Mutually exclusive choice |
|
|
10
|
+
| Default state matters | Yes (form has explicit unchecked option) | Yes (immediate state) | One must be selected |
|
|
11
|
+
| Visual | Square box + check | iOS-style slider | Circle |
|
|
12
|
+
|
|
13
|
+
For **forms with submit button**: Checkbox.
|
|
14
|
+
For **immediately-applied settings**: Switch.
|
|
15
|
+
For **pick-one-of-many**: Radio.
|
|
16
|
+
|
|
17
|
+
## Anatomy
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
☐ Send me promotional email ← unchecked
|
|
21
|
+
☑ Subscribe to newsletter ← checked
|
|
22
|
+
☒ I agree (indeterminate) ← rare, used for "mixed" group state
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<Checkbox
|
|
29
|
+
checked={subscribed}
|
|
30
|
+
onCheckedChange={setSubscribed}
|
|
31
|
+
id="subscribe"
|
|
32
|
+
/>
|
|
33
|
+
<label htmlFor="subscribe">Subscribe</label>
|
|
34
|
+
|
|
35
|
+
<Checkbox checked="indeterminate" onCheckedChange={...}>
|
|
36
|
+
Select all
|
|
37
|
+
</Checkbox>
|
|
38
|
+
|
|
39
|
+
<Checkbox required disabled />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Description |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `checked` | `boolean \| "indeterminate"` | controlled | State |
|
|
45
|
+
| `defaultChecked` | `boolean` | `false` | Uncontrolled initial |
|
|
46
|
+
| `onCheckedChange` | `(checked: boolean) => void` | — | Callback |
|
|
47
|
+
| `disabled` | `boolean` | `false` | — |
|
|
48
|
+
| `required` | `boolean` | `false` | For form validation |
|
|
49
|
+
| `name` | `string` | — | Form field name |
|
|
50
|
+
| `value` | `string` | `"on"` | Form value when checked |
|
|
51
|
+
|
|
52
|
+
## States
|
|
53
|
+
|
|
54
|
+
| State | Visual |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Unchecked | Empty box with border |
|
|
57
|
+
| Checked | Filled box with check icon |
|
|
58
|
+
| Indeterminate | Filled box with horizontal bar (group "some-checked") |
|
|
59
|
+
| Hover | Border color shift |
|
|
60
|
+
| Focus-visible | 2px focus ring |
|
|
61
|
+
| Disabled | Reduced opacity, no events |
|
|
62
|
+
| Error | Red border (form validation) |
|
|
63
|
+
|
|
64
|
+
## Indeterminate use
|
|
65
|
+
|
|
66
|
+
The "select all" pattern:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
const allChecked = items.every(i => i.checked);
|
|
70
|
+
const someChecked = items.some(i => i.checked) && !allChecked;
|
|
71
|
+
const indeterminate = someChecked;
|
|
72
|
+
|
|
73
|
+
<Checkbox
|
|
74
|
+
checked={allChecked ? true : indeterminate ? "indeterminate" : false}
|
|
75
|
+
onCheckedChange={(c) => setAll(c === true)}
|
|
76
|
+
>
|
|
77
|
+
Select all
|
|
78
|
+
</Checkbox>
|
|
79
|
+
|
|
80
|
+
{items.map(item => (
|
|
81
|
+
<Checkbox
|
|
82
|
+
key={item.id}
|
|
83
|
+
checked={item.checked}
|
|
84
|
+
onCheckedChange={(c) => updateItem(item.id, c)}
|
|
85
|
+
>
|
|
86
|
+
{item.label}
|
|
87
|
+
</Checkbox>
|
|
88
|
+
))}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Tokens consumed
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
--checkbox-bg-unchecked
|
|
95
|
+
--checkbox-bg-checked (brand)
|
|
96
|
+
--checkbox-border
|
|
97
|
+
--checkbox-border-checked
|
|
98
|
+
--checkbox-fg-check (check icon color)
|
|
99
|
+
--checkbox-error-border
|
|
100
|
+
--checkbox-size (typically 16-20px)
|
|
101
|
+
--space-xs (label-checkbox gap)
|
|
102
|
+
--motion-fast
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Accessibility
|
|
106
|
+
|
|
107
|
+
- Native `<input type="checkbox">` (or Radix `<Checkbox>` with proper ARIA).
|
|
108
|
+
- `<label htmlFor="...">` linked. Click on label toggles.
|
|
109
|
+
- `aria-checked="true|false|mixed"` — the third value for indeterminate.
|
|
110
|
+
- For groups: wrap in `<fieldset>` + `<legend>`.
|
|
111
|
+
- Keyboard: Space toggles. Tab moves between checkboxes (no arrow-nav unless in a group with `role="group"`).
|
|
112
|
+
- Touch target ≥ 44pt mobile.
|
|
113
|
+
|
|
114
|
+
## Korean conventions
|
|
115
|
+
|
|
116
|
+
- 마케팅 정보 수신 동의 (marketing consent) — required field per 정보통신망법; default unchecked, never auto-check.
|
|
117
|
+
- 이용약관 동의 (terms agreement) — typically with link to terms; required for signup.
|
|
118
|
+
- 만 14세 이상입니다 (age confirmation) — required for KR services.
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<Checkbox required>
|
|
122
|
+
<span>
|
|
123
|
+
<Link href="/terms" external>이용약관</Link>에 동의합니다 (필수)
|
|
124
|
+
</span>
|
|
125
|
+
</Checkbox>
|
|
126
|
+
<Checkbox>
|
|
127
|
+
마케팅 정보 수신에 동의합니다 (선택)
|
|
128
|
+
</Checkbox>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Don't
|
|
132
|
+
|
|
133
|
+
- Don't auto-check marketing consent. KR law (정보통신망법) prohibits.
|
|
134
|
+
- Don't omit label or `aria-label`.
|
|
135
|
+
- Don't use Checkbox for "Apply immediately" settings — use Switch.
|
|
136
|
+
- Don't make checkbox visual smaller than 16x16 (touch target may still be 44pt via padding, but visual must be readable).
|
|
137
|
+
|
|
138
|
+
## References
|
|
139
|
+
|
|
140
|
+
- Ant: [`Checkbox`](../refs/ant-design/components/checkbox)
|
|
141
|
+
- MUI: [`Checkbox`](../refs/mui/packages/mui-material/src/Checkbox)
|
|
142
|
+
- shadcn-ui: [`checkbox`](../refs/shadcn-ui/apps/v4/registry/new-york-v4/ui/checkbox.tsx)
|
|
143
|
+
|
|
144
|
+
## Cross-reference
|
|
145
|
+
|
|
146
|
+
- [`examples/component-form-controls.md`](component-form-controls.md) — combined Switch + Radio + Checkbox
|
|
147
|
+
- [`examples/component-radio.md`](component-radio.md)
|
|
148
|
+
- [`examples/component-switch.md`](component-switch.md) — N/A (covered in form-controls)
|
|
149
|
+
- [`knowledge/patterns/email-design.md`](../knowledge/patterns/email-design.md) — KR marketing consent rules
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# `ClickAwayListener` — spec
|
|
2
|
+
|
|
3
|
+
> Synthesized from MUI `ClickAwayListener`. Utility that fires a callback when user clicks outside a wrapped element. Used internally by Popover / Modal / Menu to handle click-outside-closes.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Custom dropdowns / popups that should close on outside click.
|
|
8
|
+
- Image galleries / lightboxes with click-outside-to-close.
|
|
9
|
+
- Any custom floating UI not built on Popover.
|
|
10
|
+
|
|
11
|
+
When NOT to use:
|
|
12
|
+
- Standard Popover / Menu / Modal — they include this internally.
|
|
13
|
+
- Form inputs (focus / blur events handle this naturally).
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<ClickAwayListener onClickAway={() => setOpen(false)}>
|
|
19
|
+
<div className="custom-popup">
|
|
20
|
+
{/* content */}
|
|
21
|
+
</div>
|
|
22
|
+
</ClickAwayListener>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `onClickAway` | `(event) => void` | required | Fires on outside click / touch |
|
|
28
|
+
| `mouseEvent` | `"onClick" \| "onMouseDown" \| "onMouseUp" \| false` | `"onClick"` | Which mouse event triggers |
|
|
29
|
+
| `touchEvent` | `"onTouchStart" \| "onTouchEnd" \| false` | `"onTouchEnd"` | Touch event |
|
|
30
|
+
| `disableReactTree` | `boolean` | `false` | Use document listener instead of React's synthetic events |
|
|
31
|
+
| `children` | `ReactNode` | — | Single child — the inside |
|
|
32
|
+
|
|
33
|
+
## Implementation note
|
|
34
|
+
|
|
35
|
+
For modern projects, the same effect via hooks:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
function useClickAway<T extends HTMLElement>(
|
|
39
|
+
ref: React.RefObject<T>,
|
|
40
|
+
onAway: () => void,
|
|
41
|
+
) {
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
function handler(e: MouseEvent | TouchEvent) {
|
|
44
|
+
if (!ref.current || ref.current.contains(e.target as Node)) return;
|
|
45
|
+
onAway();
|
|
46
|
+
}
|
|
47
|
+
document.addEventListener("mousedown", handler);
|
|
48
|
+
document.addEventListener("touchstart", handler);
|
|
49
|
+
return () => {
|
|
50
|
+
document.removeEventListener("mousedown", handler);
|
|
51
|
+
document.removeEventListener("touchstart", handler);
|
|
52
|
+
};
|
|
53
|
+
}, [ref, onAway]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Use:
|
|
57
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
58
|
+
useClickAway(ref, () => setOpen(false));
|
|
59
|
+
return <div ref={ref}>...</div>;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
shadcn-based projects don't include this as a separate primitive — Popover / Sheet handle it internally via Radix.
|
|
63
|
+
|
|
64
|
+
## Edge cases
|
|
65
|
+
|
|
66
|
+
- **Click on a portal child**: portal renders outside DOM tree; `ref.contains()` won't match. Use `disableReactTree` OR maintain a list of "inside" elements.
|
|
67
|
+
- **Mobile touch + click both fire**: prevent double-fire by debouncing or using only one event.
|
|
68
|
+
- **Synthetic vs native events**: React's synthetic events bubble through React tree even if rendered to portal; native events don't.
|
|
69
|
+
- **Esc key**: ClickAwayListener doesn't handle Esc — pair with separate keydown listener.
|
|
70
|
+
|
|
71
|
+
## Don't
|
|
72
|
+
|
|
73
|
+
- Don't ship custom modals without click-outside handling.
|
|
74
|
+
- Don't fire on all clicks — limit to outside-the-wrapped-element.
|
|
75
|
+
- Don't forget mobile touch events.
|
|
76
|
+
- Don't rely on ClickAwayListener for accessibility — focus trap + Esc still required.
|
|
77
|
+
|
|
78
|
+
## References
|
|
79
|
+
|
|
80
|
+
- MUI: [`ClickAwayListener`](../refs/mui/packages/mui-material/src/ClickAwayListener)
|
|
81
|
+
- Hook alternatives in many libs (use-click-away, react-use, etc.)
|
|
82
|
+
|
|
83
|
+
## Cross-reference
|
|
84
|
+
|
|
85
|
+
- [`examples/component-popover.md`](component-popover.md) — uses click-away internally
|
|
86
|
+
- [`examples/component-modal.md`](component-modal.md) — uses click-away (or backdrop click)
|
|
87
|
+
- [`examples/component-dropdown.md`](component-dropdown.md) — uses click-away
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# `Code` (inline + block) — spec
|
|
2
|
+
|
|
3
|
+
> Citing Ant Design `Typography.Text code` (inline) / `pre` (block), MUI (composition), shadcn-ui (composition with shiki/prism)
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Renders code with monospace font + appropriate styling. Two variants:
|
|
8
|
+
|
|
9
|
+
| Variant | Use |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| **Inline** | Code within prose (`const x = 1`) |
|
|
12
|
+
| **Block** | Standalone code blocks with optional syntax highlighting + copy button |
|
|
13
|
+
|
|
14
|
+
## Anatomy
|
|
15
|
+
|
|
16
|
+
### Inline
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
This is some `inline code` within text.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A short, monospace token in the flow of text.
|
|
23
|
+
|
|
24
|
+
### Block
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
┌──────────────────────────────────────────────────┐
|
|
28
|
+
│ TypeScript [Copy] │
|
|
29
|
+
├──────────────────────────────────────────────────┤
|
|
30
|
+
│ 1 type User = { │
|
|
31
|
+
│ 2 name: string; │
|
|
32
|
+
│ 3 email: string; │
|
|
33
|
+
│ 4 }; │
|
|
34
|
+
└──────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Slot | Required | Notes |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| Language label | optional | Header showing the language |
|
|
40
|
+
| Copy button | optional | Top-right corner |
|
|
41
|
+
| Line numbers | optional | Left gutter |
|
|
42
|
+
| Code content | yes | Highlighted or plain |
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
### Inline
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<Code inline>const x = 1</Code>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or as a tagged element:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<code>{value}</code> {/* native */}
|
|
56
|
+
<Code>{value}</Code> {/* component */}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Block
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<Code language="typescript" showLineNumbers showCopyButton>
|
|
63
|
+
{`type User = {
|
|
64
|
+
name: string;
|
|
65
|
+
email: string;
|
|
66
|
+
};`}
|
|
67
|
+
</Code>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| `children` | `string` | — | Code content |
|
|
73
|
+
| `inline` | `boolean` | `false` | Inline vs block |
|
|
74
|
+
| `language` | `string` | — | Syntax highlighting language (e.g., `"typescript"`, `"python"`, `"bash"`) |
|
|
75
|
+
| `showLineNumbers` | `boolean` | `false` | |
|
|
76
|
+
| `showCopyButton` | `boolean` | `true` (block only) | |
|
|
77
|
+
| `theme` | `"light" \| "dark" \| "auto"` | `"auto"` | Highlighter theme |
|
|
78
|
+
| `wrapLines` | `boolean` | `false` | Soft-wrap long lines vs horizontal scroll |
|
|
79
|
+
| `highlightLines` | `number[]` | — | Line numbers to highlight |
|
|
80
|
+
|
|
81
|
+
## Syntax highlighting
|
|
82
|
+
|
|
83
|
+
Use a library — don't roll your own:
|
|
84
|
+
- **Shiki** (best for static / SSR — uses VS Code engine)
|
|
85
|
+
- **Prism** (lighter weight, more themes)
|
|
86
|
+
- **highlight.js** (largest language coverage)
|
|
87
|
+
|
|
88
|
+
For React: `react-syntax-highlighter` wraps these.
|
|
89
|
+
|
|
90
|
+
For server-rendered (Next.js, SvelteKit): Shiki is best — pre-renders highlighted HTML on the server, no client JS needed.
|
|
91
|
+
|
|
92
|
+
## States
|
|
93
|
+
|
|
94
|
+
| State | Visual |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| Default | Code visible |
|
|
97
|
+
| Hover (block) | Copy button appears (or stays visible) |
|
|
98
|
+
| Copy clicked | Brief "복사됨!" toast or button text change |
|
|
99
|
+
| Copy failed | "복사 실패" inline |
|
|
100
|
+
|
|
101
|
+
## Tokens consumed
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
--font-mono (e.g., "SFMono-Regular, Consolas, ...")
|
|
105
|
+
--color-bg-code (block bg — slightly tinted)
|
|
106
|
+
--color-bg-inline-code (inline bg — subtle highlight)
|
|
107
|
+
--color-text-primary (default code text)
|
|
108
|
+
--color-text-secondary (line numbers)
|
|
109
|
+
--color-syntax-* (syntax highlight tokens — keyword, string, comment, etc.)
|
|
110
|
+
--color-bg-elevated (header bg, copy button bg)
|
|
111
|
+
--space-sm, --space-md
|
|
112
|
+
--radius-md (block corners)
|
|
113
|
+
--font-size-sm, --font-size-base
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
For inline: typically a subtle background tint (`--color-bg-subtle`) and slightly smaller font (90%).
|
|
117
|
+
|
|
118
|
+
For block: full-bleed monospace, dedicated background, comfortable padding.
|
|
119
|
+
|
|
120
|
+
## Sizes
|
|
121
|
+
|
|
122
|
+
Inline: matches surrounding text but slightly smaller (font-size 90%).
|
|
123
|
+
|
|
124
|
+
Block:
|
|
125
|
+
| Prop | Compact | Default | Comfortable |
|
|
126
|
+
| --- | --- | --- | --- |
|
|
127
|
+
| Font | 12px | 14px | 16px |
|
|
128
|
+
| Line height | 1.4 | 1.6 | 1.8 |
|
|
129
|
+
| Padding | 12px | 16px | 20px |
|
|
130
|
+
|
|
131
|
+
## Accessibility
|
|
132
|
+
|
|
133
|
+
- Inline: native `<code>` element. No special wiring needed.
|
|
134
|
+
- Block: `<pre><code>` (semantic).
|
|
135
|
+
- Copy button: `<button>` with `aria-label="복사"` (with success feedback).
|
|
136
|
+
- For users navigating with screen readers: code blocks are read character-by-character. This is desired for code reading.
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<pre>
|
|
140
|
+
<code class="language-typescript">
|
|
141
|
+
const x = 1;
|
|
142
|
+
</code>
|
|
143
|
+
</pre>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For language announcement:
|
|
147
|
+
```html
|
|
148
|
+
<pre aria-label="TypeScript code">
|
|
149
|
+
<code>...</code>
|
|
150
|
+
</pre>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Code example
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
// Inline
|
|
157
|
+
<p>
|
|
158
|
+
Set <Code>NODE_ENV</Code> to <Code>production</Code> for deployment.
|
|
159
|
+
</p>
|
|
160
|
+
|
|
161
|
+
// Block with syntax highlighting
|
|
162
|
+
<Code language="typescript" showCopyButton>
|
|
163
|
+
{`const greet = (name: string) => \`안녕, \${name}!\`;`}
|
|
164
|
+
</Code>
|
|
165
|
+
|
|
166
|
+
// Long block with line numbers
|
|
167
|
+
<Code language="python" showLineNumbers showCopyButton wrapLines>
|
|
168
|
+
{`def fibonacci(n):
|
|
169
|
+
if n <= 1:
|
|
170
|
+
return n
|
|
171
|
+
return fibonacci(n - 1) + fibonacci(n - 2)`}
|
|
172
|
+
</Code>
|
|
173
|
+
|
|
174
|
+
// Highlighted lines (e.g., showing a diff)
|
|
175
|
+
<Code language="js" highlightLines={[2, 3]}>
|
|
176
|
+
{`function add(a, b) {
|
|
177
|
+
// ⚠ subtle bug here
|
|
178
|
+
return a + b + 1;
|
|
179
|
+
}`}
|
|
180
|
+
</Code>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Edge cases
|
|
184
|
+
|
|
185
|
+
- **Very long lines**: default to horizontal scroll (no wrap). User can opt into wrap.
|
|
186
|
+
- **Multi-line inline code**: defaults to inline behavior; force inline-block to keep it on one line.
|
|
187
|
+
- **Code with HTML special chars** (`<`, `>`, `&`): the renderer must escape these. Library handles.
|
|
188
|
+
- **Code containing the copy-target itself**: copy returns the original string, not the rendered HTML.
|
|
189
|
+
- **Print**: code blocks should print readably — fix font + page-break-inside: avoid.
|
|
190
|
+
|
|
191
|
+
## Don't
|
|
192
|
+
|
|
193
|
+
- Don't show syntax-highlighted code in critical UI paths (first paint) without SSR — flicker.
|
|
194
|
+
- Don't omit copy button on documentation block (huge UX win).
|
|
195
|
+
- Don't truncate code blocks. Show all or scroll.
|
|
196
|
+
- Don't apply syntax highlighting to non-code (e.g., shell output that's not a command).
|
|
197
|
+
- Don't use raw `<code>` in screen readers without context — wrap with description.
|
|
198
|
+
|
|
199
|
+
## References
|
|
200
|
+
|
|
201
|
+
- Ant Design: [`Typography.Text code`](../refs/ant-design/components/typography/) — inline. Block code: just use HTML `<pre>` with optional CSS.
|
|
202
|
+
- MUI: no dedicated Code component. Use `<code>` or `<Typography component="pre">`.
|
|
203
|
+
- shadcn-ui: no built-in. Compose with `react-syntax-highlighter` + Tailwind.
|
|
204
|
+
|
|
205
|
+
Common libraries:
|
|
206
|
+
- `react-syntax-highlighter` — React wrapper for Prism / Highlight.js
|
|
207
|
+
- `shiki` — VS Code's highlighter, server-side rendering
|
|
208
|
+
- `prism-react-renderer` — lightweight Prism wrapper
|
|
209
|
+
|
|
210
|
+
## Cross-reference
|
|
211
|
+
|
|
212
|
+
- [`examples/component-typography.md`](component-typography.md) — text rendering primitives
|
|
213
|
+
- [`knowledge/typography/type-scale-fundamentals.md`](../knowledge/typography/type-scale-fundamentals.md) — monospace font choices
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# `Collapsible` — spec
|
|
2
|
+
|
|
3
|
+
> Synthesized from shadcn-ui `collapsible` (Radix). The base primitive for any expand/collapse interaction. `Accordion` is a multi-instance manager built on top; `Collapsible` is the standalone single-instance version.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- **Single expandable section** — e.g., "Show more details" toggle.
|
|
8
|
+
- **Optional content** that's hidden by default to reduce density.
|
|
9
|
+
- **As a primitive** for building Accordion, Disclosure, FAQ widgets.
|
|
10
|
+
|
|
11
|
+
When NOT to use:
|
|
12
|
+
- **Multi-section accordion** → use `Accordion`.
|
|
13
|
+
- **Modal / drawer / sheet content** — those are different patterns.
|
|
14
|
+
- **Persistent navigation** — keep nav always visible.
|
|
15
|
+
|
|
16
|
+
## Anatomy
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
[Trigger ▶ Show more] (closed)
|
|
20
|
+
|
|
21
|
+
[Trigger ▼ Show less] (open)
|
|
22
|
+
Content panel revealed
|
|
23
|
+
Multiple lines of content here.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<Collapsible defaultOpen={false} onOpenChange={track}>
|
|
30
|
+
<Collapsible.Trigger asChild>
|
|
31
|
+
<button className="trigger">
|
|
32
|
+
<ChevronIcon className="data-[state=open]:rotate-90 transition-transform" />
|
|
33
|
+
Show {open ? "less" : "more"}
|
|
34
|
+
</button>
|
|
35
|
+
</Collapsible.Trigger>
|
|
36
|
+
<Collapsible.Content>
|
|
37
|
+
<div className="content">
|
|
38
|
+
{/* content here */}
|
|
39
|
+
</div>
|
|
40
|
+
</Collapsible.Content>
|
|
41
|
+
</Collapsible>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Prop | Type | Default | Description |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| `open` | `boolean` | controlled | Controlled state |
|
|
47
|
+
| `defaultOpen` | `boolean` | `false` | Uncontrolled initial state |
|
|
48
|
+
| `onOpenChange` | `(open: boolean) => void` | — | Callback |
|
|
49
|
+
| `disabled` | `boolean` | `false` | Disable trigger |
|
|
50
|
+
|
|
51
|
+
## Composition
|
|
52
|
+
|
|
53
|
+
| Part | Purpose |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `Collapsible` | Wrapper / state holder |
|
|
56
|
+
| `Trigger` | The clickable element that toggles |
|
|
57
|
+
| `Content` | The collapsible panel |
|
|
58
|
+
|
|
59
|
+
## States
|
|
60
|
+
|
|
61
|
+
| State | Visual |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| Closed | Content hidden; Trigger shows "expand" affordance |
|
|
64
|
+
| Opening | Content height animates from 0 to natural |
|
|
65
|
+
| Open | Content visible; Trigger shows "collapse" affordance |
|
|
66
|
+
| Closing | Reverse animation |
|
|
67
|
+
| Disabled | Trigger unclickable, no events |
|
|
68
|
+
|
|
69
|
+
## Animation
|
|
70
|
+
|
|
71
|
+
The classic CSS challenge — `height: auto` doesn't animate. Modern approaches:
|
|
72
|
+
|
|
73
|
+
### CSS Grid trick (works in 2024+)
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
.collapsible-content {
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-rows: 0fr;
|
|
79
|
+
transition: grid-template-rows 200ms var(--ease-out);
|
|
80
|
+
}
|
|
81
|
+
.collapsible-content[data-state="open"] {
|
|
82
|
+
grid-template-rows: 1fr;
|
|
83
|
+
}
|
|
84
|
+
.collapsible-content > div {
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`1fr` works as auto-height in grid. Animatable.
|
|
90
|
+
|
|
91
|
+
### CSS variable + JS measurement
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
// On open: measure content; set CSS var; transition height to it
|
|
95
|
+
const height = content.scrollHeight;
|
|
96
|
+
content.style.setProperty('--height', `${height}px`);
|
|
97
|
+
content.dataset.state = 'open';
|
|
98
|
+
|
|
99
|
+
// On close: instant re-measure; transition to 0
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```css
|
|
103
|
+
.collapsible-content {
|
|
104
|
+
height: 0;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
transition: height 200ms var(--ease-out);
|
|
107
|
+
}
|
|
108
|
+
.collapsible-content[data-state="open"] {
|
|
109
|
+
height: var(--height);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Reduced motion
|
|
114
|
+
|
|
115
|
+
```css
|
|
116
|
+
@media (prefers-reduced-motion: reduce) {
|
|
117
|
+
.collapsible-content { transition: none; }
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Tokens consumed
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
--space-sm, --space-md (content padding)
|
|
125
|
+
--motion-medium (200ms transition)
|
|
126
|
+
--ease-out
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Collapsible is structural; visual styling is on the children (Trigger + Content).
|
|
130
|
+
|
|
131
|
+
## Accessibility
|
|
132
|
+
|
|
133
|
+
- Use the **WAI-ARIA Disclosure pattern**:
|
|
134
|
+
- Trigger: `<button aria-expanded="true|false" aria-controls="content-id">`.
|
|
135
|
+
- Content: `<div id="content-id">` (no special role; just a region).
|
|
136
|
+
- `Enter` / `Space` toggles.
|
|
137
|
+
- Tab moves into Content's focusable items when open; skips when closed.
|
|
138
|
+
- Don't use `aria-hidden` on Content when closed — `display: none` (or grid 0fr) removes it from a11y tree natively.
|
|
139
|
+
|
|
140
|
+
## Code example — FAQ item
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
function FAQItem({ question, answer }: Props) {
|
|
144
|
+
const [open, setOpen] = useState(false);
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<Collapsible open={open} onOpenChange={setOpen} className="faq-item">
|
|
148
|
+
<Collapsible.Trigger asChild>
|
|
149
|
+
<button className="faq-trigger">
|
|
150
|
+
<span>{question}</span>
|
|
151
|
+
<ChevronIcon
|
|
152
|
+
className={cn("transition-transform", open && "rotate-180")}
|
|
153
|
+
/>
|
|
154
|
+
</button>
|
|
155
|
+
</Collapsible.Trigger>
|
|
156
|
+
<Collapsible.Content>
|
|
157
|
+
<div className="faq-content">{answer}</div>
|
|
158
|
+
</Collapsible.Content>
|
|
159
|
+
</Collapsible>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Code example — "Show more" details
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
function ProductDetails({ product }: Props) {
|
|
168
|
+
const [showMore, setShowMore] = useState(false);
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<div>
|
|
172
|
+
<p>{product.shortDescription}</p>
|
|
173
|
+
<Collapsible open={showMore} onOpenChange={setShowMore}>
|
|
174
|
+
<Collapsible.Trigger asChild>
|
|
175
|
+
<button className="link-button">
|
|
176
|
+
{showMore ? "간단히 보기" : "자세히 보기"}
|
|
177
|
+
</button>
|
|
178
|
+
</Collapsible.Trigger>
|
|
179
|
+
<Collapsible.Content>
|
|
180
|
+
<div className="details">
|
|
181
|
+
<p>{product.longDescription}</p>
|
|
182
|
+
<SpecsTable specs={product.specs} />
|
|
183
|
+
</div>
|
|
184
|
+
</Collapsible.Content>
|
|
185
|
+
</Collapsible>
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Edge cases
|
|
192
|
+
|
|
193
|
+
- **Initial state on SSR**: pass `defaultOpen` matching server render to avoid hydration mismatch.
|
|
194
|
+
- **Content with focus on open**: don't auto-focus (Disclosure pattern doesn't trap focus); user tabs in naturally.
|
|
195
|
+
- **Animating content with images**: images may load AFTER initial measurement, causing height jumps. Use `content-visibility` or pre-load.
|
|
196
|
+
- **Nested Collapsible**: works; just style independently.
|
|
197
|
+
- **Long content**: scroll inside Content if exceeds reasonable height (cap with max-height).
|
|
198
|
+
- **Disabled while open**: keep open (or close, depending on UX); disable Trigger so user can't close.
|
|
199
|
+
- **Korean toggle labels**: "자세히 보기 / 간단히 보기", "더 보기 / 접기", or "펼치기 / 접기".
|
|
200
|
+
|
|
201
|
+
## Don't
|
|
202
|
+
|
|
203
|
+
- Don't use Collapsible for navigation menus — different a11y pattern (Menu).
|
|
204
|
+
- Don't omit visual rotate / chevron change — affords state.
|
|
205
|
+
- Don't put critical info inside (closed-by-default) without a visible summary.
|
|
206
|
+
- Don't animate longer than 300ms — feels slow for repeated toggles.
|
|
207
|
+
- Don't forget reduced motion.
|
|
208
|
+
- Don't use Collapsible for multi-instance accordion — that needs `Accordion`.
|
|
209
|
+
|
|
210
|
+
## References
|
|
211
|
+
|
|
212
|
+
- shadcn-ui: [`collapsible`](../refs/shadcn-ui/apps/v4/registry/new-york-v4/ui/collapsible.tsx) (Radix)
|
|
213
|
+
- WAI-ARIA: [Disclosure pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/)
|
|
214
|
+
|
|
215
|
+
## Cross-reference
|
|
216
|
+
|
|
217
|
+
- [`examples/component-accordion.md`](component-accordion.md) — multi-section variant
|
|
218
|
+
- [`knowledge/motion/principles.md`](../knowledge/motion/principles.md) — height animation
|
|
219
|
+
- [`knowledge/a11y/keyboard-and-focus.md`](../knowledge/a11y/keyboard-and-focus.md)
|