@contui/ui 0.0.0-stage → 0.1.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 (427) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +150 -2
  3. package/cli/contui.mjs +250 -0
  4. package/dist/charts/area-chart.d.ts +8 -0
  5. package/dist/charts/area-chart.js +9 -0
  6. package/dist/charts/bar-chart.d.ts +9 -0
  7. package/dist/charts/bar-chart.js +10 -0
  8. package/dist/charts/bubble-chart.d.ts +60 -0
  9. package/dist/charts/bubble-chart.js +392 -0
  10. package/dist/charts/bullet-chart.d.ts +53 -0
  11. package/dist/charts/bullet-chart.js +123 -0
  12. package/dist/charts/candlestick-chart.d.ts +77 -0
  13. package/dist/charts/candlestick-chart.js +558 -0
  14. package/dist/charts/cartesian.d.ts +121 -0
  15. package/dist/charts/cartesian.js +625 -0
  16. package/dist/charts/chart-card.d.ts +80 -0
  17. package/dist/charts/chart-card.js +114 -0
  18. package/dist/charts/donut-chart.d.ts +40 -0
  19. package/dist/charts/donut-chart.js +88 -0
  20. package/dist/charts/funnel-chart.d.ts +16 -0
  21. package/dist/charts/funnel-chart.js +164 -0
  22. package/dist/charts/horizontal-bar-chart.d.ts +67 -0
  23. package/dist/charts/horizontal-bar-chart.js +481 -0
  24. package/dist/charts/index.d.ts +21 -0
  25. package/dist/charts/index.js +32 -0
  26. package/dist/charts/legend.d.ts +23 -0
  27. package/dist/charts/legend.js +22 -0
  28. package/dist/charts/lib/candlestick-window.d.ts +15 -0
  29. package/dist/charts/lib/candlestick-window.js +23 -0
  30. package/dist/charts/lib/color.d.ts +39 -0
  31. package/dist/charts/lib/color.js +83 -0
  32. package/dist/charts/lib/format.d.ts +11 -0
  33. package/dist/charts/lib/format.js +33 -0
  34. package/dist/charts/lib/frame.d.ts +6 -0
  35. package/dist/charts/lib/frame.js +6 -0
  36. package/dist/charts/lib/layout.d.ts +11 -0
  37. package/dist/charts/lib/layout.js +71 -0
  38. package/dist/charts/lib/path.d.ts +35 -0
  39. package/dist/charts/lib/path.js +203 -0
  40. package/dist/charts/lib/scale.d.ts +41 -0
  41. package/dist/charts/lib/scale.js +80 -0
  42. package/dist/charts/lib/use-active.d.ts +18 -0
  43. package/dist/charts/lib/use-active.js +71 -0
  44. package/dist/charts/lib/use-size.d.ts +9 -0
  45. package/dist/charts/lib/use-size.js +40 -0
  46. package/dist/charts/line-chart.d.ts +7 -0
  47. package/dist/charts/line-chart.js +8 -0
  48. package/dist/charts/radar-chart.d.ts +27 -0
  49. package/dist/charts/radar-chart.js +165 -0
  50. package/dist/charts/rose-chart.d.ts +35 -0
  51. package/dist/charts/rose-chart.js +242 -0
  52. package/dist/charts/sparkline.d.ts +35 -0
  53. package/dist/charts/sparkline.js +110 -0
  54. package/dist/charts/tooltip.d.ts +35 -0
  55. package/dist/charts/tooltip.js +22 -0
  56. package/dist/charts/treemap.d.ts +28 -0
  57. package/dist/charts/treemap.js +103 -0
  58. package/dist/charts/uptime-strip.d.ts +40 -0
  59. package/dist/charts/uptime-strip.js +178 -0
  60. package/dist/components/accordion.d.ts +31 -0
  61. package/dist/components/accordion.js +34 -0
  62. package/dist/components/activity-item.d.ts +12 -0
  63. package/dist/components/activity-item.js +6 -0
  64. package/dist/components/alert.d.ts +21 -0
  65. package/dist/components/alert.js +58 -0
  66. package/dist/components/assistant-answer.d.ts +52 -0
  67. package/dist/components/assistant-answer.js +40 -0
  68. package/dist/components/assistant-prompt.d.ts +63 -0
  69. package/dist/components/assistant-prompt.js +122 -0
  70. package/dist/components/avatar.d.ts +28 -0
  71. package/dist/components/avatar.js +75 -0
  72. package/dist/components/badge.d.ts +16 -0
  73. package/dist/components/badge.js +33 -0
  74. package/dist/components/bar-list.d.ts +65 -0
  75. package/dist/components/bar-list.js +119 -0
  76. package/dist/components/block-slider.d.ts +43 -0
  77. package/dist/components/block-slider.js +63 -0
  78. package/dist/components/branch-graph.d.ts +87 -0
  79. package/dist/components/branch-graph.js +231 -0
  80. package/dist/components/breadcrumb.d.ts +41 -0
  81. package/dist/components/breadcrumb.js +53 -0
  82. package/dist/components/button.d.ts +23 -0
  83. package/dist/components/button.js +108 -0
  84. package/dist/components/calendar.d.ts +5 -0
  85. package/dist/components/calendar.js +90 -0
  86. package/dist/components/card.d.ts +65 -0
  87. package/dist/components/card.js +104 -0
  88. package/dist/components/chat-attachment.d.ts +47 -0
  89. package/dist/components/chat-attachment.js +63 -0
  90. package/dist/components/chat-event.d.ts +7 -0
  91. package/dist/components/chat-event.js +7 -0
  92. package/dist/components/chat-message.d.ts +59 -0
  93. package/dist/components/chat-message.js +91 -0
  94. package/dist/components/chat-reference.d.ts +20 -0
  95. package/dist/components/chat-reference.js +41 -0
  96. package/dist/components/chat-shared.d.ts +21 -0
  97. package/dist/components/chat-shared.js +23 -0
  98. package/dist/components/chat-suggestions.d.ts +59 -0
  99. package/dist/components/chat-suggestions.js +88 -0
  100. package/dist/components/chat-thread.d.ts +39 -0
  101. package/dist/components/chat-thread.js +172 -0
  102. package/dist/components/chat-typing.d.ts +35 -0
  103. package/dist/components/chat-typing.js +66 -0
  104. package/dist/components/checkbox.d.ts +18 -0
  105. package/dist/components/checkbox.js +33 -0
  106. package/dist/components/checklist.d.ts +26 -0
  107. package/dist/components/checklist.js +18 -0
  108. package/dist/components/chip.d.ts +29 -0
  109. package/dist/components/chip.js +61 -0
  110. package/dist/components/code-input.d.ts +40 -0
  111. package/dist/components/code-input.js +285 -0
  112. package/dist/components/color-picker.d.ts +38 -0
  113. package/dist/components/color-picker.js +855 -0
  114. package/dist/components/combobox.d.ts +75 -0
  115. package/dist/components/combobox.js +112 -0
  116. package/dist/components/command-menu.d.ts +58 -0
  117. package/dist/components/command-menu.js +166 -0
  118. package/dist/components/copy-button.d.ts +16 -0
  119. package/dist/components/copy-button.js +31 -0
  120. package/dist/components/data-grid.d.ts +50 -0
  121. package/dist/components/data-grid.js +599 -0
  122. package/dist/components/date-picker.d.ts +109 -0
  123. package/dist/components/date-picker.js +268 -0
  124. package/dist/components/description-list.d.ts +12 -0
  125. package/dist/components/description-list.js +10 -0
  126. package/dist/components/dialog.d.ts +57 -0
  127. package/dist/components/dialog.js +140 -0
  128. package/dist/components/dock.d.ts +45 -0
  129. package/dist/components/dock.js +79 -0
  130. package/dist/components/drop-zone.d.ts +46 -0
  131. package/dist/components/drop-zone.js +101 -0
  132. package/dist/components/dropdown-menu.d.ts +50 -0
  133. package/dist/components/dropdown-menu.js +78 -0
  134. package/dist/components/editable-cell.d.ts +34 -0
  135. package/dist/components/editable-cell.js +89 -0
  136. package/dist/components/empty-state.d.ts +17 -0
  137. package/dist/components/empty-state.js +9 -0
  138. package/dist/components/field.d.ts +43 -0
  139. package/dist/components/field.js +75 -0
  140. package/dist/components/filter-condition.d.ts +188 -0
  141. package/dist/components/filter-condition.js +113 -0
  142. package/dist/components/filter-menu.d.ts +57 -0
  143. package/dist/components/filter-menu.js +46 -0
  144. package/dist/components/header-bar.d.ts +84 -0
  145. package/dist/components/header-bar.js +94 -0
  146. package/dist/components/hold-button.d.ts +15 -0
  147. package/dist/components/hold-button.js +88 -0
  148. package/dist/components/icon-tile.d.ts +12 -0
  149. package/dist/components/icon-tile.js +29 -0
  150. package/dist/components/info-tip.d.ts +13 -0
  151. package/dist/components/info-tip.js +26 -0
  152. package/dist/components/input.d.ts +17 -0
  153. package/dist/components/input.js +83 -0
  154. package/dist/components/kbd.d.ts +6 -0
  155. package/dist/components/kbd.js +7 -0
  156. package/dist/components/menu-item.d.ts +56 -0
  157. package/dist/components/menu-item.js +94 -0
  158. package/dist/components/message-composer.d.ts +75 -0
  159. package/dist/components/message-composer.js +199 -0
  160. package/dist/components/nav-rail.d.ts +31 -0
  161. package/dist/components/nav-rail.js +85 -0
  162. package/dist/components/notice.d.ts +45 -0
  163. package/dist/components/notice.js +66 -0
  164. package/dist/components/optimistic-undo.d.ts +28 -0
  165. package/dist/components/optimistic-undo.js +43 -0
  166. package/dist/components/option-row.d.ts +15 -0
  167. package/dist/components/option-row.js +14 -0
  168. package/dist/components/page-content.d.ts +11 -0
  169. package/dist/components/page-content.js +31 -0
  170. package/dist/components/pagination.d.ts +34 -0
  171. package/dist/components/pagination.js +41 -0
  172. package/dist/components/popover.d.ts +27 -0
  173. package/dist/components/popover.js +25 -0
  174. package/dist/components/progress.d.ts +33 -0
  175. package/dist/components/progress.js +75 -0
  176. package/dist/components/radio-group.d.ts +7 -0
  177. package/dist/components/radio-group.js +33 -0
  178. package/dist/components/readonly-field.d.ts +33 -0
  179. package/dist/components/readonly-field.js +80 -0
  180. package/dist/components/segmented-control.d.ts +21 -0
  181. package/dist/components/segmented-control.js +108 -0
  182. package/dist/components/select.d.ts +42 -0
  183. package/dist/components/select.js +86 -0
  184. package/dist/components/separator.d.ts +10 -0
  185. package/dist/components/separator.js +7 -0
  186. package/dist/components/setting-row.d.ts +53 -0
  187. package/dist/components/setting-row.js +93 -0
  188. package/dist/components/sidebar-switcher.d.ts +47 -0
  189. package/dist/components/sidebar-switcher.js +20 -0
  190. package/dist/components/sidebar.d.ts +220 -0
  191. package/dist/components/sidebar.js +327 -0
  192. package/dist/components/skeleton.d.ts +18 -0
  193. package/dist/components/skeleton.js +23 -0
  194. package/dist/components/slider.d.ts +15 -0
  195. package/dist/components/slider.js +28 -0
  196. package/dist/components/spinner.d.ts +14 -0
  197. package/dist/components/spinner.js +19 -0
  198. package/dist/components/status-dot.d.ts +24 -0
  199. package/dist/components/status-dot.js +35 -0
  200. package/dist/components/stepper.d.ts +60 -0
  201. package/dist/components/stepper.js +197 -0
  202. package/dist/components/switch.d.ts +9 -0
  203. package/dist/components/switch.js +26 -0
  204. package/dist/components/table-cell.d.ts +38 -0
  205. package/dist/components/table-cell.js +107 -0
  206. package/dist/components/table-context.d.ts +48 -0
  207. package/dist/components/table-context.js +69 -0
  208. package/dist/components/table-head.d.ts +42 -0
  209. package/dist/components/table-head.js +188 -0
  210. package/dist/components/table-tree.d.ts +96 -0
  211. package/dist/components/table-tree.js +137 -0
  212. package/dist/components/table.d.ts +78 -0
  213. package/dist/components/table.js +119 -0
  214. package/dist/components/tabs.d.ts +27 -0
  215. package/dist/components/tabs.js +79 -0
  216. package/dist/components/textarea.d.ts +3 -0
  217. package/dist/components/textarea.js +20 -0
  218. package/dist/components/theme.d.ts +41 -0
  219. package/dist/components/theme.js +60 -0
  220. package/dist/components/thinking.d.ts +68 -0
  221. package/dist/components/thinking.js +94 -0
  222. package/dist/components/toast.d.ts +39 -0
  223. package/dist/components/toast.js +110 -0
  224. package/dist/components/toolbar.d.ts +25 -0
  225. package/dist/components/toolbar.js +92 -0
  226. package/dist/components/tooltip.d.ts +23 -0
  227. package/dist/components/tooltip.js +27 -0
  228. package/dist/components/top-nav.d.ts +129 -0
  229. package/dist/components/top-nav.js +211 -0
  230. package/dist/components/truncate.d.ts +29 -0
  231. package/dist/components/truncate.js +138 -0
  232. package/dist/deprecated.d.ts +43 -0
  233. package/dist/deprecated.js +47 -0
  234. package/dist/index.d.ts +93 -0
  235. package/dist/index.js +93 -0
  236. package/dist/lib/cn.d.ts +5 -0
  237. package/dist/lib/cn.js +14 -0
  238. package/dist/lib/color.d.ts +136 -0
  239. package/dist/lib/color.js +307 -0
  240. package/dist/lib/contrast.d.ts +53 -0
  241. package/dist/lib/contrast.js +169 -0
  242. package/dist/lib/create-theme.d.ts +240 -0
  243. package/dist/lib/create-theme.js +461 -0
  244. package/dist/lib/harmony.d.ts +102 -0
  245. package/dist/lib/harmony.js +426 -0
  246. package/dist/lib/import-theme.d.ts +22 -0
  247. package/dist/lib/import-theme.js +221 -0
  248. package/dist/lib/overflow-scroll.d.ts +25 -0
  249. package/dist/lib/overflow-scroll.js +66 -0
  250. package/dist/lib/radio-toggle-render.d.ts +3 -0
  251. package/dist/lib/radio-toggle-render.js +9 -0
  252. package/dist/lib/reorder.d.ts +38 -0
  253. package/dist/lib/reorder.js +193 -0
  254. package/dist/lib/spacing.d.ts +101 -0
  255. package/dist/lib/spacing.js +118 -0
  256. package/dist/lib/tailwind-palette.d.ts +5 -0
  257. package/dist/lib/tailwind-palette.js +351 -0
  258. package/dist/lib/truncate.d.ts +18 -0
  259. package/dist/lib/truncate.js +69 -0
  260. package/dist/lib/use-single-value.d.ts +5 -0
  261. package/dist/lib/use-single-value.js +17 -0
  262. package/dist/styles.css +7988 -0
  263. package/mcp/server.mjs +87590 -0
  264. package/package.json +58 -5
  265. package/skills/continuum-fix-padding/SKILL.md +69 -0
  266. package/skills/continuum-fix-padding/scripts/compute.ts +155 -0
  267. package/skills/continuum-fix-padding/scripts/spacing.ts +189 -0
  268. package/skills/continuum-taste/SKILL.md +186 -0
  269. package/skills/continuum-taste/assets/tokens.css +647 -0
  270. package/skills/continuum-taste/references/charts.md +375 -0
  271. package/skills/continuum-taste/references/components.md +1369 -0
  272. package/skills/continuum-taste/references/foundations.md +539 -0
  273. package/skills/continuum-taste/references/media/canvas.md +75 -0
  274. package/skills/continuum-taste/references/media/css.md +61 -0
  275. package/skills/continuum-taste/references/media/react.md +161 -0
  276. package/skills/continuum-taste/references/method.md +87 -0
  277. package/skills/continuum-taste/references/pages.md +391 -0
  278. package/skills/continuum-taste/references/patterns.md +77 -0
  279. package/skills/continuum-taste/references/screens/agent.tsx +450 -0
  280. package/skills/continuum-taste/references/screens/analytics-overview.tsx +377 -0
  281. package/skills/continuum-taste/references/screens/checkout-funnel.tsx +193 -0
  282. package/skills/continuum-taste/references/screens/customer.tsx +475 -0
  283. package/skills/continuum-taste/references/screens/customers.tsx +608 -0
  284. package/skills/continuum-taste/references/screens/index.tsx +72 -0
  285. package/skills/continuum-taste/references/screens/invoice-editor.tsx +558 -0
  286. package/skills/continuum-taste/references/screens/new-customer.tsx +205 -0
  287. package/skills/continuum-taste/references/screens/overview.tsx +196 -0
  288. package/skills/continuum-taste/references/screens/report-generator.tsx +329 -0
  289. package/skills/continuum-taste/references/screens/risk-report.tsx +577 -0
  290. package/skills/continuum-taste/references/screens/sequence-editor.tsx +455 -0
  291. package/skills/continuum-taste/references/screens/settings.tsx +288 -0
  292. package/skills/continuum-taste/references/screens/shared.tsx +204 -0
  293. package/skills/continuum-taste/references/screens/sign-in.tsx +104 -0
  294. package/skills/continuum-taste/references/screens/workspace.tsx +596 -0
  295. package/skills/continuum-taste/references/theming.md +95 -0
  296. package/src/charts/area-chart.tsx +17 -0
  297. package/src/charts/bar-chart.tsx +15 -0
  298. package/src/charts/bubble-chart.tsx +913 -0
  299. package/src/charts/bullet-chart.tsx +419 -0
  300. package/src/charts/candlestick-chart.tsx +1242 -0
  301. package/src/charts/cartesian.tsx +1437 -0
  302. package/src/charts/chart-card.tsx +394 -0
  303. package/src/charts/donut-chart.tsx +299 -0
  304. package/src/charts/funnel-chart.tsx +373 -0
  305. package/src/charts/horizontal-bar-chart.tsx +991 -0
  306. package/src/charts/index.ts +76 -0
  307. package/src/charts/legend.tsx +59 -0
  308. package/src/charts/lib/candlestick-window.ts +42 -0
  309. package/src/charts/lib/color.ts +110 -0
  310. package/src/charts/lib/format.ts +42 -0
  311. package/src/charts/lib/frame.ts +6 -0
  312. package/src/charts/lib/layout.ts +78 -0
  313. package/src/charts/lib/path.ts +225 -0
  314. package/src/charts/lib/scale.ts +91 -0
  315. package/src/charts/lib/use-active.ts +87 -0
  316. package/src/charts/lib/use-size.ts +45 -0
  317. package/src/charts/line-chart.tsx +16 -0
  318. package/src/charts/radar-chart.tsx +485 -0
  319. package/src/charts/rose-chart.tsx +553 -0
  320. package/src/charts/sparkline.tsx +293 -0
  321. package/src/charts/tooltip.tsx +105 -0
  322. package/src/charts/treemap.tsx +271 -0
  323. package/src/charts/uptime-strip.tsx +469 -0
  324. package/src/components/accordion.tsx +136 -0
  325. package/src/components/activity-item.tsx +43 -0
  326. package/src/components/alert.tsx +135 -0
  327. package/src/components/assistant-answer.tsx +185 -0
  328. package/src/components/assistant-prompt.tsx +352 -0
  329. package/src/components/avatar.tsx +157 -0
  330. package/src/components/badge.tsx +55 -0
  331. package/src/components/bar-list.tsx +350 -0
  332. package/src/components/block-slider.tsx +189 -0
  333. package/src/components/branch-graph.tsx +580 -0
  334. package/src/components/breadcrumb.tsx +173 -0
  335. package/src/components/button.tsx +157 -0
  336. package/src/components/calendar.tsx +154 -0
  337. package/src/components/card.tsx +296 -0
  338. package/src/components/chat-attachment.tsx +255 -0
  339. package/src/components/chat-event.tsx +34 -0
  340. package/src/components/chat-message.tsx +332 -0
  341. package/src/components/chat-reference.tsx +100 -0
  342. package/src/components/chat-shared.ts +41 -0
  343. package/src/components/chat-suggestions.tsx +188 -0
  344. package/src/components/chat-thread.tsx +348 -0
  345. package/src/components/chat-typing.tsx +155 -0
  346. package/src/components/checkbox.tsx +83 -0
  347. package/src/components/checklist.tsx +146 -0
  348. package/src/components/chip.tsx +152 -0
  349. package/src/components/code-input.tsx +406 -0
  350. package/src/components/color-picker.tsx +1385 -0
  351. package/src/components/combobox.tsx +420 -0
  352. package/src/components/command-menu.tsx +405 -0
  353. package/src/components/copy-button.tsx +87 -0
  354. package/src/components/data-grid.tsx +965 -0
  355. package/src/components/date-picker.tsx +652 -0
  356. package/src/components/description-list.tsx +39 -0
  357. package/src/components/dialog.tsx +367 -0
  358. package/src/components/dock.tsx +192 -0
  359. package/src/components/drop-zone.tsx +283 -0
  360. package/src/components/dropdown-menu.tsx +323 -0
  361. package/src/components/editable-cell.tsx +219 -0
  362. package/src/components/empty-state.tsx +50 -0
  363. package/src/components/field.tsx +148 -0
  364. package/src/components/filter-condition.tsx +463 -0
  365. package/src/components/filter-menu.tsx +196 -0
  366. package/src/components/header-bar.tsx +220 -0
  367. package/src/components/hold-button.tsx +146 -0
  368. package/src/components/icon-tile.tsx +43 -0
  369. package/src/components/info-tip.tsx +87 -0
  370. package/src/components/input.tsx +136 -0
  371. package/src/components/kbd.tsx +17 -0
  372. package/src/components/menu-item.tsx +216 -0
  373. package/src/components/message-composer.tsx +458 -0
  374. package/src/components/nav-rail.tsx +235 -0
  375. package/src/components/notice.tsx +133 -0
  376. package/src/components/optimistic-undo.ts +68 -0
  377. package/src/components/option-row.tsx +54 -0
  378. package/src/components/page-content.tsx +44 -0
  379. package/src/components/pagination.tsx +182 -0
  380. package/src/components/popover.tsx +113 -0
  381. package/src/components/progress.tsx +222 -0
  382. package/src/components/radio-group.tsx +80 -0
  383. package/src/components/readonly-field.tsx +251 -0
  384. package/src/components/segmented-control.tsx +205 -0
  385. package/src/components/select.tsx +259 -0
  386. package/src/components/separator.tsx +30 -0
  387. package/src/components/setting-row.tsx +277 -0
  388. package/src/components/sidebar-switcher.tsx +134 -0
  389. package/src/components/sidebar.tsx +804 -0
  390. package/src/components/skeleton.tsx +57 -0
  391. package/src/components/slider.tsx +106 -0
  392. package/src/components/spinner.tsx +43 -0
  393. package/src/components/status-dot.tsx +100 -0
  394. package/src/components/stepper.tsx +459 -0
  395. package/src/components/switch.tsx +54 -0
  396. package/src/components/table-cell.tsx +239 -0
  397. package/src/components/table-context.ts +135 -0
  398. package/src/components/table-head.tsx +393 -0
  399. package/src/components/table-tree.tsx +357 -0
  400. package/src/components/table.tsx +295 -0
  401. package/src/components/tabs.tsx +191 -0
  402. package/src/components/textarea.tsx +44 -0
  403. package/src/components/theme.tsx +120 -0
  404. package/src/components/thinking.tsx +295 -0
  405. package/src/components/toast.tsx +308 -0
  406. package/src/components/toolbar.tsx +166 -0
  407. package/src/components/tooltip.tsx +84 -0
  408. package/src/components/top-nav.tsx +660 -0
  409. package/src/components/truncate.tsx +234 -0
  410. package/src/deprecated.ts +61 -0
  411. package/src/index.ts +184 -0
  412. package/src/lib/cn.ts +22 -0
  413. package/src/lib/color.ts +469 -0
  414. package/src/lib/contrast.ts +220 -0
  415. package/src/lib/create-theme.ts +659 -0
  416. package/src/lib/harmony.ts +609 -0
  417. package/src/lib/import-theme.ts +272 -0
  418. package/src/lib/overflow-scroll.tsx +108 -0
  419. package/src/lib/radio-toggle-render.tsx +15 -0
  420. package/src/lib/reorder.ts +222 -0
  421. package/src/lib/spacing.ts +189 -0
  422. package/src/lib/tailwind-palette.ts +355 -0
  423. package/src/lib/truncate.ts +79 -0
  424. package/src/lib/use-single-value.ts +23 -0
  425. package/src/styles/continuum.css +3 -0
  426. package/src/styles/theme.css +524 -0
  427. package/src/styles/tokens.css +647 -0
