@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.
Files changed (529) hide show
  1. package/.claude-plugin/plugin.json +164 -0
  2. package/AGENTS.ko.md +126 -0
  3. package/AGENTS.md +182 -0
  4. package/CHANGELOG.md +6883 -0
  5. package/CLAUDE.md +39 -0
  6. package/LICENSE +21 -0
  7. package/README.ko.md +245 -0
  8. package/README.md +277 -0
  9. package/agents/README.md +14 -0
  10. package/agents/a11y-reviewer.md +121 -0
  11. package/agents/component-architect.md +57 -0
  12. package/agents/design-critic.md +46 -0
  13. package/agents/token-extractor.md +63 -0
  14. package/cli/bin/design-ai-mcp.mjs +6 -0
  15. package/cli/bin/design-ai.mjs +40 -0
  16. package/cli/commands/audit.mjs +111 -0
  17. package/cli/commands/check.mjs +226 -0
  18. package/cli/commands/doctor.mjs +141 -0
  19. package/cli/commands/examples.mjs +58 -0
  20. package/cli/commands/help.mjs +271 -0
  21. package/cli/commands/install.mjs +161 -0
  22. package/cli/commands/learn.mjs +1871 -0
  23. package/cli/commands/list.mjs +143 -0
  24. package/cli/commands/mcp.mjs +27 -0
  25. package/cli/commands/pack.mjs +211 -0
  26. package/cli/commands/prompt.mjs +199 -0
  27. package/cli/commands/route.mjs +247 -0
  28. package/cli/commands/search.mjs +60 -0
  29. package/cli/commands/show.mjs +52 -0
  30. package/cli/commands/site.mjs +558 -0
  31. package/cli/commands/status.mjs +161 -0
  32. package/cli/commands/uninstall.mjs +119 -0
  33. package/cli/commands/update.mjs +184 -0
  34. package/cli/commands/version.mjs +94 -0
  35. package/cli/commands/workspace.mjs +176 -0
  36. package/cli/lib/brief.mjs +52 -0
  37. package/cli/lib/check.mjs +642 -0
  38. package/cli/lib/dispatch.mjs +109 -0
  39. package/cli/lib/doctor.mjs +505 -0
  40. package/cli/lib/examples.mjs +258 -0
  41. package/cli/lib/exec.mjs +63 -0
  42. package/cli/lib/help-flags.mjs +5 -0
  43. package/cli/lib/learn.mjs +3694 -0
  44. package/cli/lib/log.mjs +47 -0
  45. package/cli/lib/mcp-server.mjs +426 -0
  46. package/cli/lib/output.mjs +101 -0
  47. package/cli/lib/pack.mjs +599 -0
  48. package/cli/lib/paths.mjs +63 -0
  49. package/cli/lib/prompt.mjs +603 -0
  50. package/cli/lib/route.mjs +740 -0
  51. package/cli/lib/search.mjs +158 -0
  52. package/cli/lib/show.mjs +161 -0
  53. package/cli/lib/signals.mjs +2337 -0
  54. package/cli/lib/site.mjs +6617 -0
  55. package/cli/lib/skill-proposals.mjs +2046 -0
  56. package/cli/lib/suggest.mjs +66 -0
  57. package/cli/lib/workspace.mjs +1056 -0
  58. package/commands/README.md +25 -0
  59. package/commands/component-spec.md +34 -0
  60. package/commands/conversational.md +44 -0
  61. package/commands/design-from-brief.md +141 -0
  62. package/commands/design-review.md +62 -0
  63. package/commands/document-from-brief.md +47 -0
  64. package/commands/extract-tokens.md +38 -0
  65. package/commands/game-ui.md +40 -0
  66. package/commands/illustration.md +37 -0
  67. package/commands/iterate.md +167 -0
  68. package/commands/motion-design.md +54 -0
  69. package/commands/palette-from-brand.md +50 -0
  70. package/commands/print.md +49 -0
  71. package/commands/slide-deck.md +46 -0
  72. package/commands/spatial.md +47 -0
  73. package/commands/stability-review.md +74 -0
  74. package/commands/video.md +42 -0
  75. package/commands/website-improvement.md +77 -0
  76. package/docs/AGENT-DEVELOPMENT.md +658 -0
  77. package/docs/AI-LEARNING.md +429 -0
  78. package/docs/AIDER-INTEGRATION.md +224 -0
  79. package/docs/ARCHITECTURE.ko.md +183 -0
  80. package/docs/ARCHITECTURE.md +105 -0
  81. package/docs/CODEX-INTEGRATION.md +311 -0
  82. package/docs/COMPANY-WEBSITE-DOGFOOD.ko.md +144 -0
  83. package/docs/COMPANY-WEBSITE-DOGFOOD.md +150 -0
  84. package/docs/COMPANY-WEBSITE-INTAKE-TEMPLATE.ko.md +153 -0
  85. package/docs/COMPANY-WEBSITE-INTAKE-TEMPLATE.md +154 -0
  86. package/docs/CONTRIBUTING.ko.md +203 -0
  87. package/docs/CONTRIBUTING.md +242 -0
  88. package/docs/CURSOR-INTEGRATION.md +220 -0
  89. package/docs/DISTRIBUTION.ko.md +248 -0
  90. package/docs/DISTRIBUTION.md +253 -0
  91. package/docs/DOGFOOD-FINDINGS.md +180 -0
  92. package/docs/DOGFOOD-V4-FINDINGS.md +139 -0
  93. package/docs/DOGFOOD-V4-MKDOCS-FINDINGS.md +233 -0
  94. package/docs/DOGFOOD-V4-NPM-FINDINGS.md +157 -0
  95. package/docs/DOGFOOD-V4-VSCODE-FINDINGS.md +135 -0
  96. package/docs/FIGMA-INTEGRATION.md +222 -0
  97. package/docs/MCP-INTEGRATION.md +243 -0
  98. package/docs/MIGRATION-v4.md +121 -0
  99. package/docs/PLUGIN-PACKAGING.md +240 -0
  100. package/docs/PRODUCT-READINESS.md +66 -0
  101. package/docs/QUICKSTART.ko.md +178 -0
  102. package/docs/QUICKSTART.md +179 -0
  103. package/docs/RELEASE-CHECKLIST.md +292 -0
  104. package/docs/ROADMAP.md +19495 -0
  105. package/docs/SESSION-LOG.md +940 -0
  106. package/docs/TOKEN-SYNC.md +237 -0
  107. package/docs/USING.ko.md +206 -0
  108. package/docs/USING.md +218 -0
  109. package/docs/WEBSITE-IMPROVEMENT.ko.md +75 -0
  110. package/docs/WEBSITE-IMPROVEMENT.md +89 -0
  111. package/docs/announcements/README.md +56 -0
  112. package/docs/announcements/dev-to-korea.md +206 -0
  113. package/docs/announcements/hashnode-post.ko.md +232 -0
  114. package/docs/announcements/okky-post.ko.md +158 -0
  115. package/docs/announcements/press-kit.md +101 -0
  116. package/docs/announcements/reddit-r-korea.md +196 -0
  117. package/docs/announcements/show-hn.md +114 -0
  118. package/docs/announcements/twitter-thread.md +255 -0
  119. package/docs/external-status.md +34 -0
  120. package/docs/integrations/aider-walkthrough.ko.md +275 -0
  121. package/docs/integrations/aider-walkthrough.md +274 -0
  122. package/docs/integrations/codex-walkthrough.ko.md +297 -0
  123. package/docs/integrations/codex-walkthrough.md +297 -0
  124. package/docs/integrations/cursor-walkthrough.ko.md +281 -0
  125. package/docs/integrations/cursor-walkthrough.md +284 -0
  126. package/docs/integrations/design-ai-mcp-server.md +169 -0
  127. package/docs/integrations/figma-mcp.md +149 -0
  128. package/docs/integrations/github-mcp.md +178 -0
  129. package/docs/integrations/linear-mcp.md +215 -0
  130. package/docs/integrations/notion-mcp.md +174 -0
  131. package/docs/integrations/sdk-walkthrough.ko.md +375 -0
  132. package/docs/integrations/sdk-walkthrough.md +375 -0
  133. package/docs/integrations/slack-mcp.md +208 -0
  134. package/docs/integrations/vscode-walkthrough.ko.md +202 -0
  135. package/docs/integrations/vscode-walkthrough.md +205 -0
  136. package/docs/requirements.txt +16 -0
  137. package/docs/site-overrides/extra.css +83 -0
  138. package/docs/site-overrides/favicon.svg +4 -0
  139. package/docs/site-overrides/logo.svg +10 -0
  140. package/docs/site-overrides/main.html +18 -0
  141. package/docs/website-console/app.js +2540 -0
  142. package/docs/website-console/index.html +24 -0
  143. package/docs/website-console/styles.css +975 -0
  144. package/examples/README.md +252 -0
  145. package/examples/cases/dogfood-v4-korean-hr-onboarding.md +356 -0
  146. package/examples/component-accordion-actions.md +153 -0
  147. package/examples/component-accordion-details.md +147 -0
  148. package/examples/component-accordion-summary.md +180 -0
  149. package/examples/component-accordion.md +229 -0
  150. package/examples/component-account-card.md +284 -0
  151. package/examples/component-address-input.md +260 -0
  152. package/examples/component-affix.md +190 -0
  153. package/examples/component-alert-dialog.md +210 -0
  154. package/examples/component-alert-title.md +77 -0
  155. package/examples/component-alert.md +192 -0
  156. package/examples/component-amount-input.md +278 -0
  157. package/examples/component-anchor.md +198 -0
  158. package/examples/component-app-bar.md +249 -0
  159. package/examples/component-aspect-ratio.md +156 -0
  160. package/examples/component-auto-complete.md +199 -0
  161. package/examples/component-avatar-group.md +170 -0
  162. package/examples/component-avatar.md +191 -0
  163. package/examples/component-back-top.md +123 -0
  164. package/examples/component-backdrop.md +148 -0
  165. package/examples/component-badge.md +181 -0
  166. package/examples/component-banner.md +237 -0
  167. package/examples/component-biometric-gate.md +281 -0
  168. package/examples/component-blockquote.md +153 -0
  169. package/examples/component-border-beam.md +207 -0
  170. package/examples/component-bottom-navigation.md +226 -0
  171. package/examples/component-box.md +112 -0
  172. package/examples/component-breadcrumb.md +222 -0
  173. package/examples/component-button-base.md +190 -0
  174. package/examples/component-button-group.md +117 -0
  175. package/examples/component-button.md +213 -0
  176. package/examples/component-calendar.md +280 -0
  177. package/examples/component-callout.md +131 -0
  178. package/examples/component-card-actions.md +101 -0
  179. package/examples/component-card-content.md +90 -0
  180. package/examples/component-card-header.md +122 -0
  181. package/examples/component-card-media.md +79 -0
  182. package/examples/component-card.md +233 -0
  183. package/examples/component-carousel.md +266 -0
  184. package/examples/component-cascader.md +135 -0
  185. package/examples/component-category-picker.md +271 -0
  186. package/examples/component-chart.md +237 -0
  187. package/examples/component-chat-interface.md +399 -0
  188. package/examples/component-checkbox.md +149 -0
  189. package/examples/component-click-away-listener.md +87 -0
  190. package/examples/component-code.md +213 -0
  191. package/examples/component-collapsible.md +219 -0
  192. package/examples/component-color-picker.md +110 -0
  193. package/examples/component-combobox.md +267 -0
  194. package/examples/component-command.md +299 -0
  195. package/examples/component-config-provider.md +190 -0
  196. package/examples/component-context-menu.md +179 -0
  197. package/examples/component-css-baseline.md +148 -0
  198. package/examples/component-date-picker.md +249 -0
  199. package/examples/component-descriptions.md +242 -0
  200. package/examples/component-dialog-actions.md +111 -0
  201. package/examples/component-dialog-content-text.md +76 -0
  202. package/examples/component-dialog-content.md +105 -0
  203. package/examples/component-dialog-title.md +104 -0
  204. package/examples/component-dialog.md +176 -0
  205. package/examples/component-divider.md +182 -0
  206. package/examples/component-doc-page.md +217 -0
  207. package/examples/component-drawer.md +257 -0
  208. package/examples/component-dropdown.md +220 -0
  209. package/examples/component-email-layout.md +253 -0
  210. package/examples/component-empty-state.md +269 -0
  211. package/examples/component-empty.md +172 -0
  212. package/examples/component-fade.md +87 -0
  213. package/examples/component-feature-grid.md +201 -0
  214. package/examples/component-field.md +266 -0
  215. package/examples/component-filled-input.md +114 -0
  216. package/examples/component-flex.md +117 -0
  217. package/examples/component-float-button.md +214 -0
  218. package/examples/component-form-control-label.md +134 -0
  219. package/examples/component-form-control.md +113 -0
  220. package/examples/component-form-controls.md +251 -0
  221. package/examples/component-form-group.md +86 -0
  222. package/examples/component-form-helper-text.md +95 -0
  223. package/examples/component-form-label.md +98 -0
  224. package/examples/component-form.md +291 -0
  225. package/examples/component-game-hud.md +362 -0
  226. package/examples/component-game-menu.md +327 -0
  227. package/examples/component-grid.md +140 -0
  228. package/examples/component-grow.md +79 -0
  229. package/examples/component-hero-block.md +252 -0
  230. package/examples/component-hover-card.md +211 -0
  231. package/examples/component-icon-button.md +142 -0
  232. package/examples/component-icon.md +102 -0
  233. package/examples/component-illustration.md +280 -0
  234. package/examples/component-image-list.md +107 -0
  235. package/examples/component-image.md +282 -0
  236. package/examples/component-input-adornment.md +101 -0
  237. package/examples/component-input-base.md +134 -0
  238. package/examples/component-input-number.md +141 -0
  239. package/examples/component-input-otp.md +271 -0
  240. package/examples/component-input.md +213 -0
  241. package/examples/component-item.md +243 -0
  242. package/examples/component-kbd.md +197 -0
  243. package/examples/component-krw-amount.md +219 -0
  244. package/examples/component-label.md +118 -0
  245. package/examples/component-layout.md +217 -0
  246. package/examples/component-link.md +223 -0
  247. package/examples/component-list-item-avatar.md +72 -0
  248. package/examples/component-list-item-button.md +139 -0
  249. package/examples/component-list-item-icon.md +82 -0
  250. package/examples/component-list-item-text.md +98 -0
  251. package/examples/component-list-item.md +116 -0
  252. package/examples/component-list-subheader.md +70 -0
  253. package/examples/component-list.md +198 -0
  254. package/examples/component-loading-button.md +125 -0
  255. package/examples/component-loading-sequence.md +254 -0
  256. package/examples/component-lottie-player.md +279 -0
  257. package/examples/component-masonry.md +191 -0
  258. package/examples/component-mentions.md +189 -0
  259. package/examples/component-menu-item.md +102 -0
  260. package/examples/component-menu-list.md +98 -0
  261. package/examples/component-menu.md +139 -0
  262. package/examples/component-menubar.md +259 -0
  263. package/examples/component-message.md +162 -0
  264. package/examples/component-mobile-stepper.md +155 -0
  265. package/examples/component-modal.md +220 -0
  266. package/examples/component-navigation-menu.md +295 -0
  267. package/examples/component-notification.md +166 -0
  268. package/examples/component-otp-countdown.md +245 -0
  269. package/examples/component-outlined-input.md +145 -0
  270. package/examples/component-page-transition.md +281 -0
  271. package/examples/component-pagination.md +226 -0
  272. package/examples/component-paper.md +199 -0
  273. package/examples/component-pass-auth.md +265 -0
  274. package/examples/component-payment-brand-button.md +253 -0
  275. package/examples/component-payment-method-selector.md +272 -0
  276. package/examples/component-payment-receipt.md +277 -0
  277. package/examples/component-popconfirm.md +144 -0
  278. package/examples/component-popover.md +239 -0
  279. package/examples/component-popper.md +129 -0
  280. package/examples/component-pricing-cards.md +247 -0
  281. package/examples/component-progress.md +195 -0
  282. package/examples/component-qr-code.md +201 -0
  283. package/examples/component-radio.md +167 -0
  284. package/examples/component-rate.md +202 -0
  285. package/examples/component-resizable.md +163 -0
  286. package/examples/component-result.md +270 -0
  287. package/examples/component-scroll-area.md +199 -0
  288. package/examples/component-scroll-reveal.md +320 -0
  289. package/examples/component-segmented.md +178 -0
  290. package/examples/component-select.md +258 -0
  291. package/examples/component-separator.md +177 -0
  292. package/examples/component-sheet.md +277 -0
  293. package/examples/component-sidebar.md +257 -0
  294. package/examples/component-skeleton.md +178 -0
  295. package/examples/component-slide.md +89 -0
  296. package/examples/component-slider.md +208 -0
  297. package/examples/component-snackbar-content.md +92 -0
  298. package/examples/component-snackbar.md +121 -0
  299. package/examples/component-sonner.md +165 -0
  300. package/examples/component-space.md +125 -0
  301. package/examples/component-spatial-locomotion.md +373 -0
  302. package/examples/component-spatial-panel.md +330 -0
  303. package/examples/component-speed-dial-action.md +78 -0
  304. package/examples/component-speed-dial.md +177 -0
  305. package/examples/component-spin.md +173 -0
  306. package/examples/component-spinner.md +204 -0
  307. package/examples/component-splitter.md +210 -0
  308. package/examples/component-stack.md +130 -0
  309. package/examples/component-statistic.md +282 -0
  310. package/examples/component-step-button.md +157 -0
  311. package/examples/component-step-connector.md +157 -0
  312. package/examples/component-step-content.md +121 -0
  313. package/examples/component-step-icon.md +115 -0
  314. package/examples/component-step-label.md +101 -0
  315. package/examples/component-step.md +84 -0
  316. package/examples/component-steps.md +264 -0
  317. package/examples/component-stock-chart.md +251 -0
  318. package/examples/component-swipeable-drawer.md +149 -0
  319. package/examples/component-switch.md +99 -0
  320. package/examples/component-tab-scroll-button.md +180 -0
  321. package/examples/component-tab.md +120 -0
  322. package/examples/component-table-body.md +82 -0
  323. package/examples/component-table-cell.md +118 -0
  324. package/examples/component-table-container.md +75 -0
  325. package/examples/component-table-footer.md +72 -0
  326. package/examples/component-table-head.md +78 -0
  327. package/examples/component-table-pagination.md +137 -0
  328. package/examples/component-table-row.md +113 -0
  329. package/examples/component-table-sort-label.md +109 -0
  330. package/examples/component-table.md +202 -0
  331. package/examples/component-tabs.md +184 -0
  332. package/examples/component-tag-badge.md +309 -0
  333. package/examples/component-tag.md +102 -0
  334. package/examples/component-testimonial-carousel.md +218 -0
  335. package/examples/component-textarea-autosize.md +114 -0
  336. package/examples/component-textarea.md +173 -0
  337. package/examples/component-time-picker.md +205 -0
  338. package/examples/component-timeline.md +170 -0
  339. package/examples/component-toast.md +224 -0
  340. package/examples/component-toggle-button.md +129 -0
  341. package/examples/component-toggle.md +220 -0
  342. package/examples/component-toolbar.md +104 -0
  343. package/examples/component-tooltip.md +178 -0
  344. package/examples/component-tour.md +176 -0
  345. package/examples/component-transaction-list-item.md +243 -0
  346. package/examples/component-transfer.md +156 -0
  347. package/examples/component-tree-select.md +202 -0
  348. package/examples/component-tree.md +297 -0
  349. package/examples/component-typography.md +215 -0
  350. package/examples/component-upload.md +295 -0
  351. package/examples/component-video-hero.md +409 -0
  352. package/examples/component-video-player.md +340 -0
  353. package/examples/component-voice-input.md +408 -0
  354. package/examples/component-watermark.md +217 -0
  355. package/examples/component-zoom.md +92 -0
  356. package/examples/doc-explanation-example.md +196 -0
  357. package/examples/doc-how-to-example.md +205 -0
  358. package/examples/doc-tutorial-example.md +162 -0
  359. package/examples/dogfood-korean-fintech-system.md +433 -0
  360. package/examples/email-transactional-example.md +259 -0
  361. package/examples/palette-saas-violet.md +235 -0
  362. package/examples/print-business-card-spec.md +205 -0
  363. package/examples/print-packaging-spec.md +285 -0
  364. package/examples/report-example.md +228 -0
  365. package/examples/slide-deck-example.md +237 -0
  366. package/examples/website-improvement-report.md +128 -0
  367. package/examples/website-improvement-workspace.json +126 -0
  368. package/install.sh +189 -0
  369. package/knowledge/COVERAGE.md +740 -0
  370. package/knowledge/PRINCIPLES.md +108 -0
  371. package/knowledge/a11y/contrast.md +70 -0
  372. package/knowledge/a11y/keyboard-and-focus.md +108 -0
  373. package/knowledge/colors/color-theory.md +90 -0
  374. package/knowledge/colors/mui-palette-structure.md +105 -0
  375. package/knowledge/colors/palettes-by-product-type.md +876 -0
  376. package/knowledge/components/INDEX.md +231 -0
  377. package/knowledge/components/index.json +1470 -0
  378. package/knowledge/components/shadcn-registry.md +159 -0
  379. package/knowledge/conversational/ai-chat-interfaces.md +323 -0
  380. package/knowledge/conversational/chatbot-design.md +312 -0
  381. package/knowledge/conversational/conversational-ui-fundamentals.md +299 -0
  382. package/knowledge/conversational/korean-voice-conventions.md +281 -0
  383. package/knowledge/conversational/voice-ui-patterns.md +297 -0
  384. package/knowledge/design-tokens/ant-design.md +124 -0
  385. package/knowledge/design-tokens/material-3.md +235 -0
  386. package/knowledge/design-tokens/polaris-and-carbon.md +231 -0
  387. package/knowledge/design-tokens/tailwind-v4.md +284 -0
  388. package/knowledge/game-ui/game-accessibility.md +317 -0
  389. package/knowledge/game-ui/game-ui-fundamentals.md +281 -0
  390. package/knowledge/game-ui/hud-design.md +324 -0
  391. package/knowledge/game-ui/korean-gaming-conventions.md +312 -0
  392. package/knowledge/game-ui/menu-systems.md +388 -0
  393. package/knowledge/i18n/korean-app-store-visual.md +223 -0
  394. package/knowledge/i18n/korean-document-style.md +301 -0
  395. package/knowledge/i18n/korean-payments.md +211 -0
  396. package/knowledge/i18n/korean-product-conventions.md +96 -0
  397. package/knowledge/i18n/korean-publishing.md +139 -0
  398. package/knowledge/i18n/korean-typography.md +123 -0
  399. package/knowledge/icons/curated-sets.md +225 -0
  400. package/knowledge/illustration/hero-illustrations.md +234 -0
  401. package/knowledge/illustration/illustration-systems.md +221 -0
  402. package/knowledge/illustration/mascot-design.md +208 -0
  403. package/knowledge/illustration/spot-illustrations.md +246 -0
  404. package/knowledge/illustration/svg-optimization.md +308 -0
  405. package/knowledge/layout/spacing-and-grid.md +119 -0
  406. package/knowledge/motion/app-loading-sequences.md +277 -0
  407. package/knowledge/motion/choreography-depth.md +297 -0
  408. package/knowledge/motion/marketing-motion.md +223 -0
  409. package/knowledge/motion/micro-interactions.md +266 -0
  410. package/knowledge/motion/motion-tools.md +281 -0
  411. package/knowledge/motion/principles.md +126 -0
  412. package/knowledge/patterns/auth-flow-design.md +316 -0
  413. package/knowledge/patterns/b2b-onboarding-flows.md +182 -0
  414. package/knowledge/patterns/brand-identity.md +238 -0
  415. package/knowledge/patterns/brand-references.md +97 -0
  416. package/knowledge/patterns/chart-color-encoding.md +269 -0
  417. package/knowledge/patterns/chart-types.md +344 -0
  418. package/knowledge/patterns/dashboard-composition.md +299 -0
  419. package/knowledge/patterns/design-system-qa.md +356 -0
  420. package/knowledge/patterns/document-typography.md +248 -0
  421. package/knowledge/patterns/email-design.md +338 -0
  422. package/knowledge/patterns/empty-states.md +263 -0
  423. package/knowledge/patterns/error-states.md +318 -0
  424. package/knowledge/patterns/form-design.md +237 -0
  425. package/knowledge/patterns/information-architecture.md +341 -0
  426. package/knowledge/patterns/landing-hero-design.md +283 -0
  427. package/knowledge/patterns/landing-page-patterns.md +681 -0
  428. package/knowledge/patterns/list-and-feed.md +371 -0
  429. package/knowledge/patterns/mobile-navigation.md +278 -0
  430. package/knowledge/patterns/money-and-amount.md +301 -0
  431. package/knowledge/patterns/onboarding.md +300 -0
  432. package/knowledge/patterns/pricing-page-design.md +261 -0
  433. package/knowledge/patterns/realtime-data.md +280 -0
  434. package/knowledge/patterns/report-design.md +330 -0
  435. package/knowledge/patterns/search-ux.md +373 -0
  436. package/knowledge/patterns/settings-page.md +325 -0
  437. package/knowledge/patterns/slide-deck-design.md +316 -0
  438. package/knowledge/patterns/styles-catalog.md +2599 -0
  439. package/knowledge/patterns/technical-writing.md +306 -0
  440. package/knowledge/patterns/ui-reasoning.md +1853 -0
  441. package/knowledge/patterns/ux-guidelines.md +1454 -0
  442. package/knowledge/platforms/react-native.md +395 -0
  443. package/knowledge/print/brochures-and-flyers.md +276 -0
  444. package/knowledge/print/korean-print-conventions.md +284 -0
  445. package/knowledge/print/packaging.md +321 -0
  446. package/knowledge/print/print-fundamentals.md +238 -0
  447. package/knowledge/print/signage-and-posters.md +235 -0
  448. package/knowledge/print/stationery.md +262 -0
  449. package/knowledge/spatial/ar-patterns.md +253 -0
  450. package/knowledge/spatial/comfort-and-accessibility.md +245 -0
  451. package/knowledge/spatial/spatial-design-fundamentals.md +346 -0
  452. package/knowledge/spatial/spatial-ui-elements.md +343 -0
  453. package/knowledge/spatial/vr-patterns.md +302 -0
  454. package/knowledge/typography/font-pairings.md +332 -0
  455. package/knowledge/typography/mui-type-scale.md +57 -0
  456. package/knowledge/typography/type-scale-fundamentals.md +105 -0
  457. package/knowledge/video/in-product-video.md +277 -0
  458. package/knowledge/video/korean-video-conventions.md +247 -0
  459. package/knowledge/video/marketing-video.md +258 -0
  460. package/knowledge/video/social-and-short-form.md +257 -0
  461. package/knowledge/video/video-fundamentals.md +296 -0
  462. package/package.json +106 -0
  463. package/skills/README.md +39 -0
  464. package/skills/color-palette/PLAYBOOK.md +175 -0
  465. package/skills/color-palette/SKILL.md +6 -0
  466. package/skills/color-palette/TEMPLATE.md +103 -0
  467. package/skills/component-spec-writer/PLAYBOOK.md +169 -0
  468. package/skills/component-spec-writer/SKILL.md +6 -0
  469. package/skills/component-spec-writer/TEMPLATE.md +115 -0
  470. package/skills/conversational-ui-designer/PLAYBOOK.md +231 -0
  471. package/skills/conversational-ui-designer/SKILL.md +6 -0
  472. package/skills/design-broadcast/PLAYBOOK.md +146 -0
  473. package/skills/design-broadcast/SKILL.md +6 -0
  474. package/skills/design-critique/PLAYBOOK.md +137 -0
  475. package/skills/design-critique/SKILL.md +6 -0
  476. package/skills/design-pr-review/PLAYBOOK.md +171 -0
  477. package/skills/design-pr-review/SKILL.md +6 -0
  478. package/skills/design-system-builder/PLAYBOOK.md +218 -0
  479. package/skills/design-system-builder/SKILL.md +6 -0
  480. package/skills/design-system-qa/PLAYBOOK.md +163 -0
  481. package/skills/design-system-qa/SKILL.md +6 -0
  482. package/skills/document-author/PLAYBOOK.md +167 -0
  483. package/skills/document-author/SKILL.md +6 -0
  484. package/skills/figma-token-sync/PLAYBOOK.md +149 -0
  485. package/skills/figma-token-sync/SKILL.md +6 -0
  486. package/skills/game-ui-designer/PLAYBOOK.md +209 -0
  487. package/skills/game-ui-designer/SKILL.md +6 -0
  488. package/skills/handoff-spec/PLAYBOOK.md +170 -0
  489. package/skills/handoff-spec/SKILL.md +6 -0
  490. package/skills/illustration-designer/PLAYBOOK.md +166 -0
  491. package/skills/illustration-designer/SKILL.md +6 -0
  492. package/skills/motion-designer/PLAYBOOK.md +223 -0
  493. package/skills/motion-designer/SKILL.md +6 -0
  494. package/skills/print-designer/PLAYBOOK.md +209 -0
  495. package/skills/print-designer/SKILL.md +6 -0
  496. package/skills/slide-deck-author/PLAYBOOK.md +198 -0
  497. package/skills/slide-deck-author/SKILL.md +6 -0
  498. package/skills/spatial-designer/PLAYBOOK.md +238 -0
  499. package/skills/spatial-designer/SKILL.md +6 -0
  500. package/skills/ux-audit/PLAYBOOK.md +142 -0
  501. package/skills/ux-audit/SKILL.md +6 -0
  502. package/skills/video-designer/PLAYBOOK.md +240 -0
  503. package/skills/video-designer/SKILL.md +6 -0
  504. package/skills/website-improvement/PLAYBOOK.md +118 -0
  505. package/skills/website-improvement/SKILL.md +6 -0
  506. package/skills/website-improvement/TEMPLATE.md +103 -0
  507. package/tools/audit/changelog-generate.py +176 -0
  508. package/tools/audit/check-coverage.py +483 -0
  509. package/tools/audit/doctor_assertions.py +256 -0
  510. package/tools/audit/example-qa.py +108 -0
  511. package/tools/audit/frontmatter-check.py +199 -0
  512. package/tools/audit/integration-check.py +95 -0
  513. package/tools/audit/korean-copy-check.py +161 -0
  514. package/tools/audit/link-check.py +146 -0
  515. package/tools/audit/local-ci.py +558 -0
  516. package/tools/audit/package-contents.py +723 -0
  517. package/tools/audit/package-smoke.py +22443 -0
  518. package/tools/audit/raw-hex-check.py +252 -0
  519. package/tools/audit/registry-smoke.py +8188 -0
  520. package/tools/audit/release-metadata.py +9832 -0
  521. package/tools/audit/run-all.py +351 -0
  522. package/tools/audit/smoke_assertions.py +12742 -0
  523. package/tools/audit/stability-review.py +332 -0
  524. package/tools/audit/stale-check.py +156 -0
  525. package/tools/migrations/add-version-frontmatter.py +132 -0
  526. package/tools/migrations/bump-last-updated.py +131 -0
  527. package/tools/migrations/promote-stability.py +172 -0
  528. package/tools/preview/README.md +58 -0
  529. 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)