@@ -0,0 +1,539 @@
1
+ # Foundations
2
+
3
+ The values Continuum is made of, in units: pixels, hex, weights, milliseconds. They hold in any medium. Where a
4
+ value has a name (`neutral-200`, `radius-item`), that is the system's name for it; how the name is written in a
5
+ given medium (a Tailwind class, a Paper token, a CSS variable) is in `media/`. Nothing here depends on the
6
+ components existing.
7
+
8
+ Two settings to know first: everything sits in **light** or **dark** mode, and every colour ramp reads back to
9
+ front in dark, so a role keeps its name and swaps its value. And every corner follows one **corner scale**, so a
10
+ product can square or round the whole system at once.
11
+
12
+ ## Colour
13
+
14
+ ### The ramps
15
+
16
+ Five ramps of eleven steps, 50 to 950. The neutral ramp is pure grey by default; a theme may tint it. The
17
+ four chromatic ramps are built on one lightness curve from their 500, so they step alike and an accent built the
18
+ same way sits beside them without a seam.
19
+
20
+ | Step | neutral | primary | success | warning | error |
21
+ | ---- | --------- | --------- | --------- | --------- | --------- |
22
+ | 50 | `#f8f8f8` | `#f2f5ff` | `#f1f7ee` | `#faf4ee` | `#fff2ef` |
23
+ | 100 | `#ededed` | `#dee6ff` | `#e7f5e0` | `#fbeddf` | `#ffe4de` |
24
+ | 200 | `#d2d2d2` | `#bdccfe` | `#d6f1c9` | `#fce1c6` | `#ffcdc3` |
25
+ | 300 | `#b3b3b3` | `#91a7fe` | `#bceca4` | `#ffcfa0` | `#ffab9a` |
26
+ | 400 | `#9a9a9a` | `#596ff4` | `#98e26d` | `#ffb567` | `#ff7259` |
27
+ | 500 | `#818181` | `#3939e5` | `#7cd93a` | `#fca131` | `#f53e20` |
28
+ | 600 | `#676767` | `#3218e0` | `#5db500` | `#d68200` | `#d62400` |
29
+ | 700 | `#484848` | `#2a16c4` | `#4a9300` | `#ae6900` | `#b41c00` |
30
+ | 800 | `#2a2a2a` | `#23219f` | `#397400` | `#8a5200` | `#941600` |
31
+ | 900 | `#181818` | `#20267f` | `#2e5d04` | `#704201` | `#791a0b` |
32
+ | 950 | `#0d0d0d` | `#171e52` | `#122d00` | `#381e00` | `#461007` |
33
+
34
+ **Dark mode reverses each ramp**: `neutral-50` becomes `#0d0d0d`, `neutral-950` becomes `#f8f8f8`, `neutral-200`
35
+ becomes `#2a2a2a`, and so on, step *n* taking the value of step *1000 − n*; 500 stays. The same for the four
36
+ chromatic ramps. So a role is always named by its light step, and the value follows the mode.
37
+
38
+ ### Roles
39
+
40
+ Use a step by what it means, never by how it looks:
41
+
42
+ | Role | Name | Light | Dark |
43
+ | --------------------------------------------------------- | ------------- | --------- | --------- |
44
+ | Surface: panels, cards, dialogs, floating bars, inputs | `neutral-50` | `#f8f8f8` | `#0d0d0d` |
45
+ | Canvas behind the panel; muted fills *inside* a bordered container (a table header, a group row) | `neutral-100` | `#ededed` | `#181818` |
46
+ | The hairline: every border and every divider | `neutral-200` | `#d2d2d2` | `#2a2a2a` |
47
+ | A plain field's hover border; a switch's off track; an unchecked mark's border (checkbox, radio, a menu row's indicator) | `neutral-300` | `#b3b3b3` | `#484848` |
48
+ | Disabled helper text; decorative marks (a breadcrumb's home and separators); a calendar's days outside the month; an unchecked mark's hover border | `neutral-400` | `#9a9a9a` | `#676767` |
49
+ | The focus ring; quiet icons | `neutral-500` | `#818181` | `#818181` |
50
+ | Secondary text, card titles, idle controls, default icons; **and every quieter text**: placeholders, hints, helper text, muted labels, eyebrows, timestamps, counts | `neutral-600` | `#676767` | `#9a9a9a` |
51
+ | Quieter body text; a footer label | `neutral-700` | `#484848` | `#b3b3b3` |
52
+ | Ghost text on hover | `neutral-800` | `#2a2a2a` | `#d2d2d2` |
53
+ | An input's value, a table cell | `neutral-900` | `#181818` | `#ededed` |
54
+ | Primary text, titles, the active sidebar item | `neutral-950` | `#0d0d0d` | `#f8f8f8` |
55
+
56
+ **Contrast sets the lightest step a role may take.** Text that is read needs 4.5:1 on the surface and on the
57
+ canvas; `neutral-500` gives 3.67 on the surface and 3.33 on the canvas, so it is never text, and `neutral-600`
58
+ (5.33 on the surface) is the lightest text there is. Hints, placeholders and helper text share the secondary
59
+ step with descriptions: they are told apart by size and place, not by a paler grey. An icon that alone carries
60
+ a meaning and the focus ring need 3:1, which `neutral-500` gives (3.67). A control's own outline or track (an
61
+ unchecked mark's border, a switch's off track) is a shape, not something read: it has to be seen, about 1.5:1,
62
+ which `neutral-300` gives (1.97). A hairline is meant to be faint and is held to nothing.
63
+ Disabled text is exempt (it sits at 50%, or in `neutral-400` for a disabled helper). In dark the ramps reverse
64
+ and every role passes at the same step.
65
+
66
+ The hairline is **1px** of `neutral-200`, always. There is no second border weight and no second border colour
67
+ except on hover (`neutral-300`), in an invalid state (`error-500`) and on an **unchecked mark** (a checkbox, a
68
+ radio, a menu row's indicator: `neutral-300`, `neutral-400` on hover), one step over the hairline, so an empty
69
+ box stands a little clearer than a field's edge and still sits with the fields. A plain field's border is the
70
+ hairline: its label and placeholder say it is a field.
71
+
72
+ ### The action colour
73
+
74
+ One colour does everything that acts: the primary button, a checked checkbox or switch, the active rail item, the
75
+ selected dock item, the logo mark.
76
+
77
+ | Name | Default value | Dark |
78
+ | ------------- | --------------------------------- | --------- |
79
+ | `action` | `neutral-950` → `#0d0d0d` | `#f8f8f8` |
80
+ | `action-hover`| `neutral-900` → `#181818` | `#ededed` |
81
+ | `on-action` | `neutral-50` → `#f8f8f8` | `#0d0d0d` |
82
+
83
+ A theme may move `action` to its accent (`primary-500`), and may add a *lit* look (a 1px inner highlight on top
84
+ and a 1px ring) or a *glossy* one (a gradient as well). The default is flat: no highlight, no ring, no shadow.
85
+ Nothing else is ever this colour. **One primary action per view.**
86
+
87
+ ### Washes: selection and hover are translucent
88
+
89
+ What is hovered, current or selected takes a wash of `neutral-950` at a small opacity, not a colour, so it reads
90
+ on the surface and on the canvas alike:
91
+
92
+ | State | Wash |
93
+ | --------------------------------------------------------------------- | ----------------------- |
94
+ | Hover on a row, item or ghost button | `neutral-950` at **5%** |
95
+ | Hover on a table row | `neutral-950` at **3%** |
96
+ | Current, selected or open: the page in the nav, a chosen row, a menu whose trigger is open (`selected`); always grey | `neutral-950` at **7%** |
97
+ | The tint: an active pill tab, an own chat message, a cell being edited (`tint`), text `tint-fg` = `neutral-950`; the one wash a theme may colour (the accent's palest step) | `neutral-950` at **7%** |
98
+ | A fill that may land on the canvas (a `rows` table cell, a thumbnail well) | `neutral-950` at **4%** |
99
+
100
+ A solid `neutral-100` fill vanishes on the canvas, so it is only for fills inside a bordered container. A theme
101
+ may make the tint the accent's palest step instead.
102
+
103
+ ### Status colour
104
+
105
+ Only in badges, deltas, status dots, icon tiles, meters near a limit, and invalid states. Never on a whole row,
106
+ never for emphasis. **Colour is for a state, never for a label**: a reference (`INV-1043`), a tag or a kind stays
107
+ neutral, and a tone marks only a state that needs the eye (failed, overdue, paid). `primary` means information and the assistant (a scheduled badge, the AI chip), not
108
+ importance.
109
+
110
+ | Use | Recipe |
111
+ | ---------------------------------- | ------------------------------------------------------------------ |
112
+ | A badge, tinted chip, status label, a toast's or a chat token's tone | fill: the ramp's **500 at 20%**; text: the ramp's **800**, for every tone. Filled, never outlined |
113
+ | An icon, on that tint or on the surface | the ramp's **600** where it reaches 3:1 (`primary`, `error`), else **700** (`success`, `warning`: the pale green and amber) |
114
+ | A dot or a solid fill | **500** |
115
+ | A delta | good news `success-800` `#397400`; bad news `error-600` `#d62400`; by what the change means, not its direction (churn falling is good news) |
116
+ | Error text (an invalid helper, a danger row) | `error-600` `#d62400` |
117
+ | An invalid border | `error-500` `#f53e20` |
118
+
119
+ The 20% fill adapts to whatever it sits on, light or dark; a solid 100 fill would not. The steps are the
120
+ smallest whole ones that pass: tone text on its tint needs 4.5:1, which the 700 misses for `success` (3.25) and
121
+ `warning` (3.59) and the 800 gives every tone (4.8 and up), so all badges keep one rule; a rising delta in
122
+ `success-700` would still miss on the surface (3.62), so it is the 800 (5.38), while `error-600` passes (4.81).
123
+ An icon needs 3:1 against what it sits on, so it keeps the lighter step where that reaches it. Tones: draft `neutral`,
124
+ waiting on someone `warning`, scheduled or informational `primary`, done or live `success`, failed `error`.
125
+
126
+ **A status colour has to be tellable from the action colour.** When a theme's accent sits close to a status
127
+ ramp (an amber accent beside `warning`, a red one beside `error`), a badge, a meter and the primary button
128
+ all read as one thing. Then the status carries its meaning by more than colour: an icon in the badge, and a
129
+ word that says the state ("Due soon", not a bare tone). Use that tone sparingly on a screen that also shows
130
+ the primary, and prefer `neutral` where the state is not a call for attention. Moving the status ramp's hue
131
+ away from the accent is a change to the theme, made in the theme builder.
132
+
133
+ ### Focus
134
+
135
+ A **2px** outline, **2px** outside the element (inside a clipping container, 2px inside it), in `neutral-500`
136
+ in light and dark (3.67 on the surface, past the 3:1 a focus indicator needs). Only on keyboard focus.
137
+
138
+ ### Shadows
139
+
140
+ Two, and only on what floats:
141
+
142
+ | Name | Light | Dark | On |
143
+ | ------- | ------------------------------------- | --------------------------------- | ------------------------------------------ |
144
+ | `float` | `1px 1px 4px rgb(20 22 23 / 0.10)` | `1px 1px 4px rgb(0 0 0 / 0.40)` | the dock, floating toolbars, menus, popovers, a slider knob |
145
+ | `sheet` | `0 2px 4px rgb(20 22 23 / 0.10)` | `0 2px 8px rgb(0 0 0 / 0.50)` | dialogs, sheets, the sidebar as a drawer |
146
+
147
+ Never on a card, a button, an icon button or a selected segment, unless the theme's `elevation` is `full`: then cards and table frames take `shadow-card` (the app panel stays flat) and the controls on them `shadow-control`, both short and faint. A scrim behind a dialog or the sidebar's drawer
148
+ is `black` at 40% and does not flip with the mode.
149
+
150
+ ### Data colours
151
+
152
+ Two sets: `chart-1` to `chart-5`, steps in order, and `chart-series-1` to `chart-series-5`, independent series.
153
+ Neighbours stay apart for colour-blind readers. Which set a chart takes, and how charts use colour, is in
154
+ `charts.md`.
155
+
156
+ | Name | Light | Dark |
157
+ | ---------- | ------------------------- | ------------------------- |
158
+ | `chart-1` | `primary-500` `#3939e5` | `#596ff4` |
159
+ | `chart-2` | `#eb6834` | `#d95926` |
160
+ | `chart-3` | `#1baf7a` | `#199e70` |
161
+ | `chart-4` | `#d4a800` | `#c98500` |
162
+ | `chart-5` | `primary-600` `#3218e0` | `#91a7fe` |
163
+ | `chart-series-1…4` | `chart-1…4` | |
164
+ | `chart-series-5` | `neutral-400` | |
165
+
166
+ Chart chrome is the neutral ramp: the grid `neutral-200`, labels `neutral-600`, the crosshair `neutral-300`, the
167
+ band over a column or row being read the 5% wash, the plot's frame `neutral-950` at 8% (a shade quieter than the
168
+ hairline), and the ring round a point being read the surface. An accent theme leads with its accent in place of
169
+ `primary`.
170
+
171
+ ### Avatar tones
172
+
173
+ Six hues at one lightness and chroma, so no person is louder than another: blue 250°, violet 295°, rose 10°,
174
+ amber 75°, teal 190°, green 145°. Each is a pale fill with a deep ink of the same hue, in oklch:
175
+
176
+ | Part | Light (L C) | Dark (L C) |
177
+ | ---- | ------------- | ------------- |
178
+ | fill | `0.95 0.025` | `0.31 0.04` |
179
+ | ink | `0.47 0.09` | `0.86 0.06` |
180
+ | line | `0.89 0.04` | `0.38 0.045` |
181
+
182
+ ### Never
183
+
184
+ Hex values in a design or a component (every colour is a role); a white or black that is not a ramp step; a
185
+ second accent; status colour for emphasis; a solid 100 fill on something that may sit on the canvas; a border
186
+ darker than the hairline.
187
+
188
+ ## Type
189
+
190
+ ### Family
191
+
192
+ **Geist** by default. A theme may pick Inter, Instrument Sans, IBM Plex Sans or Figtree, or name a family of
193
+ its own. Monospace is the platform's (`ui-monospace`, SFMono, Menlo). Fonts are loaded by the project; the
194
+ system only names them.
195
+
196
+ ### Scale
197
+
198
+ Line height is **1.25** throughout; tracking **0.32px** throughout, at every size. Sizes are fixed pixels.
199
+
200
+ | Name | Size | Line | For |
201
+ | ------ | ---- | ---- | ------------------------------------------------------------------------------------- |
202
+ | `xxs` | 11 | 13.75 | badges, counts, kbd, tooltips, hints, meta under a name, a sidebar group label |
203
+ | `xs` | 13 | 16.25 | **the base**: body, controls, inputs and their values, labels, table cells, sidebar items, descriptions |
204
+ | `sm` | 14 | 17.5 | dialog and sheet titles, option labels, project-level sidebar items, a page's description line |
205
+ | `base` | 16 | 20 | section titles |
206
+ | `lg` | 18 | 22.5 | a KPI value, a block or sheet heading |
207
+ | `xl` | 20 | 25 | rarely: a secondary headline figure |
208
+ | `2xl` | 24 | 30 | page titles, a chart card's headline figure |
209
+ | `3xl` | 31 | 38.75 | a leading chart headline |
210
+
211
+ Anything above `3xl` is marketing, not tool UI: the tokens carry `4xl` to `6xl` for such pages, and tool UI
212
+ stops at `3xl`. Most of a screen is `xs`; a screen with many sizes is wrong.
213
+
214
+ ### Weight and hierarchy
215
+
216
+ - **Two weights**: `normal` (400) and `medium` (500). Never semibold or bold, never all caps.
217
+ - Hierarchy comes from **colour and weight, not size**: a card title is `normal` `neutral-600` at 13; its value
218
+ is `medium` `neutral-950`. Labels quiet, data loud. A section title is `medium` at 16; a page title `medium` at
219
+ 24.
220
+ - A control's label is 13 `medium` at every height; a bigger control has more padding, not bigger text.
221
+ - An input's value is 13, like the page: a field reads as part of the page, not louder than it.
222
+ - Numbers are **tabular**, right-aligned in tables; a value and its delta share a baseline.
223
+ - Text that overflows **truncates** with an ellipsis; it never wraps a control or grows it.
224
+ - **Copy** is sentence case. Buttons are verb + object ("Add email", "Generate report"). Descriptions are one
225
+ sentence, no full stop needed under a title; under a section head, one or two sentences with full stops.
226
+
227
+ ## Surfaces and depth
228
+
229
+ - **Hairlines over shadows.** Cards, inputs, tables, panels and the sidebar's panel are all the surface colour
230
+ with a 1px `neutral-200` border. They are told apart by the line alone.
231
+ - **Space, not dividers.** Sections, groups and a header and its body are separated by distance. A divider is
232
+ kept only where nothing else can mark an edge: rows inside a table or list that is itself a bordered
233
+ container (a table, a description list, the settings in a group card), the parts of a floating container, the
234
+ header bar the page scrolls under. Inside a card the rule runs at the content's width; in a floating
235
+ container, full width, edge to edge, never inset by the container's padding. On a page: no line
236
+ between sections, no line under a page title. Line tabs sit on a hairline of their own, which is their
237
+ track, not a divider.
238
+ - **A group is marked, never implied.** Things that belong together are shown to by one of three means: a
239
+ hairline between them and their neighbours, a container around them, or an eyebrow (a small quiet title)
240
+ over them, which never repeats the title of what holds it. Closeness alone, a tighter gap, is not a group: it reads as a mistake in the rhythm. A container
241
+ never sits inside a container, so inside a card the mark is a hairline or an eyebrow.
242
+ - **No card inside a card** as a general rule: a sheet or dialog holds its parts with space and full-width rules.
243
+ A card is for a self-contained unit (a KPI, a chart, a group of settings). The one exception: an item in a list
244
+ card that must read as one unit apart from its neighbours (the option in force among others, a setting with
245
+ its dependents) takes a box of its own, on the `control` corner.
246
+ - Floating things (dock, toolbar, menu, popover) are the surface colour with a hairline and the `float` shadow.
247
+
248
+ ## Radius
249
+
250
+ Corners nest, each smaller than what holds it: **panel ⊃ card ⊃ control ⊃ item ⊃ chip**.
251
+
252
+ | Name | Value | On |
253
+ | --------- | ------- | ----------------------------------------------------------------------------- |
254
+ | `chip` | 6px | badges, checkboxes, icon tiles, small chips, code blocks |
255
+ | `item` | 10px | sidebar items, menu and list rows, cards inside a list, kanban cards, media tiles |
256
+ | `control` | 12px | buttons, inputs, selects, segmented tracks, pill tabs, the ruled table's frame |
257
+ | `card` | 16px | cards, dialogs |
258
+ | `panel` | 20px | the app panel, sheets |
259
+ | `dock` | 26px | the dock, the rail, dock actions: a full pill on 38 or 52px |
260
+ | `pill` | 12.5px | chips and delta pills: a full pill at 25px |
261
+ | `xs` | 4px | a tiny inner corner (a progress bar's fill) |
262
+ | `full` | round | avatars, status dots, switch tracks and knobs, radio buttons |
263
+
264
+ An element **inset in a rounded container takes the container's radius minus the inset**, so the curves stay
265
+ concentric: a 32px dock item inside the 38px dock (3px inset, 1px border) is `dock − 4px`; a knob inside a 2px
266
+ track is `track − 2px`. At a rounded end it sits as far from that end as from the top and bottom: an avatar, a
267
+ checkbox, an icon or a chip at the start or end of a pill or a rounded row is inset the same on all three
268
+ sides, never by the side padding a label takes.
269
+
270
+ **The corner scale.** Every token is its value times one scale, which a theme sets (1 by default; 0 squares
271
+ everything; 2 doubles). Growing, a corner stops 8px past its own value, so a doubled panel is 28px rather than
272
+ a 40px pill and the nesting order holds at every scale; `dock` and `pill` are round by design and scale freely.
273
+ Never multiply a radius by hand, and never give a theme-following corner a hard-coded round value.
274
+
275
+ ## Spacing
276
+
277
+ The unit is **4px**. Every padding, gap, margin and offset lands on this scale, never between steps. Sizes are
278
+ not spacing: the width and height of a box, an icon, a control's part or a column stay on a fixed 4px grid
279
+ whatever unit a theme picks, and the widths of panels, popups and fixed columns are fixed pixels (Layout below).
280
+ A tight or roomy theme changes the room around things, never their size, so an icon stays 14 or 16 and its strokes
281
+ stay on whole pixels:
282
+
283
+ `0 · 2 · 4 · 6 · 8 · 10 · 12 · 14 · 16 · 20 · 24 · 28 · 32 · 36 · 40 · 44 · 48 · 56 · 64 · 80 · 96`
284
+
285
+ ### Fixed side padding, by kind of control
286
+
287
+ A control's height already decides its vertical room, so its side padding is fixed by kind, not derived:
288
+
289
+ | Control | Side padding |
290
+ | ------------------------------------------------- | --------------------------------- |
291
+ | Button | 16 (12 on the side that has an icon) |
292
+ | Input, select, date picker, tab, dock item, menu row, select option | 12 |
293
+ | Sidebar item, segmented item, bar-list row, rail item | 10 (rail 9) |
294
+ | Chip, tooltip, pill badge | 8 |
295
+ | Badge | 6 |
296
+
297
+ ### Derived padding: a box holds content
298
+
299
+ **A spacing that no part draws and no row below fixes comes from the formula, never a guess.** The padding of
300
+ a box that holds content (a card, a panel, a sheet body, a section, a list row) and the gaps between texts,
301
+ boxes and blocks are **derived from what they hold**, then snapped to the scale. The formula is in
302
+ `lib/spacing.ts` and the `continuum-fix-padding` skill runs it; the results for common cases are here, so no
303
+ medium needs to run it.
304
+
305
+ **A box of text** pads by its type size and how many lines it holds (size averaged over the lines, so one large
306
+ figure does not size a whole card):
307
+
308
+ | Type size | 1 line | 2 lines | 3 lines | 4 lines | 6 lines | 8 lines | 12 lines |
309
+ | --------- | ------ | ------- | ------- | ------- | ------- | ------- | -------- |
310
+ | 11 | 8 | 14 | 16 | 20 | 20 | 24 | 24 |
311
+ | 13 | 10 | 16 | 20 | 20 | 24 | 28 | 32 |
312
+ | 14 | 10 | 16 | 20 | 24 | 28 | 28 | 32 |
313
+ | 18 | 14 | 20 | 28 | 28 | 36 | 36 | 44 |
314
+ | 24 | 16 | 28 | 36 | 40 | 44 | 48 | 48 |
315
+
316
+ Nothing pads past 48. Worked cases: a KPI card (13 label over an 18 value) pads **20**; a chart card (13, 24,
317
+ 13) pads **24**; a card of four setting rows (eight lines of 13) pads **28**.
318
+
319
+ **Where a library part is drawn off the formula, the drawn value wins for that part.** The KPI card is drawn at
320
+ 16, the settings card at 20 with its rows spaced 16, and `components.md` gives each part's drawn numbers. The
321
+ formula is for the boxes the library does not draw.
322
+
323
+ **A box of boxes** pads at least 1.5× its children's padding: children padded 8 or 12 → **20**; 16 → **24**;
324
+ 20 → **28**; 24 → **36**.
325
+
326
+ **The gap between alike boxes** (cards in a row, a stack of the same card, a list's items) is 1.1× their
327
+ padding: padded 8 → **8**; 12 → **14**; 16 → **16**; 20 → **20**; 24 → **28**.
328
+
329
+ **The gap between unlike blocks** standing free on the page or in a section (the page head, a table, a chart, a
330
+ section) is the **block gap**: each block claims its own room by what it holds, 0.375 × its type size × (1 +
331
+ 1.85 · log₂ its lines, each row or inner box counted as one), and the gap is the two rooms added. Dense content
332
+ claims a lot, light content little:
333
+
334
+ | Before → after | Block gap |
335
+ | ----------------------------------------------------- | --------- |
336
+ | A bare 24 title → a short settings card (four lines) | 32 |
337
+ | A title and its line → a settings card of three rows | 44 |
338
+ | A title and its line → a settings card of four to six rows | 48 |
339
+ | A title and its line → a settings card of eight rows | 56 |
340
+ | A title and its line → a stat card row | 44 |
341
+ | A title and its line → a table of five rows | 44 |
342
+ | A title and its line → a table of ten rows | 56 |
343
+ | A title and its line → a table of twenty rows | 64 |
344
+
345
+ **Inside a card**, unlike blocks (a title over its list, a figure over its badge, a header over its tabs) take
346
+ the same block gap with less room each: 0.6× the room, each block counting at most its first three lines, since
347
+ inside a card both are seen together and a long list should not push its own title away. Never the alike-box gap
348
+ here: the boxes are not alike, and a group without its own surface has no padding to take it from.
349
+
350
+ | Inside a card, before → after | Gap |
351
+ | ----------------------------------------------------- | --- |
352
+ | A stat card's label and figure → its badge | 12 |
353
+ | A 13 card title → its list of rows | 14 |
354
+ | A client's name and email → its tabs | 16 |
355
+
356
+ **The gap between two texts** follows the text *after* the gap, tight inside a pair (a title and its description,
357
+ a label and its value, a figure and its caption) and loose between blocks, growing with the lines either side:
358
+
359
+ | Before → after | In a pair | Between blocks |
360
+ | ----------------------------------- | --------- | -------------- |
361
+ | 13 → 13, one line each | 4 | 20 |
362
+ | 13 → 11 (a name and its meta) | 2 | 16 |
363
+ | 18 → 13 (a value and its caption) | 4 | 20 |
364
+ | 13 → 18 (a label and its value) | 4 | 28 |
365
+ | 24 → 14 (a page title and its line) | 4 | 20 |
366
+ | 16 → 13 × 2 (a section title and two lines) | 6 | 32 |
367
+ | 13 × 2 → 13 × 2 (two short paragraphs) | 6 | 40 |
368
+ | 13 × 3 → 13 × 3 | 8 | 48 |
369
+
370
+ ### The page's rhythm
371
+
372
+ | Between | Gap |
373
+ | ----------------------------------------------------- | --- |
374
+ | Sidebar items | 2 |
375
+ | Parts inside a control (icon and label) | 6–8 |
376
+ | A title and its description (a pair) | 6 under a page title, 4 under a section title, 2 for a name and its meta (the drawn values, which win over the formula) |
377
+ | Rows inside a group or card | 16 |
378
+ | Cards in a grid or a stack of group cards | 16; 24 for a stack of settings cards |
379
+ | Blocks inside a section | 20 |
380
+ | A section head and its content | 20 |
381
+ | The page head and what follows; sections of a page | the block gap, by what each side holds: about 32 to 64 |
382
+ | Sections of a long document | 64 |
383
+ | Groups in the sidebar | 24 |
384
+ | The gutter around the app panel | 8 |
385
+
386
+ This is tool UI: density is the point. Nothing on a page has marketing-page air around it.
387
+
388
+ ## Heights
389
+
390
+ Heights are fixed pixels, at the default height scale. Anything that sits in a row is on one of two rows, **34**
391
+ or **38**, so a button and a field beside each other line up without adjustment. A new control takes one of
392
+ these; never a height between them, never 32 or 36 for a control in a row. The one exception is an icon square in
393
+ an overlay's header or corner, sized to the bar it sits in: a dialog's close is 30, a sheet's close and a toast's
394
+ action and close squares are 36, and the header bar's back and forward are ghost 28. A row in a popup list (a
395
+ menu's, a command menu's) is 36 high, as a list row rather than a control.
396
+
397
+ A theme sets three sizes, each on its own: the base type size (12, 13 or 14), the spacing unit (3, 4 or 5) and
398
+ a height scale (0.9 compact, 1 default, 1.1 large). The height scale moves every height in the table below by
399
+ one factor, each rounded to a whole pixel, so the two rows stay two and stay level. Marks sized to their glyph or
400
+ text (badge, kbd, checkbox, radio, switch, avatar, status dot) keep their size. A height is always read by its
401
+ name, never written as pixels, so it follows the theme.
402
+
403
+ | Height | What sits on it |
404
+ | ------ | ----------------------------------------------------------------------------------------------------- |
405
+ | 22 | badge (every variant), count, kbd |
406
+ | 24 | small chip, a picked value in a combobox, the switch track (48 wide, 20 knob) |
407
+ | 28 | medium chip |
408
+ | 29 | segmented item, vital row, bar-list "show more" |
409
+ | 32 | dock item, calendar day, date-range preset, icon tile |
410
+ | **34** | **the control row**: button, icon button, small input / select / date picker, segmented track, sidebar item, pagination, rail item, inline toolbar, bar-list row, table group row, pill tab, top-nav link |
411
+ | 36 | rows inside a popup list: menu, select, combobox, filter and command menu items |
412
+ | **38** | **the field row**: medium input / select / date picker, large button, the dock and its action, floating toolbar, medium code box, a setting row (minimum) |
413
+ | 41 | ruled table row and head |
414
+ | 44 | line tab |
415
+ | 52 | dialog and sheet header |
416
+ | 54 | header bar |
417
+ | 56 | sidebar header, top nav |
418
+ | 4 · 8 | progress and meter track, small · medium |
419
+ | 6 · 8 | status dot, small · medium |
420
+ | 20 | checkbox and radio (16 inside a menu row) |
421
+
422
+ ## Icons
423
+
424
+ Lucide, **stroke 2**, always. By the box it sits in: **14 in a 34 control** (a button, an icon button, a field, a select, a tab or segment, a toolbar or menu row, a sidebar item, pagination), **16 in a 38 one** (the large button, the medium field and select, the floating toolbar) and anywhere larger; 12 in badges and small chips; 14 as a checkbox mark. A row that mixes 34 and 38 controls is rare; each keeps its own. An icon
425
+ takes its text's colour: `neutral-950` beside a sidebar item's label, `neutral-600` in a ghost control or a muted
426
+ row (darker on hover), in a status the tone's 600, or its 700 for `success` and `warning` (the status table). A quiet icon
427
+ may be `neutral-500`, which is 3:1; text beside it may not. An icon tile is a 32px well with `chip` corners
428
+ and a hairline. Icons lead in navigation and menu rows and trail on action buttons ("Add email +").
429
+
430
+ ## States
431
+
432
+ | State | Look |
433
+ | -------- | --------------------------------------------------------------------------------------------------- |
434
+ | Hover | border `200 → 300` (an unchecked mark `300 → 400`); ghost text `600 → 800`; a row or item takes the 5% wash (a table row 3%) |
435
+ | Pressed | a button scales to 97% for the press |
436
+ | Focus | the 2px ring above, keyboard only |
437
+ | Selected | the 7% wash; in a dock, segment or rail, the action fill with `on-action` text |
438
+ | Disabled | 50% opacity, no pointer |
439
+ | Invalid | border `error-500`, the helper text and icon in `error-600` |
440
+ | Loading | a spinner inside the control that is busy, never over the page; skeletons at the element's size |
441
+
442
+ A single-choice group (segmented control, dock, radio) always keeps one value.
443
+
444
+ ## Motion
445
+
446
+ | What | Duration | Easing | From |
447
+ | --------------------------------- | -------- | ------------------------------------ | ----------------------------------------- |
448
+ | Colour, border, opacity changes | 150ms | ease-out | |
449
+ | Something entering (dialog, sheet, popup, menu, the sidebar's drawer) | 200ms | `cubic-bezier(0.22, 1, 0.36, 1)` | opacity 0 plus a small move: dialogs 8px up, sheets 16px from their edge, popups scale 95%; the drawer slides its whole width from the left |
450
+ | A press | 150ms | | scale 97% |
451
+
452
+ A control's response stays at or under 250ms; a large surface entering or changing size (the rail's width, a
453
+ toast, a sheet) may take up to 400ms. Nothing bouncy, no animated layout. Reveal-on-hover only for secondary affordances (a
454
+ chevron), never a primary action, and never on touch (Touch, under Layout). Reduced motion turns transitions off.
455
+ A chart's marks reveal once as it enters, the one motion past 400ms; its values are in `charts.md`.
456
+
457
+ ## Layout
458
+
459
+ | Value | Px |
460
+ | -------------------------------------------------- | ---------------------------------------- |
461
+ | Content column, `narrow` (one object's fields; settings) | 640 |
462
+ | Content column, `default` (overview, detail, document) | 896 |
463
+ | Content column, `wide` (a table of several columns) | 1080 |
464
+ | Content column, `dense` (a very dense table) | 1280 |
465
+ | Side padding of the column, below its width | 16; 24 from a 640px screen; 16 in a compact shell |
466
+ | `inset` (several dense tables): the panel less, a side | 64 from 1024px; 128 from 1536px |
467
+ | The page's top offset below the header bar | 64 at every width; 40 in a compact shell |
468
+ | Designed at, then checked at | 1920 × 1080; then 1440 × 900 and 390, light and dark |
469
+
470
+ The column is centred and never runs to the panel's edge unless a page is explicitly asked to be `full`.
471
+
472
+ ### Narrow screens
473
+
474
+ The system is designed at 1920 × 1080, the common desktop screen, and holds at every other size: 1440 × 900
475
+ on a laptop, down to a phone at 390. Nothing is drawn for one width only: a page is composed at 1920 and its parts
476
+ answer to the room they get. Two widths change the shell, measured on the shell
477
+ itself, not the screen, so a shell shown narrow inside a box or embedded in another page behaves as on a phone:
478
+
479
+ | Shell width | What changes |
480
+ | ------------------------- | ---------------------------------------------------------------------------------------------- |
481
+ | 1024 and up | Nothing: everything as drawn. |
482
+ | under 1024 (`shell-sidebar`) | The sidebar no longer fits beside the panel. It becomes a drawer behind a toggle at the far left of the header bar; the header bar's back and forward and its actions hide. A top nav stays, its links scrolling. |
483
+ | under 640 (`shell-compact`) | Compact, a phone: the page's top offset is 40 and its side padding 16. The panel keeps its 8 gutter, its corners and its hairline, as on a wide screen. A top nav's switcher, links and actions go into the drawer, behind a toggle before the brand. |
484
+
485
+ **A part answers to the width it is given**, its container, never the screen: a table or a pager in a narrow
486
+ card behaves as it would on a phone. Only overlays (dialogs, sheets, toasts, popovers, a date picker's panel)
487
+ answer to the screen, since they float over it.
488
+
489
+ **A row of controls never wraps.** When it runs out of room it does one of three things:
490
+
491
+ - **Scroll**, a row of peers that are all needed: tabs, the dock, a top nav's links, a toolbar, a table. It
492
+ moves sideways under an edge fade at the end that has more (with a chevron where a pointer needs one), the
493
+ current item kept in view.
494
+ - **Hide**, what the page works without: the header bar's actions, a page's secondary actions, pagination's
495
+ results line, the dock's counts, a table's optional columns, keyboard hints on touch. Hidden, never folded
496
+ into a "⋯" menu.
497
+ - **Stack**, blocks side by side: the page head (the title, its line, then the actions), stat cards four
498
+ across become two, two cards side by side become one column.
499
+ Stacking costs height, which a phone has; width it has not.
500
+
501
+ Fold into a smaller control only what can neither scroll nor go: pagination to ‹ 3 of 25 ›, a segmented control
502
+ of more than four options to a select, an index's selects into its one Filter button. Only content wraps: text,
503
+ and applied-filter chips.
504
+
505
+ ### Touch
506
+
507
+ On a touch screen (a coarse pointer), at any width:
508
+
509
+ - Every field that takes typing is **16**, not 13, so the phone does not zoom the page on focus; the box keeps
510
+ its height. The one place the type scale yields.
511
+ - A target is at least **44** square. A smaller control keeps its drawn size and gets an invisible hit area
512
+ round it, so nothing in a row grows wider.
513
+ - Nothing is revealed by hover alone: what shows on hover (a group's chevron, a block's handle) shows always.
514
+ - No keyboard hints: a kbd and a menu row's shortcut hide.
515
+
516
+ ### Fixed widths
517
+
518
+ The width of a panel, a popup or a fixed column is a fixed pixel value, like the content columns and the
519
+ heights: it does **not** follow the spacing unit, so a tight or roomy theme changes the padding inside a sidebar
520
+ or a toast, never how wide it is. Small sizes that belong to a control's anatomy (an icon, a dot, a bar of a few
521
+ pixels) stay on the spacing scale.
522
+
523
+ | Width | Px |
524
+ | ----------------------------------------------------------- | -------------------------- |
525
+ | Sidebar (as a drawer, never wider than the shell − 48) | 256 |
526
+ | NavRail, closed · open | 52 · 208 |
527
+ | Toast | 360 |
528
+ | Popover | 288 |
529
+ | Dialog (never wider than the viewport − 32) | 480 |
530
+ | Sheet | 512 |
531
+ | Command menu (never wider than the viewport − 32) | 560 |
532
+ | Filter menu | 240 |
533
+ | A menu's minimum (dropdown) · a breadcrumb menu's minimum | 160 · 192 |
534
+ | Tooltip, info tip (maximum) · a chart's tooltip (minimum) | 256 · 140 |
535
+ | A table's or an index's search | 256 |
536
+ | A date-range picker's presets column | 144 |
537
+ | An empty state's sentence · a chat's empty line (maximum) | 480 · 288 |
538
+ | Sign-in card (on a phone, the screen less 16 a side) | 400 |
539
+ | An assistant's conversation column and its prompt | 720 |
@@ -0,0 +1,75 @@
1
+ # On a design canvas (Paper, Figma)
2
+
3
+ On a canvas there are no components to import: every part is drawn from its spec. The system is the same; only
4
+ the way it is written differs. Read `foundations.md` for the values, `pages.md` for the anatomy, and
5
+ `components.md` for each part's rows, and draw what they say. The canvas tool's own guidance on moods, palettes
6
+ and expressive type does not apply: Continuum's files decide the look.
7
+
8
+ ## Setup, once per file
9
+
10
+ 1. **Tokens.** Create the file's tokens from `foundations.md`, under Tailwind's names, so every colour on the
11
+ canvas is a role: `--color-neutral-50` … `--color-neutral-950` and the four chromatic ramps (light values),
12
+ `--color-action`, `--color-on-action`, `--radius-chip` … `--radius-panel` (6 / 10 / 12 / 16 / 20),
13
+ `--text-xxs` … `--text-2xl`, `--font-sans: Geist`. Dark mode is the same set with each ramp reversed; keep
14
+ it as a second mode or a second token set, so a dark artboard is a switch, not a repaint. If tokens cannot
15
+ be created, use the literal values and say so.
16
+ 2. **Fonts.** Geist (and the theme's font if it picks another). Confirm the family is available to the file
17
+ before the first text.
18
+ 3. **The artboard.** 1920 wide (a 1440 one beside it when the layout changes there), height fit to content, one per screen and mode, named "Screen · light" /
19
+ "Screen · dark".
20
+ 4. **The kit.** When the file has a Continuum kit (a page of every part in every state as named layers,
21
+ "Button / primary / md"), **duplicate from it and change the text**; never redraw a part the kit has.
22
+
23
+ ## How a canvas differs from code
24
+
25
+ - **Text inherits nothing.** Set the family, size, line height, weight, colour and tracking on every text node
26
+ itself; a container's font does not reach its children. A text that should not wrap needs that set on the
27
+ node, with the room it needs (a button label, a menu row, a breadcrumb crumb, a table cell: "Remove from
28
+ workspace" must stay on one line).
29
+ - **No margins.** Position with padding and gap; a part that code pulls flush with a negative margin (a ghost
30
+ button at a card's edge, a full-width divider in a padded container) is drawn as a full-width part with its
31
+ own padding.
32
+ - **Lanes.** Repeated rows (a table, a list, a nav) keep their icons and trailing controls in fixed-width
33
+ slots that do not shrink, so columns line up across rows; a gap alone will not align them.
34
+ - **Heights are fixed.** Give controls their height from the scale (34, 38, 41 …) rather than letting content
35
+ size them.
36
+ - **Hairlines are 1px** of the hairline token; corners are the radius tokens; nothing is drawn with a shadow
37
+ but the floating parts.
38
+
39
+ ## Drawing a part from its spec
40
+
41
+ Each entry in `components.md` has an anatomy (parts in order) and a values table. Draw the outer frame first
42
+ (height, padding, corner, border, fill), then its parts in order as nested frames with the stated gaps, then the
43
+ text with its stated size, weight and colour. Name the layers by the part names. Draw the state the screen
44
+ shows (a selected row, an open menu, a checked switch); other states only in the kit.
45
+
46
+ Common traps: a dock item's corner is the dock's minus 4; a badge is 22 high with 11px medium text; a switch
47
+ is 48 × 24 with a 20 knob; a stat card is label over value over a delta pill, nothing inline after the value;
48
+ a ruled table's head is 41 high on the `neutral-100` fill; a select trigger shows its value at 13 and a 16
49
+ chevron in `neutral-600`; an input's value is 13, not 14 or 16; a secondary button has no fill,
50
+ a hairline and 13/500 `neutral-950` text, and no button carries a shadow; a placeholder, a hint or a
51
+ helper line is `neutral-600`, never `neutral-500`; an unchecked checkbox or radio has a `neutral-300` border,
52
+ one step over the hairline; a badge's text is its tone's 800 on the tone's 500 at 20%; a rising delta is `success-800`.
53
+ Widths of panels and popups are the fixed pixels in `foundations.md` (sidebar 256, toast 360, popover 288,
54
+ dialog 480, sheet 512), whatever the theme's spacing unit.
55
+
56
+ ## Composing a screen
57
+
58
+ Follow the kind's anatomy in `pages.md` top to bottom with its stated gaps, inside the shell (sidebar 256,
59
+ panel inset 8, header bar 54, the column at its width, 64 below the header bar). Put the primary action where
60
+ the kind puts it. Give the column 96 of bottom padding when the page has a dock, and place the dock 24 above
61
+ the panel's foot. The artboard is as tall as its content: a page longer than the panel runs on past the foot,
62
+ as it scrolls in the app.
63
+
64
+ ## Checking
65
+
66
+ Screenshot the artboard at 1× after each section and compare it with the kind's anatomy; at 2× to read small
67
+ text. Then the dark artboard. The checks: every text 13 unless the scale says otherwise; two weights; one
68
+ action colour and one primary action; hairlines, no shadows except on floating parts; corners concentric;
69
+ controls on 34 or 38; the column at its width; the breadcrumb present. Run these by hand on the selection.
70
+
71
+ ## Figma
72
+
73
+ The same, through the Figma plugin API: tokens as variables with a light and a dark mode, parts as components
74
+ with variants for their states, auto layout for every frame with the stated padding and gap, and text styles for
75
+ the type scale. Draw from the spec rows exactly as above.